@@ -41,9 +41,7 @@ export class KernelSelection extends React.Component<IKernelSelectionProps> {
4141 const displayNameTextWidth : React . CSSProperties = {
4242 maxWidth : this . getMaxWidth ( displayNameTextSize )
4343 } ;
44- const kernelSelectionClass = this . isKernelSelectionAllowed
45- ? 'kernel-status-section kernel-status-section-hoverable kernel-status-status'
46- : 'kernel-status-section kernel-status-status' ;
44+
4745 return (
4846 < div className = "kernel-status" style = { dynamicFont } >
4947 < div className = "kernel-status-section kernel-status-server" style = { serverTextWidth } role = "button" >
@@ -53,19 +51,34 @@ export class KernelSelection extends React.Component<IKernelSelectionProps> {
5351 < Image baseTheme = { this . props . baseTheme } class = "image-button-image kernel-status-icon" image = { this . getIcon ( ) } />
5452 </ div >
5553 < div className = "kernel-status-divider" />
56- < div className = { kernelSelectionClass } style = { displayNameTextWidth } onClick = { this . selectKernel } role = "button" >
57- { this . props . kernel . displayName } : { this . props . kernel . jupyterServerStatus }
58- </ div >
54+ { this . renderKernelStatus ( displayNameTextWidth ) }
5955 </ div >
6056 ) ;
6157 }
58+
59+ private renderKernelStatus ( displayNameTextWidth : React . CSSProperties ) {
60+ if ( this . isKernelSelectionAllowed ) {
61+ return (
62+ < div className = "kernel-status-section kernel-status-section-hoverable kernel-status-status" style = { displayNameTextWidth } onClick = { this . selectKernel } role = "button" >
63+ { this . props . kernel . displayName } : { this . props . kernel . jupyterServerStatus }
64+ </ div >
65+ ) ;
66+ } else {
67+ return (
68+ < div className = "kernel-status-section kernel-status-status" style = { displayNameTextWidth } >
69+ { getLocString ( 'DataScience.noKernel' , 'No Kernel' ) }
70+ </ div >
71+ ) ;
72+ }
73+ }
74+
6275 private selectKernel ( ) {
6376 if ( this . isKernelSelectionAllowed ) {
6477 this . props . selectKernel ( ) ;
6578 }
6679 }
6780 private getIcon ( ) : ImageName {
68- return this . props . kernel . localizedUri === getLocString ( 'DataScience.noKernel' , 'No Kernel' ) ? ImageName . JupyterServerDisconnected : ImageName . JupyterServerConnected ;
81+ return this . props . kernel . jupyterServerStatus === ServerStatus . NotStarted ? ImageName . JupyterServerDisconnected : ImageName . JupyterServerConnected ;
6982 }
7083
7184 private getMaxWidth ( charLenght : number ) : string {
0 commit comments