From 50f8ff7b94c607a1203fbe66d3920a28619ddbc2 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 01/41] feat(xo-6): implement network view --- @xen-orchestra/web-core/lib/locales/en.json | 11 + @xen-orchestra/web-core/lib/locales/fr.json | 11 + .../web/src/components/host/HostHeader.vue | 6 +- .../web/src/pages/host/[id]/network.vue | 294 ++++++++++++++++++ @xen-orchestra/web/typed-router.d.ts | 1 + 5 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 @xen-orchestra/web/src/pages/host/[id]/network.vue diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index 7d994a6b2d4..457fb7026ec 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -44,15 +44,21 @@ "access-forum": "Access forum", "dashboard": "Dashboard", + "device": "Device", + "edit": "Edit", + "delete": "Delete", "documentation-name": "{name} documentation", "error-no-data": "Error, can't collect data.", "exit-fullscreen": "Exit fullscreen", "fullscreen": "Fullscreen", "gateway": "Gateway", "hosts": "Hosts", + "ip-addresses": "IP Adresses", + "ip-mode": "IP mode", "learn-more": "Learn more", "loading-in-progress": "Loading in progress…", "log-out": "Log out", + "mac-address": "MAC address", "master": "Primary host", "n-vms": "1 VM | {n} VMs", "network": "Network", @@ -62,17 +68,20 @@ "other": "Other", "page-not-found": "This page is not to be found…", "patches": "Patches", + "pifs": "PIFs", "power-on-vm-for-console": "Power on your VM to access its console", "power-on-host-for-console": "Power on your host to access its console", "professional-support": "Professional support", "receive": "Receive", "running-vm": "Running VM | Running VMs", + "scan-pifs": "Scan PIFs", "see-all": "See all", "select-to-see-details": "Select an element to see details", "send": "Send", "send-ctrl-alt-del": "Send Ctrl+Alt+Del", "speed": "Speed", "stats": "Stats", + "status": "Status", "storage": "Storage", "system": "System", @@ -85,7 +94,9 @@ "tasks.quick-view.failed": "Failed", "tasks.quick-view.in-progress": "In progress", + "table-actions": "Table actions", "total": "Total", "total-cpus": "Total CPUs", + "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index 79ef0ef481c..86f2f9ac03b 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -44,15 +44,21 @@ "access-forum": "Accès au forum", "dashboard": "Tableau de bord", + "device": "Appareil", + "edit": "Éditer", + "delete": "Supprimer", "documentation-name": "Documentation {name}", "error-no-data": "Erreur, impossible de collecter les données.", "exit-fullscreen": "Quitter le plein écran", "fullscreen": "Plein écran", "gateway": "Passerelle", "hosts": "Hôtes", + "ip-addresses": "Adresses IP", + "ip-mode": "Mode IP", "learn-more": "En savoir plus", "loading-in-progress": "Chargement en cours…", "log-out": "Se déconnecter", + "mac-address": "Adresse MAC", "master": "Hôte primaire", "n-vms": "1 VM | {n} VMs", "network": "Réseau", @@ -62,20 +68,24 @@ "other": "Autre", "page-not-found": "Cette page est introuvable…", "patches": "Patches", + "pifs": "PIFs", "power-on-vm-for-console": "Allumez votre VM pour accéder à sa console", "power-on-host-for-console": "Allumez votre hôte pour accéder à sa console", "professional-support": "Support professionel", "receive": "Recevoir", "running-vm": "VM en cours d'exécution | VMs en cours d'exécution", + "scan-pifs": "Scanner les PIFs", "see-all": "Voir tout", "select-to-see-details": "Sélectionnez un élement pour voir les details", "send": "Envoyer", "send-ctrl-alt-del": "Envoyer Ctrl+Alt+Suppr", "speed": "Vitesse", "stats": "Stats", + "status": "Statut", "storage": "Stockage", "system": "Système", + "table-actions": "Actions du tableau", "tasks": "Tâches", "tasks.n-subtasks": "{n} sous-tâche | {n} sous-tâches", "tasks.no-tasks": "Aucune tâche", @@ -87,5 +97,6 @@ "total": "Total", "total-cpus": "Total CPUs", + "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web/src/components/host/HostHeader.vue b/@xen-orchestra/web/src/components/host/HostHeader.vue index dc5bb9e4dc3..f4bc3254f3f 100644 --- a/@xen-orchestra/web/src/components/host/HostHeader.vue +++ b/@xen-orchestra/web/src/components/host/HostHeader.vue @@ -15,7 +15,11 @@ {{ $t('alarms') }} {{ $t('stats') }} {{ $t('system') }} - {{ $t('network') }} + + + {{ $t('network') }} + + {{ $t('storage') }} {{ $t('tasks') }} diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue new file mode 100644 index 00000000000..c335a2e6730 --- /dev/null +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -0,0 +1,294 @@ + + + + + +ø] diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index e3a1a98ebf1..0abcb49c534 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -26,6 +26,7 @@ declare module 'vue-router/auto-routes' { '/host/[id]': RouteRecordInfo<'/host/[id]', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/console': RouteRecordInfo<'/host/[id]/console', '/host/:id/console', { id: ParamValue }, { id: ParamValue }>, + '/host/[id]/network': RouteRecordInfo<'/host/[id]/network', '/host/:id/network', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/vms': RouteRecordInfo<'/host/[id]/vms', '/host/:id/vms', { id: ParamValue }, { id: ParamValue }>, '/pool/[id]': RouteRecordInfo<'/pool/[id]', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, '/pool/:id': RouteRecordInfo<'/pool/:id', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, From 0adef1827c083de02ca8cf128ef3c55b9b8e7911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 18 Nov 2024 10:38:17 +0100 Subject: [PATCH 02/41] feat(xo-6): Add css --- .../lite/src/components/ui/UiStatusPanel.vue | 2 +- .../lib/components/ui/button/UiButton.vue | 1 + .../lib/components/ui/input/UiInput.vue | 1 + .../ui/query-search-bar/UiQuerySearchBar.vue | 1 + .../web/src/pages/host/[id]/network.vue | 145 ++++++++++++++++-- 5 files changed, 135 insertions(+), 15 deletions(-) diff --git a/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue b/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue index 6803a570216..3c4162bb1af 100644 --- a/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue +++ b/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue @@ -28,7 +28,7 @@ defineProps<{ } .title { - text-align: center; + //text-align: center; } .subtitle { diff --git a/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue b/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue index 4035fb6f573..fc5a43dbc7a 100644 --- a/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue +++ b/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue @@ -72,6 +72,7 @@ const classNames = computed(() => [ border-width: 0.1rem; outline: none; border-style: solid; + white-space: nowrap; &.lock { cursor: default; diff --git a/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue b/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue index 03b1c8cb5d5..e2addf75657 100644 --- a/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue +++ b/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue @@ -88,6 +88,7 @@ const id = computed(() => uniqueId('input-')) /* IMPLEMENTATION */ .ui-input { position: relative; + width: 100%; .before + .input { padding-inline-start: 4.8rem; diff --git a/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue b/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue index 3dfe9b4bd86..701a64fdc4e 100644 --- a/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +++ b/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue @@ -61,6 +61,7 @@ const value = ref('') align-items: center; .label { + white-space: nowrap; color: var(--color-neutral-txt-secondary); } } diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index c335a2e6730..f53be0c0202 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -35,7 +35,9 @@ {{ $t('ip-addresses') }} {{ $t('mac-address') }} {{ $t('ip-mode') }} - + + + @@ -67,8 +69,8 @@ {{ pif.data.ip }} {{ pif.data.mac }} {{ pif.data.ip_mode }} - - + + @@ -84,7 +86,41 @@ {{ $t('delete') }} - + + {{ card.name }} +
+

{{ key }}

+
+ + + + +
+
+ +
+
+
+

{{ ip }}

+
+ + +
+
+
+
+ {{ tag }} +
+
+

{{ value }}

+ +
+
+
@@ -97,13 +133,16 @@ import ColumnTitle from '@core/components/table/ColumnTitle.vue' import VtsTable from '@core/components/table/VtsTable.vue' import UiActionsTitle from '@core/components/ui/actions-title/UiActionsTitle.vue' import UiButton from '@core/components/ui/button/UiButton.vue' +import UiButtonIcon from '@core/components/ui/button-icon/UiButtonIcon.vue' import UiCard from '@core/components/ui/card/UiCard.vue' +import UiCardTitle from '@core/components/ui/card-title/UiCardTitle.vue' import UiCheckbox from '@core/components/ui/checkbox/UiCheckbox.vue' import UiComplexIcon from '@core/components/ui/complex-icon/UiComplexIcon.vue' import UiObjectLink from '@core/components/ui/object-link/UiObjectLink.vue' import UiPanel from '@core/components/ui/panel/UiPanel.vue' import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearchBar.vue' import UiTableActions from '@core/components/ui/table-actions/UiTableActions.vue' +import UiTag from '@core/components/ui/tag/UiTag.vue' import UiTitle from '@core/components/ui/title/UiTitle.vue' import { defineTree } from '@core/composables/tree/define-tree' import { useTreeFilter } from '@core/composables/tree-filter.composable' @@ -116,6 +155,7 @@ import { faCaretDown, faCheck, faCircle, + faCopy, faEdit, faEllipsis, faExclamation, @@ -226,6 +266,40 @@ const data = [ ip_mode: 'Static', }, ] +const cardsContent = [ + { + name: 'PIF', + content: { + uuid: '71df26a2-678a-49c7-8232-8ebcac4987ab', + network: data[0].name_label, + device: data[0].device, + status: data[0].status, + physicalStatus: data[0].status, + vlan: data[0].vlan, + tags: ['prod', 'QA'], + }, + }, + { + name: 'Network Info', + content: { + ip_addresses: ['fe80::1a2b:3c4d:5f', '255.255.255.0', '255.255.255.0', '255.255.255.0', '255.255.255.0'], + mac_addresses: '00:1A:2B:3C:4D:5E', + netmask: '255.255.255.0', + dns: '8.8.8.8', + gateway: '192.168.1.1', + ip_mode: data[0].ip_mode, + }, + }, + { + name: 'Properties', + content: { + mtu: '1500', + speed: '1000 Mb/s', + network_block_device: 'Off', + default_locking_mode: 'True', + }, + }, +] const { filter, predicate } = useTreeFilter() @@ -249,15 +323,6 @@ const getStatusProps = (status: NetworkStatus) => states[status as NetworkStatus -ø] From 668330b1d0f6da768eb5acaf7fcef081aeff6f6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 18 Nov 2024 16:00:33 +0100 Subject: [PATCH 03/41] feat(xo-6): add behavior --- .../web/src/pages/host/[id]/network.vue | 82 +++++++++++++------ 1 file changed, 59 insertions(+), 23 deletions(-) diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index f53be0c0202..186c53c56a7 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -22,11 +22,17 @@ {{ $t('table-actions') }} + - + {{ $t('network') }} {{ $t('device') }} @@ -41,40 +47,46 @@ - + - + - + - {{ pif.data.name_label }} + {{ pif.name_label }} - {{ pif.data.device }} + {{ pif.device }} -
{{ pif.data.status }}
+
{{ pif.status }}
- {{ pif.data.vlan }} - {{ pif.data.ip }} - {{ pif.data.mac }} - {{ pif.data.ip_mode }} + {{ pif.vlan }} + {{ pif.ip }} + {{ pif.mac }} + {{ pif.ip_mode }}
+ @@ -144,9 +156,10 @@ import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearch import UiTableActions from '@core/components/ui/table-actions/UiTableActions.vue' import UiTag from '@core/components/ui/tag/UiTag.vue' import UiTitle from '@core/components/ui/title/UiTitle.vue' -import { defineTree } from '@core/composables/tree/define-tree' +import UiTopBottomTable from '@core/components/ui/top-bottom-table/UiTopBottomTable.vue' +// import { defineTree } from '@core/composables/tree/define-tree' import { useTreeFilter } from '@core/composables/tree-filter.composable' -import { useTree } from '@core/composables/tree.composable' +// import { useTree } from '@core/composables/tree.composable' import type { IconDefinition } from '@fortawesome/fontawesome-common-types' import { faAlignLeft, @@ -163,6 +176,7 @@ import { faPowerOff, faTrash, } from '@fortawesome/free-solid-svg-icons' +import { computed, ref } from 'vue' const data = [ { @@ -174,6 +188,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: 'e40c1da3-918b-c173-506c-e8c2c069181f', @@ -184,6 +199,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: '989cd0ad-17f8-c198-15c6-8549da1f3b9f', @@ -194,6 +210,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: 'bfbacbd4-8a09-c769-4e7e-59c2a0f77095', @@ -204,6 +221,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: '03a631e2-a39e-7c63-7bb3-ac7a5ef6c47e', @@ -214,6 +232,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'Static', + selected: false, }, { id: 'ea57eb75-c55b-d9c9-6cb4-e0ea235eb16f', @@ -224,6 +243,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: '559b0b63-2173-b6a1-ef65-7155d56401b6', @@ -234,6 +254,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: '99e196e1-33f9-461b-93e3-d70a0eb29b3e', @@ -244,6 +265,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'Static', + selected: false, }, { id: 'cd418934-1f70-22bc-688e-eb6da266aa57', @@ -254,6 +276,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'DHCP', + selected: false, }, { id: '6d9c33fc-ebec-240d-e31b-18152911795d', @@ -264,6 +287,7 @@ const data = [ ip: '127.0.0.1', mac: '00:1A:2B:3C:4D:5E', ip_mode: 'Static', + selected: false, }, ] const cardsContent = [ @@ -301,14 +325,16 @@ const cardsContent = [ }, ] -const { filter, predicate } = useTreeFilter() +const { filter } = useTreeFilter() -const definitions = defineTree(data, { - getLabel: 'name_label', - predicate, -}) +// const definitions = defineTree(data, { +// getLabel: 'name_label', +// predicate, +// }) -const { nodes: pifs } = useTree(definitions, { expand: false }) +const totalItems = ref(data) + +// const { nodes: pifs } = useTree(definitions, { expand: false }) type NetworkStatus = 'connected' | 'disconnected' | 'other' type NetworkAccent = 'success' | 'warning' | 'danger' @@ -320,6 +346,16 @@ const states: Record states[status as NetworkStatus] +const selectedItems = computed(() => totalItems.value.filter(item => item.selected).length) + +const toggleSelect = (isSelected: boolean) => { + totalItems.value.forEach(item => { + item.selected = isSelected + }) +} +const test = () => { + return false +} diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index 0abcb49c534..5a2823bcec9 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -27,6 +27,7 @@ declare module 'vue-router/auto-routes' { '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/console': RouteRecordInfo<'/host/[id]/console', '/host/:id/console', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/network': RouteRecordInfo<'/host/[id]/network', '/host/:id/network', { id: ParamValue }, { id: ParamValue }>, + '/host/[id]/pifStatus': RouteRecordInfo<'/host/[id]/pifStatus', '/host/:id/pifStatus', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/vms': RouteRecordInfo<'/host/[id]/vms', '/host/:id/vms', { id: ParamValue }, { id: ParamValue }>, '/pool/[id]': RouteRecordInfo<'/pool/[id]', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, '/pool/:id': RouteRecordInfo<'/pool/:id', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, From 4a21fca79142152676011c7710c2b42c29206b06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Fri, 22 Nov 2024 15:39:42 +0100 Subject: [PATCH 10/41] feat(xo6): refactor store --- .../pif/PifStatus.vue} | 16 +++---- .../web/src/pages/host/[id]/network.vue | 44 +++++++------------ @xen-orchestra/web/typed-router.d.ts | 1 - 3 files changed, 25 insertions(+), 36 deletions(-) rename @xen-orchestra/web/src/{pages/host/[id]/pifStatus.vue => components/pif/PifStatus.vue} (82%) diff --git a/@xen-orchestra/web/src/pages/host/[id]/pifStatus.vue b/@xen-orchestra/web/src/components/pif/PifStatus.vue similarity index 82% rename from @xen-orchestra/web/src/pages/host/[id]/pifStatus.vue rename to @xen-orchestra/web/src/components/pif/PifStatus.vue index 7cf213f16ba..3744a95f2a5 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/pifStatus.vue +++ b/@xen-orchestra/web/src/components/pif/PifStatus.vue @@ -2,12 +2,12 @@

- {{ getStatusProps(status(pif)).text }} + {{ getStatusProps(status).text }}

@@ -20,7 +20,7 @@ import { faCheck, faCircle, faExclamation } from '@fortawesome/free-solid-svg-ic import { computed } from 'vue' import { useI18n } from 'vue-i18n' -defineProps<{ +const props = defineProps<{ icon?: IconDefinition pif: XoPif card?: boolean @@ -37,15 +37,15 @@ const states = computed { - if (pif.attached && pif.carrier) { +const status = computed(() => { + if (props.pif.attached && props.pif.carrier) { return 'connected' } - if (pif.attached && !pif.carrier) { + if (props.pif.attached && !props.pif.carrier) { return 'partial' } return 'disconnected' -} +}) const getStatusProps = (status: NetworkStatus) => states.value[status as NetworkStatus] diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index 64be5eebedb..95f9ca8824e 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -22,17 +22,11 @@ {{ $t('table-actions') }} - - + {{ $t('network') }} {{ $t('device') }} @@ -49,7 +43,7 @@ - + @@ -59,7 +53,7 @@ - {{ pif.networkLabel }} + {{ getNetworkInformation(pif, 'name_label') }} {{ pif.device }} @@ -76,12 +70,6 @@ - @@ -101,7 +89,7 @@

{{ $t('network') }}

-

{{ pifs[0].networkLabel }}

+

{{ getNetworkInformation(pifs[0], 'name_label') }}

{{ $t('device') }}

@@ -122,7 +110,9 @@

{{ $t('tags') }}

- {{ tag }} + + {{ tag }} +
@@ -165,11 +155,11 @@

{{ $t('network-block-device') }}

-

{{ pifs[0].nbd }}

+

{{ getNetworkInformation(pifs[0], 'nbd') }}

{{ $t('default-locking-mode') }}

-

{{ pifs[0].defaultLockingMode }}

+

{{ getNetworkInformation(pifs[0], 'defaultIsLocked') }}

@@ -177,8 +167,11 @@ diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index 5a2823bcec9..0abcb49c534 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -27,7 +27,6 @@ declare module 'vue-router/auto-routes' { '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/console': RouteRecordInfo<'/host/[id]/console', '/host/:id/console', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/network': RouteRecordInfo<'/host/[id]/network', '/host/:id/network', { id: ParamValue }, { id: ParamValue }>, - '/host/[id]/pifStatus': RouteRecordInfo<'/host/[id]/pifStatus', '/host/:id/pifStatus', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/vms': RouteRecordInfo<'/host/[id]/vms', '/host/:id/vms', { id: ParamValue }, { id: ParamValue }>, '/pool/[id]': RouteRecordInfo<'/pool/[id]', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, '/pool/:id': RouteRecordInfo<'/pool/:id', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, From 2fbb52ad9107c1ea3c34658c7154e9fabbd2cccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 25 Nov 2024 09:02:01 +0100 Subject: [PATCH 11/41] feat(xo6): refactor store --- .../web/src/components/pif/PifPanel.vue | 159 +++++++++++++++++ .../web/src/pages/host/[id]/network.vue | 166 +----------------- 2 files changed, 165 insertions(+), 160 deletions(-) create mode 100644 @xen-orchestra/web/src/components/pif/PifPanel.vue diff --git a/@xen-orchestra/web/src/components/pif/PifPanel.vue b/@xen-orchestra/web/src/components/pif/PifPanel.vue new file mode 100644 index 00000000000..32b13cef156 --- /dev/null +++ b/@xen-orchestra/web/src/components/pif/PifPanel.vue @@ -0,0 +1,159 @@ + + + + + diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index 95f9ca8824e..f2fef2dc58b 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -53,7 +53,7 @@ - {{ getNetworkInformation(pif, 'name_label') }} + {{ getNetworkName(pif) }}
{{ pif.device }} @@ -72,101 +72,12 @@ - - - - {{ $t('pif') }} -
-

{{ $t('uuid') }}

-

{{ pifs[0].id }}

-
-
-

{{ $t('network') }}

-

{{ getNetworkInformation(pifs[0], 'name_label') }}

-
-
-

{{ $t('device') }}

-

{{ pifs[0].device }}

-
-
-

{{ $t('pif-status') }}

- -
-
-

{{ $t('physical-interface-status') }}

- -
-
-

{{ $t('vlan') }}

-

{{ pifs[0].vlan }}

-
-
-

{{ $t('tags') }}

-
- - {{ tag }} - -
-
-
- - {{ $t('network-information') }} -
-

{{ $t('ip-addresses') }}

-

{{ ip }}

-
-
-

{{ $t('mac-addresses') }}

-

{{ pifs[0].mac }}

-
-
-

{{ $t('netmask') }}

-

{{ pifs[0].netmask }}

-
-
-

{{ $t('dns') }}

-

{{ pifs[0].dns }}

-
-
-

{{ $t('gateway') }}

-

{{ pifs[0].gateway }}

-
-
-

{{ $t('ip-mode') }}

-

{{ pifs[0].mode }}

-
-
- - {{ $t('properties') }} -
-

{{ $t('mtu') }}

-

{{ pifs[0].mtu }}

-
-
-

{{ $t('speed') }}

-

{{ pifs[0].speed }} {{ $t('mbs') }}

-
-
-

{{ $t('network-block-device') }}

-

{{ getNetworkInformation(pifs[0], 'nbd') }}

-
-
-

{{ $t('default-locking-mode') }}

-

{{ getNetworkInformation(pifs[0], 'defaultIsLocked') }}

-
-
-
+ @@ -235,15 +143,6 @@ const getNetworkInformation = (pif: XoPif, type: keyof XoNetwork) => { .table-container { margin-top: 2.4rem; - - .selection { - margin: 0.8rem 0; - } - } - - .network-panel { - min-width: 400px; - border-top: none; } .pif-status { @@ -251,58 +150,5 @@ const getNetworkInformation = (pif: XoPif, type: keyof XoNetwork) => { overflow: hidden; text-overflow: ellipsis; } - - .card { - gap: 0.8rem; - } - - .card-content { - width: 100%; - display: flex; - gap: 1.8rem; - } - - .title { - min-width: 12rem; - overflow-wrap: break-word; - } - - .description { - display: flex; - justify-content: space-between; - width: 100%; - overflow: hidden; - gap: 0.8rem; - - & > p { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - flex: 1; - } - - &.ip { - display: unset; - } - } - - .action-buttons { - display: flex; - gap: 0.8rem; - align-items: center; - } - - .ip-address { - width: 100%; - display: flex; - justify-content: space-between; - align-items: center; - } - - .tags { - width: 100%; - display: flex; - gap: 0.8rem; - } } From 5866b97b1a6280ff518fc22d824f8c5fbe3ed2ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Wed, 27 Nov 2024 09:37:08 +0100 Subject: [PATCH 12/41] feat(xo-6): remove code not relevant of store --- .../lite/src/components/ui/UiStatusPanel.vue | 2 +- @xen-orchestra/lite/src/locales/de.json | 5 + @xen-orchestra/lite/src/locales/en.json | 5 + @xen-orchestra/lite/src/locales/fa.json | 5 + @xen-orchestra/lite/src/locales/fr.json | 5 + .../lib/components/ui/button/UiButton.vue | 1 - .../lib/components/ui/input/UiInput.vue | 1 - .../ui/query-search-bar/UiQuerySearchBar.vue | 1 - @xen-orchestra/web-core/lib/locales/de.json | 4 - @xen-orchestra/web-core/lib/locales/en.json | 28 --- @xen-orchestra/web-core/lib/locales/fa.json | 4 - @xen-orchestra/web-core/lib/locales/fr.json | 27 --- .../web/src/components/host/HostHeader.vue | 6 +- .../web/src/components/pif/PifPanel.vue | 159 ------------------ .../web/src/components/pif/PifStatus.vue | 59 ------- .../web/src/pages/host/[id]/network.vue | 154 ----------------- @xen-orchestra/web/typed-router.d.ts | 1 - 17 files changed, 22 insertions(+), 445 deletions(-) delete mode 100644 @xen-orchestra/web/src/components/pif/PifPanel.vue delete mode 100644 @xen-orchestra/web/src/components/pif/PifStatus.vue delete mode 100644 @xen-orchestra/web/src/pages/host/[id]/network.vue diff --git a/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue b/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue index 3c4162bb1af..6803a570216 100644 --- a/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue +++ b/@xen-orchestra/lite/src/components/ui/UiStatusPanel.vue @@ -28,7 +28,7 @@ defineProps<{ } .title { - //text-align: center; + text-align: center; } .subtitle { diff --git a/@xen-orchestra/lite/src/locales/de.json b/@xen-orchestra/lite/src/locales/de.json index 8cca662843b..53ccc961f94 100644 --- a/@xen-orchestra/lite/src/locales/de.json +++ b/@xen-orchestra/lite/src/locales/de.json @@ -42,6 +42,7 @@ "cpu-provisioning": "Zugewiesene Prozessoren", "cpu-provisioning-warning": "Die Anzahl der zugewiesenen vCPUs überschreitet die physikalisch vorhandenen CPUs. Die Systemperformance kann darunter leiden.", "cpu-usage": "Prozessorauslastung", + "delete": "Löschen", "delete-vms": "1 VM löschen| {n} VMs löschen", "deploy": "Installieren", "deploy-xoa": "XOA installieren", @@ -59,6 +60,7 @@ "dhcp": "DHCP", "disabled": "deaktiviert", "display": "Display", + "dns": "DNS", "do-you-have-needs": "Vermisst du Funktionen oder hast Vorschläge? Sag uns Bescheid: ", "documentation": "Dokumentation", "edit-config": "Einstellungen anpassen", @@ -92,6 +94,7 @@ "force-reboot": "Neustart erzwingen", "force-shutdown": "Herunterfahren erzwingen", "fullscreen-leave": "Vollbild schließen", + "gateway": "Gateway", "n-gb-left": "{n} GB frei", "n-gb-required": "{n} GB benötigt", "go-back": "Zurück", @@ -116,6 +119,7 @@ "n-hosts-awaiting-patch": "Der Host {n} benötigt dieses Patch | Die Hosts {n} benötigen dieses Patch", "n-missing": "{n} verbleibend", "name": "Name", + "netmask": "Netzmaske", "network-download": "Download", "network-throughput": "Netzwerkdurchsatz", "network-upload": "Upload", @@ -177,6 +181,7 @@ "start": "Starten", "start-on-host": "Auf bestimmtem Host starten", "static-ip": "Statische IP", + "status": "Status", "storage-usage": "Belegung Storage", "support": "Support", "suspend": "Standby", diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index 9a62de8619a..60ae6796fdc 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -43,6 +43,7 @@ "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", @@ -61,6 +62,7 @@ "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", @@ -94,6 +96,7 @@ "force-reboot": "Force reboot", "force-shutdown": "Force shutdown", "fullscreen-leave": "Leave fullscreen", + "gateway": "Gateway", "n-gb-left": "{n} GB left", "n-gb-required": "{n} GB required", "go-back": "Go back", @@ -177,6 +180,7 @@ "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", "network-upload": "Upload", @@ -238,6 +242,7 @@ "start": "Start", "start-on-host": "Start on specific host", "static-ip": "Static IP", + "status": "Status", "storage-usage": "Storage usage", "support": "Support", "suspend": "Suspend", diff --git a/@xen-orchestra/lite/src/locales/fa.json b/@xen-orchestra/lite/src/locales/fa.json index b4aa42da285..23b83c792e6 100644 --- a/@xen-orchestra/lite/src/locales/fa.json +++ b/@xen-orchestra/lite/src/locales/fa.json @@ -43,6 +43,7 @@ "cpu-provisioning": "تامین CPU", "cpu-provisioning-warning": "تعداد CPU های مجازی اختصاص داده شده بیش از تعداد CPUهای فیزیکی موجود است. عملکرد سیستم ممکن است تحت تأثیر قرار بگیرد", "cpu-usage": "استفاده از CPU", + "delete": "حذف کردن", "delete-vms": "حذف کردن 1 ماشین مجازی | حذف کردن {n} ماشین مجازی", "deploy": "مستقر کردن", "deploy-xoa": "مستقر کردن XOA", @@ -60,6 +61,7 @@ "dhcp": "DHCP", "disabled": "غیر فعال", "display": "نمایش", + "dns": "DNS", "do-you-have-needs": "نیازها و/یا انتظاراتی دارید؟ به ما اطلاع دهید", "documentation": "مستندات", "edit-config": "ویرایش پیکربندی", @@ -93,6 +95,7 @@ "force-reboot": "راه اندازی مجدد اجباری", "force-shutdown": "خاموش کردن اجباری", "fullscreen-leave": "خروج از حالت تمام صفحه", + "gateway": "دروازه", "n-gb-left": "{n} GB باقی مانده است", "n-gb-required": "{n} GB مورد نیاز است", "go-back": "برگشت به عقب", @@ -115,6 +118,7 @@ "n-missing": "{n} وجود ندارد", "n-vms": "1 ماشین مجازی | {n} ماشین مجازی", "name": "نام", + "netmask": "Netmask", "network-download": "دانلود", "network-throughput": "توان عملیاتی شبکه", "network-upload": "بارگذاری", @@ -177,6 +181,7 @@ "start": "شروع", "start-on-host": "روی هاست خاصی شروع کنید", "static-ip": "IP ثابت", + "status": "وضعیت", "storage-usage": "استفاده از فضای ذخیره سازی", "support": "پشتیبانی", "suspend": "تعلیق", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index 012f13d4c35..7681502bc7c 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -43,6 +43,7 @@ "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", @@ -59,6 +60,7 @@ "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", @@ -94,6 +96,7 @@ "force-reboot": "Forcer le redémarrage", "force-shutdown": "Forcer l'arrêt", "fullscreen-leave": "Quitter plein écran", + "gateway": "Passerelle", "n-gb-left": "{n} Go libres", "n-gb-required": "{n} Go requis", "go-back": "Revenir en arrière", @@ -177,6 +180,7 @@ "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", "network-upload": "Montant", @@ -238,6 +242,7 @@ "start": "Démarrer", "start-on-host": "Démarrer sur un hôte spécifique", "static-ip": "IP statique", + "status": "Statut", "storage-usage": "Utilisation du stockage", "support": "Support", "suspend": "Suspendre", diff --git a/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue b/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue index fc5a43dbc7a..4035fb6f573 100644 --- a/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue +++ b/@xen-orchestra/web-core/lib/components/ui/button/UiButton.vue @@ -72,7 +72,6 @@ const classNames = computed(() => [ border-width: 0.1rem; outline: none; border-style: solid; - white-space: nowrap; &.lock { cursor: default; diff --git a/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue b/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue index e2addf75657..03b1c8cb5d5 100644 --- a/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue +++ b/@xen-orchestra/web-core/lib/components/ui/input/UiInput.vue @@ -88,7 +88,6 @@ const id = computed(() => uniqueId('input-')) /* IMPLEMENTATION */ .ui-input { position: relative; - width: 100%; .before + .input { padding-inline-start: 4.8rem; diff --git a/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue b/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue index 701a64fdc4e..3dfe9b4bd86 100644 --- a/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +++ b/@xen-orchestra/web-core/lib/components/ui/query-search-bar/UiQuerySearchBar.vue @@ -61,7 +61,6 @@ const value = ref('') align-items: center; .label { - white-space: nowrap; color: var(--color-neutral-txt-secondary); } } diff --git a/@xen-orchestra/web-core/lib/locales/de.json b/@xen-orchestra/web-core/lib/locales/de.json index bd053ebe5fa..5eae961a611 100644 --- a/@xen-orchestra/web-core/lib/locales/de.json +++ b/@xen-orchestra/web-core/lib/locales/de.json @@ -18,8 +18,6 @@ "dark-mode.auto": "Automatischer Dunkelmodus", "dashboard": "Dashboard", - "delete": "Löschen", - "dns": "DNS", "documentation-name": "{name} Dokumentation", "error-no-data": "Fehler beim Datenabruf.", "fullscreen": "Vollbild", @@ -30,7 +28,6 @@ "log-out": "Abmelden", "master": "Primärer Host", "n-vms": "1 VM | {n} VMs", - "netmask": "Netzmaske", "network": "Netzwerk", "object-not-found": "Objekt {id} wurde nicht gefunden…", "open-console-in-new-tab": "Konsole in neuem Reiter öffnen", @@ -41,7 +38,6 @@ "running-vm": "VM eingeschalten | VMs eingeschalten", "send-ctrl-alt-del": "Ctrl+Alt+Del senden", "stats": "Statistiken", - "status": "Status", "storage": "Speicher", "system": "System", diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index 789c8323d4e..7d994a6b2d4 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -6,7 +6,6 @@ "bytes.gi": "GiB", "coming-soon": "Coming soon!", - "connected": "Connected", "console": "Console", "console-actions": "Console actions", "console-clipboard": "Console clipboard", @@ -45,63 +44,38 @@ "access-forum": "Access forum", "dashboard": "Dashboard", - "delete": "Delete", - "device": "Device", - "disconnected": "Disconnected", - "disconnected-from-physical-device": "Disconnected from physical device", - "dns": "DNS", - "edit": "Edit", - "default-locking-mode": "Default locking mode", "documentation-name": "{name} documentation", "error-no-data": "Error, can't collect data.", "exit-fullscreen": "Exit fullscreen", "fullscreen": "Fullscreen", "gateway": "Gateway", "hosts": "Hosts", - "ip-addresses": "IP Addresses", - "ip-mode": "IP mode", "learn-more": "Learn more", "loading-in-progress": "Loading in progress…", "log-out": "Log out", - "mac-address": "MAC address", - "mac-addresses": "MAC addresses", "master": "Primary host", - "mbs": "Mb/s", - "mtu": "MTU", "n-vms": "1 VM | {n} VMs", - "netmask": "Netmask", "network": "Network", - "network-block-device": "Network block device", - "network-information": "Network Information", "no-data": "No data", "object-not-found": "Object {id} can't be found…", "open-console-in-new-tab": "Open console in new tab", "other": "Other", "page-not-found": "This page is not to be found…", "patches": "Patches", - "physical-interface-status": "Physical interface status", - "pif": "PIF", - "pifs": "PIFs", - "pif-status": "Pif status", - "properties": "Properties", "power-on-vm-for-console": "Power on your VM to access its console", "power-on-host-for-console": "Power on your host to access its console", "professional-support": "Professional support", "receive": "Receive", "running-vm": "Running VM | Running VMs", - "scan-pifs": "Scan PIFs", "see-all": "See all", "select-to-see-details": "Select an element to see details", "send": "Send", "send-ctrl-alt-del": "Send Ctrl+Alt+Del", "speed": "Speed", "stats": "Stats", - "status": "Status", "storage": "Storage", "system": "System", - "table-actions": "Table actions", - "tags": "Tags", "tasks": "Tasks", "tasks.n-subtasks": "{n} subtask | {n} subtasks", "tasks.no-tasks": "No tasks", @@ -113,7 +87,5 @@ "total": "Total", "total-cpus": "Total CPUs", - "uuid": "Uuid", - "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web-core/lib/locales/fa.json b/@xen-orchestra/web-core/lib/locales/fa.json index 0b7ffd84172..aaf2050bbfe 100644 --- a/@xen-orchestra/web-core/lib/locales/fa.json +++ b/@xen-orchestra/web-core/lib/locales/fa.json @@ -32,8 +32,6 @@ "dark-mode.auto": "حالت خودکار تاریک", "dashboard": "داشبورد", - "delete": "حذف کردن", - "dns": "DNS", "documentation-name": "اسناد {name}", "error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.", "fullscreen": "تمام صفحه", @@ -42,7 +40,6 @@ "loading-in-progress": "بارگیری در حال انجام است…", "log-out": "خروج", "master": "میزبان اصلی", - "netmask": "Netmask", "network": "شبکه", "open-console-in-new-tab": "باز کردن کنسول در برگه جدید", "page-not-found": "این صفحه پیدا نمی شود…", @@ -52,7 +49,6 @@ "running-vm": "ماشین های مجازی در حال اجرا | ماشین مجازی در حال اجرا", "send-ctrl-alt-del": "ارسال کلیدهای Ctrl+Alt+Del", "stats": "آمار", - "status": "وضعیت", "storage": "ذخیره سازی", "system": "سیستم", "tasks": "کارها" diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index ec17f74317f..a1498c17396 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -45,63 +45,38 @@ "access-forum": "Accès au forum", "dashboard": "Tableau de bord", - "device": "Appareil", - "default-locking-mode": "Mode de verrouillage par defaut", - "delete": "Supprimer", - "disconnected": "Déconnecté", - "disconnected-from-physical-device": "Déconnecté d'un appareil physique", - "dns": "DNS", - "edit": "Éditer", "documentation-name": "Documentation {name}", "error-no-data": "Erreur, impossible de collecter les données.", "exit-fullscreen": "Quitter le plein écran", "fullscreen": "Plein écran", "gateway": "Passerelle", "hosts": "Hôtes", - "ip-addresses": "Adresses IP", - "ip-mode": "Mode IP", "learn-more": "En savoir plus", "loading-in-progress": "Chargement en cours…", "log-out": "Se déconnecter", - "mac-address": "Adresse MAC", - "mac-addresses": "Adresses MAC", "master": "Hôte primaire", - "mbs": "Mb/s", - "mtu": "MTU", "n-vms": "1 VM | {n} VMs", - "netmask": "Masque réseau", "network": "Réseau", - "network-block-device": "Appareil de blocage réseau", - "network-information": "Information du réseau", "no-data": "Aucune donnée", "object-not-found": "L'objet {id} est introuvable…", "open-console-in-new-tab": "Ouvrir la console dans un nouvel onglet", "other": "Autre", "page-not-found": "Cette page est introuvable…", "patches": "Patches", - "physical-interface-status": "Status de l'interface physique", - "pif": "PIF", - "pifs": "PIFs", - "pif-status": "Status pif", - "properties": "Propriétés", "power-on-vm-for-console": "Allumez votre VM pour accéder à sa console", "power-on-host-for-console": "Allumez votre hôte pour accéder à sa console", "professional-support": "Support professionel", "receive": "Recevoir", "running-vm": "VM en cours d'exécution | VMs en cours d'exécution", - "scan-pifs": "Scanner les PIFs", "see-all": "Voir tout", "select-to-see-details": "Sélectionnez un élement pour voir les details", "send": "Envoyer", "send-ctrl-alt-del": "Envoyer Ctrl+Alt+Suppr", "speed": "Vitesse", "stats": "Stats", - "status": "Statut", "storage": "Stockage", "system": "Système", - "table-actions": "Actions du tableau", - "tags": "Etiquettes", "tasks": "Tâches", "tasks.n-subtasks": "{n} sous-tâche | {n} sous-tâches", "tasks.no-tasks": "Aucune tâche", @@ -113,7 +88,5 @@ "total": "Total", "total-cpus": "Total CPUs", - "uuid": "Uuid", - "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web/src/components/host/HostHeader.vue b/@xen-orchestra/web/src/components/host/HostHeader.vue index f4bc3254f3f..dc5bb9e4dc3 100644 --- a/@xen-orchestra/web/src/components/host/HostHeader.vue +++ b/@xen-orchestra/web/src/components/host/HostHeader.vue @@ -15,11 +15,7 @@ {{ $t('alarms') }} {{ $t('stats') }} {{ $t('system') }} - - - {{ $t('network') }} - - + {{ $t('network') }} {{ $t('storage') }} {{ $t('tasks') }} diff --git a/@xen-orchestra/web/src/components/pif/PifPanel.vue b/@xen-orchestra/web/src/components/pif/PifPanel.vue deleted file mode 100644 index 32b13cef156..00000000000 --- a/@xen-orchestra/web/src/components/pif/PifPanel.vue +++ /dev/null @@ -1,159 +0,0 @@ - - - - - diff --git a/@xen-orchestra/web/src/components/pif/PifStatus.vue b/@xen-orchestra/web/src/components/pif/PifStatus.vue deleted file mode 100644 index 3744a95f2a5..00000000000 --- a/@xen-orchestra/web/src/components/pif/PifStatus.vue +++ /dev/null @@ -1,59 +0,0 @@ - - - - - diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue deleted file mode 100644 index f2fef2dc58b..00000000000 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ /dev/null @@ -1,154 +0,0 @@ - - - - - diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index 0abcb49c534..e3a1a98ebf1 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -26,7 +26,6 @@ declare module 'vue-router/auto-routes' { '/host/[id]': RouteRecordInfo<'/host/[id]', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/console': RouteRecordInfo<'/host/[id]/console', '/host/:id/console', { id: ParamValue }, { id: ParamValue }>, - '/host/[id]/network': RouteRecordInfo<'/host/[id]/network', '/host/:id/network', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/vms': RouteRecordInfo<'/host/[id]/vms', '/host/:id/vms', { id: ParamValue }, { id: ParamValue }>, '/pool/[id]': RouteRecordInfo<'/pool/[id]', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, '/pool/:id': RouteRecordInfo<'/pool/:id', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, From c3f4f8b9633f4a1f40f78551d426f8acc859f55f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Wed, 27 Nov 2024 09:38:33 +0100 Subject: [PATCH 13/41] feat(xo-6): remove code not relevant of store --- @xen-orchestra/web-core/lib/locales/fr.json | 1 - @xen-orchestra/web/src/stores/xo-rest-api/host.store.ts | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index a1498c17396..79ef0ef481c 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -6,7 +6,6 @@ "bytes.gi": "Gio", "coming-soon": "Bientôt disponible !", - "connected": "Connecté", "console": "Console", "console-actions": "Actions de la console", "console-clipboard": "Presse-papiers de la console", diff --git a/@xen-orchestra/web/src/stores/xo-rest-api/host.store.ts b/@xen-orchestra/web/src/stores/xo-rest-api/host.store.ts index ce4b5bb7782..05e0f820361 100644 --- a/@xen-orchestra/web/src/stores/xo-rest-api/host.store.ts +++ b/@xen-orchestra/web/src/stores/xo-rest-api/host.store.ts @@ -32,6 +32,7 @@ export const useHostStore = defineStore('host', () => { hostsByPoolMap.get(poolId)!.push(host) }) + return hostsByPoolMap }) From 9c90a3bdf19340898a4bc120dba44ca7fe4d38df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Fri, 29 Nov 2024 09:57:17 +0100 Subject: [PATCH 14/41] feat(xo-6): remove locale --- @xen-orchestra/lite/src/locales/en.json | 1 - @xen-orchestra/lite/src/locales/fa.json | 1 - @xen-orchestra/lite/src/locales/fr.json | 1 - @xen-orchestra/web-core/lib/locales/fa.json | 1 - 4 files changed, 4 deletions(-) diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index 60ae6796fdc..a9217ed7ae1 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -96,7 +96,6 @@ "force-reboot": "Force reboot", "force-shutdown": "Force shutdown", "fullscreen-leave": "Leave fullscreen", - "gateway": "Gateway", "n-gb-left": "{n} GB left", "n-gb-required": "{n} GB required", "go-back": "Go back", diff --git a/@xen-orchestra/lite/src/locales/fa.json b/@xen-orchestra/lite/src/locales/fa.json index 23b83c792e6..f057084aa93 100644 --- a/@xen-orchestra/lite/src/locales/fa.json +++ b/@xen-orchestra/lite/src/locales/fa.json @@ -95,7 +95,6 @@ "force-reboot": "راه اندازی مجدد اجباری", "force-shutdown": "خاموش کردن اجباری", "fullscreen-leave": "خروج از حالت تمام صفحه", - "gateway": "دروازه", "n-gb-left": "{n} GB باقی مانده است", "n-gb-required": "{n} GB مورد نیاز است", "go-back": "برگشت به عقب", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index 7681502bc7c..d9f86ea546e 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -96,7 +96,6 @@ "force-reboot": "Forcer le redémarrage", "force-shutdown": "Forcer l'arrêt", "fullscreen-leave": "Quitter plein écran", - "gateway": "Passerelle", "n-gb-left": "{n} Go libres", "n-gb-required": "{n} Go requis", "go-back": "Revenir en arrière", diff --git a/@xen-orchestra/web-core/lib/locales/fa.json b/@xen-orchestra/web-core/lib/locales/fa.json index aaf2050bbfe..6b6cbe4e56c 100644 --- a/@xen-orchestra/web-core/lib/locales/fa.json +++ b/@xen-orchestra/web-core/lib/locales/fa.json @@ -35,7 +35,6 @@ "documentation-name": "اسناد {name}", "error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.", "fullscreen": "تمام صفحه", - "gateway": "دروازه", "learn-more": "بیشتر بدانید", "loading-in-progress": "بارگیری در حال انجام است…", "log-out": "خروج", From 951f828e50624a30022bc31fbeec4c5ff8e0360b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Fri, 29 Nov 2024 09:57:55 +0100 Subject: [PATCH 15/41] feat(xo-6): add locale --- @xen-orchestra/web-core/lib/locales/fa.json | 1 + 1 file changed, 1 insertion(+) diff --git a/@xen-orchestra/web-core/lib/locales/fa.json b/@xen-orchestra/web-core/lib/locales/fa.json index 6b6cbe4e56c..aaf2050bbfe 100644 --- a/@xen-orchestra/web-core/lib/locales/fa.json +++ b/@xen-orchestra/web-core/lib/locales/fa.json @@ -35,6 +35,7 @@ "documentation-name": "اسناد {name}", "error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.", "fullscreen": "تمام صفحه", + "gateway": "دروازه", "learn-more": "بیشتر بدانید", "loading-in-progress": "بارگیری در حال انجام است…", "log-out": "خروج", From f83b8ace41a01057fa83699bb8436dd116535511 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Wed, 4 Dec 2024 15:56:40 +0100 Subject: [PATCH 16/41] feat(xo-6): feedback --- @xen-orchestra/lite/src/locales/de.json | 1 - 1 file changed, 1 deletion(-) diff --git a/@xen-orchestra/lite/src/locales/de.json b/@xen-orchestra/lite/src/locales/de.json index 53ccc961f94..e5d13c7e705 100644 --- a/@xen-orchestra/lite/src/locales/de.json +++ b/@xen-orchestra/lite/src/locales/de.json @@ -94,7 +94,6 @@ "force-reboot": "Neustart erzwingen", "force-shutdown": "Herunterfahren erzwingen", "fullscreen-leave": "Vollbild schließen", - "gateway": "Gateway", "n-gb-left": "{n} GB frei", "n-gb-required": "{n} GB benötigt", "go-back": "Zurück", From 65ce2964a043931bf9ff3f9aa1a1f262e3bf6926 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 17/41] feat(xo-6): implement network view --- @xen-orchestra/web-core/lib/locales/en.json | 11 + @xen-orchestra/web-core/lib/locales/fr.json | 11 + .../web/src/components/host/HostHeader.vue | 6 +- .../web/src/pages/host/[id]/network.vue | 294 ++++++++++++++++++ @xen-orchestra/web/typed-router.d.ts | 1 + 5 files changed, 322 insertions(+), 1 deletion(-) create mode 100644 @xen-orchestra/web/src/pages/host/[id]/network.vue diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index 7d994a6b2d4..457fb7026ec 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -44,15 +44,21 @@ "access-forum": "Access forum", "dashboard": "Dashboard", + "device": "Device", + "edit": "Edit", + "delete": "Delete", "documentation-name": "{name} documentation", "error-no-data": "Error, can't collect data.", "exit-fullscreen": "Exit fullscreen", "fullscreen": "Fullscreen", "gateway": "Gateway", "hosts": "Hosts", + "ip-addresses": "IP Adresses", + "ip-mode": "IP mode", "learn-more": "Learn more", "loading-in-progress": "Loading in progress…", "log-out": "Log out", + "mac-address": "MAC address", "master": "Primary host", "n-vms": "1 VM | {n} VMs", "network": "Network", @@ -62,17 +68,20 @@ "other": "Other", "page-not-found": "This page is not to be found…", "patches": "Patches", + "pifs": "PIFs", "power-on-vm-for-console": "Power on your VM to access its console", "power-on-host-for-console": "Power on your host to access its console", "professional-support": "Professional support", "receive": "Receive", "running-vm": "Running VM | Running VMs", + "scan-pifs": "Scan PIFs", "see-all": "See all", "select-to-see-details": "Select an element to see details", "send": "Send", "send-ctrl-alt-del": "Send Ctrl+Alt+Del", "speed": "Speed", "stats": "Stats", + "status": "Status", "storage": "Storage", "system": "System", @@ -85,7 +94,9 @@ "tasks.quick-view.failed": "Failed", "tasks.quick-view.in-progress": "In progress", + "table-actions": "Table actions", "total": "Total", "total-cpus": "Total CPUs", + "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index 79ef0ef481c..86f2f9ac03b 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -44,15 +44,21 @@ "access-forum": "Accès au forum", "dashboard": "Tableau de bord", + "device": "Appareil", + "edit": "Éditer", + "delete": "Supprimer", "documentation-name": "Documentation {name}", "error-no-data": "Erreur, impossible de collecter les données.", "exit-fullscreen": "Quitter le plein écran", "fullscreen": "Plein écran", "gateway": "Passerelle", "hosts": "Hôtes", + "ip-addresses": "Adresses IP", + "ip-mode": "Mode IP", "learn-more": "En savoir plus", "loading-in-progress": "Chargement en cours…", "log-out": "Se déconnecter", + "mac-address": "Adresse MAC", "master": "Hôte primaire", "n-vms": "1 VM | {n} VMs", "network": "Réseau", @@ -62,20 +68,24 @@ "other": "Autre", "page-not-found": "Cette page est introuvable…", "patches": "Patches", + "pifs": "PIFs", "power-on-vm-for-console": "Allumez votre VM pour accéder à sa console", "power-on-host-for-console": "Allumez votre hôte pour accéder à sa console", "professional-support": "Support professionel", "receive": "Recevoir", "running-vm": "VM en cours d'exécution | VMs en cours d'exécution", + "scan-pifs": "Scanner les PIFs", "see-all": "Voir tout", "select-to-see-details": "Sélectionnez un élement pour voir les details", "send": "Envoyer", "send-ctrl-alt-del": "Envoyer Ctrl+Alt+Suppr", "speed": "Vitesse", "stats": "Stats", + "status": "Statut", "storage": "Stockage", "system": "Système", + "table-actions": "Actions du tableau", "tasks": "Tâches", "tasks.n-subtasks": "{n} sous-tâche | {n} sous-tâches", "tasks.no-tasks": "Aucune tâche", @@ -87,5 +97,6 @@ "total": "Total", "total-cpus": "Total CPUs", + "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web/src/components/host/HostHeader.vue b/@xen-orchestra/web/src/components/host/HostHeader.vue index dc5bb9e4dc3..f4bc3254f3f 100644 --- a/@xen-orchestra/web/src/components/host/HostHeader.vue +++ b/@xen-orchestra/web/src/components/host/HostHeader.vue @@ -15,7 +15,11 @@ {{ $t('alarms') }} {{ $t('stats') }} {{ $t('system') }} - {{ $t('network') }} + + + {{ $t('network') }} + + {{ $t('storage') }} {{ $t('tasks') }} diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue new file mode 100644 index 00000000000..c335a2e6730 --- /dev/null +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -0,0 +1,294 @@ + + + + + +ø] diff --git a/@xen-orchestra/web/typed-router.d.ts b/@xen-orchestra/web/typed-router.d.ts index e3a1a98ebf1..0abcb49c534 100644 --- a/@xen-orchestra/web/typed-router.d.ts +++ b/@xen-orchestra/web/typed-router.d.ts @@ -26,6 +26,7 @@ declare module 'vue-router/auto-routes' { '/host/[id]': RouteRecordInfo<'/host/[id]', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/:id': RouteRecordInfo<'/host/:id', '/host/:id', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/console': RouteRecordInfo<'/host/[id]/console', '/host/:id/console', { id: ParamValue }, { id: ParamValue }>, + '/host/[id]/network': RouteRecordInfo<'/host/[id]/network', '/host/:id/network', { id: ParamValue }, { id: ParamValue }>, '/host/[id]/vms': RouteRecordInfo<'/host/[id]/vms', '/host/:id/vms', { id: ParamValue }, { id: ParamValue }>, '/pool/[id]': RouteRecordInfo<'/pool/[id]', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, '/pool/:id': RouteRecordInfo<'/pool/:id', '/pool/:id', { id: ParamValue }, { id: ParamValue }>, From 48a0bc6f87390bdd531bc88d01d9490004ac5c39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 25 Nov 2024 10:34:09 +0100 Subject: [PATCH 18/41] feat(xo6): Update with checkbox composable --- .../lib/components/ui/checkbox/UiCheckbox.vue | 2 +- .../composables/multi-select.composable.md | 33 +++++++++++++++++++ .../table/multi-select.composable.ts | 32 ++++++++++++++++++ .../web/src/pages/host/[id]/network.vue | 25 ++++++++++++++ 4 files changed, 91 insertions(+), 1 deletion(-) create mode 100644 @xen-orchestra/web-core/lib/composables/multi-select.composable.md create mode 100644 @xen-orchestra/web-core/lib/composables/table/multi-select.composable.ts diff --git a/@xen-orchestra/web-core/lib/components/ui/checkbox/UiCheckbox.vue b/@xen-orchestra/web-core/lib/components/ui/checkbox/UiCheckbox.vue index 8b1bdaf05b3..2092b8a2d93 100644 --- a/@xen-orchestra/web-core/lib/components/ui/checkbox/UiCheckbox.vue +++ b/@xen-orchestra/web-core/lib/components/ui/checkbox/UiCheckbox.vue @@ -43,7 +43,7 @@ const props = withDefaults( { disabled: undefined } ) -const checkboxModel = defineModel({ default: undefined }) +const checkboxModel = defineModel({ default: undefined }) const slots = defineSlots<{ default?(): any diff --git a/@xen-orchestra/web-core/lib/composables/multi-select.composable.md b/@xen-orchestra/web-core/lib/composables/multi-select.composable.md new file mode 100644 index 00000000000..03267f39189 --- /dev/null +++ b/@xen-orchestra/web-core/lib/composables/multi-select.composable.md @@ -0,0 +1,33 @@ +# useMultiSelect composable + +```vue + + + +``` diff --git a/@xen-orchestra/web-core/lib/composables/table/multi-select.composable.ts b/@xen-orchestra/web-core/lib/composables/table/multi-select.composable.ts new file mode 100644 index 00000000000..d4f900f0bc5 --- /dev/null +++ b/@xen-orchestra/web-core/lib/composables/table/multi-select.composable.ts @@ -0,0 +1,32 @@ +import { computed, ref, unref, type MaybeRef, type Ref } from 'vue' + +export default function useMultiSelect(usableIds: MaybeRef, selectableIds?: MaybeRef) { + const $selected = ref(new Set()) as Ref> + + const selected = computed({ + get() { + return unref(usableIds).filter(usableId => $selected.value.has(usableId)) + }, + set(ids: T[]) { + $selected.value = new Set(ids) + }, + }) + + const areAllSelected = computed({ + get() { + return (unref(selectableIds) ?? unref(usableIds)).every(id => $selected.value.has(id)) + }, + set(value: boolean) { + if (value) { + $selected.value = new Set(unref(selectableIds) ?? unref(usableIds)) + } else { + $selected.value = new Set() + } + }, + }) + + return { + selected, + areAllSelected, + } +} diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index c335a2e6730..d414cc03572 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -22,6 +22,12 @@ {{ $t('table-actions') }} + @@ -73,6 +79,12 @@ + @@ -106,6 +118,8 @@ import UiQuerySearchBar from '@core/components/ui/query-search-bar/UiQuerySearch import UiTableActions from '@core/components/ui/table-actions/UiTableActions.vue' import UiTitle from '@core/components/ui/title/UiTitle.vue' import { defineTree } from '@core/composables/tree/define-tree' +import UiTopBottomTable from '@core/components/ui/top-bottom-table/UiTopBottomTable.vue' +import useMultiSelect from '@core/composables/table/multi-select.composable' import { useTreeFilter } from '@core/composables/tree-filter.composable' import { useTree } from '@core/composables/tree.composable' import type { IconDefinition } from '@fortawesome/fontawesome-common-types' @@ -233,10 +247,21 @@ const definitions = defineTree(data, { getLabel: 'name_label', predicate, }) +const { filter } = useTreeFilter() +const usableRefs = computed(() => data.map(item => item.id)) +const { selected, areAllSelected } = useMultiSelect(usableRefs) const { nodes: pifs } = useTree(definitions, { expand: false }) +const totalItems = ref(data) + +const toggleSelect = () => { + selected.value = selected.value.length === 0 ? usableRefs.value : [] +} + +// const { nodes: pifs } = useTree(definitions, { expand: false }) type NetworkStatus = 'connected' | 'disconnected' | 'other' + type NetworkAccent = 'success' | 'warning' | 'danger' const states: Record = { From d958ac85d895de9eff8ab9b6d5e412c812ab6f00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 25 Nov 2024 10:44:20 +0100 Subject: [PATCH 19/41] feat(xo6): remove duplicated --- @xen-orchestra/lite/src/locales/en.json | 2 -- @xen-orchestra/lite/src/locales/fr.json | 2 -- 2 files changed, 4 deletions(-) diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index a9217ed7ae1..a82eca4dd70 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", @@ -241,7 +240,6 @@ "start": "Start", "start-on-host": "Start on specific host", "static-ip": "Static IP", - "status": "Status", "storage-usage": "Storage usage", "support": "Support", "suspend": "Suspend", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index d9f86ea546e..6baf9418c8c 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", @@ -241,7 +240,6 @@ "start": "Démarrer", "start-on-host": "Démarrer sur un hôte spécifique", "static-ip": "IP statique", - "status": "Statut", "storage-usage": "Utilisation du stockage", "support": "Support", "suspend": "Suspendre", From 657d745b7ce4b799a9f4eac37b7c54e2aaa6b3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 25 Nov 2024 16:12:56 +0100 Subject: [PATCH 20/41] feat(xo6): wip make pif table component --- .../web/src/components/pif/PifTable.vue | 218 ++++++++++++++++++ .../web/src/pages/host/[id]/network.vue | 154 +++++-------- 2 files changed, 274 insertions(+), 98 deletions(-) create mode 100644 @xen-orchestra/web/src/components/pif/PifTable.vue diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue new file mode 100644 index 00000000000..49ad6461601 --- /dev/null +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index d414cc03572..f2bfdef30b6 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -1,92 +1,6 @@ -ø] From 548e7e9018e7c2b13ce4aff0d1a5107f99283cbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Thu, 28 Nov 2024 10:13:51 +0100 Subject: [PATCH 24/41] feat(xo-6):update info --- .../lib/components/ui/info/UiInfo.vue | 1 - .../web/src/components/pif/PifStatus.vue | 19 +++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/@xen-orchestra/web-core/lib/components/ui/info/UiInfo.vue b/@xen-orchestra/web-core/lib/components/ui/info/UiInfo.vue index 1a42b2e673f..4ac9cf557f7 100644 --- a/@xen-orchestra/web-core/lib/components/ui/info/UiInfo.vue +++ b/@xen-orchestra/web-core/lib/components/ui/info/UiInfo.vue @@ -42,7 +42,6 @@ const icon = computed(() => iconByAccent[props.accent]) From 28dd3522e82531c0c3ceb35588315078bb1748d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Thu, 28 Nov 2024 15:32:48 +0100 Subject: [PATCH 25/41] feat(xo-6):update with new card key component --- @xen-orchestra/lite/src/locales/cs.json | 1 - @xen-orchestra/lite/src/locales/de.json | 2 - @xen-orchestra/lite/src/locales/en.json | 3 - @xen-orchestra/lite/src/locales/fa.json | 1 - @xen-orchestra/lite/src/locales/fr.json | 3 - .../components/card/VtsCardRowKeyValue.vue | 1 + @xen-orchestra/web-core/lib/locales/de.json | 2 + @xen-orchestra/web-core/lib/locales/en.json | 17 +- @xen-orchestra/web-core/lib/locales/fa.json | 1 + @xen-orchestra/web-core/lib/locales/fr.json | 17 +- .../web/src/components/pif/PifPanel.vue | 242 ++++++++++++++++++ .../web/src/components/pif/PifTable.vue | 14 +- @xen-orchestra/web/src/fakeGetNetwork.ts | 3 +- @xen-orchestra/web/src/fakePifStore.ts | 22 +- .../web/src/pages/host/[id]/network.vue | 43 ++-- 15 files changed, 311 insertions(+), 61 deletions(-) create mode 100644 @xen-orchestra/web/src/components/pif/PifPanel.vue diff --git a/@xen-orchestra/lite/src/locales/cs.json b/@xen-orchestra/lite/src/locales/cs.json index 57dc074bba0..1a79d89f0f3 100644 --- a/@xen-orchestra/lite/src/locales/cs.json +++ b/@xen-orchestra/lite/src/locales/cs.json @@ -59,7 +59,6 @@ "descending": "sestupně", "description": "Popis", - "dhcp": "DHCP", "disabled": "Zakázáno", "display": "Zobrazení", "dns": "DNS", diff --git a/@xen-orchestra/lite/src/locales/de.json b/@xen-orchestra/lite/src/locales/de.json index e5d13c7e705..f132f383f66 100644 --- a/@xen-orchestra/lite/src/locales/de.json +++ b/@xen-orchestra/lite/src/locales/de.json @@ -57,7 +57,6 @@ "descending": "absteigend", "description": "Beschreibung", - "dhcp": "DHCP", "disabled": "deaktiviert", "display": "Display", "dns": "DNS", @@ -118,7 +117,6 @@ "n-hosts-awaiting-patch": "Der Host {n} benötigt dieses Patch | Die Hosts {n} benötigen dieses Patch", "n-missing": "{n} verbleibend", "name": "Name", - "netmask": "Netzmaske", "network-download": "Download", "network-throughput": "Netzwerkdurchsatz", "network-upload": "Upload", diff --git a/@xen-orchestra/lite/src/locales/en.json b/@xen-orchestra/lite/src/locales/en.json index a82eca4dd70..15213ae213b 100644 --- a/@xen-orchestra/lite/src/locales/en.json +++ b/@xen-orchestra/lite/src/locales/en.json @@ -58,10 +58,8 @@ "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 +176,6 @@ "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", "network-upload": "Upload", diff --git a/@xen-orchestra/lite/src/locales/fa.json b/@xen-orchestra/lite/src/locales/fa.json index f057084aa93..d38abfd754d 100644 --- a/@xen-orchestra/lite/src/locales/fa.json +++ b/@xen-orchestra/lite/src/locales/fa.json @@ -58,7 +58,6 @@ "descending": "نزولی", "description": "توصیف", - "dhcp": "DHCP", "disabled": "غیر فعال", "display": "نمایش", "dns": "DNS", diff --git a/@xen-orchestra/lite/src/locales/fr.json b/@xen-orchestra/lite/src/locales/fr.json index 6baf9418c8c..c07a574eda5 100644 --- a/@xen-orchestra/lite/src/locales/fr.json +++ b/@xen-orchestra/lite/src/locales/fr.json @@ -58,8 +58,6 @@ "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", @@ -178,7 +176,6 @@ "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", "network-upload": "Montant", 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/locales/de.json b/@xen-orchestra/web-core/lib/locales/de.json index 5eae961a611..219b45901da 100644 --- a/@xen-orchestra/web-core/lib/locales/de.json +++ b/@xen-orchestra/web-core/lib/locales/de.json @@ -18,6 +18,7 @@ "dark-mode.auto": "Automatischer Dunkelmodus", "dashboard": "Dashboard", + "dhcp": "DHCP", "documentation-name": "{name} Dokumentation", "error-no-data": "Fehler beim Datenabruf.", "fullscreen": "Vollbild", @@ -28,6 +29,7 @@ "log-out": "Abmelden", "master": "Primärer Host", "n-vms": "1 VM | {n} VMs", + "netmask": "Netzmaske", "network": "Netzwerk", "object-not-found": "Objekt {id} wurde nicht gefunden…", "open-console-in-new-tab": "Konsole in neuem Reiter öffnen", diff --git a/@xen-orchestra/web-core/lib/locales/en.json b/@xen-orchestra/web-core/lib/locales/en.json index 29bff574ef1..21014194779 100644 --- a/@xen-orchestra/web-core/lib/locales/en.json +++ b/@xen-orchestra/web-core/lib/locales/en.json @@ -49,20 +49,29 @@ "disconnected-from-physical-device": "Disconnected form physical device", "device": "Device", "edit": "Edit", + "default-locking-mode": "Default locking mode", "delete": "Delete", + "dhcp": "DHCP", + "dns": "DNS", "documentation-name": "{name} documentation", "error-no-data": "Error, can't collect data.", "exit-fullscreen": "Exit fullscreen", "fullscreen": "Fullscreen", "gateway": "Gateway", "hosts": "Hosts", - "ip-addresses": "IP Adresses", + "ip-addresses": "IP Addresses", "ip-mode": "IP mode", "learn-more": "Learn more", "loading-in-progress": "Loading in progress…", "log-out": "Log out", "mac-address": "MAC address", + "mac-addresses": "MAC addresses", "master": "Primary host", + "mbs": "Mb/s", + "mtu": "MTU", + "netmask": "Netmask", + "network-block-device": "Network block device", + "network-information": "Network information", "n-vms": "1 VM | {n} VMs", "network": "Network", "no-data": "No data", @@ -71,10 +80,14 @@ "other": "Other", "page-not-found": "This page is not to be found…", "patches": "Patches", + "physical-interface-status": "Physical interface status", + "pif": "PIF", "pifs": "PIFs", + "pif-status": "Pif status", "power-on-vm-for-console": "Power on your VM to access its console", "power-on-host-for-console": "Power on your host to access its console", "professional-support": "Professional support", + "properties": "Properties", "receive": "Receive", "running-vm": "Running VM | Running VMs", "scan-pifs": "Scan PIFs", @@ -98,8 +111,10 @@ "tasks.quick-view.in-progress": "In progress", "table-actions": "Table actions", + "tags": "Tags", "total": "Total", "total-cpus": "Total CPUs", + "uuid": "Uuid", "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web-core/lib/locales/fa.json b/@xen-orchestra/web-core/lib/locales/fa.json index aaf2050bbfe..a35c461e6d9 100644 --- a/@xen-orchestra/web-core/lib/locales/fa.json +++ b/@xen-orchestra/web-core/lib/locales/fa.json @@ -32,6 +32,7 @@ "dark-mode.auto": "حالت خودکار تاریک", "dashboard": "داشبورد", + "dhcp": "DHCP", "documentation-name": "اسناد {name}", "error-no-data": "خطا، نمی توان داده ها را جمع آوری کرد.", "fullscreen": "تمام صفحه", diff --git a/@xen-orchestra/web-core/lib/locales/fr.json b/@xen-orchestra/web-core/lib/locales/fr.json index 7b8b5f69879..54ce8e5b276 100644 --- a/@xen-orchestra/web-core/lib/locales/fr.json +++ b/@xen-orchestra/web-core/lib/locales/fr.json @@ -49,7 +49,10 @@ "disconnected-from-physical-device": "Déconnécté de l'appareil physique", "device": "Appareil", "edit": "Éditer", + "default-locking-mode": "Mode de verrouillage par défaut", "delete": "Supprimer", + "dhcp": "DHCP", + "dns": "DNS", "documentation-name": "Documentation {name}", "error-no-data": "Erreur, impossible de collecter les données.", "exit-fullscreen": "Quitter le plein écran", @@ -62,7 +65,13 @@ "loading-in-progress": "Chargement en cours…", "log-out": "Se déconnecter", "mac-address": "Adresse MAC", + "mac-addresses": "Adresses MAC", "master": "Hôte primaire", + "mbs": "Mb/s", + "mtu": "MTU", + "netmask": "Masque réseau", + "network-block-device": "Dispositif de blocage réseau", + "network-information": "Information du réseau", "n-vms": "1 VM | {n} VMs", "network": "Réseau", "no-data": "Aucune donnée", @@ -71,10 +80,14 @@ "other": "Autre", "page-not-found": "Cette page est introuvable…", "patches": "Patches", + "physical-interface-status": "Status de l'interface physique", + "pif": "PIF", "pifs": "PIFs", + "pif-status": "Status du Pif", "power-on-vm-for-console": "Allumez votre VM pour accéder à sa console", "power-on-host-for-console": "Allumez votre hôte pour accéder à sa console", "professional-support": "Support professionel", + "properties": "Propriétés", "receive": "Recevoir", "running-vm": "VM en cours d'exécution | VMs en cours d'exécution", "scan-pifs": "Scanner les PIFs", @@ -88,7 +101,6 @@ "storage": "Stockage", "system": "Système", - "table-actions": "Actions du tableau", "tasks": "Tâches", "tasks.n-subtasks": "{n} sous-tâche | {n} sous-tâches", "tasks.no-tasks": "Aucune tâche", @@ -98,8 +110,11 @@ "tasks.quick-view.failed": "Échouées", "tasks.quick-view.in-progress": "En cours", + "table-actions": "Actions du tableau", + "tags": "Etiquettes", "total": "Total", "total-cpus": "Total CPUs", + "uuid": "Uuid", "vlan": "VLAN", "vms": "VMs" } diff --git a/@xen-orchestra/web/src/components/pif/PifPanel.vue b/@xen-orchestra/web/src/components/pif/PifPanel.vue new file mode 100644 index 00000000000..39b9e78f27e --- /dev/null +++ b/@xen-orchestra/web/src/components/pif/PifPanel.vue @@ -0,0 +1,242 @@ + + + + + diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index f7131660bfc..40dabd7ba68 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -80,7 +80,6 @@ From 10e9a7fef39fc705c6e27d850d95938786e29925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Thu, 28 Nov 2024 17:16:04 +0100 Subject: [PATCH 26/41] feat(web-core): update css alignment, tooltip and ellipsis on text --- .../components/card/VtsCardRowKeyValue.vue | 1 - .../lib/components/ui/info/UiInfo.vue | 3 +- @xen-orchestra/web-core/lib/locales/en.json | 6 +- @xen-orchestra/web-core/lib/locales/fr.json | 6 +- .../web/src/components/pif/PifPanel.vue | 373 +++++++++--------- .../web/src/components/pif/PifTable.vue | 19 +- @xen-orchestra/web/src/fakePifStore.ts | 9 +- .../web/src/pages/host/[id]/network.vue | 4 +- 8 files changed, 224 insertions(+), 197 deletions(-) diff --git a/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue b/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue index 04d4f722847..f9dd28f7281 100644 --- a/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue +++ b/@xen-orchestra/web-core/lib/components/card/VtsCardRowKeyValue.vue @@ -25,7 +25,6 @@ const slots = defineSlots<{ diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index 16eea8dae27..de00e45bbc5 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -202,6 +202,10 @@ const selectRow = (rowId: string) => { padding: 1.1rem; } + .row { + cursor: default; + } + .row:hover { background-color: var(--color-brand-background-hover); } diff --git a/@xen-orchestra/web/src/pages/host/[id]/network.vue b/@xen-orchestra/web/src/pages/host/[id]/network.vue index 6bf5c50eaa8..0d4af0765f3 100644 --- a/@xen-orchestra/web/src/pages/host/[id]/network.vue +++ b/@xen-orchestra/web/src/pages/host/[id]/network.vue @@ -1,7 +1,10 @@ @@ -10,6 +13,8 @@ import PifPanel from '@/components/pif/PifPanel.vue' import PifTable from '@/components/pif/PifTable.vue' import { getNetwork } from '@/fakeGetNetwork' import { pifsByHost } from '@/fakePifStore' +import VtsNoDataHero from '@core/components/state-hero/VtsNoDataHero.vue' +import UiPanel from '@core/components/ui/panel/UiPanel.vue' import { computed, ref } from 'vue' const pifs = computed(() => pifsByHost.get('438aca0f-429c-4ae6-accc-93c306e636a0') ?? []) @@ -37,5 +42,10 @@ const selectPif = (id: string) => { .host-network-view { display: flex; height: 100%; + + .panel { + width: 40rem; + border-top: none; + } } From 1f5f9ba95911f8de94508b949152fb33760896af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 2 Dec 2024 08:40:58 +0100 Subject: [PATCH 29/41] feat(web-core): wip --- @xen-orchestra/web/src/components/pif/PifTable.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index de00e45bbc5..a885ae54ae8 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -186,9 +186,16 @@ const selectRow = (rowId: string) => { border: solid 0.1rem var(--color-neutral-border); border-radius: 0.8rem; background-color: var(--color-neutral-background-primary); + overflow-x: hidden; + width: 100%; .table-container { margin-top: 2.4rem; + overflow-x: auto; + + .table { + width: 1600px; + } tr:last-child { border-bottom: 1px solid var(--color-neutral-border); From 985c52aac4eef1360dbab64121a83855a854615a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 2 Dec 2024 09:32:14 +0100 Subject: [PATCH 30/41] feat(xo-6): add table scrolling bar --- .../web/src/components/pif/PifTable.vue | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index a885ae54ae8..b4725b2e8c5 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -8,8 +8,8 @@ -
- +
+ {{ $t('edit') }} @@ -27,6 +27,8 @@ :total-items="usableRefs.length" @toggle-select-all="toggleSelect" /> +
+
@@ -60,7 +62,7 @@

{{ row.value.name_label }}

{{ row.value.device }}
-
+
{{ row.value.vlan }}
@@ -74,13 +76,13 @@ -
+
@@ -187,14 +189,22 @@ const selectRow = (rowId: string) => { border-radius: 0.8rem; background-color: var(--color-neutral-background-primary); overflow-x: hidden; - width: 100%; - .table-container { + .table-actions { margin-top: 2.4rem; + display: flex; + flex-direction: column; + } + + .selection { + margin: 0.8rem 0; + } + + .table-container { overflow-x: auto; .table { - width: 1600px; + width: 160rem; } tr:last-child { @@ -225,19 +235,6 @@ const selectRow = (rowId: string) => { display: flex; gap: 1.6rem; } - - .status { - display: flex; - gap: 0.8rem; - - .icon { - font-size: 1.6rem; - } - } - - .selection { - margin: 0.8rem 0; - } } } From 693b16fc7295498ff10745c8b5a6ceb267ed8b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Mon, 2 Dec 2024 14:12:34 +0100 Subject: [PATCH 31/41] feat(xo-6): add responsiveness for table --- .../web/src/components/pif/PifTable.vue | 35 +++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index b4725b2e8c5..f3e090c14e0 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -32,7 +32,7 @@ - +
@@ -204,27 +204,40 @@ const selectRow = (rowId: string) => { overflow-x: auto; .table { - width: 160rem; + .col-checkbox, + .col-more, + .col-vlan { + width: 4.5rem; + } + + .col-network, + .col-status, + .col-ip, + .col-mac { + width: 17rem; + } + + .col-device, + .col-mode { + width: 9.5rem; + } } tr:last-child { border-bottom: 1px solid var(--color-neutral-border); } - th { - width: 48px; - } - td { padding: 1.1rem; } .row { - cursor: default; + cursor: pointer; } .row:hover { background-color: var(--color-brand-background-hover); + transition: all 0.3s ease; } .row.selected { @@ -236,5 +249,13 @@ const selectRow = (rowId: string) => { gap: 1.6rem; } } + + @media (max-width: 1500px) { + .table-container { + .table { + width: 160rem; + } + } + } } From 9aed6d7e4961fd7cd722cd61f61b0f234ac8fe0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Tue, 3 Dec 2024 14:20:18 +0100 Subject: [PATCH 32/41] feat(xo-6): update headers --- .../web/src/components/pif/PifTable.vue | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index f3e090c14e0..84295a1b91a 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -32,16 +32,18 @@ - -
+ @@ -89,9 +91,11 @@ diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index 6695886e105..8af24ec49df 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -56,7 +56,7 @@ > -
+
@@ -65,9 +65,11 @@
{{ row.value.device }}
- + +
+
+ {{ getPifData(row.value, 'vlan') }}
-
{{ row.value.vlan }}
{{ row.value.ip }}
{{ row.value.mac }}
{{ row.value.mode }}
@@ -136,7 +138,12 @@ const { get, isReady } = useNetworkStore().subscribe() const getNetworkName = (pif: XoPif) => { const network: XoNetwork = get(pif.$network)! - return network.name_label ? network.name_label : 'Unknown' + return network.name_label ? network.name_label : '' +} + +const getPifData = (pif: XoPif, type: keyof XoPif) => { + const value = type === 'vlan' ? pif.vlan : pif[type] + return value === -1 || value === '' ? '' : value } const searchQuery = ref('') @@ -263,6 +270,10 @@ const selectRow = (rowId: XoPif['id']) => { display: flex; gap: 1.6rem; } + + .status { + font-size: 8.4rem !important; + } } @media (max-width: 1500px) { From 0ec8a9b67cbb05c29ee3e8b8221303467eed8954 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Thu, 5 Dec 2024 15:59:14 +0100 Subject: [PATCH 38/41] feat(xo-6): simplify functions --- .../web/src/components/pif/PifPanel.vue | 18 +++++++++++++----- .../web/src/components/pif/PifTable.vue | 8 +++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/@xen-orchestra/web/src/components/pif/PifPanel.vue b/@xen-orchestra/web/src/components/pif/PifPanel.vue index f0b6b0e4057..c5d38b800ed 100644 --- a/@xen-orchestra/web/src/components/pif/PifPanel.vue +++ b/@xen-orchestra/web/src/components/pif/PifPanel.vue @@ -153,7 +153,7 @@ {{ $t('ip-mode') }}
@@ -245,14 +245,22 @@ const getNetworkData = (type: keyof XoNetwork) => { return network[type] ? 'on' : 'off' case 'tags': return network.tags.length ? network.tags : '-' - default: - return undefined } } const getPifData = (type: keyof XoPif) => { - const value = type === 'vlan' ? props.pif.vlan : props.pif[type] - return value === -1 || value === '' ? '-' : value + const value = props.pif[type] + + switch (type) { + case 'vlan': + return value === -1 ? '-' : value + case 'netmask': + case 'dns': + case 'gateway': + return value === '' ? '-' : props.pif.netmask + case 'mode': + return value === 'None' ? '-' : value + } } diff --git a/@xen-orchestra/web/src/components/pif/PifTable.vue b/@xen-orchestra/web/src/components/pif/PifTable.vue index 8af24ec49df..79be123ab5b 100644 --- a/@xen-orchestra/web/src/components/pif/PifTable.vue +++ b/@xen-orchestra/web/src/components/pif/PifTable.vue @@ -72,7 +72,7 @@
{{ row.value.ip }}
{{ row.value.mac }}
-
{{ row.value.mode }}
+
{{ getPifData(row.value, 'mode') }}
@@ -141,10 +141,8 @@ const getNetworkName = (pif: XoPif) => { return network.name_label ? network.name_label : '' } -const getPifData = (pif: XoPif, type: keyof XoPif) => { - const value = type === 'vlan' ? pif.vlan : pif[type] - return value === -1 || value === '' ? '' : value -} +const getPifData = (pif: XoPif, type: keyof XoPif) => + (type === 'vlan' && pif[type] === -1) || (type === 'mode' && pif[type] === 'None') ? '' : pif[type] const searchQuery = ref('') From 1ed06d9cac360e8873ae1a4ad8a0b44e5267467b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastian=20Czech?= Date: Fri, 6 Dec 2024 10:05:09 +0100 Subject: [PATCH 39/41] feat(xo-6): handle header width --- .../lib/components/table/ColumnTitle.vue | 7 +++--- .../lib/components/ui/panel/UiPanel.vue | 1 + .../web/src/components/pif/PifPanel.vue | 1 + .../web/src/components/pif/PifStatus.vue | 3 ++- .../web/src/components/pif/PifTable.vue | 23 +++++++++++-------- 5 files changed, 21 insertions(+), 14 deletions(-) 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 @@