@@ -64,6 +64,7 @@ class AdminSystemHealthController {
6464 ] ) ) ;
6565 this . historyRows = root . querySelector ( "[data-admin-system-health-history-rows]" ) ;
6666 this . apiContractRows = root . querySelector ( "[data-admin-system-health-api-contract-rows]" ) ;
67+ this . capabilityRows = root . querySelector ( "[data-admin-system-health-capability-rows]" ) ;
6768 this . actionRows = root . querySelector ( "[data-admin-system-health-action-rows]" ) ;
6869 this . actionButtons = Array . from ( root . querySelectorAll ( "[data-admin-system-health-action]" ) ) ;
6970 this . configurationRows = root . querySelector ( "[data-admin-system-health-configuration-rows]" ) ;
@@ -144,6 +145,7 @@ class AdminSystemHealthController {
144145 this . renderStartupPending ( reason ) ;
145146 this . renderStoragePending ( reason ) ;
146147 this . renderRuntimeHealthPending ( reason ) ;
148+ this . renderEnvironmentCapabilitiesPending ( reason ) ;
147149 this . renderApiContractPending ( reason ) ;
148150 this . renderServiceHealthPending ( reason ) ;
149151 this . renderConfigurationSummaryPending ( reason ) ;
@@ -285,6 +287,45 @@ class AdminSystemHealthController {
285287 this . apiContractRows . replaceChildren ( fragment ) ;
286288 }
287289
290+ renderEnvironmentCapabilitiesPending ( reason ) {
291+ if ( ! this . capabilityRows ) {
292+ return ;
293+ }
294+ const row = document . createElement ( "tr" ) ;
295+ row . append (
296+ this . createCell ( "Environment Capabilities" ) ,
297+ this . createCell ( "not available" ) ,
298+ this . createStatusCell ( "PENDING" , reason ) ,
299+ ) ;
300+ this . capabilityRows . replaceChildren ( row ) ;
301+ }
302+
303+ renderEnvironmentCapabilities ( environmentCapabilities = { } ) {
304+ if ( ! this . capabilityRows ) {
305+ return ;
306+ }
307+ if ( environmentCapabilities ?. secretsExposed === true || environmentCapabilities ?. secretEditingAllowed === true ) {
308+ this . renderEnvironmentCapabilitiesPending ( "Safe environment capabilities response was blocked because it exposed secret controls." ) ;
309+ return ;
310+ }
311+ const rows = Array . isArray ( environmentCapabilities . rows ) ? environmentCapabilities . rows : [ ] ;
312+ if ( ! rows . length ) {
313+ this . renderEnvironmentCapabilitiesPending ( "Safe Admin System Health API returned no environment capability rows." ) ;
314+ return ;
315+ }
316+ const fragment = document . createDocumentFragment ( ) ;
317+ rows . forEach ( ( capabilityRow ) => {
318+ const row = document . createElement ( "tr" ) ;
319+ row . append (
320+ this . createCell ( capabilityRow . capability ) ,
321+ this . createCell ( capabilityRow . value ) ,
322+ this . createStatusCell ( capabilityRow . status , environmentCapabilities . message ) ,
323+ ) ;
324+ fragment . append ( row ) ;
325+ } ) ;
326+ this . capabilityRows . replaceChildren ( fragment ) ;
327+ }
328+
288329 renderServiceHealthPending ( reason ) {
289330 if ( ! this . serviceCards ) {
290331 return ;
@@ -706,6 +747,7 @@ class AdminSystemHealthController {
706747 this . renderStorageStatus ( data ?. storageStatus || { } ) ;
707748 this . runStorageDiagnostics ( ) ;
708749 this . renderRuntimeHealth ( data ?. runtimeHealth || { } ) ;
750+ this . renderEnvironmentCapabilities ( data ?. environmentCapabilities || { } ) ;
709751 this . renderApiContract ( data ?. apiContract || { } ) ;
710752 this . renderServiceHealth ( data ?. serviceHealth || { } ) ;
711753 this . renderConfigurationSummary ( data ?. configurationSummary || { } ) ;
0 commit comments