Skip to content

Commit

Permalink
Merge pull request jupyterlab#6852 from telamonian/fix-statusbar-kern…
Browse files Browse the repository at this point in the history
…el-name

fixes jupyterlab#6850 jupyterlab#6851: always use kernel display_name in statusbar
  • Loading branch information
telamonian authored Jul 22, 2019
2 parents 079115d + da38e27 commit 0aa41d1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions packages/statusbar/src/defaults/kernelStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ function KernelStatusComponent(
return (
<TextItem
onClick={props.handleClick}
source={`${Text.titleCase(props.kernelName)} | ${Text.titleCase(
props.status
)}`}
source={`${props.kernelName} | ${Text.titleCase(props.status)}`}
title={`Change kernel for ${props.activityName}`}
/>
);
Expand Down Expand Up @@ -153,7 +151,7 @@ export namespace KernelStatus {
this._kernelName = 'unknown';
} else {
this._kernelStatus = this._session.status;
this._kernelName = this._session.kernelDisplayName.toLowerCase();
this._kernelName = this._session.kernelDisplayName;

this._session.statusChanged.connect(this._onKernelStatusChanged);
this._session.kernelChanged.connect(this._onKernelChanged);
Expand Down Expand Up @@ -183,14 +181,17 @@ export namespace KernelStatus {
const oldState = this._getAllState();
const { newValue } = change;
if (newValue !== null) {
this._kernelStatus = newValue.status;
this._kernelName = newValue.model.name.toLowerCase();
newValue.getSpec().then(spec => {
// sync setting of status and display name
this._kernelStatus = newValue.status;
this._kernelName = spec.display_name;
this._triggerChange(oldState, this._getAllState());
});
} else {
this._kernelStatus = 'unknown';
this._kernelName = 'unknown';
this._triggerChange(oldState, this._getAllState());
}

this._triggerChange(oldState, this._getAllState());
};

private _getAllState(): [string, string, string] {
Expand Down

0 comments on commit 0aa41d1

Please sign in to comment.