Skip to content

[BUG] <title>GlAlerts Widget is failing with latest Glances. #1953

@sypticus

Description

@sypticus

Environment

Self-Hosted (Docker)

System

Chrome 142.0.7444.162

Version

3.1.1 (and running on develop)

Describe the problem

The Glances alerts API has changed, and instead of returning a list of lists, it is now returning a list of objects
{"begin": 1764056155, "state": "WARNING", "type": "LOAD", "min": 3.1771240234375, "max": 3.1771240234375, "sum": 3.1771240234375, "count": 1, "avg": 3.1771240234375, "top": [], "desc": "", "sort": "cpu_percent", "global_msg": "High CPU I/O waiting", "end": -1}

GlAlerts.vue is still trying to get values by index.

            category: alert[3],
            value: round(alert[5]),

It should instead by key.

alert['type'], alert['max'] 

etc.

I'll try to get a PR up for this shortly.

Additional info

    at s (MiscHelpers.js:41:55)
    at r (MiscHelpers.js:46:46)
    at GlAlerts.vue:49:1
    at Array.forEach (<anonymous>)
    at r.processData (GlAlerts.vue:47:1)```


### Please tick the boxes

- [x] You have explained the issue clearly, and included all relevant info
- [x] You are using a [supported](https://github.com/Lissy93/dashy/blob/master/.github/SECURITY.md#supported-versions) version of Dashy
- [x] You've checked that this [issue hasn't already been raised](https://github.com/Lissy93/dashy/issues?q=is%3Aissue)
- [x] You've checked the [docs](https://github.com/Lissy93/dashy/tree/master/docs#readme) and [troubleshooting](https://github.com/Lissy93/dashy/blob/master/docs/troubleshooting.md#troubleshooting) guide ![important](https://img.shields.io/badge/Important!-F6094E)
- [x] You agree to the [code of conduct](https://github.com/Lissy93/dashy/blob/master/.github/CODE_OF_CONDUCT.md#contributor-covenant-code-of-conduct)

Metadata

Metadata

Assignees

Labels

🐛 Bug[ISSUE] Ticket describing something that isn't working👤 Awaiting Maintainer Response[ISSUE] Response from repo author is pending

Projects

Status

Awaiting Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions