iterate through keys in data
This commit is contained in:
parent
2b29a7983a
commit
d6999f5628
|
@ -338,12 +338,12 @@ if ( currentView != 'none' && currentView != 'login' ) {
|
||||||
auth_hash = data.auth;
|
auth_hash = data.auth;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// TO-DO: just interate through all the keys instead
|
// iterate through all the keys then update each element id with the same name
|
||||||
if ( $j('#getBandwidthHTML').length ) $j('#getBandwidthHTML').replaceWith(data.getBandwidthHTML);
|
for (var key of Object.keys(data)) {
|
||||||
if ( $j('#getSysLoadHTML').length ) $j('#getSysLoadHTML').replaceWith(data.getSysLoadHTML);
|
if ( key == "auth" ) continue;
|
||||||
if ( $j('#getDbConHTML').length ) $j('#getDbConHTML').replaceWith(data.getDbConHTML);
|
if ( $j('#'+key).length ) $j('#'+key).replaceWith(data[key]);
|
||||||
if ( $j('#getStorageHTML').length ) $j('#getStorageHTML').replaceWith(data.getStorageHTML);
|
}
|
||||||
if ( $j('#getShmHTML').length ) $j('#getShmHTML').replaceWith(data.getShmHTML);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue