client tabledefs: add name & icon

This commit is contained in:
Starbeamrainbowlabs 2022-02-27 02:04:42 +00:00
parent 405df9acfc
commit 5bbe91c3e9
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 77 additions and 69 deletions

View file

@ -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)}`,
}
},
]
};

View file

@ -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"
}
];
]
};