fix: 🐛 server stats setting, meta fetching

This commit is contained in:
ThatOneCalculator 2023-07-08 16:19:55 -07:00
parent c33313f797
commit 1f5cf72ae7
No known key found for this signature in database
GPG key ID: 8703CACD01000000
2 changed files with 5 additions and 2 deletions

View file

@ -21,8 +21,10 @@ export default function () {
ev.emit(`serverStatsLog:${x.id}`, log.slice(0, x.length || 50));
});
const meta = fetchMeta();
if (!meta.enableServerMachineStats) return;
fetchMeta().then((meta) => {
if (!meta.enableServerMachineStats) return;
}
);
async function tick() {
const cpu = await cpuUsage();

View file

@ -468,6 +468,7 @@ let enableIdenticonGeneration: boolean = $ref(false);
async function init() {
const meta = await os.api("admin/meta");
if (!meta) throw new Error("No meta");
name = meta.name;
description = meta.description;
tosUrl = meta.tosUrl;