@@ -41,6 +41,7 @@ export enum Editable {
4141 CONTEXT_ROOT = "context-root" ,
4242 APP_PORT = "app-port" ,
4343 DEBUG_PORT = "debug-port" ,
44+ DISABLED = "disabled" ,
4445}
4546
4647export function refreshProjectOverview ( webviewPanel : vscode . WebviewPanel , project : Project ) : void {
@@ -117,17 +118,17 @@ export function generateHtml(project: Project): string {
117118 ${ buildRow ( "Internal App Port" ,
118119 normalize ( project . ports . internalAppPort , notAvailable ) ,
119120 undefined ,
120- supportsEditableSettings ? Editable . APP_PORT : undefined ) }
121+ supportsEditableSettings ? Editable . APP_PORT : Editable . DISABLED ) }
121122 ${ buildRow ( "Application Endpoint" ,
122123 normalize ( project . appBaseUrl , notRunning ) ,
123124 ( project . appBaseUrl != null ? Openable . WEB : undefined ) ,
124- supportsEditableSettings ? Editable . CONTEXT_ROOT : undefined ) }
125+ supportsEditableSettings ? Editable . CONTEXT_ROOT : Editable . DISABLED ) }
125126 ${ emptyRow }
126127 ${ buildRow ( "Exposed Debug Port" , normalize ( project . ports . debugPort , notDebugging ) ) }
127128 ${ buildRow ( "Internal Debug Port" ,
128129 normalize ( project . ports . internalDebugPort , notAvailable ) ,
129130 undefined ,
130- supportsEditableSettings ? Editable . DEBUG_PORT : undefined ) }
131+ supportsEditableSettings ? Editable . DEBUG_PORT : Editable . DISABLED ) }
131132 ${ buildRow ( "Debug URL" , normalize ( project . debugUrl , notDebugging ) ) }
132133 </table>
133134
@@ -179,8 +180,12 @@ function buildRow(label: string, data: string, openable?: Openable, editable?: E
179180 }
180181
181182 if ( editable ) {
183+ const tooltip = `title=` + ( editable === Editable . DISABLED ? `"Upgrade your Microclimate version to use this feature"` : "Edit" ) ;
184+ const cursor = editable === Editable . DISABLED ? `style="cursor: not-allowed;"` : "" ;
185+ const onClick = editable === Editable . DISABLED ? "" : `onclick="sendMsg('${ Messages . EDIT } ', { type: '${ editable } ' })"` ;
186+
182187 thirdColTdContents = `
183- <img id="edit-${ MCUtil . slug ( label ) } " class="edit-btn" title="Edit" onclick="sendMsg(' ${ Messages . EDIT } ', { type: ' ${ editable } ' })" ` +
188+ <img id="edit-${ MCUtil . slug ( label ) } " class="edit-btn" ${ tooltip } ${ cursor } ${ onClick } ` +
184189 `src="${ getIcon ( Resources . Icons . Edit ) } "/>
185190 ` ;
186191 }
0 commit comments