@@ -309,15 +309,24 @@ $(function () {
309309
310310 // *overall status*
311311 clusterStatusOverall = data [ 'health' ] [ 'overall_status' ] ;
312- clusterHealthSummary = data [ 'health' ] [ 'summary' ] ;
312+ if ( data [ 'health' ] [ 'status' ] || false ) {
313+ clusterStatusOverall = data [ 'health' ] [ 'status' ] ;
314+ }
315+ clusterHealthSummary = [ ] ;
316+ if ( data [ 'health' ] [ 'summary' ] || false ) {
317+ $ . each ( data [ 'health' ] [ 'summary' ] , function ( index , check ) {
318+ clusterHealthSummary . push ( check [ 'summary' ] ) ;
319+ } ) ;
320+ }
321+ if ( data [ 'health' ] [ 'checks' ] || false ) {
322+ $ . each ( data [ 'health' ] [ 'checks' ] , function ( index , check ) {
323+ clusterHealthSummary . push ( check [ 'summary' ] [ 'message' ] ) ;
324+ } ) ;
325+ }
313326
314327 // *monitor state*
315328 monmapMons = data [ 'monmap' ] [ 'mons' ] ;
316- if ( monmapMons . length > 1 ) {
317- timechekMons = data [ 'health' ] [ 'timechecks' ] [ 'mons' ] ;
318- } else {
319- timechekMons = data [ 'health' ] [ 'health' ] [ 'health_services' ] [ 0 ] [ 'mons' ] ;
320- }
329+ quorumMons = data [ 'quorum_names' ] ;
321330 // }}}
322331
323332 // Update Content {{{
@@ -414,19 +423,17 @@ $(function () {
414423 // update overall cluster status details
415424 $ ( "#overall_status" ) . append ( '<ul class="list-group">' ) ;
416425 $ . each ( clusterHealthSummary , function ( index , obj ) {
417- $ ( "#overall_status" ) . append ( '<li class="list-group-item active"><span class="glyphicon glyphicon-flash"></span><strong>' + obj [ 'summary' ] + '</strong></li>' ) ;
426+ $ ( "#overall_status" ) . append ( '<li class="list-group-item active"><span class="glyphicon glyphicon-flash"></span><strong>' + obj + '</strong></li>' ) ;
418427 } ) ;
419428 $ ( "#overall_status" ) . append ( '</ul>' ) ;
420429
421430 // update monitor status
422431 $ ( "#monitor_status" ) . empty ( ) ;
423432 $ . each ( monmapMons , function ( index , mon ) {
424433 health = 'HEALTH_ERR'
425- $ . each ( timechekMons , function ( index , mon_health ) {
426- if ( mon [ 'name' ] == mon_health [ 'name' ] ) {
427- health = mon_health [ 'health' ] ;
428- }
429- } ) ;
434+ if ( quorumMons . includes ( mon [ 'name' ] ) ) {
435+ health = 'HEALTH_OK' ;
436+ }
430437 msg = 'Monitor ' + mon [ 'name' ] . toUpperCase ( ) + ': ' + health ;
431438 $ ( "#monitor_status" ) . append ( '<div class="col-md-4">' + message ( ceph2bootstrap [ health ] , msg ) + '</div>' ) ;
432439 } ) ;
0 commit comments