From 422f6fa7635f1102767a538a5a1bafad12e74cc8 Mon Sep 17 00:00:00 2001 From: overtrue Date: Sun, 26 Oct 2025 23:15:24 +0800 Subject: [PATCH] refactor: migrate sse kms status card --- pages/sse/index.vue | 107 +++++++++++++++++++++++--------------------- 1 file changed, 57 insertions(+), 50 deletions(-) diff --git a/pages/sse/index.vue b/pages/sse/index.vue index dc63e31..1a7f5dc 100644 --- a/pages/sse/index.vue +++ b/pages/sse/index.vue @@ -13,75 +13,73 @@ - -
-
- - {{ getKmsStatusText() }} - -
- {{ getKmsStatusDescription() }} -
-
- {{ t('Backend') }}: {{ sseKmsForm.backend_type }} + +
+
+
+ + {{ getKmsStatusText() }} + + {{ getKmsStatusDescription() }} + + {{ t('Backend') }}: {{ sseKmsForm.backend_type }} +
-
- - +
+ + {{ t('Refresh') }} - - + - + {{ t('Clear Cache') }} - - - + + + {{ t('Details') }} - + - - - + {{ t('Start KMS') }} - + - - + {{ t('Stop KMS') }} - +
- + @@ -989,6 +987,7 @@ import { ref, reactive, computed, onMounted, watch } from 'vue'; import { useI18n } from 'vue-i18n'; import { useMessage } from 'naive-ui'; +import { AppBadge, AppButton, AppCard } from '@/components/app'; const { getKMSStatus, getConfiguration, @@ -1022,6 +1021,14 @@ const startingKMS = ref(false); const stoppingKMS = ref(false); const detailedStatusData = ref(null); +const kmsStatusVariant = computed(() => { + const type = getKmsStatusType(); + if (type === 'success') return 'primary'; + if (type === 'warning') return 'warning'; + if (type === 'error' || type === 'danger') return 'danger'; + return 'secondary'; +}); + // 密钥管理状态 const showCreateKeyModal = ref(false); const showDeleteModal = ref(false);