Merge pull request #4057 from feitianbubu/fix/ops-sla-zero-window

fix(ops): show neutral SLA card when window has no requests
This commit is contained in:
Wesley Liddick
2026-08-18 13:51:09 +08:00
committed by GitHub
@@ -394,6 +394,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
})
@@ -1272,7 +1273,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>