@@ -41,9 +41,7 @@ export class KernelSelection extends React.Component<IKernelSelectionProps> {
41
41
const displayNameTextWidth : React . CSSProperties = {
42
42
maxWidth : this . getMaxWidth ( displayNameTextSize )
43
43
} ;
44
- const kernelSelectionClass = this . isKernelSelectionAllowed
45
- ? 'kernel-status-section kernel-status-section-hoverable kernel-status-status'
46
- : 'kernel-status-section kernel-status-status' ;
44
+
47
45
return (
48
46
< div className = "kernel-status" style = { dynamicFont } >
49
47
< div className = "kernel-status-section kernel-status-server" style = { serverTextWidth } role = "button" >
@@ -53,19 +51,34 @@ export class KernelSelection extends React.Component<IKernelSelectionProps> {
53
51
< Image baseTheme = { this . props . baseTheme } class = "image-button-image kernel-status-icon" image = { this . getIcon ( ) } />
54
52
</ div >
55
53
< 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 ) }
59
55
</ div >
60
56
) ;
61
57
}
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
+
62
75
private selectKernel ( ) {
63
76
if ( this . isKernelSelectionAllowed ) {
64
77
this . props . selectKernel ( ) ;
65
78
}
66
79
}
67
80
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 ;
69
82
}
70
83
71
84
private getMaxWidth ( charLenght : number ) : string {
0 commit comments