diff --git a/src/lib/core/InfoBroker.mjs b/src/lib/core/InfoBroker.mjs index 49ac2f8..1f73519 100644 --- a/src/lib/core/InfoBroker.mjs +++ b/src/lib/core/InfoBroker.mjs @@ -13,11 +13,16 @@ const __dirname = import.meta.url.slice(7, import.meta.url.lastIndexOf("/")); class InfoBroker { constructor() { - this.sym_meta = Symbol("____meta_info____") this.allowed_tables = { // name → sysinfo name cpu: "cpu", - meta: this.sym_meta + cpu_live: async () => { + return { + frequency: await sysinfo.cpuCurrentSpeed(), + temperature: await sysinfo.cpuTemperature() + }; + }, + meta: async () => await this.make_table_meta() }; } @@ -45,8 +50,9 @@ class InfoBroker { } let name_translated = this.allowed_tables[name]; - if(name_translated === this.sym_meta) - return await this.make_table_meta(); + + if(typeof name_translated === "function") + return await name_translated(); return await sysinfo[name_translated](); }