From 333012bd29d8bf40efac194c847c19b0f8493380 Mon Sep 17 00:00:00 2001
From: Paloma <94314524+P4l0m4@users.noreply.github.com>
Date: Fri, 26 Jul 2024 11:09:15 +0200
Subject: [PATCH] feat(xo-web): add host status to xo6 dashboard (#7799)
---
.../components/site/dashboard/HostsStatus.vue | 68 +++++++++++++++++++
.../components/site/dashboard/VmsStatus.vue | 4 +-
@xen-orchestra/web/src/locales/en.json | 8 +++
@xen-orchestra/web/src/locales/fr.json | 8 +++
@xen-orchestra/web/src/pages/index.vue | 6 ++
@xen-orchestra/web/src/types/host.type.ts | 6 +-
6 files changed, 95 insertions(+), 5 deletions(-)
create mode 100644 @xen-orchestra/web/src/components/site/dashboard/HostsStatus.vue
diff --git a/@xen-orchestra/web/src/components/site/dashboard/HostsStatus.vue b/@xen-orchestra/web/src/components/site/dashboard/HostsStatus.vue
new file mode 100644
index 00000000000..ffe08ccbc68
--- /dev/null
+++ b/@xen-orchestra/web/src/components/site/dashboard/HostsStatus.vue
@@ -0,0 +1,68 @@
+
+
+ {{ $t('hosts-status') }}
+
+
+
+
+
+
+
+
+
+
diff --git a/@xen-orchestra/web/src/components/site/dashboard/VmsStatus.vue b/@xen-orchestra/web/src/components/site/dashboard/VmsStatus.vue
index b592f391da3..8f3a90a9484 100644
--- a/@xen-orchestra/web/src/components/site/dashboard/VmsStatus.vue
+++ b/@xen-orchestra/web/src/components/site/dashboard/VmsStatus.vue
@@ -1,9 +1,9 @@
{{ $t('vms-status') }}
-
+
-
+
diff --git a/@xen-orchestra/web/src/locales/en.json b/@xen-orchestra/web/src/locales/en.json
index 22c521c88eb..2b8ecc0a5ed 100644
--- a/@xen-orchestra/web/src/locales/en.json
+++ b/@xen-orchestra/web/src/locales/en.json
@@ -1,7 +1,15 @@
{
"account-organization-more": "Account, organization & more…",
+
"host": "Host",
"host-description": "Host description",
+
+ "hosts-status": "Hosts status",
+ "hosts-status.halted": "Stopped",
+ "hosts-status.running": "Running",
+ "hosts-status.unknown": "Unknown",
+ "hosts-status.unknown.tooltip": "Hosts metrics are unavailable",
+
"n-hosts": "1 host | {n} hosts",
"no-results": "No results",
diff --git a/@xen-orchestra/web/src/locales/fr.json b/@xen-orchestra/web/src/locales/fr.json
index 7bfa442d17e..cb7e0826eb3 100644
--- a/@xen-orchestra/web/src/locales/fr.json
+++ b/@xen-orchestra/web/src/locales/fr.json
@@ -1,7 +1,15 @@
{
"account-organization-more": "Compte, organisation et plus…",
+
"host": "Hôte",
"host-description": "Description de l'hôte",
+
+ "hosts-status": "Statut des hôtes",
+ "hosts-status.halted": "Arrêtés",
+ "hosts-status.running": "Démarrés",
+ "hosts-status.unknown": "Inconnu",
+ "hosts-status.unknown.tooltip": "Les métriques de l'hôte sont inaccessibles",
+
"n-hosts": "1 hôte | {n} hôtes",
"no-results": "Aucun résultat",
diff --git a/@xen-orchestra/web/src/pages/index.vue b/@xen-orchestra/web/src/pages/index.vue
index de8f7ed8a8f..8e27fcac872 100644
--- a/@xen-orchestra/web/src/pages/index.vue
+++ b/@xen-orchestra/web/src/pages/index.vue
@@ -1,10 +1,12 @@
+
@@ -21,6 +23,10 @@ import VmsStatus from '@/components/site/dashboard/VmsStatus.vue'
'alarms alarms alarms alarms alarms alarms alarms patches';
}
+.hosts-status {
+ grid-area: hosts-status;
+}
+
.vms-status {
grid-area: vms-status;
}
diff --git a/@xen-orchestra/web/src/types/host.type.ts b/@xen-orchestra/web/src/types/host.type.ts
index 533ea672964..a431634181d 100644
--- a/@xen-orchestra/web/src/types/host.type.ts
+++ b/@xen-orchestra/web/src/types/host.type.ts
@@ -3,9 +3,9 @@ import type { RecordId } from '@/types/xo-object.type'
import type { Branch } from '@core/composables/tree/branch'
export enum HOST_POWER_STATE {
- HALTED = 'halted',
- RUNNING = 'running',
- UNKNOWN = 'unknown',
+ HALTED = 'Halted',
+ RUNNING = 'Running',
+ UNKNOWN = 'Unknown',
}
export type Host = {