@xen-orchestra/web-core 0.35.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/lib/components/console/VtsRemoteConsole.vue +1 -1
  2. package/lib/components/copy-button/VtsCopyButton.vue +1 -1
  3. package/lib/components/layout/VtsLayoutSidebar.vue +1 -1
  4. package/lib/components/quick-info-card/VtsQuickInfoCard.vue +1 -1
  5. package/lib/components/relative-time/VtsRelativeTime.vue +2 -3
  6. package/lib/components/select/VtsSelect.vue +1 -1
  7. package/lib/components/state-hero/VtsStateHero.vue +20 -10
  8. package/lib/components/table/VtsRow.vue +26 -0
  9. package/lib/components/table/VtsTable.vue +99 -42
  10. package/lib/components/table/cells/VtsCollapsedListCell.vue +59 -0
  11. package/lib/components/table/cells/VtsHeaderCell.vue +31 -0
  12. package/lib/components/table/cells/VtsLinkCell.vue +33 -0
  13. package/lib/components/table/cells/VtsNumberCell.vue +21 -0
  14. package/lib/components/{size-progress-cell/VtsSizeProgressCell.vue → table/cells/VtsProgressBarCell.vue} +8 -5
  15. package/lib/components/table/cells/VtsStatusCell.vue +69 -0
  16. package/lib/components/table/cells/VtsTagCell.vue +24 -0
  17. package/lib/components/table/cells/VtsTextCell.vue +32 -0
  18. package/lib/components/table/cells/VtsTruncatedTextCell.vue +64 -0
  19. package/lib/components/task/VtsQuickTaskButton.vue +1 -1
  20. package/lib/components/tree/VtsTreeLine.vue +1 -1
  21. package/lib/components/ui/alert/UiAlert.vue +1 -1
  22. package/lib/components/ui/button/UiButton.vue +4 -2
  23. package/lib/components/ui/button-icon/UiButtonIcon.vue +12 -11
  24. package/lib/components/ui/column-header/UiColumnHeader.vue +22 -0
  25. package/lib/components/ui/info/UiInfo.vue +5 -1
  26. package/lib/components/ui/input/UiInput.vue +3 -2
  27. package/lib/components/ui/link/UiLink.vue +5 -0
  28. package/lib/components/ui/log-entry-viewer/UiLogEntryViewer.vue +1 -1
  29. package/lib/components/ui/query-search-bar/UiQuerySearchBar.vue +2 -2
  30. package/lib/components/ui/table-cell/UiTableCell.vue +41 -0
  31. package/lib/components/ui/table-pagination/PaginationButton.vue +1 -1
  32. package/lib/components/ui/task-item/UiTaskItem.vue +229 -0
  33. package/lib/components/ui/task-list/UiTaskList.vue +31 -0
  34. package/lib/components/ui/toaster/UiToaster.vue +1 -1
  35. package/lib/components/ui/top-bottom-table/UiTopBottomTable.vue +6 -2
  36. package/lib/components/ui/tree-item-label/UiTreeItemLabel.vue +1 -7
  37. package/lib/composables/pagination.composable.ts +16 -1
  38. package/lib/composables/relative-time.composable.ts +8 -61
  39. package/lib/composables/table-state.composable.ts +56 -0
  40. package/lib/composables/tree-filter.composable.ts +2 -2
  41. package/lib/icons/fa-icons.ts +2 -0
  42. package/lib/icons/object-icons.ts +1 -1
  43. package/lib/locales/en.json +26 -1
  44. package/lib/locales/fr.json +26 -1
  45. package/lib/packages/form-select/use-form-select-controller.ts +1 -0
  46. package/lib/packages/table/README.md +53 -308
  47. package/lib/packages/table/define-column.ts +7 -0
  48. package/lib/packages/table/define-columns.ts +104 -50
  49. package/lib/packages/table/index.ts +3 -11
  50. package/lib/packages/table/types.ts +10 -0
  51. package/lib/{composables/tree.composable.md → packages/tree/README.md} +28 -23
  52. package/lib/{composables → packages}/tree/branch-definition.ts +9 -4
  53. package/lib/{composables → packages}/tree/branch.ts +15 -20
  54. package/lib/{composables → packages}/tree/build-nodes.ts +5 -5
  55. package/lib/{composables → packages}/tree/define-branch.ts +8 -4
  56. package/lib/{composables → packages}/tree/define-leaf.ts +8 -3
  57. package/lib/{composables → packages}/tree/define-tree.ts +10 -5
  58. package/lib/{composables → packages}/tree/leaf-definition.ts +1 -1
  59. package/lib/{composables → packages}/tree/leaf.ts +3 -3
  60. package/lib/{composables → packages}/tree/tree-node-base.ts +18 -3
  61. package/lib/{composables → packages}/tree/tree-node-definition-base.ts +4 -2
  62. package/lib/{composables → packages}/tree/types.ts +11 -9
  63. package/lib/{composables/tree.composable.ts → packages/tree/use-tree.ts} +24 -11
  64. package/lib/tables/column-definitions/address-column.ts +4 -0
  65. package/lib/tables/column-definitions/button-column.ts +35 -0
  66. package/lib/tables/column-definitions/button-icon-column.ts +30 -0
  67. package/lib/tables/column-definitions/collapsed-list-column.ts +12 -0
  68. package/lib/tables/column-definitions/date-column.ts +34 -0
  69. package/lib/tables/column-definitions/info-column.ts +12 -0
  70. package/lib/tables/column-definitions/input-column.ts +32 -0
  71. package/lib/tables/column-definitions/link-column.ts +14 -0
  72. package/lib/tables/column-definitions/literal-column.ts +9 -0
  73. package/lib/tables/column-definitions/number-column.ts +10 -0
  74. package/lib/tables/column-definitions/percent-column.ts +15 -0
  75. package/lib/tables/column-definitions/progress-bar-column.ts +10 -0
  76. package/lib/tables/column-definitions/select-column.ts +12 -0
  77. package/lib/tables/column-definitions/select-item-column.ts +8 -0
  78. package/lib/tables/column-definitions/status-column.ts +16 -0
  79. package/lib/tables/column-definitions/tag-column.ts +11 -0
  80. package/lib/tables/column-definitions/text-column.ts +11 -0
  81. package/lib/tables/column-definitions/truncated-text-column.ts +10 -0
  82. package/lib/tables/column-sets/backup-issue-columns.ts +15 -0
  83. package/lib/tables/column-sets/backup-job-columns.ts +23 -0
  84. package/lib/tables/column-sets/backup-job-schedule-columns.ts +21 -0
  85. package/lib/tables/column-sets/backup-log-columns.ts +19 -0
  86. package/lib/tables/column-sets/host-columns.ts +19 -0
  87. package/lib/tables/column-sets/network-columns.ts +22 -0
  88. package/lib/tables/column-sets/new-vm-network-columns.ts +24 -0
  89. package/lib/tables/column-sets/new-vm-sr-columns.ts +33 -0
  90. package/lib/tables/column-sets/patch-columns.ts +13 -0
  91. package/lib/tables/column-sets/pif-columns.ts +23 -0
  92. package/lib/tables/column-sets/server-columns.ts +18 -0
  93. package/lib/tables/column-sets/sr-columns.ts +20 -0
  94. package/lib/tables/column-sets/vdi-columns.ts +21 -0
  95. package/lib/tables/column-sets/vif-columns.ts +23 -0
  96. package/lib/tables/column-sets/vm-columns.ts +21 -0
  97. package/lib/tables/helpers/render-body-cell.ts +4 -0
  98. package/lib/tables/helpers/render-head-cell.ts +6 -0
  99. package/lib/tables/helpers/render-loading-cell.ts +5 -0
  100. package/lib/tables/types.ts +7 -0
  101. package/lib/utils/size.util.ts +5 -9
  102. package/package.json +1 -1
  103. package/lib/components/data-table/VtsDataTable.vue +0 -70
  104. package/lib/components/table/ColumnTitle.vue +0 -152
  105. package/lib/packages/table/apply-extensions.ts +0 -26
  106. package/lib/packages/table/define-renderer/define-table-cell-renderer.ts +0 -27
  107. package/lib/packages/table/define-renderer/define-table-renderer.ts +0 -47
  108. package/lib/packages/table/define-renderer/define-table-row-renderer.ts +0 -29
  109. package/lib/packages/table/define-renderer/define-table-section-renderer.ts +0 -29
  110. package/lib/packages/table/define-table/define-multi-source-table.ts +0 -39
  111. package/lib/packages/table/define-table/define-table.ts +0 -13
  112. package/lib/packages/table/define-table/define-typed-table.ts +0 -18
  113. package/lib/packages/table/transform-sources.ts +0 -13
  114. package/lib/packages/table/types/extensions.ts +0 -16
  115. package/lib/packages/table/types/index.ts +0 -47
  116. package/lib/packages/table/types/table-cell.ts +0 -18
  117. package/lib/packages/table/types/table-row.ts +0 -20
  118. package/lib/packages/table/types/table-section.ts +0 -19
  119. package/lib/packages/table/types/table.ts +0 -28
  120. package/lib/types/button.type.ts +0 -3
@@ -0,0 +1,30 @@
1
+ import UiButtonIcon, {
2
+ type ButtonIconAccent,
3
+ type ButtonIconSize,
4
+ } from '@core/components/ui/button-icon/UiButtonIcon.vue'
5
+ import UiTableCell from '@core/components/ui/table-cell/UiTableCell.vue'
6
+ import type { IconName } from '@core/icons'
7
+ import { defineColumn } from '@core/packages/table/define-column'
8
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
9
+ import type { HeaderConfig } from '@core/tables/types.ts'
10
+ import { h, toValue, type MaybeRefOrGetter } from 'vue'
11
+
12
+ type ButtonIconConfig = {
13
+ buttonIcon: MaybeRefOrGetter<IconName>
14
+ buttonSize?: MaybeRefOrGetter<ButtonIconSize>
15
+ buttonAccent?: MaybeRefOrGetter<ButtonIconAccent>
16
+ }
17
+
18
+ export const useButtonIconColumn = defineColumn((config: HeaderConfig & ButtonIconConfig) => ({
19
+ renderHead: () => renderHeadCell(config.headerIcon, config.headerLabel),
20
+ renderBody: (onClick: () => void) =>
21
+ h(UiTableCell, { align: 'center', style: 'width: 6rem' }, () =>
22
+ h(UiButtonIcon, {
23
+ icon: toValue(config.buttonIcon),
24
+ accent: toValue(config.buttonAccent) ?? 'brand',
25
+ size: toValue(config.buttonSize) ?? 'small',
26
+ targetScale: 1.5,
27
+ onClick,
28
+ })
29
+ ),
30
+ }))
@@ -0,0 +1,12 @@
1
+ import VtsCollapsedListCell from '@core/components/table/cells/VtsCollapsedListCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column.ts'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell.ts'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import type { MaybeArray } from '@core/types/utility.type.ts'
6
+ import { toArray } from '@core/utils/to-array.utils.ts'
7
+ import { h } from 'vue'
8
+
9
+ export const useCollapsedListColumn = defineColumn((config?: HeaderConfig) => ({
10
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:square-caret-down', config?.headerLabel),
11
+ renderBody: (items: MaybeArray<string>) => h(VtsCollapsedListCell, { items: toArray(items) }),
12
+ }))
@@ -0,0 +1,34 @@
1
+ import VtsRelativeTime from '@core/components/relative-time/VtsRelativeTime.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderBodyCell } from '@core/tables/helpers/render-body-cell'
4
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
5
+ import type { HeaderConfig } from '@core/tables/types.ts'
6
+ import type { DateLike } from '@vueuse/shared'
7
+ import { h } from 'vue'
8
+ import { useI18n } from 'vue-i18n'
9
+
10
+ type DateConfig = Pick<Intl.DateTimeFormatOptions, 'dateStyle' | 'timeStyle'>
11
+
12
+ export const useDateColumn = defineColumn((config?: HeaderConfig & DateConfig) => {
13
+ const { d } = useI18n()
14
+
15
+ return {
16
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:calendar', config?.headerLabel),
17
+ renderBody: (date?: DateLike, options?: { relative?: boolean }) => {
18
+ return renderBodyCell(() => {
19
+ if (date === undefined) {
20
+ return undefined
21
+ }
22
+
23
+ if (options?.relative) {
24
+ return h(VtsRelativeTime, { date })
25
+ }
26
+
27
+ return d(date, {
28
+ dateStyle: config?.dateStyle,
29
+ timeStyle: config?.timeStyle,
30
+ })
31
+ })
32
+ },
33
+ }
34
+ })
@@ -0,0 +1,12 @@
1
+ import type { InfoAccent } from '@core/components/ui/info/UiInfo.vue'
2
+ import UiInfo from '@core/components/ui/info/UiInfo.vue'
3
+ import { defineColumn } from '@core/packages/table/define-column'
4
+ import { renderBodyCell } from '@core/tables/helpers/render-body-cell'
5
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
6
+ import type { HeaderConfig } from '@core/tables/types.ts'
7
+ import { h } from 'vue'
8
+
9
+ export const useInfoColumn = defineColumn((config?: HeaderConfig) => ({
10
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:square-caret-down', config?.headerLabel),
11
+ renderBody: (label: string, accent: InfoAccent) => renderBodyCell(() => h(UiInfo, { accent }, () => label)),
12
+ }))
@@ -0,0 +1,32 @@
1
+ import UiInput, { type InputType } from '@core/components/ui/input/UiInput.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderBodyCell } from '@core/tables/helpers/render-body-cell'
4
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
5
+ import type { HeaderConfig } from '@core/tables/types.ts'
6
+ import { h, toValue, type MaybeRefOrGetter, type Ref } from 'vue'
7
+
8
+ type InputConfig = {
9
+ placeholder?: MaybeRefOrGetter<string | undefined>
10
+ type?: MaybeRefOrGetter<InputType | undefined>
11
+ }
12
+
13
+ export const useInputColumn = defineColumn((config?: HeaderConfig & InputConfig) => ({
14
+ renderHead: () =>
15
+ renderHeadCell(
16
+ config?.headerIcon ?? (config?.type === 'number' ? 'fa:hashtag' : 'fa:align-left'),
17
+ config?.headerLabel
18
+ ),
19
+ renderBody: (model: Ref<string | number>, inputProps?: { disabled?: boolean }) =>
20
+ renderBodyCell(() =>
21
+ h(UiInput, {
22
+ accent: 'brand',
23
+ placeholder: toValue(config?.placeholder),
24
+ type: toValue(config?.type),
25
+ ...inputProps,
26
+ modelValue: toValue(model),
27
+ 'onUpdate:modelValue': (value: string | number) => {
28
+ model.value = value
29
+ },
30
+ })
31
+ ),
32
+ }))
@@ -0,0 +1,14 @@
1
+ import VtsLinkCell, { type VtsLinkCellProps } from '@core/components/table/cells/VtsLinkCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+
7
+ export const useLinkColumn = defineColumn((config?: HeaderConfig) => ({
8
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:a', config?.headerLabel),
9
+ renderBody: (link: { label: string } & VtsLinkCellProps) => {
10
+ const { label, ...linkCellProps } = link
11
+
12
+ return h(VtsLinkCell, linkCellProps, () => label)
13
+ },
14
+ }))
@@ -0,0 +1,9 @@
1
+ import { defineColumn } from '@core/packages/table/define-column'
2
+ import { renderBodyCell } from '@core/tables/helpers/render-body-cell'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+
6
+ export const useLiteralColumn = defineColumn((config?: HeaderConfig) => ({
7
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:square-caret-down', config?.headerLabel),
8
+ renderBody: (value: any) => renderBodyCell(() => value),
9
+ }))
@@ -0,0 +1,10 @@
1
+ import VtsNumberCell from '@core/components/table/cells/VtsNumberCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+
7
+ export const useNumberColumn = defineColumn((headerConfig?: HeaderConfig) => ({
8
+ renderHead: () => renderHeadCell(headerConfig?.headerIcon ?? 'fa:hashtag', headerConfig?.headerLabel),
9
+ renderBody: (number?: number | string, unit?: string) => h(VtsNumberCell, { unit }, () => number),
10
+ }))
@@ -0,0 +1,15 @@
1
+ import VtsNumberCell from '@core/components/table/cells/VtsNumberCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+ import { useI18n } from 'vue-i18n'
7
+
8
+ export const usePercentColumn = defineColumn((headerConfig?: HeaderConfig) => {
9
+ const { n } = useI18n()
10
+
11
+ return {
12
+ renderHead: () => renderHeadCell(headerConfig?.headerIcon ?? 'fa:hashtag', headerConfig?.headerLabel),
13
+ renderBody: (number: number) => h(VtsNumberCell, () => n(number, 'percent')),
14
+ }
15
+ })
@@ -0,0 +1,10 @@
1
+ import VtsProgressBarCell from '@core/components/table/cells/VtsProgressBarCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+
7
+ export const useProgressBarColumn = defineColumn((config?: HeaderConfig) => ({
8
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:hashtag', config?.headerLabel),
9
+ renderBody: (current: number, total: number) => h(VtsProgressBarCell, { current, total }),
10
+ }))
@@ -0,0 +1,12 @@
1
+ import VtsSelect from '@core/components/select/VtsSelect.vue'
2
+ import type { FormSelectId } from '@core/packages/form-select/types.ts'
3
+ import { defineColumn } from '@core/packages/table/define-column.ts'
4
+ import { renderBodyCell } from '@core/tables/helpers/render-body-cell'
5
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
6
+ import type { HeaderConfig } from '@core/tables/types.ts'
7
+ import { h } from 'vue'
8
+
9
+ export const useSelectColumn = defineColumn((config?: HeaderConfig) => ({
10
+ renderHead: () => renderHeadCell(config?.headerIcon, config?.headerLabel),
11
+ renderBody: (id: FormSelectId) => renderBodyCell(() => h(VtsSelect, { accent: 'brand', id })),
12
+ }))
@@ -0,0 +1,8 @@
1
+ import { useButtonIconColumn } from '@core/tables/column-definitions/button-icon-column.ts'
2
+ import type { HeaderConfig } from '@core/tables/types.ts'
3
+
4
+ export const useSelectItemColumn = (config?: HeaderConfig) =>
5
+ useButtonIconColumn({
6
+ buttonIcon: 'fa:eye',
7
+ ...config,
8
+ })
@@ -0,0 +1,16 @@
1
+ import VtsStatusCell, { type StatusCellProps } from '@core/components/table/cells/VtsStatusCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+ import { useI18n } from 'vue-i18n'
7
+
8
+ export const useStatusColumn = defineColumn((config?: HeaderConfig & Omit<StatusCellProps, 'status'>) => {
9
+ const { t } = useI18n()
10
+ const { headerIcon, headerLabel, ...statusCellProps } = config ?? {}
11
+
12
+ return {
13
+ renderHead: () => renderHeadCell(headerIcon ?? 'fa:square-caret-down', headerLabel ?? t('status')),
14
+ renderBody: (status: StatusCellProps['status']) => h(VtsStatusCell, { status, ...statusCellProps }),
15
+ }
16
+ })
@@ -0,0 +1,11 @@
1
+ import VtsTagCell from '@core/components/table/cells/VtsTagCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import type { MaybeArray } from '@core/types/utility.type'
6
+ import { h } from 'vue'
7
+
8
+ export const useTagColumn = defineColumn((config?: HeaderConfig) => ({
9
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:square-caret-down', config?.headerLabel),
10
+ renderBody: (tag: MaybeArray<string>) => h(VtsTagCell, { tag }),
11
+ }))
@@ -0,0 +1,11 @@
1
+ import type { TextCellProps } from '@core/components/table/cells/VtsTextCell.vue'
2
+ import VtsTextCell from '@core/components/table/cells/VtsTextCell.vue'
3
+ import { defineColumn } from '@core/packages/table/define-column.ts'
4
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell.ts'
5
+ import type { HeaderConfig } from '@core/tables/types.ts'
6
+ import { h } from 'vue'
7
+
8
+ export const useTextColumn = defineColumn((config?: HeaderConfig) => ({
9
+ renderHead: () => renderHeadCell(config?.headerIcon, config?.headerLabel),
10
+ renderBody: (content: string, props?: TextCellProps) => h(VtsTextCell, props, () => content),
11
+ }))
@@ -0,0 +1,10 @@
1
+ import VtsTruncatedTextCell from '@core/components/table/cells/VtsTruncatedTextCell.vue'
2
+ import { defineColumn } from '@core/packages/table/define-column.ts'
3
+ import { renderHeadCell } from '@core/tables/helpers/render-head-cell.ts'
4
+ import type { HeaderConfig } from '@core/tables/types.ts'
5
+ import { h } from 'vue'
6
+
7
+ export const useTruncatedTextColumn = defineColumn((config?: HeaderConfig & { limit?: number }) => ({
8
+ renderHead: () => renderHeadCell(config?.headerIcon ?? 'fa:align-left', config?.headerLabel),
9
+ renderBody: (content: string) => h(VtsTruncatedTextCell, { content, limit: config?.limit }),
10
+ }))
@@ -0,0 +1,15 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
3
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
4
+ import { useI18n } from 'vue-i18n'
5
+
6
+ export const useBackupIssueColumns = defineColumns(() => {
7
+ const { t } = useI18n()
8
+
9
+ return {
10
+ job: useLinkColumn({ headerIcon: 'fa:floppy-disk', headerLabel: () => t('job-name') }),
11
+ lastRun: useStatusColumn({ headerIcon: 'fa:square-caret-down', headerLabel: () => t('last') }),
12
+ secondLastRun: useStatusColumn({ headerIcon: 'fa:square-caret-down', headerLabel: () => t('2nd-last') }),
13
+ thirdLastRun: useStatusColumn({ headerIcon: 'fa:square-caret-down', headerLabel: () => t('3rd-last') }),
14
+ }
15
+ })
@@ -0,0 +1,23 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useCollapsedListColumn } from '@core/tables/column-definitions/collapsed-list-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
5
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column.ts'
6
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
7
+ import { useI18n } from 'vue-i18n'
8
+
9
+ export const useBackupJobColumns = defineColumns(() => {
10
+ const { t } = useI18n()
11
+
12
+ return {
13
+ job: useLinkColumn({ headerLabel: t('job-name') }),
14
+ mode: useCollapsedListColumn({ headerLabel: t('mode') }),
15
+ lastRuns: useStatusColumn({
16
+ headerLabel: t('last-n-runs', { n: 3 }),
17
+ iconOnly: true,
18
+ progressiveSize: true,
19
+ }),
20
+ schedules: useNumberColumn({ headerLabel: t('total-schedules') }),
21
+ selectItem: useSelectItemColumn(),
22
+ }
23
+ })
@@ -0,0 +1,21 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
3
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
4
+ import { useTextColumn } from '@core/tables/column-definitions/text-column.ts'
5
+ import { useI18n } from 'vue-i18n'
6
+
7
+ export const useBackupJobScheduleColumns = defineColumns(() => {
8
+ const { t } = useI18n()
9
+
10
+ return {
11
+ schedule: useLinkColumn({ headerLabel: () => t('schedule') }),
12
+ id: useTextColumn({ headerLabel: () => t('id'), headerIcon: 'fa:hashtag' }),
13
+ status: useStatusColumn(),
14
+ cronPattern: useTextColumn({ headerLabel: () => t('cron-pattern'), headerIcon: 'fa:clock' }),
15
+ lastThreeRuns: useStatusColumn({
16
+ headerLabel: () => t('last-n-runs', { n: 3 }),
17
+ iconOnly: true,
18
+ progressiveSize: true,
19
+ }),
20
+ }
21
+ })
@@ -0,0 +1,19 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useDateColumn } from '@core/tables/column-definitions/date-column.ts'
3
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
4
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
5
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
6
+ import { useI18n } from 'vue-i18n'
7
+
8
+ export const useBackupLogsColumns = defineColumns(() => {
9
+ const { t } = useI18n()
10
+
11
+ return {
12
+ startDate: useDateColumn({ headerLabel: () => t('start-date'), dateStyle: 'short', timeStyle: 'medium' }),
13
+ endDate: useDateColumn({ headerLabel: () => t('end-date'), dateStyle: 'short', timeStyle: 'medium' }),
14
+ duration: useNumberColumn({ headerIcon: 'fa:time', headerLabel: () => t('duration') }),
15
+ status: useStatusColumn(),
16
+ transferSize: useNumberColumn({ headerLabel: () => t('transfer-size') }),
17
+ selectItem: useSelectItemColumn(),
18
+ }
19
+ })
@@ -0,0 +1,19 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useAddressColumn } from '@core/tables/column-definitions/address-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
5
+ import { useTagColumn } from '@core/tables/column-definitions/tag-column.ts'
6
+ import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column'
7
+ import { useI18n } from 'vue-i18n'
8
+
9
+ export const useHostColumns = defineColumns(() => {
10
+ const { t } = useI18n()
11
+
12
+ return {
13
+ host: useLinkColumn({ headerLabel: () => t('host') }),
14
+ description: useTruncatedTextColumn({ headerLabel: () => t('description') }),
15
+ ipAddresses: useAddressColumn({ headerLabel: () => t('ip-addresses') }),
16
+ tags: useTagColumn({ headerLabel: () => t('tags') }),
17
+ selectItem: useSelectItemColumn(),
18
+ }
19
+ })
@@ -0,0 +1,22 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
3
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
4
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
5
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
6
+ import { useTextColumn } from '@core/tables/column-definitions/text-column.ts'
7
+ import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column'
8
+ import { useI18n } from 'vue-i18n'
9
+
10
+ export const useNetworkColumns = defineColumns(() => {
11
+ const { t } = useI18n()
12
+
13
+ return {
14
+ network: useLinkColumn({ headerLabel: () => t('name') }),
15
+ description: useTruncatedTextColumn({ headerLabel: () => t('description') }),
16
+ status: useStatusColumn({ headerLabel: () => t('status') }),
17
+ vlan: useNumberColumn({ headerLabel: () => t('vlan') }),
18
+ mtu: useNumberColumn({ headerLabel: () => t('mtu') }),
19
+ defaultLockingMode: useTextColumn({ headerLabel: () => t('default-locking-mode') }),
20
+ selectItem: useSelectItemColumn(),
21
+ }
22
+ })
@@ -0,0 +1,24 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useButtonIconColumn } from '@core/tables/column-definitions/button-icon-column.ts'
3
+ import { useInputColumn } from '@core/tables/column-definitions/input-column.ts'
4
+ import { useSelectColumn } from '@core/tables/column-definitions/select-column.ts'
5
+ import { useI18n } from 'vue-i18n'
6
+
7
+ export const useNewVmNetworkColumns = defineColumns(() => {
8
+ const { t } = useI18n()
9
+
10
+ return {
11
+ interface: useSelectColumn({
12
+ headerLabel: () => t('interfaces'),
13
+ headerIcon: 'fa:network-wired',
14
+ }),
15
+
16
+ mac: useInputColumn({
17
+ headerLabel: () => t('mac-addresses'),
18
+ headerIcon: 'fa:at',
19
+ placeholder: () => t('auto-generated'),
20
+ }),
21
+
22
+ remove: useButtonIconColumn({ buttonIcon: 'fa:trash' }),
23
+ }
24
+ })
@@ -0,0 +1,33 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useButtonIconColumn } from '@core/tables/column-definitions/button-icon-column.ts'
3
+ import { useInputColumn } from '@core/tables/column-definitions/input-column.ts'
4
+ import { useSelectColumn } from '@core/tables/column-definitions/select-column.ts'
5
+ import { useI18n } from 'vue-i18n'
6
+
7
+ export const useNewVmSrColumns = defineColumns(() => {
8
+ const { t } = useI18n()
9
+
10
+ return {
11
+ sr: useSelectColumn({
12
+ headerLabel: () => t('storage-repositories'),
13
+ headerIcon: 'fa:database',
14
+ }),
15
+
16
+ diskName: useInputColumn({
17
+ headerLabel: () => t('disk-name'),
18
+ placeholder: () => t('disk-name'),
19
+ }),
20
+
21
+ size: useInputColumn({
22
+ type: 'number',
23
+ headerLabel: () => `${t('size')} (GB)`,
24
+ }),
25
+
26
+ description: useInputColumn({
27
+ headerLabel: () => t('description'),
28
+ placeholder: () => t('description'),
29
+ }),
30
+
31
+ remove: useButtonIconColumn({ buttonIcon: 'fa:trash' }),
32
+ }
33
+ })
@@ -0,0 +1,13 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
3
+ import { useTextColumn } from '@core/tables/column-definitions/text-column.ts'
4
+ import { useI18n } from 'vue-i18n'
5
+
6
+ export const usePatchColumns = defineColumns(() => {
7
+ const { t } = useI18n()
8
+
9
+ return {
10
+ name: useTextColumn({ headerLabel: () => t('patch-name') }),
11
+ version: useNumberColumn({ headerLabel: () => t('version') }),
12
+ }
13
+ })
@@ -0,0 +1,23 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useAddressColumn } from '@core/tables/column-definitions/address-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
5
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
6
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
7
+ import { useTextColumn } from '@core/tables/column-definitions/text-column.ts'
8
+ import { useI18n } from 'vue-i18n'
9
+
10
+ export const usePifColumns = defineColumns(() => {
11
+ const { t } = useI18n()
12
+
13
+ return {
14
+ network: useLinkColumn({ headerLabel: () => t('network') }),
15
+ device: useTextColumn({ headerLabel: () => t('device') }),
16
+ status: useStatusColumn({ headerLabel: () => t('status') }),
17
+ vlan: useNumberColumn({ headerLabel: () => t('vlan') }),
18
+ ip: useAddressColumn({ headerLabel: () => t('ip-address') }),
19
+ mac: useAddressColumn({ headerLabel: () => t('mac-address') }),
20
+ mode: useTextColumn({ headerLabel: () => t('mode') }),
21
+ selectItem: useSelectItemColumn(),
22
+ }
23
+ })
@@ -0,0 +1,18 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useAddressColumn } from '@core/tables/column-definitions/address-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
5
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
6
+ import { useI18n } from 'vue-i18n'
7
+
8
+ export const useServerColumns = defineColumns(() => {
9
+ const { t } = useI18n()
10
+
11
+ return {
12
+ pool: useLinkColumn({ headerLabel: () => t('pool') }),
13
+ hostIp: useAddressColumn({ headerLabel: () => t('ip-address') }),
14
+ status: useStatusColumn({ headerLabel: () => t('status') }),
15
+ primaryHost: useLinkColumn({ headerLabel: () => t('master'), headerIcon: 'fa:server' }),
16
+ selectItem: useSelectItemColumn(),
17
+ }
18
+ })
@@ -0,0 +1,20 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
3
+ import { useLiteralColumn } from '@core/tables/column-definitions/literal-column.ts'
4
+ import { useProgressBarColumn } from '@core/tables/column-definitions/progress-bar-column.ts'
5
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
6
+ import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column'
7
+ import { useI18n } from 'vue-i18n'
8
+
9
+ export const useSrColumns = defineColumns(() => {
10
+ const { t } = useI18n()
11
+
12
+ return {
13
+ storageRepository: useLinkColumn({ headerLabel: () => t('storage-repository') }),
14
+ description: useTruncatedTextColumn({ headerLabel: () => t('description') }),
15
+ storageFormat: useLiteralColumn({ headerLabel: () => t('storage-format') }),
16
+ accessMode: useLiteralColumn({ headerLabel: () => t('access-mode') }),
17
+ usedSpace: useProgressBarColumn({ headerLabel: () => t('used-space') }),
18
+ selectItem: useSelectItemColumn(),
19
+ }
20
+ })
@@ -0,0 +1,21 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column.ts'
3
+ import { useLiteralColumn } from '@core/tables/column-definitions/literal-column.ts'
4
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
5
+ import { useProgressBarColumn } from '@core/tables/column-definitions/progress-bar-column.ts'
6
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column.ts'
7
+ import { useTruncatedTextColumn } from '@core/tables/column-definitions/truncated-text-column.ts'
8
+ import { useI18n } from 'vue-i18n'
9
+
10
+ export const useVdiColumns = defineColumns(() => {
11
+ const { t } = useI18n()
12
+
13
+ return {
14
+ vdi: useLinkColumn({ headerLabel: () => t('vdis') }),
15
+ description: useTruncatedTextColumn({ headerLabel: () => t('description') }),
16
+ usedSpace: useProgressBarColumn({ headerLabel: () => t('used-space') }),
17
+ size: useNumberColumn({ headerLabel: () => t('size') }),
18
+ format: useLiteralColumn({ headerLabel: () => t('format') }),
19
+ selectItem: useSelectItemColumn(),
20
+ }
21
+ })
@@ -0,0 +1,23 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useAddressColumn } from '@core/tables/column-definitions/address-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
5
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
6
+ import { useStatusColumn } from '@core/tables/column-definitions/status-column.ts'
7
+ import { useTextColumn } from '@core/tables/column-definitions/text-column.ts'
8
+ import { useI18n } from 'vue-i18n'
9
+
10
+ export const useVifColumns = defineColumns(() => {
11
+ const { t } = useI18n()
12
+
13
+ return {
14
+ network: useLinkColumn({ headerLabel: () => t('network') }),
15
+ device: useTextColumn({ headerLabel: () => t('device') }),
16
+ status: useStatusColumn({ headerLabel: () => t('status') }),
17
+ ipsAddresses: useAddressColumn({ headerLabel: () => t('ip-addresses') }),
18
+ macAddresses: useAddressColumn({ headerLabel: () => t('mac-addresses') }),
19
+ mtu: useNumberColumn({ headerLabel: () => t('mtu') }),
20
+ lockingMode: useTextColumn({ headerLabel: () => t('locking-mode') }),
21
+ selectItem: useSelectItemColumn(),
22
+ }
23
+ })
@@ -0,0 +1,21 @@
1
+ import { defineColumns } from '@core/packages/table/define-columns.ts'
2
+ import { useAddressColumn } from '@core/tables/column-definitions/address-column.ts'
3
+ import { useLinkColumn } from '@core/tables/column-definitions/link-column'
4
+ import { useNumberColumn } from '@core/tables/column-definitions/number-column.ts'
5
+ import { useSelectItemColumn } from '@core/tables/column-definitions/select-item-column'
6
+ import { useTagColumn } from '@core/tables/column-definitions/tag-column.ts'
7
+ import { useI18n } from 'vue-i18n'
8
+
9
+ export const useVmColumns = defineColumns(() => {
10
+ const { t } = useI18n()
11
+
12
+ return {
13
+ vm: useLinkColumn({ headerLabel: () => t('vm') }),
14
+ ipAddresses: useAddressColumn({ headerLabel: () => t('ip-addresses') }),
15
+ vcpus: useNumberColumn({ headerLabel: () => t('vcpus') }),
16
+ ram: useNumberColumn({ headerLabel: () => t('ram') }),
17
+ diskSpace: useNumberColumn({ headerLabel: () => t('disk-space') }),
18
+ tags: useTagColumn({ headerLabel: () => t('tags') }),
19
+ selectItem: useSelectItemColumn(),
20
+ }
21
+ })
@@ -0,0 +1,4 @@
1
+ import UiTableCell, { type TableCellAlign } from '@core/components/ui/table-cell/UiTableCell.vue'
2
+ import { h } from 'vue'
3
+
4
+ export const renderBodyCell = (content?: () => any, align?: TableCellAlign) => h(UiTableCell, { align }, content)
@@ -0,0 +1,6 @@
1
+ import VtsHeaderCell from '@core/components/table/cells/VtsHeaderCell.vue'
2
+ import type { IconName } from '@core/icons/index.ts'
3
+ import { h, toValue, type MaybeRefOrGetter } from 'vue'
4
+
5
+ export const renderHeadCell = (icon?: MaybeRefOrGetter<IconName>, label?: MaybeRefOrGetter<string | undefined>) =>
6
+ h(VtsHeaderCell, { icon: toValue(icon) }, () => toValue(label))
@@ -0,0 +1,5 @@
1
+ import UiLoader from '@core/components/ui/loader/UiLoader.vue'
2
+ import UiTableCell from '@core/components/ui/table-cell/UiTableCell.vue'
3
+ import { h } from 'vue'
4
+
5
+ export const renderLoadingCell = () => h(UiTableCell, { align: 'center' }, () => h(UiLoader))