55 < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
66 < title > ODS Management</ title >
77 < style >
8- * { box-sizing : border-box; }
8+ * {
9+ box-sizing : border-box;
10+ }
911 body {
1012 font-family : var (--vscode-font-family , system-ui, sans-serif);
1113 font-size : var (--vscode-font-size , 13px );
1416 margin : 0 ;
1517 padding : 1rem ;
1618 }
17- h1 { font-size : 1.1rem ; margin : 0 0 1rem ; }
18- .toolbar { margin-bottom : 1rem ; }
19+ h1 {
20+ font-size : 1.1rem ;
21+ margin : 0 0 1rem ;
22+ }
23+ .toolbar {
24+ margin-bottom : 1rem ;
25+ }
1926 button .primary {
2027 padding : 0.5rem 1rem ;
2128 font-size : 1em ;
2532 border : none;
2633 border-radius : 4px ;
2734 }
28- button .primary : hover { background : var (--vscode-button-hoverBackground ); }
35+ button .primary : hover {
36+ background : var (--vscode-button-hoverBackground );
37+ }
2938 .table-wrap {
3039 overflow-x : auto;
3140 border : 1px solid var (--vscode-widget-border );
3746 border-collapse : collapse;
3847 font-size : 0.9em ;
3948 }
40- th , td {
49+ th ,
50+ td {
4151 padding : 0.4rem 0.6rem ;
4252 text-align : left;
4353 border-bottom : 1px solid var (--vscode-widget-border );
4757 font-weight : 600 ;
4858 color : var (--vscode-descriptionForeground );
4959 }
50- tr : last-child td { border-bottom : none; }
60+ tr : last-child td {
61+ border-bottom : none;
62+ }
5163 .message {
5264 padding : 1rem ;
5365 color : var (--vscode-descriptionForeground );
5668 color : var (--vscode-errorForeground );
5769 padding : 1rem ;
5870 }
59- .hidden { display : none !important ; }
71+ .hidden {
72+ display : none !important ;
73+ }
6074 .btn-delete {
6175 padding : 0.25rem 0.5rem ;
6276 font-size : 0.85em ;
@@ -95,8 +109,16 @@ <h1>On Demand Sandbox (ODS) Management</h1>
95109 const tbody = document . getElementById ( 'ods-tbody' ) ;
96110
97111 const EXTENDED_COLUMNS = [
98- 'realm' , 'instance' , 'state' , 'profile' , 'created' , 'eol' , 'id' ,
99- 'hostname' , 'createdBy' , 'autoScheduled'
112+ 'realm' ,
113+ 'instance' ,
114+ 'state' ,
115+ 'profile' ,
116+ 'created' ,
117+ 'eol' ,
118+ 'id' ,
119+ 'hostname' ,
120+ 'createdBy' ,
121+ 'autoScheduled' ,
100122 ] ;
101123 const HEADERS = {
102124 realm : 'Realm' ,
@@ -108,7 +130,7 @@ <h1>On Demand Sandbox (ODS) Management</h1>
108130 id : 'ID' ,
109131 hostname : 'Hostname' ,
110132 createdBy : 'Created By' ,
111- autoScheduled : 'Auto'
133+ autoScheduled : 'Auto' ,
112134 } ;
113135 function showError ( msg ) {
114136 errorEl . textContent = msg || '' ;
@@ -123,31 +145,38 @@ <h1>On Demand Sandbox (ODS) Management</h1>
123145 }
124146 messageEl . textContent = '' ;
125147 tableWrap . classList . remove ( 'hidden' ) ;
126- thead . innerHTML = '<tr>' + EXTENDED_COLUMNS . map ( function ( k ) {
127- return '<th>' + escapeHtml ( HEADERS [ k ] || k ) + '</th>' ;
128- } ) . join ( '' ) + '<th>Actions</th></tr>' ;
148+ thead . innerHTML =
149+ '<tr>' +
150+ EXTENDED_COLUMNS . map ( function ( k ) {
151+ return '<th>' + escapeHtml ( HEADERS [ k ] || k ) + '</th>' ;
152+ } ) . join ( '' ) +
153+ '<th>Actions</th></tr>' ;
129154
130- tbody . innerHTML = sandboxes . map ( function ( s ) {
131- const row = EXTENDED_COLUMNS . map ( function ( k ) {
132- let val = '—' ;
133- if ( k === 'realm' ) val = s . realm ?? '—' ;
134- else if ( k === 'instance' ) val = s . instance ?? '—' ;
135- else if ( k === 'state' ) val = s . state ?? '—' ;
136- else if ( k === 'profile' ) val = s . resourceProfile ?? '—' ;
137- else if ( k === 'created' ) val = s . createdAt ? String ( s . createdAt ) . slice ( 0 , 10 ) : '—' ;
138- else if ( k === 'eol' ) val = s . eol ? String ( s . eol ) . slice ( 0 , 10 ) : '—' ;
139- else if ( k === 'id' ) val = s . id ?? '—' ;
140- else if ( k === 'hostname' ) val = s . hostName || s . hostname || '—' ;
141- else if ( k === 'createdBy' ) val = s . createdBy ?? '—' ;
142- else if ( k === 'autoScheduled' ) val = s . autoScheduled ? 'Yes' : 'No' ;
143- return '<td>' + escapeHtml ( String ( val ) ) + '</td>' ;
144- } ) . join ( '' ) ;
145- const sandboxId = ( s . id ?? '' ) . toString ( ) ;
146- const deleteBtn = sandboxId
147- ? '<button type="button" class="btn-delete" data-sandbox-id="' + escapeHtml ( sandboxId ) + '" title="Delete">Delete</button>'
148- : '' ;
149- return '<tr>' + row + '<td>' + deleteBtn + '</td></tr>' ;
150- } ) . join ( '' ) ;
155+ tbody . innerHTML = sandboxes
156+ . map ( function ( s ) {
157+ const row = EXTENDED_COLUMNS . map ( function ( k ) {
158+ let val = '—' ;
159+ if ( k === 'realm' ) val = s . realm ?? '—' ;
160+ else if ( k === 'instance' ) val = s . instance ?? '—' ;
161+ else if ( k === 'state' ) val = s . state ?? '—' ;
162+ else if ( k === 'profile' ) val = s . resourceProfile ?? '—' ;
163+ else if ( k === 'created' ) val = s . createdAt ? String ( s . createdAt ) . slice ( 0 , 10 ) : '—' ;
164+ else if ( k === 'eol' ) val = s . eol ? String ( s . eol ) . slice ( 0 , 10 ) : '—' ;
165+ else if ( k === 'id' ) val = s . id ?? '—' ;
166+ else if ( k === 'hostname' ) val = s . hostName || s . hostname || '—' ;
167+ else if ( k === 'createdBy' ) val = s . createdBy ?? '—' ;
168+ else if ( k === 'autoScheduled' ) val = s . autoScheduled ? 'Yes' : 'No' ;
169+ return '<td>' + escapeHtml ( String ( val ) ) + '</td>' ;
170+ } ) . join ( '' ) ;
171+ const sandboxId = ( s . id ?? '' ) . toString ( ) ;
172+ const deleteBtn = sandboxId
173+ ? '<button type="button" class="btn-delete" data-sandbox-id="' +
174+ escapeHtml ( sandboxId ) +
175+ '" title="Delete">Delete</button>'
176+ : '' ;
177+ return '<tr>' + row + '<td>' + deleteBtn + '</td></tr>' ;
178+ } )
179+ . join ( '' ) ;
151180 }
152181
153182 function escapeHtml ( s ) {
@@ -157,13 +186,13 @@ <h1>On Demand Sandbox (ODS) Management</h1>
157186 }
158187
159188 createBtn . addEventListener ( 'click' , function ( ) {
160- vscode . postMessage ( { type : 'odsCreateClick' } ) ;
189+ vscode . postMessage ( { type : 'odsCreateClick' } ) ;
161190 } ) ;
162191
163192 tbody . addEventListener ( 'click' , function ( e ) {
164193 const btn = e . target && e . target . closest && e . target . closest ( '.btn-delete' ) ;
165194 if ( btn && btn . dataset . sandboxId ) {
166- vscode . postMessage ( { type : 'odsDeleteClick' , sandboxId : btn . dataset . sandboxId } ) ;
195+ vscode . postMessage ( { type : 'odsDeleteClick' , sandboxId : btn . dataset . sandboxId } ) ;
167196 }
168197 } ) ;
169198
@@ -181,7 +210,7 @@ <h1>On Demand Sandbox (ODS) Management</h1>
181210 }
182211 } ) ;
183212
184- vscode . postMessage ( { type : 'odsListRequest' } ) ;
213+ vscode . postMessage ( { type : 'odsListRequest' } ) ;
185214 } ) ( ) ;
186215 </ script >
187216 </ body >
0 commit comments