bfg-common 1.5.237 → 1.5.238

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 (146) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/components/atoms/TheIcon3.vue +50 -50
  3. package/components/atoms/perPage/PerPage.vue +58 -58
  4. package/components/atoms/stack/StackBlock.vue +185 -185
  5. package/components/atoms/table/dataGrid/DataGrid.vue +1717 -1717
  6. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  7. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  8. package/components/atoms/table/info/lib/models/interfaces.ts +10 -10
  9. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  10. package/components/common/backup/storage/actions/add/Add.vue +247 -247
  11. package/components/common/backup/storage/actions/add/New.vue +281 -281
  12. package/components/common/backup/storage/actions/add/Old.vue +114 -114
  13. package/components/common/backup/storage/actions/add/lib/config/steps.ts +168 -168
  14. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue +41 -41
  15. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureNew.vue +294 -294
  16. package/components/common/backup/storage/actions/add/steps/readyComplete/ReadyComplete.vue +45 -45
  17. package/components/common/backup/storage/actions/add/steps/readyComplete/lib/config/propertiesDetails.ts +242 -242
  18. package/components/common/backup/storage/actions/delete/Delete.vue +65 -65
  19. package/components/common/browse/BrowseNew.vue +1 -7
  20. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  21. package/components/common/context/lib/models/interfaces.ts +31 -31
  22. package/components/common/diagramMain/DiagramMain.vue +897 -897
  23. package/components/common/diagramMain/Header.vue +214 -214
  24. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  25. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  26. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  27. package/components/common/pages/home/headline/Headline.vue +45 -45
  28. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  29. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  30. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  31. package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
  32. package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
  33. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  34. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  35. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  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/packages/Packages.vue +208 -208
  39. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  40. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  41. package/components/common/recursionTree/RecursionTree.vue +223 -223
  42. package/components/common/select/button/ButtonDropdown.vue +108 -108
  43. package/components/common/spiceConsole/Drawer.vue +377 -377
  44. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  45. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  46. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  47. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  48. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  49. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  50. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +1 -1
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +7 -7
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +319 -319
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +0 -1
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +190 -194
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/ModelNew.vue +237 -242
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/SharesNew.vue +1 -6
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +307 -307
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +154 -158
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/hotPlug/HotPlugNew.vue +2 -8
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +382 -382
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +0 -1
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/file/FileNew.vue +3 -8
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +151 -151
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationNew.vue +73 -73
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +83 -83
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSizeNew.vue +4 -8
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/ProvisioningNew.vue +1 -6
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +1 -6
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +1 -1
  82. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  83. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  84. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  85. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  86. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  87. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  88. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  89. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  90. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  91. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  92. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  93. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +0 -1
  94. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  95. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +30 -36
  96. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevicesNew.vue +40 -40
  97. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +2 -5
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +81 -85
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  103. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +67 -71
  104. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +149 -150
  105. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -146
  106. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +31 -31
  107. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +31 -31
  108. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  109. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  110. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +128 -128
  111. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  112. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +39 -39
  113. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  114. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +1 -5
  115. package/components/common/vm/actions/common/lib/utils/capabilities.ts +52 -52
  116. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  117. package/components/common/vm/actions/common/select/computeResource/treeView/New.vue +44 -44
  118. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +118 -118
  119. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  120. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  121. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  122. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  123. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  124. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  125. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  126. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  127. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  128. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  129. package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +137 -137
  130. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  131. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  132. package/composables/productNameLocal.ts +30 -30
  133. package/composables/useAppVersion.ts +21 -21
  134. package/package.json +2 -2
  135. package/plugins/date.ts +233 -233
  136. package/plugins/helpers.ts +18 -0
  137. package/plugins/number.ts +18 -0
  138. package/plugins/panelStates.ts +70 -0
  139. package/plugins/text.ts +59 -48
  140. package/plugins/time.ts +17 -0
  141. package/public/spice-console/lib/images/bitmap.js +203 -203
  142. package/public/spice-console/network/spicechannel.js +387 -387
  143. package/store/main/mutations.ts +7 -7
  144. package/store/main/state.ts +7 -7
  145. package/store/tasks/mappers/recentTasks.ts +64 -64
  146. /package/{components/common/split/horizontal/lib/models → lib/models/plugins/panelStates}/interfaces.ts +0 -0
@@ -4,7 +4,6 @@
4
4
  :is-roll-back="props.type === 'removed'"
5
5
  :removable="props.isRemovable"
6
6
  :test-id="`hard-disk-stack-block-${props.index}`"
7
- is-toggle-on-stack-view-key
8
7
  @remove="emits('remove')"
9
8
  @roll-back="emits('roll-back')"
10
9
  >
@@ -1,9 +1,7 @@
1
1
  <template>
2
2
  <ui-stack-block :has-children="false">
3
3
  <template #stackBlockKey>
4
- <span class="limit-title">
5
- {{ localization.common.diskFile }}
6
- </span>
4
+ {{ localization.common.diskFile }}
7
5
  </template>
8
6
  <template #stackBlockContent>
9
7
  <span class="file-path"> {{ props.path }} </span>
@@ -23,16 +21,13 @@ const props = defineProps<{
23
21
 
24
22
  <style>
25
23
  :root {
26
- --vm-wizard-file-path-color: #182531;
24
+ --vm-wizard-file-path-color: #182531
27
25
  }
28
26
  :root.dark-theme {
29
- --vm-wizard-file-path-color: #e9eaec;
27
+ --vm-wizard-file-path-color: #e9eaec
30
28
  }
31
29
  </style>
32
30
  <style scoped>
33
- .limit-title {
34
- margin-right: 12px;
35
- }
36
31
  .file-path {
37
32
  font-size: 13px;
38
33
  color: var(--vm-wizard-file-path-color);
@@ -1,151 +1,151 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-new
3
- v-if="isNewView"
4
- v-model:selected-location="selectedLocation"
5
- :index="props.index"
6
- :datastore="props.datastore"
7
- :get-datastore-table-func="props.getDatastoreTableFunc"
8
- :api-error="apiError"
9
- :location-options="locationOptions"
10
- :storage-modal-is-show="storageModalIsShow"
11
- :storage-submit="storageSubmit"
12
- @change-location="onChangeLocation"
13
- @change-storage="onChangeStorage"
14
- @hide-storage-modal="onHideStorageModal"
15
- @submit-storage-modal="onSubmitStorageModal"
16
- @remove-validation-error="onRemoveValidationError"
17
- />
18
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-old
19
- v-else
20
- v-model:selected-location="selectedLocation"
21
- :index="props.index"
22
- :datastore="props.datastore"
23
- :get-datastore-table-func="props.getDatastoreTableFunc"
24
- :api-error="apiError"
25
- :location-options="locationOptions"
26
- :storage-modal-is-show="storageModalIsShow"
27
- :storage-submit="storageSubmit"
28
- @change-location="onChangeLocation"
29
- @change-storage="onChangeStorage"
30
- @hide-storage-modal="onHideStorageModal"
31
- @submit-storage-modal="onSubmitStorageModal"
32
- @remove-validation-error="onRemoveValidationError"
33
- />
34
- </template>
35
-
36
- <script setup lang="ts">
37
- import type {
38
- UI_I_HTMLSelectElement,
39
- UI_I_Localization,
40
- } from '~/lib/models/interfaces'
41
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
42
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
43
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
44
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
45
-
46
- const props = defineProps<{
47
- location: UI_I_DatastoreTableItem | null
48
- index: number
49
- errorValidationFields: UI_I_ErrorValidationField[]
50
- datastore: UI_I_DatastoreTableItem[]
51
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
52
- }>()
53
- const emits = defineEmits<{
54
- (event: 'change', value: UI_I_DatastoreTableItem): void
55
- (event: 'remove-error-by-title', value: string): void
56
- }>()
57
-
58
- const { $store }: any = useNuxtApp()
59
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
60
-
61
- const localization = computed<UI_I_Localization>(() => useLocal())
62
-
63
- const selectedLocation = ref<string>(props.location?.id || '')
64
-
65
- const storages = ref<UI_I_DatastoreTableItem[]>([])
66
- const addStorage = (storage: UI_I_DatastoreTableItem): void => {
67
- const hasStorage = storages.value.some((item) => item.id === storage.id)
68
- if (hasStorage) {
69
- return
70
- }
71
-
72
- storages.value.push(storage)
73
- }
74
- const locationOptions = ref<UI_I_OptionItem[]>([])
75
-
76
- watch(
77
- () => props.location,
78
- (newValue) => {
79
- if (locationOptions.value.length || !newValue) {
80
- return
81
- }
82
-
83
- locationOptions.value = [
84
- {
85
- text: localization.value.common.storeWithVirtualMachine,
86
- value: newValue.id,
87
- },
88
- { text: `${localization.value.common.browse}...`, value: -1 },
89
- ]
90
- selectedLocation.value = newValue.id
91
- storages.value.push(newValue)
92
- addStorage(newValue)
93
- },
94
- { immediate: true }
95
- )
96
-
97
- const storageSubmit = ref<null | Function>(null)
98
- const onSubmitStorageModal = (): void => {
99
- storageSubmit.value = (_isValid: boolean): void => {
100
- storageSubmit.value = null
101
- }
102
- }
103
- const storageModalIsShow = ref<boolean>(false)
104
- const onHideStorageModal = (): void => {
105
- storageModalIsShow.value = false
106
- if (selectedLocation.value === -1)
107
- selectedLocation.value = locationOptions.value[0].value
108
- }
109
- const onChangeStorage = (storage: UI_I_DatastoreTableItem): void => {
110
- locationOptions.value = [
111
- locationOptions.value[0],
112
- { text: storage.name, value: storage.id },
113
- // @ts-ignore
114
- locationOptions.value.at(-1),
115
- ]
116
-
117
- selectedLocation.value = storage.id
118
- emits('change', storage)
119
- addStorage(storage)
120
- onHideStorageModal()
121
- }
122
- const onChangeLocation = (event: UI_I_HTMLSelectElement): void => {
123
- const value = +event.target.value
124
- if (value === -1) {
125
- storageModalIsShow.value = true
126
- return
127
- }
128
-
129
- selectedLocation.value = event.target.value
130
- const storage = storages.value.find((item) => item.id === event.target.value)
131
- storage && emits('change', storage)
132
- }
133
-
134
- const typeError = computed<string>(
135
- () => `disk_devices[${props.index}].location`
136
- )
137
-
138
- const apiError = computed<string>(() => {
139
- return (
140
- props.errorValidationFields?.find(
141
- (message) => message.field === typeError.value
142
- )?.error_message || ''
143
- )
144
- })
145
-
146
- const onRemoveValidationError = (): void => {
147
- emits('remove-error-by-title', typeError.value)
148
- }
149
- </script>
150
-
151
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-new
3
+ v-if="isNewView"
4
+ v-model:selected-location="selectedLocation"
5
+ :index="props.index"
6
+ :datastore="props.datastore"
7
+ :get-datastore-table-func="props.getDatastoreTableFunc"
8
+ :api-error="apiError"
9
+ :location-options="locationOptions"
10
+ :storage-modal-is-show="storageModalIsShow"
11
+ :storage-submit="storageSubmit"
12
+ @change-location="onChangeLocation"
13
+ @change-storage="onChangeStorage"
14
+ @hide-storage-modal="onHideStorageModal"
15
+ @submit-storage-modal="onSubmitStorageModal"
16
+ @remove-validation-error="onRemoveValidationError"
17
+ />
18
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-old
19
+ v-else
20
+ v-model:selected-location="selectedLocation"
21
+ :index="props.index"
22
+ :datastore="props.datastore"
23
+ :get-datastore-table-func="props.getDatastoreTableFunc"
24
+ :api-error="apiError"
25
+ :location-options="locationOptions"
26
+ :storage-modal-is-show="storageModalIsShow"
27
+ :storage-submit="storageSubmit"
28
+ @change-location="onChangeLocation"
29
+ @change-storage="onChangeStorage"
30
+ @hide-storage-modal="onHideStorageModal"
31
+ @submit-storage-modal="onSubmitStorageModal"
32
+ @remove-validation-error="onRemoveValidationError"
33
+ />
34
+ </template>
35
+
36
+ <script setup lang="ts">
37
+ import type {
38
+ UI_I_HTMLSelectElement,
39
+ UI_I_Localization,
40
+ } from '~/lib/models/interfaces'
41
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
42
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
43
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
44
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
45
+
46
+ const props = defineProps<{
47
+ location: UI_I_DatastoreTableItem | null
48
+ index: number
49
+ errorValidationFields: UI_I_ErrorValidationField[]
50
+ datastore: UI_I_DatastoreTableItem[]
51
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
52
+ }>()
53
+ const emits = defineEmits<{
54
+ (event: 'change', value: UI_I_DatastoreTableItem): void
55
+ (event: 'remove-error-by-title', value: string): void
56
+ }>()
57
+
58
+ const { $store }: any = useNuxtApp()
59
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
60
+
61
+ const localization = computed<UI_I_Localization>(() => useLocal())
62
+
63
+ const selectedLocation = ref<string>(props.location?.id || '')
64
+
65
+ const storages = ref<UI_I_DatastoreTableItem[]>([])
66
+ const addStorage = (storage: UI_I_DatastoreTableItem): void => {
67
+ const hasStorage = storages.value.some((item) => item.id === storage.id)
68
+ if (hasStorage) {
69
+ return
70
+ }
71
+
72
+ storages.value.push(storage)
73
+ }
74
+ const locationOptions = ref<UI_I_OptionItem[]>([])
75
+
76
+ watch(
77
+ () => props.location,
78
+ (newValue) => {
79
+ if (locationOptions.value.length || !newValue) {
80
+ return
81
+ }
82
+
83
+ locationOptions.value = [
84
+ {
85
+ text: localization.value.common.storeWithVirtualMachine,
86
+ value: newValue.id,
87
+ },
88
+ { text: `${localization.value.common.browse}...`, value: -1 },
89
+ ]
90
+ selectedLocation.value = newValue.id
91
+ storages.value.push(newValue)
92
+ addStorage(newValue)
93
+ },
94
+ { immediate: true }
95
+ )
96
+
97
+ const storageSubmit = ref<null | Function>(null)
98
+ const onSubmitStorageModal = (): void => {
99
+ storageSubmit.value = (_isValid: boolean): void => {
100
+ storageSubmit.value = null
101
+ }
102
+ }
103
+ const storageModalIsShow = ref<boolean>(false)
104
+ const onHideStorageModal = (): void => {
105
+ storageModalIsShow.value = false
106
+ if (selectedLocation.value === -1)
107
+ selectedLocation.value = locationOptions.value[0].value
108
+ }
109
+ const onChangeStorage = (storage: UI_I_DatastoreTableItem): void => {
110
+ locationOptions.value = [
111
+ locationOptions.value[0],
112
+ { text: storage.name, value: storage.id },
113
+ // @ts-ignore
114
+ locationOptions.value.at(-1),
115
+ ]
116
+
117
+ selectedLocation.value = storage.id
118
+ emits('change', storage)
119
+ addStorage(storage)
120
+ onHideStorageModal()
121
+ }
122
+ const onChangeLocation = (event: UI_I_HTMLSelectElement): void => {
123
+ const value = +event.target.value
124
+ if (value === -1) {
125
+ storageModalIsShow.value = true
126
+ return
127
+ }
128
+
129
+ selectedLocation.value = event.target.value
130
+ const storage = storages.value.find((item) => item.id === event.target.value)
131
+ storage && emits('change', storage)
132
+ }
133
+
134
+ const typeError = computed<string>(
135
+ () => `disk_devices[${props.index}].location`
136
+ )
137
+
138
+ const apiError = computed<string>(() => {
139
+ return (
140
+ props.errorValidationFields?.find(
141
+ (message) => message.field === typeError.value
142
+ )?.error_message || ''
143
+ )
144
+ })
145
+
146
+ const onRemoveValidationError = (): void => {
147
+ emits('remove-error-by-title', typeError.value)
148
+ }
149
+ </script>
150
+
151
+ <style scoped lang="scss"></style>
@@ -1,73 +1,73 @@
1
- <template>
2
- <ui-stack-block :has-children="false">
3
- <template #stackBlockKey>
4
- {{ localization.common.location }}
5
- </template>
6
- <template #stackBlockContent>
7
- <ui-select
8
- :id="`vm-wizard-disk-device-target-field-${props.index}`"
9
- v-model="selectedLocation"
10
- width="auto"
11
- :items="props.locationOptions"
12
- :test-id="`vm-wizard-disk-device-target-field-${props.index}`"
13
- :class="`vm-wizard-disk-device-target-field-${props.index} location-field`"
14
- size="sm"
15
- @change="onChangeLocation"
16
- />
17
- </template>
18
- </ui-stack-block>
19
-
20
- <Teleport to="body">
21
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-storage-modal
22
- :storage-modal-is-show="props.storageModalIsShow"
23
- :storage-submit="props.storageSubmit"
24
- :datastore="props.datastore"
25
- :get-datastore-table-func="props.getDatastoreTableFunc"
26
- @change-storage="emits('change-storage', $event)"
27
- @hide="emits('hide-storage-modal')"
28
- @submit="emits('submit-storage-modal')"
29
- />
30
- </Teleport>
31
- </template>
32
-
33
- <script setup lang="ts">
34
- import type {
35
- UI_I_HTMLSelectElement,
36
- UI_I_Localization,
37
- } from '~/lib/models/interfaces'
38
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
39
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
40
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
41
-
42
- const selectedLocation = defineModel<string>('selectedLocation', {
43
- required: true,
44
- })
45
- const props = defineProps<{
46
- index: number
47
- datastore: UI_I_DatastoreTableItem[]
48
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
49
- apiError: string
50
- locationOptions: UI_I_OptionItem[]
51
- storageModalIsShow: boolean
52
- storageSubmit: null | Function
53
- }>()
54
- const emits = defineEmits<{
55
- (event: 'change-location', value: UI_I_HTMLSelectElement): void
56
- (event: 'change-storage', value: UI_I_DatastoreTableItem): void
57
- (event: 'hide-storage-modal'): void
58
- (event: 'submit-storage-modal'): void
59
- (event: 'remove-validation-error'): void
60
- }>()
61
-
62
- const localization = computed<UI_I_Localization>(() => useLocal())
63
-
64
- const onChangeLocation = (value: number): void => {
65
- emits('change-location', { target: { value } })
66
- }
67
- </script>
68
-
69
- <style scoped lang="scss">
70
- :deep(.location-field .ui-main-select-toggle) {
71
- width: auto;
72
- }
73
- </style>
1
+ <template>
2
+ <ui-stack-block :has-children="false">
3
+ <template #stackBlockKey>
4
+ {{ localization.common.location }}
5
+ </template>
6
+ <template #stackBlockContent>
7
+ <ui-select
8
+ :id="`vm-wizard-disk-device-target-field-${props.index}`"
9
+ v-model="selectedLocation"
10
+ width="auto"
11
+ :items="props.locationOptions"
12
+ :test-id="`vm-wizard-disk-device-target-field-${props.index}`"
13
+ :class="`vm-wizard-disk-device-target-field-${props.index} location-field`"
14
+ size="sm"
15
+ @change="onChangeLocation"
16
+ />
17
+ </template>
18
+ </ui-stack-block>
19
+
20
+ <Teleport to="body">
21
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-storage-modal
22
+ :storage-modal-is-show="props.storageModalIsShow"
23
+ :storage-submit="props.storageSubmit"
24
+ :datastore="props.datastore"
25
+ :get-datastore-table-func="props.getDatastoreTableFunc"
26
+ @change-storage="emits('change-storage', $event)"
27
+ @hide="emits('hide-storage-modal')"
28
+ @submit="emits('submit-storage-modal')"
29
+ />
30
+ </Teleport>
31
+ </template>
32
+
33
+ <script setup lang="ts">
34
+ import type {
35
+ UI_I_HTMLSelectElement,
36
+ UI_I_Localization,
37
+ } from '~/lib/models/interfaces'
38
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
39
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
40
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
41
+
42
+ const selectedLocation = defineModel<string>('selectedLocation', {
43
+ required: true,
44
+ })
45
+ const props = defineProps<{
46
+ index: number
47
+ datastore: UI_I_DatastoreTableItem[]
48
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
49
+ apiError: string
50
+ locationOptions: UI_I_OptionItem[]
51
+ storageModalIsShow: boolean
52
+ storageSubmit: null | Function
53
+ }>()
54
+ const emits = defineEmits<{
55
+ (event: 'change-location', value: UI_I_HTMLSelectElement): void
56
+ (event: 'change-storage', value: UI_I_DatastoreTableItem): void
57
+ (event: 'hide-storage-modal'): void
58
+ (event: 'submit-storage-modal'): void
59
+ (event: 'remove-validation-error'): void
60
+ }>()
61
+
62
+ const localization = computed<UI_I_Localization>(() => useLocal())
63
+
64
+ const onChangeLocation = (value: number): void => {
65
+ emits('change-location', { target: { value } })
66
+ }
67
+ </script>
68
+
69
+ <style scoped lang="scss">
70
+ :deep(.location-field .ui-main-select-toggle) {
71
+ width: auto;
72
+ }
73
+ </style>
@@ -1,83 +1,83 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.location }}
6
- </template>
7
- <template #stackBlockContent>
8
- <atoms-tooltip-error
9
- :has-error="!!props.apiError"
10
- :selector="`.vm-wizard-disk-device-target-field-${props.index}`"
11
- @remove="emits('remove-validation-error')"
12
- >
13
- <template #elem>
14
- <div class="select">
15
- <select
16
- :id="`vm-wizard-disk-device-target-field-${props.index}`"
17
- v-model="selectedLocation"
18
- :data-id="`vm-wizard-disk-device-target-field-${props.index}`"
19
- :class="`vm-wizard-disk-device-target-field-${props.index}`"
20
- @change="emits('change-location', $event)"
21
- >
22
- <option
23
- v-for="(item, key) in props.locationOptions"
24
- :key="key"
25
- :value="item.value"
26
- >
27
- {{ item.text }}
28
- </option>
29
- </select>
30
- </div>
31
- </template>
32
- <template #content>{{ props.apiError }}</template>
33
- </atoms-tooltip-error>
34
- </template>
35
- </atoms-stack-block>
36
-
37
- <Teleport to="body">
38
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-storage-modal
39
- :storage-modal-is-show="props.storageModalIsShow"
40
- :storage-submit="props.storageSubmit"
41
- :datastore="props.datastore"
42
- :get-datastore-table-func="props.getDatastoreTableFunc"
43
- @change-storage="emits('change-storage', $event)"
44
- @hide="emits('hide-storage-modal')"
45
- @submit="emits('submit-storage-modal')"
46
- />
47
- </Teleport>
48
- </div>
49
- </template>
50
-
51
- <script setup lang="ts">
52
- import type {
53
- UI_I_HTMLSelectElement,
54
- UI_I_Localization,
55
- } from '~/lib/models/interfaces'
56
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
57
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
58
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
59
-
60
- const selectedLocation = defineModel<string>('selectedLocation', {
61
- required: true,
62
- })
63
- const props = defineProps<{
64
- index: number
65
- datastore: UI_I_DatastoreTableItem[]
66
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
67
- apiError: string
68
- locationOptions: UI_I_OptionItem[]
69
- storageModalIsShow: boolean
70
- storageSubmit: null | Function
71
- }>()
72
- const emits = defineEmits<{
73
- (event: 'change-location', value: UI_I_HTMLSelectElement): void
74
- (event: 'change-storage', value: UI_I_DatastoreTableItem): void
75
- (event: 'hide-storage-modal'): void
76
- (event: 'submit-storage-modal'): void
77
- (event: 'remove-validation-error'): void
78
- }>()
79
-
80
- const localization = computed<UI_I_Localization>(() => useLocal())
81
- </script>
82
-
83
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.common.location }}
6
+ </template>
7
+ <template #stackBlockContent>
8
+ <atoms-tooltip-error
9
+ :has-error="!!props.apiError"
10
+ :selector="`.vm-wizard-disk-device-target-field-${props.index}`"
11
+ @remove="emits('remove-validation-error')"
12
+ >
13
+ <template #elem>
14
+ <div class="select">
15
+ <select
16
+ :id="`vm-wizard-disk-device-target-field-${props.index}`"
17
+ v-model="selectedLocation"
18
+ :data-id="`vm-wizard-disk-device-target-field-${props.index}`"
19
+ :class="`vm-wizard-disk-device-target-field-${props.index}`"
20
+ @change="emits('change-location', $event)"
21
+ >
22
+ <option
23
+ v-for="(item, key) in props.locationOptions"
24
+ :key="key"
25
+ :value="item.value"
26
+ >
27
+ {{ item.text }}
28
+ </option>
29
+ </select>
30
+ </div>
31
+ </template>
32
+ <template #content>{{ props.apiError }}</template>
33
+ </atoms-tooltip-error>
34
+ </template>
35
+ </atoms-stack-block>
36
+
37
+ <Teleport to="body">
38
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location-storage-modal
39
+ :storage-modal-is-show="props.storageModalIsShow"
40
+ :storage-submit="props.storageSubmit"
41
+ :datastore="props.datastore"
42
+ :get-datastore-table-func="props.getDatastoreTableFunc"
43
+ @change-storage="emits('change-storage', $event)"
44
+ @hide="emits('hide-storage-modal')"
45
+ @submit="emits('submit-storage-modal')"
46
+ />
47
+ </Teleport>
48
+ </div>
49
+ </template>
50
+
51
+ <script setup lang="ts">
52
+ import type {
53
+ UI_I_HTMLSelectElement,
54
+ UI_I_Localization,
55
+ } from '~/lib/models/interfaces'
56
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
57
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
58
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
59
+
60
+ const selectedLocation = defineModel<string>('selectedLocation', {
61
+ required: true,
62
+ })
63
+ const props = defineProps<{
64
+ index: number
65
+ datastore: UI_I_DatastoreTableItem[]
66
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
67
+ apiError: string
68
+ locationOptions: UI_I_OptionItem[]
69
+ storageModalIsShow: boolean
70
+ storageSubmit: null | Function
71
+ }>()
72
+ const emits = defineEmits<{
73
+ (event: 'change-location', value: UI_I_HTMLSelectElement): void
74
+ (event: 'change-storage', value: UI_I_DatastoreTableItem): void
75
+ (event: 'hide-storage-modal'): void
76
+ (event: 'submit-storage-modal'): void
77
+ (event: 'remove-validation-error'): void
78
+ }>()
79
+
80
+ const localization = computed<UI_I_Localization>(() => useLocal())
81
+ </script>
82
+
83
+ <style scoped lang="scss"></style>