File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -135,16 +135,26 @@ function health_node(addr) {
135135
136136function health_update_nscore ( ) {
137137 var nscore = 0 ;
138+ var nodes = 0 ;
138139 $ ( '#health td.nscore' ) . each ( function ( ) {
139140 var td = $ ( this ) . text ( ) ;
140141 if ( td . match ( / ^ [ 0 - 9 ] + $ / ) ) {
141142 n = parseInt ( td ) ;
142143 if ( n > nscore ) {
143- nscore = n ;
144+ nscore += n ;
145+ nodes += 1 ;
144146 }
145147 }
146148 } ) ;
147- $ ( '#nscore' ) . text ( nscore ) ;
149+ nscore = Math . round ( nscore / nodes ) ;
150+ var score = 0 ;
151+ $ ( '#health td.score' ) . each ( function ( ) {
152+ var td = $ ( this ) . text ( ) ;
153+ if ( td . match ( / ^ [ 0 - 9 ] + $ / ) ) {
154+ score += parseInt ( td ) ;
155+ }
156+ } ) ;
157+ $ ( '#nscore' ) . html ( '<span title="average">' + nscore + '</span>/<span title="actual">' + score + '</span>' ) ;
148158}
149159
150160function health_update_cost ( ) {
You can’t perform that action at this time.
0 commit comments