Compare commits

...

4 Commits

Author SHA1 Message Date
Starbeamrainbowlabs 00722e6b76
client GlobalUI: use display name for navigation items 2022-03-11 01:39:45 +00:00
Starbeamrainbowlabs 658c6ca7f6
remove redundant code 2022-03-11 01:39:09 +00:00
Starbeamrainbowlabs 7f383dcc74
InfoBroker: reorder tablles
The order tables appear in the info broker is the order they'll appear 
in the UI.
2022-03-11 01:38:38 +00:00
Starbeamrainbowlabs f1321d6c37
build.sh: add task to automate launching development environment 2022-03-11 01:38:08 +00:00
5 changed files with 21 additions and 16 deletions

View File

@ -37,6 +37,7 @@ if [[ "$#" -lt 1 ]]; then
echo -e "${CSECTION}Available actions${RS}";
echo -e " ${CACTION}setup${RS} - Perform initial setup";
echo -e " ${CACTION}launch${RS} - Launch a 3-node development swarm";
echo -e " ${CACTION}start-dev${RS} - As launch, but additionally starts a tab for esbuild.";
echo -e "";
exit 1;
@ -74,6 +75,17 @@ task_setup() {
}
task_start-dev() {
set_title "systemquery:dev";
task_begin "Launching esbuild";
terminal_tab "systemquery:build" bash -c "npm run watch; read -p 'Press enter to exit....';";
task_end "$?";
task_launch;
}
task_launch() {
task_begin "Launching swarm";

View File

@ -17,13 +17,14 @@ class InfoBroker {
this.allowed_tables = {
// name → sysinfo name
cpu: "cpu",
// Note that the order here is the order in the web interface
cpu_live: async () => {
return {
frequency: await sysinfo.cpuCurrentSpeed(),
temperature: await sysinfo.cpuTemperature()
};
},
cpu: "cpu",
meta: async () => await this.make_table_meta()
};
}

View File

@ -1,9 +0,0 @@
"use strict";
import cpu from './tabledefs/cpu.mjs';
import cpu_live from './tabledefs/cpu_live.mjs';
export default {
cpu,
cpu_live
}

View File

@ -1,7 +1,5 @@
"use strict";
import human_filesize from '../misc/human_filesize.mjs';
export default {
name: "CPU",
icon: "microchip",

View File

@ -35,16 +35,19 @@ class GlobalUI {
const result = document.createDocumentFragment();
for(const table_name of status.tables) {
console.log(`[nav] new dynamic item ${table_name}, def`, tabledefs[table_name]);
const icondef = typeof tabledefs[table_name] === "undefined"
? "question-circle"
: tabledefs[table_name].icon;
let icondef = `question-circle`;
let display_name = table_name;
if(typeof tabledefs[table_name] !== "undefined") {
icondef = tabledefs[table_name].icon;
display_name = tabledefs[table_name].name;
}
const emel_icon = forkawesome_emel(icondef);
console.log(`emel_icon`, emel_icon);
result.append(this.emel(`li>a[href="?"]>${emel_icon}+span{?}`, {
placeholders: [
`#table/${table_name}`,
table_name
display_name
]
}));
}