Revert "refactor: add back old info display from mkv12"

This reverts commit c58692fa58.
This commit is contained in:
ThatOneCalculator 2023-05-29 19:45:42 -07:00
parent 15d311c513
commit ce5d93c9df
No known key found for this signature in database
GPG Key ID: 8703CACD01000000

View File

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