refactor: add back old info display from mkv12

This commit is contained in:
ThatOneCalculator 2023-05-29 16:13:36 -07:00
parent fd97dd7c18
commit c58692fa58
No known key found for this signature in database
GPG Key ID: 8703CACD01000000
1 changed files with 101 additions and 60 deletions

View File

@ -1,52 +1,72 @@
<template> <template>
<div class="_panel" :class="$style.root"> <div class="_panel ntjkdlsfk" :class="$style.root">
<div class="ntjkdlsfk"> <div class="container env">
<div class="_panel"> <div class="body">
<XPie class="pie" :value="cpuUsage" /> <div class="number _panel">
<div> <div class="label">Calckey</div>
<p><i class="ph-cpu ph-bold ph-lg"></i>CPU</p> <div class="value _monospace">{{ version }}</div>
<p>{{ meta.cpu.cores }} Logical cores</p>
<p>{{ meta.cpu.model }}</p>
</div> </div>
</div> <div v-if="serverInfo" class="number _panel">
<div class="label">Node.js</div>
<div class="_panel"> <div class="value _monospace">{{ serverInfo.node }}</div>
<XPie class="pie" :value="memUsage" />
<div>
<p><i class="ph-microchip ph-bold ph-lg"></i>RAM</p>
<p>Total: {{ bytes(memTotal, 1) }}</p>
<p>Used: {{ bytes(memUsed, 1) }}</p>
<p>Free: {{ bytes(memFree, 1) }}</p>
</div> </div>
</div> <div v-if="serverInfo" class="number _panel">
<div class="label">PostgreSQL</div>
<div class="_panel"> <div class="value _monospace">{{ serverInfo.psql }}</div>
<XPie class="pie" :value="diskUsage" /> </div>
<div> <div v-if="serverInfo" class="number _panel">
<p><i class="ph-hard-drives ph-bold ph-lg"></i>Disk</p> <div class="label">Redis</div>
<p>Total: {{ bytes(diskTotal, 1) }}</p> <div class="value _monospace">{{ serverInfo.redis }}</div>
<p>Free: {{ bytes(diskAvailable, 1) }}</p> </div>
<p>Used: {{ bytes(diskUsed, 1) }}</p> <div class="_panel">
<XPie class="pie" :value="cpuUsage" />
<div>
<p><i class="ph-cpu ph-bold ph-lg"></i>CPU</p>
<p>{{ meta.cpu.cores }} Logical cores</p>
<p>{{ meta.cpu.model }}</p>
</div>
</div> </div>
</div>
<div class="_panel"> <div class="_panel">
<XPie class="pie" :value="meiliProgress" /> <XPie class="pie" :value="memUsage" />
<div> <div>
<p> <p><i class="ph-microchip ph-bold ph-lg"></i>RAM</p>
<i class="ph-file-search ph-bold ph-lg"></i>MeiliSearch <p>Total: {{ bytes(memTotal, 1) }}</p>
</p> <p>Used: {{ bytes(memUsed, 1) }}</p>
<p> <p>Free: {{ bytes(memFree, 1) }}</p>
{{ i18n.ts._widgets.meiliStatus }}: {{ meiliAvailable }} </div>
</p> </div>
<p>
{{ i18n.ts._widgets.meiliSize }}: <div class="_panel">
{{ bytes(meiliTotalSize, 1) }} <XPie class="pie" :value="diskUsage" />
</p> <div>
<p> <p><i class="ph-hard-drives ph-bold ph-lg"></i>Disk</p>
{{ i18n.ts._widgets.meiliIndexCount }}: <p>Total: {{ bytes(diskTotal, 1) }}</p>
{{ meiliIndexCount }} <p>Free: {{ bytes(diskAvailable, 1) }}</p>
</p> <p>Used: {{ bytes(diskUsed, 1) }}</p>
</div>
</div>
<div class="_panel">
<XPie class="pie" :value="meiliProgress" />
<div>
<p>
<i class="ph-file-search ph-bold ph-lg"></i
>MeiliSearch
</p>
<p>
{{ i18n.ts._widgets.meiliStatus }}:
{{ meiliAvailable }}
</p>
<p>
{{ i18n.ts._widgets.meiliSize }}:
{{ bytes(meiliTotalSize, 1) }}
</p>
<p>
{{ i18n.ts._widgets.meiliIndexCount }}:
{{ meiliIndexCount }}
</p>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -60,9 +80,11 @@ import bytes from "@/filters/bytes";
import { stream } from "@/stream"; import { stream } from "@/stream";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { version } from "@/config";
const meta = await os.api("server-info", {}); const meta = await os.api("server-info", {});
const serverStats = await os.api("stats"); const serverStats = await os.api("stats");
const serverInfo = await os.api("admin/server-info");
let cpuUsage: number = $ref(0); let cpuUsage: number = $ref(0);
@ -116,26 +138,45 @@ onUnmounted(() => {
display: flex; display: flex;
padding: 16px; padding: 16px;
> ._panel { &.env {
> .pie { > .body {
height: 82px; display: grid;
flex-shrink: 0; grid-gap: 16px;
margin-right: 16px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
> div { > .number {
flex: 1; padding: 14px 20px;
> p { > .label {
margin: 0; opacity: 0.7;
font-size: 0.8em; font-size: 0.8em;
}
&:first-child { > .value {
font-weight: bold; font-size: 1.1em;
margin-bottom: 4px; }
}
> i { > .pie {
margin-right: 4px; height: 82px;
flex-shrink: 0;
margin-right: 16px;
}
> div {
flex: 1;
> p {
margin: 0;
font-size: 0.8em;
&:first-child {
font-weight: bold;
margin-bottom: 4px;
> i {
margin-right: 4px;
}
} }
} }
} }