fix(ops): show neutral SLA card when window has no requests

This commit is contained in:
feitianbubu
2026-07-11 19:48:08 +08:00
parent e316ebf528
commit 0d5e3ca9b0
@@ -393,6 +393,7 @@ const tpsAvgLabel = computed(() => {
const slaPercent = computed(() => {
const v = overview.value?.sla
if (typeof v !== 'number') return null
if ((overview.value?.request_count_sla ?? 0) <= 0) return null
return v * 100
})
@@ -1271,7 +1272,7 @@ function handleToolbarRefresh() {
<div class="mt-3 text-xs">
<div class="flex justify-between">
<span class="text-gray-500">{{ t('admin.ops.exceptions') }}:</span>
<span class="font-bold text-red-600 dark:text-red-400">{{ formatNumber((overview.request_count_sla ?? 0) - (overview.success_count ?? 0)) }}</span>
<span class="font-bold text-gray-900 dark:text-white">{{ formatNumber((overview.request_count_sla ?? 0) - (overview.success_count ?? 0)) }}</span>
</div>
</div>
</div>