@@ -69,6 +69,7 @@ class AdminSystemHealthController {
6969 this . historyRows = root . querySelector ( "[data-admin-system-health-history-rows]" ) ;
7070 this . apiContractRows = root . querySelector ( "[data-admin-system-health-api-contract-rows]" ) ;
7171 this . apiRegistryRows = root . querySelector ( "[data-admin-system-health-api-registry-rows]" ) ;
72+ this . environmentComparisonRows = root . querySelector ( "[data-admin-system-health-environment-comparison-rows]" ) ;
7273 this . capabilityRows = root . querySelector ( "[data-admin-system-health-capability-rows]" ) ;
7374 this . featureFlagRows = root . querySelector ( "[data-admin-system-health-feature-flag-rows]" ) ;
7475 this . actionRows = root . querySelector ( "[data-admin-system-health-action-rows]" ) ;
@@ -160,6 +161,7 @@ class AdminSystemHealthController {
160161 this . renderPostgresMetricsPending ( reason ) ;
161162 this . renderStoragePending ( reason ) ;
162163 this . renderRuntimeHealthPending ( reason ) ;
164+ this . renderEnvironmentComparisonPending ( reason ) ;
163165 this . renderEnvironmentCapabilitiesPending ( reason ) ;
164166 this . renderApiContractPending ( reason ) ;
165167 this . renderAdminApiRegistryPending ( reason ) ;
@@ -203,6 +205,53 @@ class AdminSystemHealthController {
203205 this . setEnvironmentStatus ( "lastHealthCheck" , environmentIdentity . lastHealthCheck ? "PASS" : "WARN" , reason ) ;
204206 }
205207
208+ renderEnvironmentComparisonPending ( reason ) {
209+ if ( ! this . environmentComparisonRows ) {
210+ return ;
211+ }
212+ const row = document . createElement ( "tr" ) ;
213+ row . append (
214+ this . createCell ( "Environment comparison" ) ,
215+ this . createCell ( "Reference-only" ) ,
216+ this . createCell ( "not available" ) ,
217+ this . createCell ( "Reference-only" ) ,
218+ this . createCell ( "Reference-only" ) ,
219+ this . createCell ( "Unavailable" ) ,
220+ this . createStatusCell ( "PENDING" , reason ) ,
221+ ) ;
222+ this . environmentComparisonRows . replaceChildren ( row ) ;
223+ }
224+
225+ renderEnvironmentComparison ( environmentComparison = { } ) {
226+ if ( ! this . environmentComparisonRows ) {
227+ return ;
228+ }
229+ if ( environmentComparison ?. secretsExposed === true || environmentComparison ?. secretEditingAllowed === true ) {
230+ this . renderEnvironmentComparisonPending ( "Safe environment comparison response was blocked because it exposed secret controls." ) ;
231+ return ;
232+ }
233+ const rows = Array . isArray ( environmentComparison . rows ) ? environmentComparison . rows : [ ] ;
234+ if ( ! rows . length ) {
235+ this . renderEnvironmentComparisonPending ( "Safe Admin System Health API returned no environment comparison rows." ) ;
236+ return ;
237+ }
238+ const fragment = document . createDocumentFragment ( ) ;
239+ rows . forEach ( ( comparisonRow ) => {
240+ const row = document . createElement ( "tr" ) ;
241+ row . append (
242+ this . createCell ( comparisonRow . displayName ) ,
243+ this . createCell ( comparisonRow . hostingModel ) ,
244+ this . createCell ( comparisonRow . runtimeExpectation ) ,
245+ this . createCell ( comparisonRow . databaseModel ) ,
246+ this . createCell ( comparisonRow . storageFolder ) ,
247+ this . createCell ( comparisonRow . state ) ,
248+ this . createStatusCell ( comparisonRow . status , comparisonRow . summary || environmentComparison . message ) ,
249+ ) ;
250+ fragment . append ( row ) ;
251+ } ) ;
252+ this . environmentComparisonRows . replaceChildren ( fragment ) ;
253+ }
254+
206255 renderStoragePending ( reason ) {
207256 [ "bucket" , "list" , "upload" , "read" , "delete" , "lastChecked" ] . forEach ( ( key ) => {
208257 this . setStorageStatus ( key , "PENDING" , reason ) ;
@@ -893,6 +942,7 @@ class AdminSystemHealthController {
893942 return ;
894943 }
895944 this . renderEnvironmentIdentity ( data ?. environmentIdentity || { } ) ;
945+ this . renderEnvironmentComparison ( data ?. environmentComparison || { } ) ;
896946 this . renderPostgresStatus ( data ?. databaseStatus || { } ) ;
897947 this . renderStartupDiagnostics ( data ?. localApiStartup || { } ) ;
898948 this . renderStorageStatus ( data ?. storageStatus || { } ) ;
0 commit comments