diff --git a/src/components/cards/StorageCard.vue b/src/components/cards/StorageCard.vue index 7c830430..f273d2c7 100644 --- a/src/components/cards/StorageCard.vue +++ b/src/components/cards/StorageCard.vue @@ -72,6 +72,17 @@ const getIcon = computed(() => { } }) +// 计算进度条颜色 +const progressColor = computed(() => { + if (usage.value > 90) { + return 'error' + } else if (usage.value > 70) { + return 'warning' + } else { + return 'success' + } +}) + // 计算存储使用率 const usage = computed(() => { return Math.round((available.value / (total.value || 1)) * 1000) / 10 @@ -105,13 +116,15 @@ onMounted(() => {
{{ storage.name }}
-
{{ formatBytes(available) }} / {{ formatBytes(total) }}
+
+ {{ formatBytes(available, 1) }} / {{ formatBytes(total, 1) }} +
未配置
- +