Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ac89952

Browse files
authored
Show status of Jupyter server (Connected/Disconnected) when the user hovers over the status icon (microsoft#13544)
1 parent 9391658 commit ac89952

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

news/2 Fixes/13543.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added tooltip to indicate status of server connection

package.nls.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,8 @@
179179
"DataScience.connectingToJupyter": "Connecting to Jupyter server",
180180
"DataScience.connectingToIPyKernel": "Connecting to IPython kernel",
181181
"DataScience.connectedToIPyKernel": "Connected.",
182+
"DataScience.connected": "Connected",
183+
"DataScience.disconnected": "Disconnected",
182184
"Experiments.inGroup": "User belongs to experiment group '{0}'",
183185
"Interpreters.RefreshingInterpreters": "Refreshing Python Interpreters",
184186
"Interpreters.entireWorkspace": "Entire workspace",

src/client/common/utils/localize.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,8 @@ export namespace DataScience {
11061106
'DataScience.previewNotebookOnlySupportedInVSCInsiders',
11071107
'The Preview Notebook Editor is supported only in the Insiders version of Visual Studio Code.'
11081108
);
1109+
export const connected = localize('DataScience.connected', 'Connected');
1110+
export const disconnected = localize('DataScience.disconnected', 'Disconnected');
11091111
}
11101112

11111113
export namespace StartPage {

src/datascience-ui/interactive-common/jupyterInfo.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {
6161
baseTheme={this.props.baseTheme}
6262
class="image-button-image kernel-status-icon"
6363
image={this.getIcon()}
64+
title={this.getStatus()}
6465
/>
6566
</div>
6667
<div className="kernel-status-divider" />
@@ -113,4 +114,10 @@ export class JupyterInfo extends React.Component<IJupyterInfoProps> {
113114
? ImageName.JupyterServerDisconnected
114115
: ImageName.JupyterServerConnected;
115116
}
117+
118+
private getStatus() {
119+
return this.props.kernel.jupyterServerStatus === ServerStatus.NotStarted
120+
? getLocString('DataScience.disconnected', 'Disconnected')
121+
: getLocString('DataScience.connected', 'Connected');
122+
}
116123
}

src/datascience-ui/react-common/image.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ interface IImageProps {
238238
baseTheme: string;
239239
image: ImageName;
240240
class: string;
241+
title?: string;
241242
}
242243

243244
export class Image extends React.Component<IImageProps> {
@@ -249,6 +250,6 @@ export class Image extends React.Component<IImageProps> {
249250
const key = ImageName[this.props.image].toString();
250251
const image = images.hasOwnProperty(key) ? images[key] : images.Cancel; // Default is cancel.
251252
const source = this.props.baseTheme.includes('dark') ? image.dark : image.light;
252-
return <InlineSVG className={this.props.class} src={source} />;
253+
return <InlineSVG className={this.props.class} src={source} title={this.props.title} />;
253254
}
254255
}

0 commit comments

Comments
 (0)