mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
hopefully fix server metrics refresh bug
This commit is contained in:
committed by
Aiden McClelland
parent
decc17fce5
commit
f364202ae9
@@ -43,16 +43,19 @@ export class ServerMetricsPage {
|
||||
|
||||
async getMetrics (): Promise<void> {
|
||||
try {
|
||||
const metrics = await this.apiService.getServerMetrics({ })
|
||||
Object.keys(metrics).forEach(outerKey => {
|
||||
if (!this.metrics[outerKey]) {
|
||||
this.metrics[outerKey] = metrics[outerKey]
|
||||
} else {
|
||||
Object.entries(metrics[outerKey]).forEach(([key, value]) => {
|
||||
this.metrics[outerKey][key] = value
|
||||
})
|
||||
}
|
||||
})
|
||||
this.metrics = await this.apiService.getServerMetrics({ })
|
||||
|
||||
// @TODO keeping code in case naive approach (above) has issues
|
||||
// Object.keys(metrics).forEach(outerKey => {
|
||||
// if (!this.metrics[outerKey]) {
|
||||
// console.log('outer keys')
|
||||
// this.metrics[outerKey] = metrics[outerKey]
|
||||
// } else {
|
||||
// Object.entries(metrics[outerKey]).forEach(([key, value]) => {
|
||||
// this.metrics[outerKey][key] = value
|
||||
// })
|
||||
// }
|
||||
// })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
this.error = e.message
|
||||
|
||||
Reference in New Issue
Block a user