From bf042a2aed4c21d2b87c1bc07a9a4fd9152bddc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Fri, 15 Nov 2024 15:03:14 +0100 Subject: [PATCH] feat(xo-6): implement network view --- @xen-orchestra/lite/src/locales/en.json | 37 --- @xen-orchestra/lite/src/locales/fr.json | 37 --- .../connection-status/VtsConnectionStatus.vue | 6 +- .../components/state-hero/VtsStateHero.vue | 5 + .../lib/components/table/ColumnTitle.vue | 7 +- .../lib/components/ui/card/UiCard.vue | 2 +- .../lib/components/ui/checkbox/UiCheckbox.vue | 2 +- .../lib/components/ui/input/UiInput.vue | 1 + .../lib/components/ui/panel/UiPanel.vue | 2 + .../ui/table-pagination/UiTablePagination.vue | 52 +++- .../table/multi-select.composable.ts | 32 ++ @xen-orchestra/web-core/lib/locales/en.json | 38 ++- @xen-orchestra/web-core/lib/locales/fr.json | 40 ++- .../web/src/components/pif/PifRow.vue | 50 +++ .../web/src/components/pif/PifStatus.vue | 28 ++ .../web/src/components/pool/PoolHeader.vue | 6 +- .../pool/PoolHostInternalNetworkTable.vue | 280 +++++++++++++++++ .../components/pool/PoolNetworkPifStatus.vue | 17 ++ .../components/pool/PoolNetworksSidePanel.vue | 225 ++++++++++++++ .../src/components/pool/PoolNetworksTable.vue | 287 ++++++++++++++++++ .../web/src/pages/pool/[id]/networks.vue | 30 ++ .../src/stores/xo-rest-api/network.store.ts | 14 +- .../web/src/stores/xo-rest-api/pif.store.ts | 33 +- .../web/src/types/xo/network.type.ts | 5 + .../web/src/utils/xo-api-definition.util.ts | 4 +- @xen-orchestra/web/typed-router.d.ts | 1 + 26 files changed, 1121 insertions(+), 120 deletions(-) create mode 100644 @xen-orchestra/web-core/lib/composables/table/multi-select.composable.ts create mode 100644 @xen-orchestra/web/src/components/pif/PifRow.vue create mode 100644 @xen-orchestra/web/src/components/pif/PifStatus.vue create mode 100644 @xen-orchestra/web/src/components/pool/PoolHostInternalNetworkTable.vue create mode 100644 @xen-orchestra/web/src/components/pool/PoolNetworkPifStatus.vue create mode 100644 @xen-orchestra/web/src/components/pool/PoolNetworksSidePanel.vue create mode 100644 @xen-orchestra/web/src/components/pool/PoolNetworksTable.vue create mode 100644 @xen-orchestra/web/src/pages/pool/[id]/networks.vue diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index a9217ed7ae1..a6ab26a5cf9 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -8,7 +8,6 @@ "admin-login": "Admin login", "admin-password": "Admin password", "admin-password-confirm": "Confirm admin password", - "alarm-type.cpu_usage": "CPU usage exceeds {n}%", "alarm-type.disk_usage": "Disk usage exceeds {n}%", "alarm-type.fs_usage": "FS usage exceeds {n}%", @@ -19,7 +18,6 @@ "alarm-type.physical_utilisation": "Physical utilisation exceeds {n}%", "alarm-type.sr_io_throughput_total_per_host": "SR IO throughput total per host exceeds {n}%", "alarm-type.unknown": "Unknown alarm type", - "all-good": "All good!", "allow-self-signed-ssl": "You may need to allow self-signed SSL certificates in your browser", "appearance": "Appearance", @@ -43,26 +41,20 @@ "cpu-provisioning": "CPU provisioning", "cpu-provisioning-warning": "The number of vCPUs allocated exceeds the number of physical CPUs available. System performance could be affected", "cpu-usage": "CPU usage", - "delete": "Delete", "delete-vms": "Delete 1 VM | Delete {n} VMs", "deploy": "Deploy", "deploy-xoa": "Deploy XOA", "deploy-xoa-available-on-desktop": "XOA deployment is available on your desktop interface", "deploy-xoa-custom-ntp-servers": "Custom NTP servers (separated by spaces)", - "deploy-xoa-status.configuring": "Configuring XOA…", "deploy-xoa-status.importing": "Importing XOA…", "deploy-xoa-status.not-responding": "XOA is not responding", "deploy-xoa-status.ready": "XOA is ready!", "deploy-xoa-status.starting": "Starting XOA…", "deploy-xoa-status.waiting": "Waiting for XOA to respond…", - "descending": "descending", - "description": "Description", "dhcp": "DHCP", - "disabled": "Disabled", "display": "Display", - "dns": "DNS", "do-you-have-needs": "You have needs and/or expectations? Let us know", "documentation": "Documentation", "edit-config": "Edit config", @@ -76,7 +68,6 @@ "export-vms": "Export VMs", "export-vms-manually-information": "Some VM exports were not able to start automatically, probably due to your browser settings. To export them, you should click on each one. (Alternatively, copy the link as well.)", "fetching-fresh-data": "Fetching fresh data", - "filter.comparison.contains": "Contains", "filter.comparison.ends-with": "Ends with", "filter.comparison.equals": "Equals", @@ -91,7 +82,6 @@ "filter.comparison.not-match-regex": "Doesn't match regex", "filter.comparison.not-start-with": "Doesn't start with", "filter.comparison.starts-with": "Starts with", - "following-hosts-unreachable": "The following hosts are unreachable", "force-reboot": "Force reboot", "force-shutdown": "Force shutdown", @@ -101,70 +91,53 @@ "go-back": "Go back", "gzip": "gzip", "here": "Here", - "host.active": "Active", "host.inactive": "Inactive", - "invalid-field": "Invalid field", - "job.vm-copy.bad-power-state": "VM must be halted", "job.vm-copy.in-progress": "Copy in progress…", "job.vm-copy.missing-vms": "No VM to copy", - "job.vm-delete.bad-power-state": "VM must be halted", "job.vm-delete.in-progress": "Delete in progress…", "job.vm-delete.missing-vms": "No VM to delete", - "job.vm-force-reboot.bad-power-state": "VM must be running or paused", "job.vm-force-reboot.in-progress": "Force reboot in progress…", "job.vm-force-reboot.missing-vms": "No VM to force reboot", - "job.vm-force-shutdown.bad-power-state": "VM must be running, suspended or paused", "job.vm-force-shutdown.in-progress": "Force shutdown in progress…", "job.vm-force-shutdown.missing-vms": "No VM to force shutdown", - "job.vm-export.in-progress": "Export in progress…", "job.vm-export.missing-compression": "Compression must be provided", "job.vm-export.missing-vms": "No VM to export", "job.vm-export.not-allowed": "A VM is not allowed to export", - "job.vm-migrate.bad-power-state": "VM must be running", "job.vm-migrate.in-progress": "Migrate in progress…", "job.vm-migrate.missing-host": "Destination host must be provided", "job.vm-migrate.missing-vms": "No VM to migrate", - "job.vm-pause.bad-power-state": "VM must be running", "job.vm-pause.in-progress": "Pause in progress…", "job.vm-pause.missing-vms": "No VM to pause", - "job.vm-reboot.bad-power-state": "VM must be running", "job.vm-reboot.in-progress": "Reboot in progress…", "job.vm-reboot.missing-vms": "No VM to reboot", - "job.vm-resume.bad-power-state": "VM must be paused or suspended", "job.vm-resume.in-progress": "Resume in progress…", "job.vm-resume.missing-vms": "No VM to resume", - "job.vm-shutdown.bad-power-state": "VM must be running", "job.vm-shutdown.in-progress": "Shutdown in progress…", "job.vm-shutdown.missing-vms": "No VM to shutdown", - "job.vm-snapshot.in-progress": "Snapshot in progress…", "job.vm-snapshot.missing-vms": "No VM to snapshot", - "job.vm-start.bad-power-state": "VM must be halted", "job.vm-start.in-progress": "Start in progress…", "job.vm-start.missing-vms": "No VM to start", - "job.vm-start-on.bad-power-state": "VM must be halted", "job.vm-start-on.in-progress": "Start in progress…", "job.vm-start-on.missing-host": "Destination host must be provided", "job.vm-start-on.missing-vms": "No VM to start", - "job.vm-suspend.bad-power-state": "VM must be running", "job.vm-suspend.in-progress": "Suspend in progress…", "job.vm-suspend.missing-vms": "No VM to suspend", - "keep-me-logged": "Keep me logged in", "keep-page-open": "Do not refresh or quit tab before end of deployment.", "language": "Language", @@ -178,7 +151,6 @@ "migrate-n-vms": "Migrate 1 VM | Migrate {n} VMs", "n-hosts-awaiting-patch": "{n} host is awaiting this patch | {n} hosts are awaiting this patch", "n-missing": "{n} missing", - "name": "Name", "netmask": "Netmask", "network-download": "Download", "network-throughput": "Network throughput", @@ -187,7 +159,6 @@ "news": "News", "news-name": "{name} news", "no-alarm-triggered": "No alarm triggered", - "no-result": "No result", "no-selected-vm-can-be-exported": "No selected VM can be exported", "no-selected-vm-can-be-migrated": "No selected VM can be migrated", "no-tasks": "No tasks", @@ -207,7 +178,6 @@ "ram-usage": "RAM usage", "reboot": "Reboot", "reformat": "Reformat", - "relative-time.day": "1 day | {n} days", "relative-time.future": "In {str}", "relative-time.hour": "1 hour | {n} hours", @@ -217,17 +187,14 @@ "relative-time.past": "{str} ago", "relative-time.second": "1 second | {n} seconds", "relative-time.year": "1 year | {n} years", - "resume": "Resume", "save": "Save", "select-compression": "Select a compression", "select-destination-host": "Select a destination host", "selected-vms-in-execution": "Some selected VMs are running", "send-us-feedback": "Send us feedback", - "select.network": "Select a network", "select.storage": "Select a storage", - "settings": "Settings", "shutdown": "Shutdown", "snapshot": "Snapshot", @@ -246,11 +213,9 @@ "support": "Support", "suspend": "Suspend", "switch-theme": "Switch theme", - "task.estimated-end": "Estimated end", "task.progress": "Progress", "task.started": "Started", - "theme-auto": "Auto", "theme-dark": "Dark", "theme-light": "Light", @@ -263,10 +228,8 @@ "vcpus": "vCPUs", "vcpus-used": "vCPUs used", "version": "Version", - "vm.active": "Active", "vm.inactive": "Inactive", - "vm-is-running": "The VM is running", "xo-lite-under-construction": "XOLite is under construction", "xoa-admin-account": "XOA admin account", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index d9f86ea546e..30a769f29e7 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -8,7 +8,6 @@ "admin-login": "Nom d'utilisateur administrateur", "admin-password": "Mot de passe administrateur", "admin-password-confirm": "Confirmer le mot de passe administrateur", - "alarm-type.cpu_usage": "L'utilisation du CPU dépasse {n}%", "alarm-type.disk_usage": "L'utilisation du disque dépasse {n}%", "alarm-type.fs_usage": "L'utilisation de FS dépasse {n}%", @@ -19,7 +18,6 @@ "alarm-type.physical_utilisation": "L'utilisation physique dépasse {n}%", "alarm-type.sr_io_throughput_total_per_host": "Le débit total de l'IO SR par hôte dépasse {n}%", "alarm-type.unknown": "Type d'alarme inconnu", - "all-good": "Tout va bien !", "allow-self-signed-ssl": "Vous devrez peut-être autoriser les certificats SSL auto-signés depuis votre navigateur", "appearance": "Apparence", @@ -43,25 +41,19 @@ "cpu-provisioning": "Provisionnement CPU", "cpu-provisioning-warning": "Le nombre de vCPU alloués dépasse le nombre de CPU physique disponible. Les performances du système pourraient être affectées", "cpu-usage": "Utilisation CPU", - "delete": "Supprimer", "delete-vms": "Supprimer 1 VM | Supprimer {n} VMs", "deploy": "Déployer", "deploy-xoa": "Déployer XOA", "deploy-xoa-available-on-desktop": "Le déploiement de la XOA est disponible sur ordinateur", "deploy-xoa-custom-ntp-servers": "Serveurs NTP (séparés par des espaces)", - "deploy-xoa-status.configuring": "Configuration de la XOA…", "deploy-xoa-status.importing": "Importation de la XOA…", "deploy-xoa-status.not-responding": "La XOA ne répond pas", "deploy-xoa-status.ready": "La XOA est prête !", "deploy-xoa-status.starting": "Démarrage de la XOA…", "deploy-xoa-status.waiting": "En attente de réponse de la XOA…", - "descending": "descendant", - "description": "Description", "dhcp": "DHCP", - "dns": "DNS", - "disabled": "Désactivé", "display": "Affichage", "do-you-have-needs": "Vous avez des besoins et/ou des attentes ? Faites le nous savoir", "documentation": "Documentation", @@ -76,7 +68,6 @@ "export-vms": "Exporter les VMs", "export-vms-manually-information": "Certaines exportations de VMs n'ont pas pu démarrer automatiquement, peut-être en raison des paramètres du navigateur. Pour les exporter, vous devrez cliquer sur chacune d'entre elles. (Ou copier le lien.)", "fetching-fresh-data": "Récupération de données à jour", - "filter.comparison.contains": "Contient", "filter.comparison.ends-with": "Termine par", "filter.comparison.equals": "Est égal à", @@ -91,7 +82,6 @@ "filter.comparison.not-match-regex": "Ne correspond pas à la regex", "filter.comparison.not-start-with": "Ne commence pas par", "filter.comparison.starts-with": "Commence par", - "following-hosts-unreachable": "Les hôtes suivants sont inaccessibles", "force-reboot": "Forcer le redémarrage", "force-shutdown": "Forcer l'arrêt", @@ -101,70 +91,53 @@ "go-back": "Revenir en arrière", "gzip": "gzip", "here": "Ici", - "host.active": "Actif | Actif | Actifs", "host.inactive": "Inactif | Inactif | Inactifs", - "invalid-field": "Champ invalide", - "job.vm-copy.bad-power-state": "La VM doit être arrêtée", "job.vm-copy.in-progress": "Copie en cours…", "job.vm-copy.missing-vms": "Aucune VM à copier", - "job.vm-delete.bad-power-state": "La VM doit être arrêtée", "job.vm-delete.in-progress": "Suppression en cours…", "job.vm-delete.missing-vms": "Aucune VM à supprimer", - "job.vm-force-reboot.bad-power-state": "La VM doit être allumée ou en pause", "job.vm-force-reboot.in-progress": "Redémarrage forcé en cours…", "job.vm-force-reboot.missing-vms": "Aucune VM à redémarrer de force", - "job.vm-force-shutdown.bad-power-state": "La VM doit être allumée, suspendue ou en pause", "job.vm-force-shutdown.in-progress": "Arrêt forcé en cours…", "job.vm-force-shutdown.missing-vms": "Aucune VM à arrêter de force", - "job.vm-export.in-progress": "Exportation en cours…", "job.vm-export.missing-compression": "La compression est requise", "job.vm-export.missing-vms": "Aucune VM à exporter", "job.vm-export.not-allowed": "VM non autorisée à être exportée", - "job.vm-migrate.bad-power-state": "La VM doit être allumée", "job.vm-migrate.in-progress": "Migration en cours…", "job.vm-migrate.missing-host": "L'hôte de destination est requis", "job.vm-migrate.missing-vms": "Aucune VM à migrer", - "job.vm-pause.bad-power-state": "La VM doit être allumée", "job.vm-pause.in-progress": "Mise en pause en cours…", "job.vm-pause.missing-vms": "Aucune VM à mettre en pause", - "job.vm-reboot.bad-power-state": "La VM doit être allumée", "job.vm-reboot.in-progress": "Redémarrage en cours…", "job.vm-reboot.missing-vms": "Aucune VM à redémarrer", - "job.vm-resume.bad-power-state": "La VM doit être en pause ou suspendue", "job.vm-resume.in-progress": "Reprise en cours…", "job.vm-resume.missing-vms": "Aucune VM à reprendre", - "job.vm-shutdown.bad-power-state": "La VM doit être allumée", "job.vm-shutdown.in-progress": "Arrêt en cours…", "job.vm-shutdown.missing-vms": "Aucune VM à arrêter", - "job.vm-snapshot.in-progress": "Instantané en cours…", "job.vm-snapshot.missing-vms": "Aucune VM pour l'instantané", - "job.vm-start.bad-power-state": "La VM doit être arrêtée", "job.vm-start.in-progress": "Démarrage en cours…", "job.vm-start.missing-vms": "Aucune VM à démarrer", - "job.vm-start-on.bad-power-state": "La VM doit être arrêtée", "job.vm-start-on.in-progress": "Démarrage en cours…", "job.vm-start-on.missing-host": "L'hôte de destination est requis", "job.vm-start-on.missing-vms": "Aucune VM à démarrer", - "job.vm-suspend.bad-power-state": "La VM doit être allumée", "job.vm-suspend.in-progress": "Suspension en cours…", "job.vm-suspend.missing-vms": "Aucune VM à suspendre", - "keep-me-logged": "Rester connecté", "keep-page-open": "Ne pas rafraichir ou quitter cette page avant la fin du déploiement.", "language": "Langue", @@ -178,7 +151,6 @@ "migrate-n-vms": "Migrer 1 VM | Migrer {n} VMs", "n-hosts-awaiting-patch": "{n} hôte attend ce patch | {n} hôtes attendent ce patch", "n-missing": "{n} manquant | {n} manquants", - "name": "Nom", "netmask": "Masque réseau", "network-download": "Descendant", "network-throughput": "Débit du réseau", @@ -187,7 +159,6 @@ "news": "Actualités", "news-name": "Actualités {name}", "no-alarm-triggered": "Aucune alarme déclenchée", - "no-result": "Aucun résultat", "no-selected-vm-can-be-exported": "Aucune VM sélectionnée ne peut être exportée", "no-selected-vm-can-be-migrated": "Aucune VM sélectionnée ne peut être migrée", "no-tasks": "Aucune tâche", @@ -207,7 +178,6 @@ "ram-usage": "Utilisation de la RAM", "reboot": "Redémarrer", "reformat": "Reformater", - "relative-time.day": "1 jour | {n} jours", "relative-time.future": "Dans {str}", "relative-time.hour": "1 heure | {n} heures", @@ -217,17 +187,14 @@ "relative-time.past": "Il y a {str}", "relative-time.second": "1 seconde | {n} secondes", "relative-time.year": "1 an | {n} ans", - "resume": "Reprendre", "save": "Enregistrer", "select-compression": "Sélectionnez une compression", "select-destination-host": "Sélectionnez un hôte de destination", "selected-vms-in-execution": "Certaines VMs sélectionnées sont en cours d'exécution", "send-us-feedback": "Envoyez-nous vos commentaires", - "select.network": "Sélectionner un réseau", "select.storage": "Sélectionner un SR", - "settings": "Paramètres", "shutdown": "Arrêter", "snapshot": "Instantané", @@ -246,11 +213,9 @@ "support": "Support", "suspend": "Suspendre", "switch-theme": "Changer de thème", - "task.estimated-end": "Fin estimée", "task.progress": "Progression", "task.started": "Démarré", - "theme-auto": "Auto", "theme-dark": "Sombre", "theme-light": "Clair", @@ -263,10 +228,8 @@ "vcpus": "vCPUs", "vcpus-used": "vCPUs utilisés", "version": "Version", - "vm.active": "Active | Active | Actives", "vm.inactive": "Inactive | Inactive | Inactives", - "vm-is-running": "La VM est en cours d'exécution", "xo-lite-under-construction": "XOLite est en construction", "xoa-admin-account": "Compte administrateur de la XOA", diff --git a/@xen-orchestra/web-core/lib/components/connection-status/VtsConnectionStatus.vue b/@xen-orchestra/web-core/lib/components/connection-status/VtsConnectionStatus.vue index cd0288a2541..c1526c66874 100644 --- a/@xen-orchestra/web-core/lib/components/connection-status/VtsConnectionStatus.vue +++ b/@xen-orchestra/web-core/lib/components/connection-status/VtsConnectionStatus.vue @@ -9,7 +9,11 @@ import UiInfo, { type InfoAccent } from '@core/components/ui/info/UiInfo.vue' import { computed, type ComputedRef } from 'vue' import { useI18n } from 'vue-i18n' -type ConnectionStatus = 'connected' | 'disconnected' | 'partially-connected' | 'disconnected-from-physical-device' +export type ConnectionStatus = + | 'connected' + | 'disconnected' + | 'partially-connected' + | 'disconnected-from-physical-device' type ConnectionStatusesMap = Record const { status } = defineProps<{ diff --git a/@xen-orchestra/web-core/lib/components/state-hero/VtsStateHero.vue b/@xen-orchestra/web-core/lib/components/state-hero/VtsStateHero.vue index 134fea7f428..40fd6e242ab 100644 --- a/@xen-orchestra/web-core/lib/components/state-hero/VtsStateHero.vue +++ b/@xen-orchestra/web-core/lib/components/state-hero/VtsStateHero.vue @@ -107,9 +107,12 @@ const imageSrc = computed(() => { gap: 4rem; justify-content: unset; padding-top: 8rem; + position: relative; .text { order: 1; + position: sticky; + top: 2rem; } .loader { @@ -120,6 +123,8 @@ const imageSrc = computed(() => { .image { order: 2; width: 80%; + position: sticky; + top: 10rem; } } diff --git a/@xen-orchestra/web-core/lib/components/table/ColumnTitle.vue b/@xen-orchestra/web-core/lib/components/table/ColumnTitle.vue index 85127619f52..1b7ec7916c1 100644 --- a/@xen-orchestra/web-core/lib/components/table/ColumnTitle.vue +++ b/@xen-orchestra/web-core/lib/components/table/ColumnTitle.vue @@ -3,12 +3,12 @@