Skip to content

Commit e544c87

Browse files
authored
🔀 Merge pull request #1954 from sypticus/FIX/1953_glances_alerts_api_update
🐛 Updated GlAlerts to use latest Glances Alerts API Fixes #1953
2 parents 448c625 + bf10fc1 commit e544c87

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/components/Widgets/GlAlerts.vue

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ export default {
4646
const alerts = [];
4747
alertData.forEach((alert) => {
4848
alerts.push({
49-
time: timestampToDateTime(alert[0] * 1000),
50-
ongoing: (alert[1] === -1),
51-
timeAgo: getTimeAgo(alert[0] * 1000),
52-
lasted: alert[1] ? getTimeDifference(alert[0] * 1000, alert[1] * 1000) : 'Ongoing',
53-
severity: alert[2],
54-
category: alert[3],
55-
value: round(alert[5]),
56-
minMax: `Min: ${round(alert[4])}%<br>Avg: `
57-
+ `${round(alert[5])}%<br>Max: ${round(alert[6])}%`,
49+
time: timestampToDateTime(alert.begin * 1000),
50+
ongoing: (alert.end === -1),
51+
timeAgo: getTimeAgo(alert.begin * 1000),
52+
lasted: alert.end !== -1 ? getTimeDifference(alert.begin * 1000, alert.end * 1000) : 'Ongoing',
53+
severity: alert.state,
54+
category: alert.type,
55+
value: round(alert.sum),
56+
minMax: `Min: ${round(alert.min)}%<br>Avg: `
57+
+ `${round(alert.avg)}%<br>Max: ${round(alert.max)}%`,
5858
});
5959
});
6060
this.alerts = alerts;

0 commit comments

Comments
 (0)