From 5bbe91c3e9b5f7ef1175d7471935bc91de067f35 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 27 Feb 2022 02:04:42 +0000 Subject: [PATCH] client tabledefs: add name & icon --- src/static/js/tabledefs/cpu.mjs | 84 +++++++++++++++------------- src/static/js/tabledefs/cpu_live.mjs | 62 ++++++++++---------- 2 files changed, 77 insertions(+), 69 deletions(-) diff --git a/src/static/js/tabledefs/cpu.mjs b/src/static/js/tabledefs/cpu.mjs index 20d2dbd..899fe23 100644 --- a/src/static/js/tabledefs/cpu.mjs +++ b/src/static/js/tabledefs/cpu.mjs @@ -2,43 +2,47 @@ import human_filesize from '../misc/human_filesize.mjs'; -export default [ - { - name: "Model", - type: "table", - content: "{{manufacturer}} {{brand}}" - }, - { - name: "Speed (GHz)", - type: "table", - content: { - "Speed": "{{speed}}", - "Speed (min)": "{{speedMin}}", - "Speed (max)": "{{speedMax}}", - } - }, - { - name: "Core layout", - type: "table", - content: { - "Processors": "{{processors}}", - "Cores": "{{cores}}", - "Physical Cores": "{{physicalCores}}" - } - }, - { - name: "Governor", - type: "table", - content: "{{governor}}" - }, - { - name: "Cache", - type: "table", - content: { - "L1 (data)": (table) => `${human_filesize(table.cache.l1d)}`, - "L1 (instruction)": (table) => `${human_filesize(table.cache.l1i)}`, - "L2": (table) => `${human_filesize(table.cache.l2)}`, - "L3": (table) => `${human_filesize(table.cache.l3)}`, - } - }, -]; +export default { + name: "Hardware: CPU", + icon: [ "square-o", "microchip" ], + items: [ + { + name: "Model", + type: "table", + content: "{{manufacturer}} {{brand}}" + }, + { + name: "Speed (GHz)", + type: "table", + content: { + "Speed": "{{speed}}", + "Speed (min)": "{{speedMin}}", + "Speed (max)": "{{speedMax}}", + } + }, + { + name: "Core layout", + type: "table", + content: { + "Processors": "{{processors}}", + "Cores": "{{cores}}", + "Physical Cores": "{{physicalCores}}" + } + }, + { + name: "Governor", + type: "table", + content: "{{governor}}" + }, + { + name: "Cache", + type: "table", + content: { + "L1 (data)": (table) => `${human_filesize(table.cache.l1d)}`, + "L1 (instruction)": (table) => `${human_filesize(table.cache.l1i)}`, + "L2": (table) => `${human_filesize(table.cache.l2)}`, + "L3": (table) => `${human_filesize(table.cache.l3)}`, + } + }, + ] +}; diff --git a/src/static/js/tabledefs/cpu_live.mjs b/src/static/js/tabledefs/cpu_live.mjs index 207c907..a99cc1b 100644 --- a/src/static/js/tabledefs/cpu_live.mjs +++ b/src/static/js/tabledefs/cpu_live.mjs @@ -2,33 +2,37 @@ import human_filesize from '../misc/human_filesize.mjs'; -export default [ - { - name: "Frequency (GHz)", - type: "guage", - guage: { min: 0, max: 6 }, - content: { - "min": "frequency.min", - "max": "frequency.max", - "average": "frequency.avg" +export default { + name: "CPU", + icon: microchip, + items: [ + { + name: "Frequency (GHz)", + type: "guage", + guage: { min: 0, max: 6 }, + content: { + "min": "frequency.min", + "max": "frequency.max", + "average": "frequency.avg" + } + }, + { + name: "Frequency per-core (GHz)", + type: "guage", + guage: { min: 0, max: 6 }, + content: (table) => table.frequency.cores + }, + { + name: "Temperature (°C)", + type: "guage", + guage: { min: 0, max: 100 }, + content: "main", + }, + { + name: "Chipset temperature (°C)", + type: "guage", + guage: { min: 0, max: 100 }, + content: "main" } - }, - { - name: "Frequency per-core (GHz)", - type: "guage", - guage: { min: 0, max: 6 }, - content: (table) => table.frequency.cores - }, - { - name: "Temperature (°C)", - type: "guage", - guage: { min: 0, max: 100 }, - content: "main", - }, - { - name: "Chipset temperature (°C)", - type: "guage", - guage: { min: 0, max: 100 }, - content: "main" - } -]; + ] +};