Don't show badge without information (#2130)

Was requested
[here](https://github.com/woodpecker-ci/woodpecker/issues/1314#issuecomment-1477858832)
for queue, but this also applies to agents: Do not show badges that only
show `???` because they don't provide any useful information.
This commit is contained in:
qwerty287 2023-08-07 13:19:51 +02:00 committed by GitHub
parent 270de5f574
commit e17d0da2c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,9 +24,9 @@
<span>{{ agent.name || `Agent ${agent.id}` }}</span>
<span class="ml-auto">
<span class="hidden md:inline-block space-x-2">
<Badge :label="$t('admin.settings.agents.platform.badge')" :value="agent.platform || '???'" />
<Badge :label="$t('admin.settings.agents.backend.badge')" :value="agent.backend || '???'" />
<Badge :label="$t('admin.settings.agents.capacity.badge')" :value="agent.capacity || '???'" />
<Badge v-if="agent.platform" :label="$t('admin.settings.agents.platform.badge')" :value="agent.platform" />
<Badge v-if="agent.backend" :label="$t('admin.settings.agents.backend.badge')" :value="agent.backend" />
<Badge v-if="agent.capacity" :label="$t('admin.settings.agents.capacity.badge')" :value="agent.capacity" />
</span>
<span class="ml-2">{{ agent.last_contact ? timeAgo.format(agent.last_contact * 1000) : 'never' }}</span>
</span>