Fix for bug where corrupted title shows as first line
Some checks are pending
build-docker / Build Image (push) Waiting to run
Some checks are pending
build-docker / Build Image (push) Waiting to run
This commit is contained in:
parent
c42b6ddca8
commit
9eae924960
1 changed files with 2 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ import { withBasePath } from './utils/base-path.mjs';
|
|||
|
||||
const LINES_PER_PAGE = 4;
|
||||
const PAGE_DURATION_MS = 7000;
|
||||
const ALLOWED_KEYS = new Set(['OS', 'Kernel', 'Uptime', 'CPU', 'GPU', 'Memory', 'Disk']);
|
||||
|
||||
const parseServerObservationLine = (line) => {
|
||||
const trimmed = line.trim();
|
||||
|
|
@ -19,7 +20,7 @@ const parseServerObservationLine = (line) => {
|
|||
if (separatorIndex > 0) {
|
||||
const key = trimmed.slice(0, separatorIndex).trim();
|
||||
const value = trimmed.slice(separatorIndex + separator.length).trim();
|
||||
if (key && value) {
|
||||
if (key && value && ALLOWED_KEYS.has(key)) {
|
||||
return { key, value };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue