implement Docker

This commit is contained in:
Timi
2026-04-13 11:57:52 +08:00
parent b95d7fe9b6
commit 3393cca441
10 changed files with 1067 additions and 86 deletions

View File

@@ -53,8 +53,9 @@
class="item"
v-for="item in snapshotView?.snapshot?.storagePartitions"
:key="item.uuid"
:label="item.mountPoint"
:label="item.mountPoint || item.partitionId"
:value="`${IOSize.format(item.used)} / ${IOSize.format(item.total)}`"
clip-text="label"
>
<progress-group
mode="heap"
@@ -123,7 +124,7 @@ import SystemAPI from "@/api/SystemAPI";
import type { SystemStatusHistoryPoint, SystemStatusSnapshotView } from "@/types/System";
import type { DashboardHistoryMetric } from "@/store/settingStore";
import { useSettingStore } from "@/store/settingStore";
import { IOSize, type LabelValue, Text, Time } from "timi-web";
import { IOSize, type LabelValue, Text, Time, Toolkit } from "timi-web";
import TCellInfo from "@/components/TCellInfo.vue";
import type { ProgressItem } from "@/components/ProgressGroup.vue";
import ProgressGroup from "@/components/ProgressGroup.vue";
@@ -230,7 +231,6 @@ const historyChartUpdateOptions = Object.freeze({
notMerge: true
});
const isDarkTheme = ref(false);
let historyTimer: number | null;
// ---------- Tab ----------
@@ -605,12 +605,10 @@ function resolveLineSeries(name: string, data: Array<number | null>, yAxisIndex?
// ---------- 加载数据:当前状态 ----------
let snapshotTimer: number | null;
let snapshotTimer: number | undefined;
onUnmounted(() => {
if (snapshotTimer !== null) {
window.clearInterval(snapshotTimer);
snapshotTimer = null;
}
window.clearInterval(snapshotTimer);
snapshotTimer = undefined;
});
async function refreshSnapshot(): Promise<void> {
@@ -633,6 +631,8 @@ async function refreshSnapshot(): Promise<void> {
// ---------- 加载数据:历史采集 ----------
let historyTimer: number | undefined;
async function refreshHistory(): Promise<void> {
if (isHistoryLoading.value) {
return;
@@ -655,6 +655,11 @@ async function refreshHistory(): Promise<void> {
}
}
onUnmounted(() => {
window.clearInterval(historyTimer);
historyTimer = undefined;
});
// ---------- 自动刷新 ----------
watch(() => settingStore.dashboard.server, restartAutoRefresh, { deep: true });
@@ -684,11 +689,11 @@ function restartAutoRefresh(): void {
function clearAutoRefreshTimer(): void {
if (snapshotTimer !== null) {
window.clearInterval(snapshotTimer);
snapshotTimer = null;
snapshotTimer = undefined;
}
if (historyTimer !== null) {
window.clearInterval(historyTimer);
historyTimer = null;
historyTimer = undefined;
}
}
onMounted(restartAutoRefresh);