fix undefined if system_view_selectedMetric missing

- defaults to first metric on init
- reorder gitignore
This commit is contained in:
Christoph Kluge 2025-02-10 15:36:14 +01:00
parent 2bd7c8d51e
commit 140b3c371d
2 changed files with 13 additions and 10 deletions

22
.gitignore vendored
View File

@ -1,21 +1,23 @@
/cc-backend
/var/job-archive
/var/*.db
/var/machine-state
/.env
/config.json
/var/job-archive
/var/machine-state
/var/job.db-shm
/var/job.db-wal
/var/*.db
/var/*.txt
/web/frontend/public/build
/web/frontend/node_modules
/.vscode/*
/archive-migration
/archive-manager
var/job.db-shm
var/job.db-wal
/internal/repository/testdata/job.db-shm
/internal/repository/testdata/job.db-wal
/.vscode/*
dist/
*.db
internal/repository/testdata/job.db-shm
internal/repository/testdata/job.db-wal

View File

@ -77,6 +77,7 @@
for (let sm of systemMetrics) {
systemUnits[sm.name] = (sm?.unit?.prefix ? sm.unit.prefix : "") + (sm?.unit?.base ? sm.unit.base : "")
}
if (!selectedMetric) selectedMetric = systemMetrics[0].name
}
$: loadMetrics($initialized)