From 44e33666cfcaf8ec14dabde2bde0680812d60217 Mon Sep 17 00:00:00 2001 From: OlivierFL <66562640+OlivierFL@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:20:06 +0200 Subject: [PATCH] feat(xo-6/dashboard): add resources overview data (#8009) Display resources overview data on XO 6 dashboard. --- @xen-orchestra/lite/src/locales/en.json | 1 - @xen-orchestra/lite/src/locales/fr.json | 1 - @xen-orchestra/web-core/lib/locales/en.json | 1 + @xen-orchestra/web-core/lib/locales/fr.json | 1 + .../site/dashboard/ResourcesOverview.vue | 41 +++++++++++++++++++ @xen-orchestra/web/src/locales/en.json | 3 ++ @xen-orchestra/web/src/locales/fr.json | 3 ++ @xen-orchestra/web/src/pages/index.vue | 8 +++- .../web/src/types/xo/dashboard.type.ts | 5 +++ CHANGELOG.unreleased.md | 1 + 10 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 @xen-orchestra/web/src/components/site/dashboard/ResourcesOverview.vue diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index aaad3c1ccaa..d582732a0a9 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -203,7 +203,6 @@ "theme-light": "Light", "this-vm-cant-be-migrated": "This VM can't be migrated", "top-#": "Top {n}", - "total-cpus": "Total CPUs", "total-free:": "Total free:", "total-used:": "Total used:", "unreachable-hosts": "Unreachable hosts", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index ab62e66bebf..ee3d2813eae 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -203,7 +203,6 @@ "theme-light": "Clair", "this-vm-cant-be-migrated": "Cette VM ne peut pas être migrée", "top-#": "Top {n}", - "total-cpus": "Total CPUs", "total-free:": "Total libre :", "total-used:": "Total utilisé :", "unreachable-hosts": "Hôtes inaccessibles", diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index 3ec8c93eff9..3a172b205ba 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -69,5 +69,6 @@ "tasks.quick-view.in-progress": "In progress", "total": "Total", + "total-cpus": "Total CPUs", "vms": "VMs" } diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index 80fb1528b12..7449ba46ab6 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -69,5 +69,6 @@ "tasks.quick-view.in-progress": "En cours", "total": "Total", + "total-cpus": "Total CPUs", "vms": "VMs" } diff --git a/@xen-orchestra/web/src/components/site/dashboard/ResourcesOverview.vue b/@xen-orchestra/web/src/components/site/dashboard/ResourcesOverview.vue new file mode 100644 index 00000000000..1c52186699d --- /dev/null +++ b/@xen-orchestra/web/src/components/site/dashboard/ResourcesOverview.vue @@ -0,0 +1,41 @@ + + + + + diff --git a/@xen-orchestra/web/src/locales/en.json b/@xen-orchestra/web/src/locales/en.json index 09ca0a31652..1a129861d44 100644 --- a/@xen-orchestra/web/src/locales/en.json +++ b/@xen-orchestra/web/src/locales/en.json @@ -36,12 +36,15 @@ "n-hosts": "1 host | {n} hosts", "no-results": "No results", "pools": "Pools", + "resources-overview": "Resources overview", "s3-backup-repository": "S3 backup repository", "storage-repository": "Storage repository", "sidebar.search-tree-view": "Search in treeview", "sidebar.vms-treeview": "VMs treeview", + "total-memory": "Total memory", + "total-storage-repository": "Total storage repository", "up-to-date": "Up-to-date", "used": "Used", "vm": "VM", diff --git a/@xen-orchestra/web/src/locales/fr.json b/@xen-orchestra/web/src/locales/fr.json index f46573ea675..26b6af70a1c 100644 --- a/@xen-orchestra/web/src/locales/fr.json +++ b/@xen-orchestra/web/src/locales/fr.json @@ -36,12 +36,15 @@ "n-hosts": "1 hôte | {n} hôtes", "no-results": "Aucun résultat", "pools": "Pools", + "resources-overview": "Vue d'ensemble des ressources", "s3-backup-repository": "Dépot de sauvegarde S3", "storage-repository": "Dépot de stockage", "sidebar.search-tree-view": "Rechercher dans l'arborescence", "sidebar.vms-treeview": "Arborescence des VMs", + "total-memory": "Mémoire totale", + "total-storage-repository": "Total dépot de stockage", "up-to-date": "À jour", "used": "Utilisé", "vm": "VM", diff --git a/@xen-orchestra/web/src/pages/index.vue b/@xen-orchestra/web/src/pages/index.vue index 7136c5392d3..5956c09176e 100644 --- a/@xen-orchestra/web/src/pages/index.vue +++ b/@xen-orchestra/web/src/pages/index.vue @@ -2,6 +2,7 @@
+ @@ -15,6 +16,7 @@ import Backups from '@/components/site/dashboard/Backups.vue' import HostsStatus from '@/components/site/dashboard/HostsStatus.vue' import Patches from '@/components/site/dashboard/Patches.vue' import Repositories from '@/components/site/dashboard/Repositories.vue' +import ResourcesOverview from '@/components/site/dashboard/ResourcesOverview.vue' import VmsStatus from '@/components/site/dashboard/VmsStatus.vue' @@ -25,7 +27,7 @@ import VmsStatus from '@/components/site/dashboard/VmsStatus.vue' gap: 0.8rem; grid-template-columns: repeat(8, 1fr); grid-template-areas: - 'pools-status pools-status hosts-status hosts-status vms-status vms-status resources resources' + 'pools-status pools-status hosts-status hosts-status vms-status vms-status resources-overview resources-overview' 'backups backups backups backups backup-issues backup-issues backup-issues backup-issues' 'repositories repositories repositories repositories repositories repositories repositories repositories' 'alarms alarms alarms alarms alarms alarms patches patches'; @@ -39,6 +41,10 @@ import VmsStatus from '@/components/site/dashboard/VmsStatus.vue' grid-area: vms-status; } +.resources-overview { + grid-area: resources-overview; +} + .backups { grid-area: backups; } diff --git a/@xen-orchestra/web/src/types/xo/dashboard.type.ts b/@xen-orchestra/web/src/types/xo/dashboard.type.ts index b0c6c692bd4..163209cecea 100644 --- a/@xen-orchestra/web/src/types/xo/dashboard.type.ts +++ b/@xen-orchestra/web/src/types/xo/dashboard.type.ts @@ -53,4 +53,9 @@ export type XoDashboard = { notInJob: number } } + resourcesOverview: { + nCpus: number + memorySize: number + srSize: number + } } diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index fa7cfa69e25..0cef5ba58e1 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -15,6 +15,7 @@ - **XO 6**: - [Dashboard] Display S3 backup repository data (PR [#8006](https://github.com/vatesfr/xen-orchestra/pull/8006)) - [Dashboard] Display VMs protection data (PR [#8007](https://github.com/vatesfr/xen-orchestra/pull/8007)) + - [Dashboard] Display resources overview data (PR [#8009](https://github.com/vatesfr/xen-orchestra/pull/8009)) - **xo-cli** - `rest get --output $file` now displays progress information during download - `rest post` and `rest put` now accept `--input $file` to upload a file and display progress information