From 0138398168007c5ae433fec5f67f49f9490359c7 Mon Sep 17 00:00:00 2001 From: Joris-k Date: Tue, 3 Dec 2024 14:07:36 +0100 Subject: [PATCH] feat(xo-lite): adding pif status component, some improvement and css --- .../network/PoolHostInternalNetworkTable.vue | 184 +++++++++------- .../pool/network/PoolNetworksPifStatus.vue | 24 +++ .../pool/network/PoolNetworksTable.vue | 203 ++++++++++-------- @xen-orchestra/lite/src/locales/en.json | 3 +- @xen-orchestra/lite/src/locales/fr.json | 3 +- .../lite/src/stores/xen-api/network.store.ts | 2 +- .../lite/src/views/pool/PoolNetworkView.vue | 28 ++- .../lib/components/ui/info/UiInfo.vue | 1 - .../lib/components/ui/input/UiInput.vue | 1 + 9 files changed, 272 insertions(+), 177 deletions(-) create mode 100644 @xen-orchestra/lite/src/components/pool/network/PoolNetworksPifStatus.vue diff --git a/@xen-orchestra/lite/src/components/pool/network/PoolHostInternalNetworkTable.vue b/@xen-orchestra/lite/src/components/pool/network/PoolHostInternalNetworkTable.vue index e90f35af179..b8b508aace6 100644 --- a/@xen-orchestra/lite/src/components/pool/network/PoolHostInternalNetworkTable.vue +++ b/@xen-orchestra/lite/src/components/pool/network/PoolHostInternalNetworkTable.vue @@ -1,73 +1,81 @@ @@ -138,6 +146,7 @@ const { visibleColumns, rows } = useTable('networks', filteredNetworks, { }) type networkHeader = 'name_label' | 'name_description' | 'MTU' | 'default_locking_mode' | 'more' + const headerIcon: Record = { name_label: { icon: faAlignLeft }, name_description: { icon: faAlignLeft }, @@ -145,6 +154,7 @@ const headerIcon: Record = { default_locking_mode: { icon: faCaretDown }, more: { icon: faEllipsis }, } + const getHeaderIcon = (status: networkHeader) => headerIcon[status].icon watchEffect(() => { @@ -155,8 +165,38 @@ watchEffect(() => { diff --git a/@xen-orchestra/lite/src/components/pool/network/PoolNetworksPifStatus.vue b/@xen-orchestra/lite/src/components/pool/network/PoolNetworksPifStatus.vue new file mode 100644 index 00000000000..e26d69e5dd8 --- /dev/null +++ b/@xen-orchestra/lite/src/components/pool/network/PoolNetworksPifStatus.vue @@ -0,0 +1,24 @@ + + + diff --git a/@xen-orchestra/lite/src/components/pool/network/PoolNetworksTable.vue b/@xen-orchestra/lite/src/components/pool/network/PoolNetworksTable.vue index ed11ae771d1..6b7982f903a 100644 --- a/@xen-orchestra/lite/src/components/pool/network/PoolNetworksTable.vue +++ b/@xen-orchestra/lite/src/components/pool/network/PoolNetworksTable.vue @@ -1,90 +1,94 @@ diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index 74c0713d4d9..637bd240df8 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -99,7 +99,7 @@ "here": "Here", "host.active": "Active", "host.inactive": "Inactive", - "host-internal-network": "Host internal network", + "host-internal-networks": "Host internal networks", "invalid-field": "Invalid field", "job.vm-copy.bad-power-state": "VM must be halted", @@ -178,6 +178,7 @@ "n-missing": "{n} missing", "name": "Name", "netmask": "Netmask", + "networks": "Networks", "network-download": "Download", "network-throughput": "Network throughput", "network-upload": "Upload", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index b1355bc6332..bec38f35785 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -99,7 +99,7 @@ "here": "Ici", "host.active": "Actif | Actif | Actifs", "host.inactive": "Inactif | Inactif | Inactifs", - "host-internal-network": "Réseau interne de l'hôte", + "host-internal-networks": "Réseaux interne de l'hôte", "invalid-field": "Champ invalide", "job.vm-copy.bad-power-state": "La VM doit être arrêtée", @@ -178,6 +178,7 @@ "n-missing": "{n} manquant | {n} manquants", "name": "Nom", "netmask": "Masque réseau", + "networks": "Réseaux", "network-download": "Descendant", "network-throughput": "Débit du réseau", "network-upload": "Montant", diff --git a/@xen-orchestra/lite/src/stores/xen-api/network.store.ts b/@xen-orchestra/lite/src/stores/xen-api/network.store.ts index e41119d9a6c..b1d4be5e37c 100644 --- a/@xen-orchestra/lite/src/stores/xen-api/network.store.ts +++ b/@xen-orchestra/lite/src/stores/xen-api/network.store.ts @@ -93,7 +93,7 @@ function determineStatus(PIFs: XenApiPif[]): string { return 'connected' } if (currentlyAttached.some(Boolean)) { - return 'partially connected' + return 'partially_connected' } return 'disconnected' } diff --git a/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue b/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue index 2d776f8fc92..3c3cb0df877 100644 --- a/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue +++ b/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue @@ -1,12 +1,10 @@