fix(dashboard): count Recent workloads by source_kind, not raw rows
The Recent-workloads badge and empty-state guard used workloads.length (which includes legacy kind:site rows with empty source_kind) while the list renders pluginWorkloads (source_kind != ''). With one legacy row and no real workloads the badge showed "1" over an empty list and the empty state never appeared. Both now use pluginWorkloads, matching the list and the headline Total count.
This commit is contained in:
@@ -186,7 +186,7 @@
|
||||
<CollapsibleSection
|
||||
id="dashboard-workloads"
|
||||
title={$t('dashboard.recentWorkloads')}
|
||||
badge={!loading && workloads.length > 0 ? String(workloads.length) : ''}
|
||||
badge={!loading && pluginWorkloads.length > 0 ? String(pluginWorkloads.length) : ''}
|
||||
>
|
||||
{#if loading}
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
||||
@@ -205,7 +205,7 @@
|
||||
{$t('dashboard.retry')}
|
||||
</button>
|
||||
</div>
|
||||
{:else if workloads.length === 0}
|
||||
{:else if pluginWorkloads.length === 0}
|
||||
<EmptyState
|
||||
title={$t('dashboard.noWorkloads')}
|
||||
description={$t('dashboard.noWorkloadsDesc')}
|
||||
|
||||
Reference in New Issue
Block a user