bfg-common 1.5.730 → 1.5.732

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 (110) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  14. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  15. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  16. package/components/common/diagramMain/port/Port.vue +580 -580
  17. package/components/common/layout/console/Console.vue +70 -70
  18. package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
  19. package/components/common/pages/backups/DetailView.vue +52 -52
  20. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  21. package/components/common/pages/backups/modals/Modals.vue +243 -243
  22. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  23. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  24. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  25. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  26. package/components/common/pages/backups/modals/restore/Restore.vue +289 -289
  27. package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +85 -85
  28. package/components/common/pages/backups/modals/restore/lib/config/steps.ts +121 -121
  29. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  30. package/components/common/pages/backups/modals/restore/types/New.vue +95 -95
  31. package/components/common/pages/backups/modals/restore/types/Old.vue +62 -62
  32. package/components/common/pages/backups/modals/restore/types/Types.vue +31 -31
  33. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  34. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  35. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  36. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  37. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  38. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  39. package/components/common/pages/tasks/Tasks.vue +125 -125
  40. package/components/common/pages/tasks/table/Table.vue +373 -373
  41. package/components/common/pages/tasks/table/lib/config/config.ts +279 -279
  42. package/components/common/pages/tasks/table/lib/models/interfaces.ts +9 -9
  43. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  44. package/components/common/select/radio/RadioGroup.vue +137 -137
  45. package/components/common/spiceConsole/Drawer.vue +420 -420
  46. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  47. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  48. package/components/common/tools/Actions.vue +207 -207
  49. package/components/common/treeView/TreeView.vue +52 -52
  50. package/components/common/vm/actions/clone/lib/config/steps.ts +295 -295
  51. package/components/common/vm/actions/clone/new/New.vue +438 -438
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
  54. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
  55. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  56. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  57. package/components/common/vm/actions/common/select/options/New.vue +264 -264
  58. package/components/common/vm/actions/common/select/options/Options.vue +58 -58
  59. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  60. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
  61. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  62. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  63. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  64. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  65. package/components/common/vm/snapshots/DetailView.vue +90 -0
  66. package/components/common/vm/snapshots/Old.vue +71 -0
  67. package/components/common/vm/snapshots/Snapshots.vue +82 -0
  68. package/components/common/vm/snapshots/lib/models/types.ts +8 -0
  69. package/components/common/vm/snapshots/new/New.vue +389 -0
  70. package/components/common/vm/snapshots/new/contextMenuView/ContextMenuView.vue +96 -0
  71. package/components/common/vm/snapshots/new/contextMenuView/lib/config/contextMenuItems.ts +34 -0
  72. package/components/common/vm/snapshots/new/lib/models/interfaces.ts +12 -0
  73. package/components/common/vm/snapshots/new/lib/utils/contextMenu.ts +29 -0
  74. package/components/common/vm/snapshots/new/lib/utils/details.ts +48 -0
  75. package/components/common/vm/snapshots/tools/Tools.vue +56 -0
  76. package/components/common/vm/snapshots/tools/lib/config/tabsPannel.ts +39 -0
  77. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  78. package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
  79. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  80. package/components/common/wizards/common/steps/name/New.vue +221 -221
  81. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  82. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  83. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  84. package/components/common/wizards/datastore/add/Add.vue +228 -228
  85. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  86. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  87. package/composables/useAppVersion.ts +21 -21
  88. package/composables/useBrowse.ts +24 -24
  89. package/composables/useLocal.ts +6 -6
  90. package/composables/useLocalCommon.ts +39 -39
  91. package/lib/models/types.ts +59 -59
  92. package/package.json +1 -1
  93. package/plugins/console.ts +21 -21
  94. package/plugins/mouse.ts +21 -21
  95. package/plugins/panelStates.ts +70 -70
  96. package/plugins/text.ts +59 -59
  97. package/public/spice-console/application/clientgui.js +854 -854
  98. package/public/spice-console/application/packetfactory.js +211 -211
  99. package/public/spice-console/application/virtualmouse.js +147 -147
  100. package/public/spice-console/lib/images/bitmap.js +203 -203
  101. package/public/spice-console/network/spicechannel.js +440 -440
  102. package/public/spice-console/process/cursorprocess.js +128 -128
  103. package/public/spice-console/process/inputprocess.js +227 -227
  104. package/public/spice-console/process/mainprocess.js +212 -212
  105. package/public/spice-console/run.js +210 -210
  106. package/store/inventory/modules/snapshots/lib/models/interfaces.ts +40 -0
  107. package/store/main/mutations.ts +7 -7
  108. package/store/main/state.ts +7 -7
  109. package/store/tasks/mappers/recentTasks.ts +123 -123
  110. package/store/tasks/mutations.ts +82 -82
@@ -1,85 +1,85 @@
1
- import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
2
- import type { UI_I_Localization } from '~/lib/models/interfaces'
3
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
4
- import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
5
-
6
- const getDisks = (
7
- model: UI_I_RestoreForm,
8
- localization: UI_I_Localization
9
- ): UI_I_TableInfoItem[] => {
10
- const result: UI_I_TableInfoItem[] = []
11
-
12
- model.pvm.disk_devices.forEach((disk_device, i) => {
13
- if (!disk_device.source) return
14
-
15
- result.push({
16
- label: `${localization.common.disk} ${i}`,
17
- value: disk_device.source,
18
- iconClassName: 'icon-vSphere-dsVmDisk',
19
- })
20
- })
21
-
22
- return result
23
- }
24
-
25
- export const readyToCompleteOptions = (
26
- model: UI_I_RestoreForm,
27
- localization: UI_I_Localization,
28
- selectedStorageName: string
29
- ): UI_I_TableInfoItem[] => {
30
- const result: UI_I_TableInfoItem[] = []
31
-
32
- switch (model.restore_code) {
33
- case restoreCodes.diskOnly:
34
- result.push({
35
- label: localization.common.backup,
36
- value: model.backup,
37
- iconClassName: 'icon-backup',
38
- })
39
- // Disks
40
- result.push(...getDisks(model, localization))
41
- break
42
- case restoreCodes.existing:
43
- result.push({
44
- label: localization.common.backup,
45
- value: model.backup,
46
- iconClassName: 'icon-backup',
47
- })
48
- break
49
- case restoreCodes.asNew:
50
- case restoreCodes.asNewAndCopy:
51
- result.push({
52
- label: localization.common.vmName,
53
- value: model.pvm.name,
54
- iconClassName: 'vsphere-icon-vm',
55
- })
56
-
57
- // Datastores
58
- result.push({
59
- label: localization.common.datastore,
60
- value: selectedStorageName,
61
- iconClassName: 'vsphere-icon-datastore',
62
- })
63
-
64
- // Disks
65
- result.push(...getDisks(model, localization))
66
-
67
- // Networks
68
- model.pvm.network_devices.forEach((network) => {
69
- result.push({
70
- label: localization.common.network,
71
- value: network.network,
72
- iconClassName: 'vsphere-icon-network',
73
- })
74
- })
75
- break
76
- // case 1:
77
- // result.push({
78
- // label: localization.value.common.vmName,
79
- // value: model.value.pvm.name,
80
- // })
81
- // break
82
- }
83
-
84
- return result
85
- }
1
+ import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
4
+ import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
5
+
6
+ const getDisks = (
7
+ model: UI_I_RestoreForm,
8
+ localization: UI_I_Localization
9
+ ): UI_I_TableInfoItem[] => {
10
+ const result: UI_I_TableInfoItem[] = []
11
+
12
+ model.pvm.disk_devices.forEach((disk_device, i) => {
13
+ if (!disk_device.source) return
14
+
15
+ result.push({
16
+ label: `${localization.common.disk} ${i}`,
17
+ value: disk_device.source,
18
+ iconClassName: 'icon-vSphere-dsVmDisk',
19
+ })
20
+ })
21
+
22
+ return result
23
+ }
24
+
25
+ export const readyToCompleteOptions = (
26
+ model: UI_I_RestoreForm,
27
+ localization: UI_I_Localization,
28
+ selectedStorageName: string
29
+ ): UI_I_TableInfoItem[] => {
30
+ const result: UI_I_TableInfoItem[] = []
31
+
32
+ switch (model.restore_code) {
33
+ case restoreCodes.diskOnly:
34
+ result.push({
35
+ label: localization.common.backup,
36
+ value: model.backup,
37
+ iconClassName: 'icon-backup',
38
+ })
39
+ // Disks
40
+ result.push(...getDisks(model, localization))
41
+ break
42
+ case restoreCodes.existing:
43
+ result.push({
44
+ label: localization.common.backup,
45
+ value: model.backup,
46
+ iconClassName: 'icon-backup',
47
+ })
48
+ break
49
+ case restoreCodes.asNew:
50
+ case restoreCodes.asNewAndCopy:
51
+ result.push({
52
+ label: localization.common.vmName,
53
+ value: model.pvm.name,
54
+ iconClassName: 'vsphere-icon-vm',
55
+ })
56
+
57
+ // Datastores
58
+ result.push({
59
+ label: localization.common.datastore,
60
+ value: selectedStorageName,
61
+ iconClassName: 'vsphere-icon-datastore',
62
+ })
63
+
64
+ // Disks
65
+ result.push(...getDisks(model, localization))
66
+
67
+ // Networks
68
+ model.pvm.network_devices.forEach((network) => {
69
+ result.push({
70
+ label: localization.common.network,
71
+ value: network.network,
72
+ iconClassName: 'vsphere-icon-network',
73
+ })
74
+ })
75
+ break
76
+ // case 1:
77
+ // result.push({
78
+ // label: localization.value.common.vmName,
79
+ // value: model.value.pvm.name,
80
+ // })
81
+ // break
82
+ }
83
+
84
+ return result
85
+ }
@@ -1,121 +1,121 @@
1
- import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
2
- import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
3
- import type { UI_I_Localization } from '~/lib/models/interfaces'
4
-
5
- export const dynamicSteps = {
6
- selectType: 0,
7
- selectName: 1,
8
- selectStorage: 2,
9
- selectDisks: 3,
10
- selectNetwork: 4,
11
- readyComplete: 5,
12
- }
13
-
14
- export const stepsFunc = (
15
- localization: UI_I_Localization
16
- ): UI_I_WizardStep[] => {
17
- return [
18
- {
19
- id: dynamicSteps.selectType,
20
- stepName: '',
21
- title: localization.backup.selectType,
22
- subTitle: '',
23
- status: UI_E_WIZARD_STATUS.SELECTED,
24
- isValid: true,
25
- fields: {},
26
- testId: 'backup-restore-type',
27
- },
28
- {
29
- id: dynamicSteps.selectName,
30
- stepName: '',
31
- title: localization.common.selectName,
32
- subTitle: 'Specify a unique name for the virtual machine.',
33
- status: UI_E_WIZARD_STATUS.INACTIVE,
34
- isValid: true,
35
- testId: 'backup-restore-select-name',
36
- fields: {
37
- name: {
38
- field: '',
39
- alert: '',
40
- },
41
- },
42
- },
43
- {
44
- id: dynamicSteps.selectStorage,
45
- stepName: '',
46
- title: localization.common.selectStorage,
47
- subTitle: 'Select a storage for the configuration and disk files.',
48
- status: UI_E_WIZARD_STATUS.INACTIVE,
49
- isValid: true,
50
- testId: 'backup-restore-select-storage',
51
- fields: {
52
- storage: {
53
- field: '',
54
- alert: '',
55
- },
56
- },
57
- },
58
- {
59
- id: dynamicSteps.selectDisks,
60
- stepName: '',
61
- title: localization.common.selectDisks,
62
- subTitle: localization.common.selectDisksInvolvedBackup,
63
- status: UI_E_WIZARD_STATUS.INACTIVE,
64
- isValid: true,
65
- fields: {
66
- disk_devices: {
67
- field: '',
68
- alert: '',
69
- },
70
- },
71
- testId: 'backup-restore-select--disks',
72
- },
73
- {
74
- id: dynamicSteps.selectNetwork,
75
- stepName: '',
76
- title: localization.common.selectNetwork,
77
- subTitle: 'Select adapter types and networks in Procurator.',
78
- status: UI_E_WIZARD_STATUS.INACTIVE,
79
- isValid: true,
80
- testId: 'backup-restore-select-network',
81
- fields: {},
82
- },
83
- {
84
- id: dynamicSteps.readyComplete,
85
- stepName: '',
86
- title: localization.common.readyComplete,
87
- subTitle: localization.backup.restoreBackupReviewSubtitle,
88
- status: UI_E_WIZARD_STATUS.INACTIVE,
89
- isValid: true,
90
- testId: 'backup-restore-ready-complete',
91
- fields: {},
92
- },
93
- ]
94
- }
95
-
96
- export const stepsSchemeInitial = [
97
- // [0, 1, 5], // disk only
98
- [
99
- dynamicSteps.selectType,
100
- dynamicSteps.selectDisks,
101
- dynamicSteps.readyComplete,
102
- ], // disk only
103
- // [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
104
- [dynamicSteps.selectType, dynamicSteps.readyComplete], // existing
105
- [
106
- dynamicSteps.selectType,
107
- dynamicSteps.selectName,
108
- dynamicSteps.selectStorage,
109
- dynamicSteps.selectDisks,
110
- dynamicSteps.selectNetwork,
111
- dynamicSteps.readyComplete,
112
- ], // as new
113
- [
114
- dynamicSteps.selectType,
115
- dynamicSteps.selectName,
116
- dynamicSteps.selectStorage,
117
- dynamicSteps.selectDisks,
118
- dynamicSteps.selectNetwork,
119
- dynamicSteps.readyComplete,
120
- ], // as new and copy other disks (like as new)
121
- ]
1
+ import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
2
+ import { UI_E_WIZARD_STATUS } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/enums'
3
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
4
+
5
+ export const dynamicSteps = {
6
+ selectType: 0,
7
+ selectName: 1,
8
+ selectStorage: 2,
9
+ selectDisks: 3,
10
+ selectNetwork: 4,
11
+ readyComplete: 5,
12
+ }
13
+
14
+ export const stepsFunc = (
15
+ localization: UI_I_Localization
16
+ ): UI_I_WizardStep[] => {
17
+ return [
18
+ {
19
+ id: dynamicSteps.selectType,
20
+ stepName: '',
21
+ title: localization.backup.selectType,
22
+ subTitle: '',
23
+ status: UI_E_WIZARD_STATUS.SELECTED,
24
+ isValid: true,
25
+ fields: {},
26
+ testId: 'backup-restore-type',
27
+ },
28
+ {
29
+ id: dynamicSteps.selectName,
30
+ stepName: '',
31
+ title: localization.common.selectName,
32
+ subTitle: 'Specify a unique name for the virtual machine.',
33
+ status: UI_E_WIZARD_STATUS.INACTIVE,
34
+ isValid: true,
35
+ testId: 'backup-restore-select-name',
36
+ fields: {
37
+ name: {
38
+ field: '',
39
+ alert: '',
40
+ },
41
+ },
42
+ },
43
+ {
44
+ id: dynamicSteps.selectStorage,
45
+ stepName: '',
46
+ title: localization.common.selectStorage,
47
+ subTitle: 'Select a storage for the configuration and disk files.',
48
+ status: UI_E_WIZARD_STATUS.INACTIVE,
49
+ isValid: true,
50
+ testId: 'backup-restore-select-storage',
51
+ fields: {
52
+ storage: {
53
+ field: '',
54
+ alert: '',
55
+ },
56
+ },
57
+ },
58
+ {
59
+ id: dynamicSteps.selectDisks,
60
+ stepName: '',
61
+ title: localization.common.selectDisks,
62
+ subTitle: localization.common.selectDisksInvolvedBackup,
63
+ status: UI_E_WIZARD_STATUS.INACTIVE,
64
+ isValid: true,
65
+ fields: {
66
+ disk_devices: {
67
+ field: '',
68
+ alert: '',
69
+ },
70
+ },
71
+ testId: 'backup-restore-select--disks',
72
+ },
73
+ {
74
+ id: dynamicSteps.selectNetwork,
75
+ stepName: '',
76
+ title: localization.common.selectNetwork,
77
+ subTitle: 'Select adapter types and networks in Procurator.',
78
+ status: UI_E_WIZARD_STATUS.INACTIVE,
79
+ isValid: true,
80
+ testId: 'backup-restore-select-network',
81
+ fields: {},
82
+ },
83
+ {
84
+ id: dynamicSteps.readyComplete,
85
+ stepName: '',
86
+ title: localization.common.readyComplete,
87
+ subTitle: localization.backup.restoreBackupReviewSubtitle,
88
+ status: UI_E_WIZARD_STATUS.INACTIVE,
89
+ isValid: true,
90
+ testId: 'backup-restore-ready-complete',
91
+ fields: {},
92
+ },
93
+ ]
94
+ }
95
+
96
+ export const stepsSchemeInitial = [
97
+ // [0, 1, 5], // disk only
98
+ [
99
+ dynamicSteps.selectType,
100
+ dynamicSteps.selectDisks,
101
+ dynamicSteps.readyComplete,
102
+ ], // disk only
103
+ // [dynamicSteps.selectType, dynamicSteps.readyComplete], // disk only
104
+ [dynamicSteps.selectType, dynamicSteps.readyComplete], // existing
105
+ [
106
+ dynamicSteps.selectType,
107
+ dynamicSteps.selectName,
108
+ dynamicSteps.selectStorage,
109
+ dynamicSteps.selectDisks,
110
+ dynamicSteps.selectNetwork,
111
+ dynamicSteps.readyComplete,
112
+ ], // as new
113
+ [
114
+ dynamicSteps.selectType,
115
+ dynamicSteps.selectName,
116
+ dynamicSteps.selectStorage,
117
+ dynamicSteps.selectDisks,
118
+ dynamicSteps.selectNetwork,
119
+ dynamicSteps.readyComplete,
120
+ ], // as new and copy other disks (like as new)
121
+ ]
@@ -1,6 +1,6 @@
1
- import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
2
-
3
- export interface UI_I_NameCheck {
4
- name: string
5
- cb: (error: API_UI_I_Error) => void
6
- }
1
+ import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
2
+
3
+ export interface UI_I_NameCheck {
4
+ name: string
5
+ cb: (error: API_UI_I_Error) => void
6
+ }
@@ -1,95 +1,95 @@
1
- <template>
2
- <section class="datastore-type">
3
- <div class="datastore-type__radio-container flex flex-col gap-3">
4
- <ui-radio
5
- v-for="(option, key) in props.backupTypes"
6
- :key="key"
7
- v-model="model.restore_code"
8
- :label="option.text"
9
- :test-id="option.testId"
10
- :value="option.value"
11
- size="md"
12
- >
13
- <template #description>
14
- <span class="datastore-type__radio-description">
15
- {{ optionsDescription[option.value - 1] }}
16
- </span>
17
- </template>
18
- </ui-radio>
19
- </div>
20
- </section>
21
- </template>
22
-
23
- <script lang="ts" setup>
24
- import type { UI_I_Localization } from '~/lib/models/interfaces'
25
- import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
26
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
27
-
28
- const model = defineModel<UI_I_RestoreForm>({ required: true })
29
-
30
- const props = defineProps<{
31
- backupTypes: UI_I_OptionItem[]
32
- }>()
33
-
34
- const localization = computed<UI_I_Localization>(() => useLocal())
35
-
36
- const optionsDescription = ref<string[]>([
37
- localization.value.common.restoreDiskOnlyDescription,
38
- localization.value.common.restoreExistingDescription,
39
- localization.value.common.restoreAsNewDescription,
40
- localization.value.common.restoreAsNewAndCopyDescription,
41
- ])
42
- </script>
43
-
44
- <style lang="scss" scoped>
45
- @import 'assets/scss/common/mixins.scss';
46
-
47
- .datastore-type {
48
- container-type: inline-size;
49
- margin-top: 16px;
50
-
51
- &__radio {
52
- &-description {
53
- color: #9da6ad;
54
- line-height: 18px;
55
- }
56
-
57
- &-container {
58
- :deep(.radio-label__text) {
59
- padding-top: 1px;
60
- }
61
- }
62
- }
63
-
64
- :deep(input[type='radio']) {
65
- & ~ .radio-label {
66
- width: 100%;
67
- height: 100%;
68
- background-color: var(--select-bg);
69
- border-radius: 8px;
70
- padding: 12px;
71
- box-shadow: inset 0 0 0 1px var(--line-color);
72
- transition: box-shadow 0.1s ease-in-out;
73
- }
74
-
75
- &:not(:checked) {
76
- & ~ .radio-label:hover {
77
- box-shadow: inset 0 0 0 1px var(--select-border);
78
- }
79
- }
80
-
81
- &:checked {
82
- & ~ .radio-label {
83
- background-color: var(--radio-btn-active-label-bg-color);
84
- box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
85
- }
86
- }
87
- }
88
- }
89
-
90
- @container (max-width:600px) {
91
- .datastore-type__radio-container {
92
- grid-template-columns: 1fr;
93
- }
94
- }
95
- </style>
1
+ <template>
2
+ <section class="datastore-type">
3
+ <div class="datastore-type__radio-container flex flex-col gap-3">
4
+ <ui-radio
5
+ v-for="(option, key) in props.backupTypes"
6
+ :key="key"
7
+ v-model="model.restore_code"
8
+ :label="option.text"
9
+ :test-id="option.testId"
10
+ :value="option.value"
11
+ size="md"
12
+ >
13
+ <template #description>
14
+ <span class="datastore-type__radio-description">
15
+ {{ optionsDescription[option.value - 1] }}
16
+ </span>
17
+ </template>
18
+ </ui-radio>
19
+ </div>
20
+ </section>
21
+ </template>
22
+
23
+ <script lang="ts" setup>
24
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
25
+ import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
26
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
27
+
28
+ const model = defineModel<UI_I_RestoreForm>({ required: true })
29
+
30
+ const props = defineProps<{
31
+ backupTypes: UI_I_OptionItem[]
32
+ }>()
33
+
34
+ const localization = computed<UI_I_Localization>(() => useLocal())
35
+
36
+ const optionsDescription = ref<string[]>([
37
+ localization.value.common.restoreDiskOnlyDescription,
38
+ localization.value.common.restoreExistingDescription,
39
+ localization.value.common.restoreAsNewDescription,
40
+ localization.value.common.restoreAsNewAndCopyDescription,
41
+ ])
42
+ </script>
43
+
44
+ <style lang="scss" scoped>
45
+ @import 'assets/scss/common/mixins.scss';
46
+
47
+ .datastore-type {
48
+ container-type: inline-size;
49
+ margin-top: 16px;
50
+
51
+ &__radio {
52
+ &-description {
53
+ color: #9da6ad;
54
+ line-height: 18px;
55
+ }
56
+
57
+ &-container {
58
+ :deep(.radio-label__text) {
59
+ padding-top: 1px;
60
+ }
61
+ }
62
+ }
63
+
64
+ :deep(input[type='radio']) {
65
+ & ~ .radio-label {
66
+ width: 100%;
67
+ height: 100%;
68
+ background-color: var(--select-bg);
69
+ border-radius: 8px;
70
+ padding: 12px;
71
+ box-shadow: inset 0 0 0 1px var(--line-color);
72
+ transition: box-shadow 0.1s ease-in-out;
73
+ }
74
+
75
+ &:not(:checked) {
76
+ & ~ .radio-label:hover {
77
+ box-shadow: inset 0 0 0 1px var(--select-border);
78
+ }
79
+ }
80
+
81
+ &:checked {
82
+ & ~ .radio-label {
83
+ background-color: var(--radio-btn-active-label-bg-color);
84
+ box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ @container (max-width:600px) {
91
+ .datastore-type__radio-container {
92
+ grid-template-columns: 1fr;
93
+ }
94
+ }
95
+ </style>