Skip to content

Commit

Permalink
feat(web-6): add loading hero to hosts status card
Browse files Browse the repository at this point in the history
  • Loading branch information
ByScripts committed Jul 26, 2024
1 parent e6b8707 commit e1ef684
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<template v-if="isReady">
<UiCard>
<CardTitle>{{ $t('hosts-status') }}</CardTitle>
<DonutChartWithLegend :icon="faServer" :segments />
<CardNumbers :value="hosts.length" class="total" label="Total" size="small" />
<LoadingHero :disabled="isReady" type="card">
<DonutChartWithLegend :icon="faServer" :segments />
<CardNumbers :label="t('total')" :value="hosts.length" class="total" size="small" />
</LoadingHero>
</UiCard>
</template>

Expand All @@ -13,13 +15,14 @@ import type { DonutChartWithLegendProps } from '@core/components/donut-chart-wit
import CardTitle from '@core/components/card/CardTitle.vue'
import CardNumbers from '@core/components/CardNumbers.vue'
import DonutChartWithLegend from '@core/components/donut-chart-with-legend/DonutChartWithLegend.vue'
import LoadingHero from '@core/components/state-hero/LoadingHero.vue'
import UiCard from '@core/components/UiCard.vue'
import { faServer } from '@fortawesome/free-solid-svg-icons'
import { computed } from 'vue'
import { useI18n } from 'vue-i18n'
const { t } = useI18n()
const { records: hosts } = useHostStore().subscribe()
const { records: hosts, isReady } = useHostStore().subscribe()
const hostsCount = computed(() => {
return hosts.value.reduce(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<template>
<UiCard>
<CardTitle>{{ $t('vms-status') }}</CardTitle>
<LoadingHero type="card" :disabled="isReady">
<LoadingHero :disabled="isReady" type="card">
<DonutChartWithLegend :icon="faDesktop" :segments />
<CardNumbers :value="vms.length" class="total" :label="t('total')" size="small" />
<CardNumbers :label="t('total')" :value="vms.length" class="total" size="small" />
</LoadingHero>
</UiCard>
</template>
Expand Down

0 comments on commit e1ef684

Please sign in to comment.