From 08af27b5fbde5cb08114c8db9644c64e0ddc781d 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 | 6 - @xen-orchestra/lite/src/locales/fr.json | 6 - .../components/card/VtsCardRowKeyValue.vue | 1 + .../connection-status/VtsConnectionStatus.vue | 6 +- .../components/state-hero/VtsStateHero.vue | 5 + .../lib/components/table/ColumnTitle.vue | 7 +- .../lib/components/table/VtsDataTable.vue | 35 ++ .../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 | 51 ++- .../table/multi-select.composable.ts | 32 ++ @xen-orchestra/web-core/lib/locales/en.json | 35 +- @xen-orchestra/web-core/lib/locales/fr.json | 35 +- .../web/src/components/pif/PifRow.vue | 90 ++++++ .../web/src/components/pif/PifStatus.vue | 31 ++ .../web/src/components/pool/PoolHeader.vue | 6 +- .../pool/PoolHostInternalNetworkTable.vue | 272 ++++++++++++++++ .../components/pool/PoolNetworksSidePanel.vue | 213 ++++++++++++ .../src/components/pool/PoolNetworksTable.vue | 304 ++++++++++++++++++ .../web/src/pages/pool/[id]/networks.vue | 31 ++ .../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 + 27 files changed, 1188 insertions(+), 42 deletions(-) create mode 100644 @xen-orchestra/web-core/lib/components/table/VtsDataTable.vue 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/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..50a4435e4eb 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -43,7 +43,6 @@ "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", @@ -58,11 +57,8 @@ "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", @@ -178,7 +174,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 +182,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", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index d9f86ea546e..f8052b82f3d 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -43,7 +43,6 @@ "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", @@ -58,10 +57,7 @@ "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", @@ -178,7 +174,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 +182,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", diff --git a/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue b/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue index 513e358fd97..04d4f722847 100644 --- a/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue +++ b/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue @@ -30,6 +30,7 @@ const slots = defineSlots<{ .key { min-width: 12rem; + max-width: 12rem; overflow-wrap: break-word; color: var(--color-neutral-txt-secondary); } 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 @@