From ee49e4d6ee9907d2074b6a5645111735a75a136f Mon Sep 17 00:00:00 2001 From: Joris-K Date: Mon, 6 Jan 2025 11:01:58 +0100 Subject: [PATCH] improvement of status management --- .../components/host/network/HostPifSidePanel.vue | 13 ++++--------- @xen-orchestra/lite/src/locales/en.json | 3 --- @xen-orchestra/lite/src/locales/fr.json | 3 --- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/@xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue b/@xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue index 8f04b136e9b..f430d5b4602 100644 --- a/@xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue +++ b/@xen-orchestra/lite/src/components/host/network/HostPifSidePanel.vue @@ -255,20 +255,15 @@ const getNetworkData = (type: keyof XenApiNetwork) => { } const getPifStatus = (pif: XenApiPif) => { - const carrier = getPifCarrier(pif) const currentlyAttached = pif.currently_attached - if (currentlyAttached && carrier) { - return 'connected' - } - if (currentlyAttached && !carrier) { - return 'partially-connected' - } - return 'disconnected' + return currentlyAttached ? 'connected' : 'disconnected' } const getPhysicalInterfaceStatus = (pif: XenApiPif) => { - return pif.physical ? 'connected' : 'disconnected-from-physical-device' + const carrier = getPifCarrier(pif) + + return carrier ? 'connected' : 'disconnected-from-physical-device' } const getSpeedData = (speedRef: string) => { diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index 9501a298c9d..a098f39eea0 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -35,7 +35,6 @@ "close": "Close", "community": "Community", "community-name": "{name} community", - "connected": "Connected", "configuration": "Configuration", "confirm-cancel": "Are you sure you want to cancel?", "confirm-delete": "You're about to delete {0}", @@ -63,8 +62,6 @@ "description": "Description", "device": "Device", "dhcp": "DHCP", - "disconnected": "Disconnected", - "disconnected-from-physical-device": "Disconnected from physical device", "disabled": "Disabled", "display": "Display", "dns": "DNS", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index a125a811d97..cab6ca4f7a8 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -36,7 +36,6 @@ "community": "Communauté", "community-name": "Communauté {name}", "configuration": "Configuration", - "connected": "Connecté", "confirm-cancel": "Êtes-vous sûr de vouloir annuler ?", "confirm-delete": "Vous êtes sur le point de supprimer {0}", "console-unavailable": "Console indisponible", @@ -63,8 +62,6 @@ "description": "Description", "device": "Appareil", "dhcp": "DHCP", - "disconnected": "Déconnecté", - "disconnected-from-physical-device": "Déconnecté de l'appareil physique", "dns": "DNS", "disabled": "Désactivé", "display": "Affichage",