-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(xo-6/dashboard): add resources overview data (#8009)
Display resources overview data on XO 6 dashboard.
- Loading branch information
Showing
10 changed files
with
62 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,5 +69,6 @@ | |
"tasks.quick-view.in-progress": "In progress", | ||
|
||
"total": "Total", | ||
"total-cpus": "Total CPUs", | ||
"vms": "VMs" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,5 +69,6 @@ | |
"tasks.quick-view.in-progress": "En cours", | ||
|
||
"total": "Total", | ||
"total-cpus": "Total CPUs", | ||
"vms": "VMs" | ||
} |
41 changes: 41 additions & 0 deletions
41
@xen-orchestra/web/src/components/site/dashboard/ResourcesOverview.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<template> | ||
<UiCard> | ||
<CardTitle>{{ $t('resources-overview') }}</CardTitle> | ||
<LoadingHero :disabled="isReady" type="card"> | ||
<div class="line-1"> | ||
<CardNumbers :label="$t('total-memory')" :value="memorySize?.value" :unit="memorySize?.prefix" size="medium" /> | ||
<CardNumbers :label="$t('total-cpus')" :value="nCpus" size="medium" /> | ||
</div> | ||
<CardNumbers | ||
:label="$t('total-storage-repository')" | ||
:value="srSize?.value" | ||
:unit="srSize?.prefix" | ||
size="medium" | ||
/> | ||
</LoadingHero> | ||
</UiCard> | ||
</template> | ||
<script lang="ts" setup> | ||
import { useDashboardStore } from '@/stores/xo-rest-api/dashboard.store' | ||
import { formatSizeRaw } from '@/utils/size.util' | ||
import CardTitle from '@core/components/card/CardTitle.vue' | ||
import CardNumbers from '@core/components/CardNumbers.vue' | ||
import LoadingHero from '@core/components/state-hero/LoadingHero.vue' | ||
import UiCard from '@core/components/UiCard.vue' | ||
import { computed } from 'vue' | ||
const { record, isReady } = useDashboardStore().subscribe() | ||
const nCpus = computed(() => record.value?.resourcesOverview?.nCpus) | ||
const memorySize = computed(() => formatSizeRaw(record.value?.resourcesOverview?.memorySize, 1)) | ||
const srSize = computed(() => formatSizeRaw(record.value?.resourcesOverview?.srSize, 1)) | ||
</script> | ||
<style lang="postcss" scoped> | ||
.line-1 { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
gap: 1rem; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters