From fbc66f034903a602cca6d9738c68c37d5b41e8cb Mon Sep 17 00:00:00 2001 From: Joris-k Date: Thu, 21 Nov 2024 12:20:46 +0100 Subject: [PATCH] feat(xo-lite): add selected pifs in side panel and copy to clipboard --- @xen-orchestra/lite/src/locales/en.json | 3 + @xen-orchestra/lite/src/locales/fr.json | 3 + .../lite/src/stores/xen-api/network.store.ts | 8 +- .../lite/src/views/pool/PoolNetworkView.vue | 78 ++++++++++++++++--- 4 files changed, 80 insertions(+), 12 deletions(-) diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index b7f64875454..294eefbb9f4 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -39,6 +39,7 @@ "configuration": "Configuration", "confirm-cancel": "Are you sure you want to cancel?", "confirm-delete": "You're about to delete {0}", + "coming-soon": "Coming soon!", "console-unavailable": "Console unavailable", "copy": "Copy", "cpu-provisioning": "CPU provisioning", @@ -67,6 +68,7 @@ "dns": "DNS", "do-you-have-needs": "You have needs and/or expectations? Let us know", "documentation": "Documentation", + "device": "Device", "edit": "Edit", "edit-config": "Edit config", "enabled": "Enabled", @@ -157,6 +159,7 @@ "password-invalid": "Password invalid", "pause": "Pause", "please-confirm": "Please confirm", + "pifs": "PIFs", "pifs-status": "PIFs status", "pool-cpu-usage": "Pool CPU Usage", "pool-ram-usage": "Pool RAM Usage", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index 4df2197398b..8404b2a781d 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -39,6 +39,7 @@ "configuration": "Configuration", "confirm-cancel": "Êtes-vous sûr de vouloir annuler ?", "confirm-delete": "Vous êtes sur le point de supprimer {0}", + "coming-soon": "Bientôt disponible !", "console-unavailable": "Console indisponible", "copy": "Copier", "cpu-provisioning": "Provisionnement CPU", @@ -67,6 +68,7 @@ "display": "Affichage", "do-you-have-needs": "Vous avez des besoins et/ou des attentes ? Faites le nous savoir", "documentation": "Documentation", + "device": "Appareil", "edit": "Modifier", "edit-config": "Modifier config", "enabled": "Activé", @@ -157,6 +159,7 @@ "password-invalid": "Mot de passe incorrect", "pause": "Pause", "please-confirm": "Veuillez confirmer", + "pifs": "PIFs", "pifs-status": "Statut des PIFs", "pool-cpu-usage": "Utilisation CPU du Pool", "pool-ram-usage": "Utilisation RAM du Pool", 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 6f35646dee5..96c1670dd9d 100644 --- a/@xen-orchestra/lite/src/stores/xen-api/network.store.ts +++ b/@xen-orchestra/lite/src/stores/xen-api/network.store.ts @@ -1,4 +1,4 @@ -import type { XenApiPif } from '@/libs/xen-api/xen-api.types' +import type { XenApiNetwork, XenApiPif } from '@/libs/xen-api/xen-api.types' import { createXapiStoreConfig } from '@/stores/xen-api/create-xapi-store-config' import { useHostStore } from '@/stores/xen-api/host.store' import { usePifStore } from '@/stores/xen-api/pif.store' @@ -79,8 +79,14 @@ export const useNetworkStore = defineStore('xen-api-network', () => { })) }) + const getPIFsInformationByNetwork = (network: XenApiNetwork) => { + const PIFsOpaqueRefNetwork = network.PIFs + return PIFsOpaqueRefNetwork.map(ref => pifContext.records.value.find(pif => pif.$ref === ref)).filter(pif => !!pif) + } + const context = { ...baseContext, + getPIFsInformationByNetwork, networksWithVLANs, hostPrivateNetworks, } diff --git a/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue b/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue index 05d614e123b..3e45134cf71 100644 --- a/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue +++ b/@xen-orchestra/lite/src/views/pool/PoolNetworkView.vue @@ -32,7 +32,7 @@ - + {{ item.name_label }} {{ item.name_description }} @@ -100,8 +100,8 @@ - -