diff --git a/@xen-orchestra/lite/CHANGELOG.md b/@xen-orchestra/lite/CHANGELOG.md index c3b0ab7708..bbeb8f93c2 100644 --- a/@xen-orchestra/lite/CHANGELOG.md +++ b/@xen-orchestra/lite/CHANGELOG.md @@ -3,6 +3,7 @@ ## **next** - [Pool/networks] Add the possibility to create new network or bonded network (PR [#10145](https://github.com/vatesfr/xen-orchestra/pull/10145)) +- [VM] Add VDIs page with table and side panel (PR [#10269](https://github.com/vatesfr/xen-orchestra/pull/10269)) - [Host/Network] Add ability to rescan physical network interfaces (PIFs) (PR [#10147](https://github.com/vatesfr/xen-orchestra/pull/10147)) - Fix inconsistent spacing in side panel cards (PR [#10279](https://github.com/vatesfr/xen-orchestra/pull/10279)) - Fix missing collapse buttons on pools and hosts in the tree sidebar (added `hasChildren` prop) (PR [#10244](https://github.com/vatesfr/xen-orchestra/pull/10244)) diff --git a/@xen-orchestra/lite/src/components/vm/VmTabBar.vue b/@xen-orchestra/lite/src/components/vm/VmTabBar.vue index a91b57f908..90367a6a51 100644 --- a/@xen-orchestra/lite/src/components/vm/VmTabBar.vue +++ b/@xen-orchestra/lite/src/components/vm/VmTabBar.vue @@ -18,6 +18,9 @@ {{ t('network') }} + + {{ t('vdis') }} + {{ t('tasks') }} diff --git a/@xen-orchestra/lite/src/modules/storage-repository/components/list/panel/cards/StorageRepositoryVdisCard.vue b/@xen-orchestra/lite/src/modules/storage-repository/components/list/panel/cards/StorageRepositoryVdisCard.vue index 73b15c8116..30687f4845 100644 --- a/@xen-orchestra/lite/src/modules/storage-repository/components/list/panel/cards/StorageRepositoryVdisCard.vue +++ b/@xen-orchestra/lite/src/modules/storage-repository/components/list/panel/cards/StorageRepositoryVdisCard.vue @@ -48,8 +48,8 @@ + + diff --git a/@xen-orchestra/lite/src/modules/vdi/components/list/panel/VdiSidePanel.vue b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/VdiSidePanel.vue new file mode 100644 index 0000000000..9542e76295 --- /dev/null +++ b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/VdiSidePanel.vue @@ -0,0 +1,24 @@ + + + + + + + + + + + diff --git a/@xen-orchestra/lite/src/modules/vdi/components/list/panel/card-items/VdiFormatCardItem.vue b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/card-items/VdiFormatCardItem.vue new file mode 100644 index 0000000000..13b978531e --- /dev/null +++ b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/card-items/VdiFormatCardItem.vue @@ -0,0 +1,25 @@ + + + + {{ t('format') }} + + {{ format }} + + + + + + + diff --git a/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiConfigurationCard.vue b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiConfigurationCard.vue new file mode 100644 index 0000000000..e455955343 --- /dev/null +++ b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiConfigurationCard.vue @@ -0,0 +1,89 @@ + + + + {{ t('configuration') }} + + + + + + {{ t('storage') }} + + + + + + {{ vdiSr.name_label }} + + + + + + + + + + {{ t('read-only') }} + + + + + + + + {{ t('change-block-tracking') }} + + + + + + + + {{ t('bootable') }} + + + + + + + + + + + + diff --git a/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiInfosCard.vue b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiInfosCard.vue new file mode 100644 index 0000000000..2034d54772 --- /dev/null +++ b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiInfosCard.vue @@ -0,0 +1,92 @@ + + + + + + {{ t('description') }} + {{ vdi.name_description }} + + + + + + {{ t('tags') }} + + + + + + + + + + + {{ t('status') }} + + + + + + + + + {{ t('device') }} + {{ vbd?.device }} + + + + + + + + + + + diff --git a/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiSpaceCard.vue b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiSpaceCard.vue new file mode 100644 index 0000000000..b912a7fc28 --- /dev/null +++ b/@xen-orchestra/lite/src/modules/vdi/components/list/panel/cards/VdiSpaceCard.vue @@ -0,0 +1,12 @@ + + + + + diff --git a/@xen-orchestra/lite/src/libs/vdi.ts b/@xen-orchestra/lite/src/modules/vdi/utils/vdi.util.ts similarity index 84% rename from @xen-orchestra/lite/src/libs/vdi.ts rename to @xen-orchestra/lite/src/modules/vdi/utils/vdi.util.ts index f27a3ad49b..f4cfbd7939 100644 --- a/@xen-orchestra/lite/src/libs/vdi.ts +++ b/@xen-orchestra/lite/src/modules/vdi/utils/vdi.util.ts @@ -19,3 +19,7 @@ export function getVbdsForVdi( ): XenApiVbd[] { return vdi.VBDs.map(ref => getVbdByOpaqueRef(ref)).filter((vbd): vbd is XenApiVbd => vbd !== undefined) } + +export function getVdiFormat(format: string | undefined): string { + return format !== undefined ? format.toUpperCase() : 'VHD' +} diff --git a/@xen-orchestra/lite/src/pages/vm/[uuid]/vdis.vue b/@xen-orchestra/lite/src/pages/vm/[uuid]/vdis.vue new file mode 100644 index 0000000000..824dc45bdf --- /dev/null +++ b/@xen-orchestra/lite/src/pages/vm/[uuid]/vdis.vue @@ -0,0 +1,55 @@ + + + + + + + + + + + + diff --git a/@xen-orchestra/lite/src/route-map.d.ts b/@xen-orchestra/lite/src/route-map.d.ts index e22a4a5708..aa8abe04b4 100644 --- a/@xen-orchestra/lite/src/route-map.d.ts +++ b/@xen-orchestra/lite/src/route-map.d.ts @@ -980,6 +980,7 @@ declare module 'vue-router/auto-routes' { | '/vm/[uuid]/stats' | '/vm/[uuid]/system' | '/vm/[uuid]/tasks' + | '/vm/[uuid]/vdis' >, '/vm/[uuid]/alarms': RouteRecordInfo< '/vm/[uuid]/alarms', @@ -1030,6 +1031,13 @@ declare module 'vue-router/auto-routes' { { uuid: ParamValue }, | never >, + '/vm/[uuid]/vdis': RouteRecordInfo< + '/vm/[uuid]/vdis', + '/vm/:uuid/vdis', + { uuid: ParamValue }, + { uuid: ParamValue }, + | never + >, '/vm/new': RouteRecordInfo< '/vm/new', '/vm/new', @@ -1875,6 +1883,7 @@ declare module 'vue-router/auto-routes' { | '/vm/[uuid]/stats' | '/vm/[uuid]/system' | '/vm/[uuid]/tasks' + | '/vm/[uuid]/vdis' views: | 'default' } @@ -1920,6 +1929,12 @@ declare module 'vue-router/auto-routes' { views: | never } + 'src/pages/vm/[uuid]/vdis.vue': { + routes: + | '/vm/[uuid]/vdis' + views: + | never + } 'src/pages/vm/new.vue': { routes: | '/vm/new' diff --git a/@xen-orchestra/web-core/lib/tables/column-sets/vdi-columns.ts b/@xen-orchestra/web-core/lib/tables/column-sets/vdi-columns.ts index 8c17df884e..bc4fde6cd3 100644 --- a/@xen-orchestra/web-core/lib/tables/column-sets/vdi-columns.ts +++ b/@xen-orchestra/web-core/lib/tables/column-sets/vdi-columns.ts @@ -4,6 +4,7 @@ import { useLinkColumn } from '@core/tables/column-definitions/link-column.ts' import { useLiteralColumn } from '@core/tables/column-definitions/literal-column.ts' import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts' import { useProgressBarColumn } from '@core/tables/column-definitions/progress-bar-column.ts' +import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column.ts' import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column.ts' import { useI18n } from 'vue-i18n' @@ -17,5 +18,6 @@ export const useVdiColumns = defineColumns(() => { size: useNumberColumn({ headerLabel: () => t('size') }), format: useLiteralColumn({ headerLabel: () => t('format') }), actions: useActionColumn({}), + selectItem: useSelectItemColumn(), } }) diff --git a/@xen-orchestra/web/src/modules/vdi/components/list/VdisTable.vue b/@xen-orchestra/web/src/modules/vdi/components/list/VdisTable.vue index 2761fe964c..8a30d51fd9 100644 --- a/@xen-orchestra/web/src/modules/vdi/components/list/VdisTable.vue +++ b/@xen-orchestra/web/src/modules/vdi/components/list/VdisTable.vue @@ -89,6 +89,7 @@ const state = useTableState({ const { pageRecords: paginatedVdis, paginationBindings } = usePagination('vdis', filteredVdis) const { HeadCells, BodyCells } = useVdiColumns({ + exclude: ['selectItem'], body: (vdi: FrontXoVdi) => { const vbds = useGetVbdsByIds(vdi.$VBDs)