bfg-common 1.4.398 → 1.4.400

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 (122) hide show
  1. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +203 -189
  2. package/package.json +1 -1
  3. package/components/common/vm/actions/common/_customizeHardware/CustomizeHardware.vue +0 -274
  4. package/components/common/vm/actions/common/_customizeHardware/lib/config/navItems.ts +0 -21
  5. package/components/common/vm/actions/common/_customizeHardware/lib/models/interfaces.ts +0 -7
  6. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue +0 -702
  7. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/BrowseView.vue +0 -203
  8. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/lib/models/interfaces.ts +0 -8
  9. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/Bus.vue +0 -156
  10. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/lib/config/options.ts +0 -20
  11. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +0 -270
  12. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes.ts +0 -9
  13. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +0 -11
  14. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/models/types.ts +0 -1
  15. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +0 -57
  16. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +0 -110
  17. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Cpu.vue +0 -403
  18. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +0 -56
  19. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuModel.vue +0 -225
  20. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Hv.vue +0 -99
  21. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Iommu.vue +0 -55
  22. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/MaxCpu.vue +0 -106
  23. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Pc.vue +0 -55
  24. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Sa.vue +0 -106
  25. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/lib/config/cpuOptions.ts +0 -21
  26. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/Shares.vue +0 -160
  27. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +0 -28
  28. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +0 -59
  29. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/binaryOptions.ts +0 -12
  30. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/dropdownItems.ts +0 -66
  31. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/interfaces.ts +0 -118
  32. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/types.ts +0 -4
  33. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/Limit.vue +0 -236
  34. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/lib/config/options.ts +0 -28
  35. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/Memory.vue +0 -329
  36. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +0 -54
  37. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/lib/config/memoryOptions.ts +0 -35
  38. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/DiskFile.vue +0 -24
  39. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/MaximumSize.vue +0 -27
  40. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +0 -462
  41. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +0 -81
  42. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options.ts +0 -7
  43. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +0 -153
  44. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options.ts +0 -28
  45. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/Location.vue +0 -172
  46. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +0 -52
  47. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -175
  48. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -167
  49. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +0 -88
  50. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/lib/config/options.ts +0 -18
  51. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +0 -88
  52. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options.ts +0 -15
  53. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +0 -86
  54. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options.ts +0 -12
  55. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/Location.vue +0 -145
  56. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +0 -305
  57. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +0 -87
  58. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/lib/config/options.ts +0 -9
  59. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +0 -148
  60. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/lib/config/options.ts +0 -11
  61. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +0 -168
  62. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -48
  63. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +0 -49
  64. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/lib/config/options.ts +0 -10
  65. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +0 -7
  66. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/note/Note.vue +0 -27
  67. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +0 -42
  68. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +0 -57
  69. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +0 -82
  70. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/lib/config/options.ts +0 -6
  71. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/InputDevices.vue +0 -21
  72. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/Other.vue +0 -32
  73. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/Reservation.vue +0 -237
  74. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/lib/config/options.ts +0 -33
  75. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/Graphics.vue +0 -50
  76. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +0 -121
  77. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/VideoCard.vue +0 -182
  78. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/lib/config/options.ts +0 -11
  79. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/Model.vue +0 -59
  80. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/lib/config/options.ts +0 -10
  81. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +0 -83
  82. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/lib/config/options.ts +0 -14
  83. package/components/common/vm/actions/common/_customizeHardware/vmoptions/Vmoptions.vue +0 -181
  84. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/BootOptions.vue +0 -114
  85. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Menu.vue +0 -50
  86. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Secure.vue +0 -50
  87. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/Delay.vue +0 -54
  88. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/lib/config/config.ts +0 -14
  89. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +0 -84
  90. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/lib/config/config.ts +0 -11
  91. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/Order.vue +0 -201
  92. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +0 -9
  93. package/components/common/vm/actions/common/_customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +0 -192
  94. package/components/common/vm/actions/common/_customizeHardware/vmoptions/lib/models/interfaces.ts +0 -34
  95. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +0 -52
  96. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -52
  97. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -51
  98. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +0 -52
  99. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +0 -50
  100. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +0 -254
  101. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +0 -85
  102. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/lib/config/config.ts +0 -14
  103. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +0 -85
  104. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/lib/config/config.ts +0 -12
  105. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +0 -56
  106. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/lib/config/config.ts +0 -6
  107. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +0 -57
  108. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/lib/config/config.ts +0 -11
  109. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +0 -142
  110. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces.ts +0 -5
  111. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils.ts +0 -12
  112. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +0 -56
  113. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/lib/config/config.ts +0 -11
  114. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +0 -85
  115. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/lib/config/config.ts +0 -12
  116. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +0 -85
  117. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/lib/config/config.ts +0 -7
  118. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +0 -57
  119. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config.ts +0 -14
  120. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +0 -85
  121. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/lib/config/config.ts +0 -12
  122. package/components/common/vm/actions/common/_customizeHardware/vmoptions/tools/Tools.vue +0 -72
@@ -1,203 +0,0 @@
1
- <template>
2
- <div>
3
- <common-browse
4
- v-model:selected-file="selectedFile"
5
- v-model:selected-file-type="selectedFileType"
6
- :show="props.show"
7
- :nodes="props.nodes"
8
- :files="files"
9
- :info="selectedNodeInfo"
10
- :file-types="props.fileTypes"
11
- @get-nodes="onGetCurrentDirNodes"
12
- @select-node="onSelectNode"
13
- @submit="onSubmit"
14
- @hide="emits('hide')"
15
- />
16
- </div>
17
- </template>
18
-
19
- <script lang="ts" setup>
20
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
21
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
22
- import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
23
- import type { UI_I_CurrentDirNodesArguments } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/lib/models/interfaces'
24
- import type { UI_I_Localization } from '~/lib/models/interfaces'
25
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
26
- import type { UI_I_FileInfo } from '~/components/common/browse/lib/models/interfaces'
27
-
28
- const props = defineProps<{
29
- show: boolean
30
- nodes: UI_I_FileTreeNode[]
31
- files: UI_I_FileTreeNode[]
32
- fileTypes?: UI_I_OptionItem[]
33
- }>()
34
- const emits = defineEmits<{
35
- (event: 'hide'): void
36
- (event: 'submit', value: UI_I_FileTreeNode | null): void
37
- (event: 'get-storage', value: UI_I_TablePayload): void
38
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
39
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
40
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
41
- }>()
42
-
43
- const { $recursion } = useNuxtApp()
44
-
45
- const localization = computed<UI_I_Localization>(() => useLocal())
46
-
47
- const selectedFileType = ref<string | null>(null)
48
- watch(
49
- selectedFileType,
50
- (newValue) => {
51
- if (newValue === null || selectedFile.value === null) return
52
-
53
- const isExist = files.value.includes(selectedFile.value)
54
- if (!isExist) selectedFile.value = null
55
- },
56
- { immediate: true, deep: true }
57
- )
58
- watch(
59
- () => props.fileTypes,
60
- (newValue) => {
61
- if (newValue?.length) selectedFileType.value = newValue[0].value
62
- },
63
- { immediate: true, deep: true }
64
- )
65
-
66
- const getStorage = (): void => {
67
- const payload: UI_I_TablePayload = {
68
- pagination: {
69
- page: 1,
70
- pageSize: 100,
71
- },
72
- sortBy: null,
73
- type: 'datastore',
74
- schema: 'full',
75
- }
76
-
77
- emits('get-storage', payload)
78
- }
79
- getStorage()
80
-
81
- const getFileNodes = (payload: UI_I_FolderOrFileTreePayload): void => {
82
- emits('get-folders-or-files', payload)
83
- }
84
-
85
- const files = computed<UI_I_FileTreeNode[]>(() => {
86
- if (!selectedNode.value) return []
87
-
88
- const files: UI_I_FileTreeNode[] = props.files
89
- if (selectedFileType.value === 'all' || selectedFileType.value === null)
90
- return files
91
-
92
- let type = 3
93
- if (selectedFileType.value === 'iso') type = 2
94
-
95
- return files.filter((file) => file.provisioned_type === type)
96
- })
97
-
98
- const getRootNodeById = (id: string): UI_I_FileTreeNode | null => {
99
- let result = null
100
- props.nodes.forEach((node) => {
101
- const findNode =
102
- node.id === id ? node : $recursion.find(node.nodes, id, 'id', 'nodes')
103
-
104
- findNode && (result = node)
105
- })
106
-
107
- return result
108
- }
109
- const onGetCurrentDirNodes = async ({
110
- node,
111
- cb,
112
- select = false,
113
- type = 'folder',
114
- }: UI_I_CurrentDirNodesArguments): Promise<void> => {
115
- if (!node) return
116
-
117
- const isRootNode = props.nodes?.some((item) => item.id === node.id)
118
-
119
- if (!select && (isRootNode || node.nodesShow)) {
120
- emits('show-datastore-child', node)
121
- cb && cb()
122
- return
123
- }
124
-
125
- const rootNode = getRootNodeById(node.id)
126
- if (!rootNode) return
127
-
128
- const payload: UI_I_FolderOrFileTreePayload = {
129
- type,
130
- id: rootNode.id,
131
- path: node.path,
132
- merge: true,
133
- show: !select,
134
- }
135
-
136
- await getFileNodes(payload)
137
- cb && cb()
138
- }
139
-
140
- const selectedNode = ref<UI_I_FileTreeNode | null>(null)
141
- const selectedFile = ref<UI_I_FileTreeNode | null>(null)
142
- const selectedNodeInfo = computed<UI_I_FileInfo[] | null>(() => {
143
- const node = selectedFile.value || selectedNode.value
144
- if (!node) return null
145
-
146
- const result = [
147
- {
148
- type: 'text',
149
- title: localization.value.common.name,
150
- value: node.name || '',
151
- },
152
- {
153
- type: 'size',
154
- title: localization.value.common.available,
155
- value: node.size || 0,
156
- },
157
- ]
158
-
159
- if (node.type !== 4) {
160
- const modified = node.modified_time || 0
161
- result.push({
162
- type: 'date',
163
- title: localization.value.common.modified,
164
- value: +modified * 1000,
165
- })
166
- }
167
-
168
- return result
169
- })
170
- const onSelectNode = (node: UI_I_FileTreeNode): void => {
171
- selectedNode.value = node
172
- selectedFile.value = null
173
-
174
- onGetCurrentDirNodes({ node, select: true, type: 'file' })
175
-
176
- emits('get-active-device-child', node)
177
- }
178
- const onSubmit = (): void => {
179
- emits('submit', selectedFile.value)
180
- emits('hide')
181
- }
182
-
183
- let helper = false
184
- watch(
185
- () => props.nodes,
186
- (newValue: UI_I_FileTreeNode[]) => {
187
- if (helper || !newValue.length) return
188
- newValue.forEach((node) => {
189
- getFileNodes({
190
- id: node.id,
191
- path: `${node.id}:/`,
192
- type: 'folder',
193
- show: false,
194
- merge: false,
195
- })
196
- })
197
- helper = true
198
- },
199
- { immediate: true }
200
- )
201
- </script>
202
-
203
- <style lang="scss" scoped></style>
@@ -1,8 +0,0 @@
1
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
2
-
3
- export interface UI_I_CurrentDirNodesArguments {
4
- node: UI_I_FileTreeNode | null
5
- cb?: () => void
6
- select?: boolean
7
- type?: string
8
- }
@@ -1,156 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.bus }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="select-row">
9
- <atoms-tooltip-error
10
- :has-error="!!apiError"
11
- :selector="`.vm-wizard-${props.componentType}-bus-field-${props.index}`"
12
- @remove="onRemoveValidationError"
13
- >
14
- <template #elem>
15
- <div class="select">
16
- <select
17
- :id="`vm-wizard-${props.componentType}-bus-field-${props.index}`"
18
- v-model="busLocal"
19
- :data-id="`${props.testId}-select`"
20
- :class="`vm-wizard-${props.componentType}-bus-field-${props.index}`"
21
- :disabled="props.disabled"
22
- >
23
- <option
24
- v-for="(item, key) in busOptions"
25
- :key="key"
26
- :value="item.value"
27
- >
28
- {{ item.text }}
29
- </option>
30
- </select>
31
- </div>
32
- </template>
33
- <template #content>{{ apiError }}</template>
34
- </atoms-tooltip-error>
35
- <div
36
- v-if="props.helpText"
37
- :id="helpId"
38
- class="content-signpost relative"
39
- >
40
- <atoms-the-icon
41
- :data-id="`${props.testId}-show-help-icon`"
42
- class="icon-show-help"
43
- fill="#0072a3"
44
- width="24px"
45
- height="24px"
46
- name="info-circle"
47
- @click="isShowHelp = !isShowHelp"
48
- />
49
- <Teleport to="body">
50
- <atoms-tooltip-signpost
51
- v-if="isShowHelp"
52
- test-id="help-signpost"
53
- :elem-id="helpId"
54
- @hide="isShowHelp = false"
55
- >
56
- <p>
57
- <!-- {{ localization.common.busVirtioHelpDesc }}-->
58
- {{ props.helpText }}
59
- </p>
60
- </atoms-tooltip-signpost>
61
- </Teleport>
62
- </div>
63
- </div>
64
- </template>
65
- </atoms-stack-block>
66
- </div>
67
- </template>
68
-
69
- <script setup lang="ts">
70
- import type { UI_I_Localization } from '~/lib/models/interfaces'
71
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
72
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
73
- import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
74
-
75
- const localization = computed<UI_I_Localization>(() => useLocal())
76
-
77
- const props = defineProps<{
78
- bus: string
79
- index: number
80
- componentType: string
81
- testId: string
82
- errorValidationFields: UI_I_ErrorValidationField<string>[]
83
- disabled?: boolean
84
- shortOptions?: boolean
85
- helpText?: string
86
- guestMachineType?: UI_I_OptionItem | null
87
- }>()
88
- const emits = defineEmits<{
89
- (event: 'update:bus', value: string): void
90
- (event: 'remove-error-by-title', value: string): void
91
- }>()
92
-
93
- const helpId = ref<string>(`bus-field-help-icon${useUniqueId()}`)
94
-
95
- const busLocal = computed<string>({
96
- get() {
97
- return props.bus
98
- },
99
- set(newValue) {
100
- emits('update:bus', newValue)
101
- },
102
- })
103
- const busOptions = ref<UI_I_OptionItem[]>([])
104
- watch(
105
- () => props.guestMachineType,
106
- () => {
107
- if (props.guestMachineType) {
108
- busOptions.value = capabilities.bus[props.guestMachineType.value]
109
- if (props.shortOptions) {
110
- busOptions.value = capabilities.cdromBus[props.guestMachineType.value]
111
- }
112
-
113
- const hasSelected = busOptions.value.some(
114
- (option) => option.value === busLocal.value
115
- )
116
- if (!hasSelected) busLocal.value = busOptions.value[0].value
117
- }
118
- },
119
- { immediate: true, deep: true }
120
- )
121
-
122
- const busValidationType = computed<string>(
123
- () => `disk_devices[${props.index}].bus`
124
- )
125
-
126
- const apiError = computed<string>(() => {
127
- return (
128
- props.errorValidationFields?.find(
129
- (message) => message.field === busValidationType.value
130
- )?.error_message || ''
131
- )
132
- })
133
-
134
- const onRemoveValidationError = (): void => {
135
- emits('remove-error-by-title', busValidationType.value)
136
- }
137
-
138
- const isShowHelp = ref<boolean>(false)
139
- </script>
140
-
141
- <style scoped>
142
- .select-row {
143
- display: flex;
144
- justify-content: space-between;
145
-
146
- .content-signpost {
147
- .icon-show-help {
148
- cursor: pointer;
149
- }
150
-
151
- .signpost {
152
- max-width: 360px;
153
- }
154
- }
155
- }
156
- </style>
@@ -1,20 +0,0 @@
1
- // import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- // import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
- //
4
- // export const busOptionsFunc = (
5
- // localization: UI_I_Localization,
6
- // shortOptions?: boolean
7
- // ): UI_I_OptionItem[] => {
8
- // if (shortOptions) {
9
- // return [
10
- // { text: localization.common.ide, value: 'ide' },
11
- // { text: localization.common.sata, value: 'sata' },
12
- // ]
13
- // }
14
- // return [
15
- // { text: localization.common.ide, value: 'ide' },
16
- // { text: localization.common.scsi, value: 'scsi' },
17
- // { text: localization.common.sata, value: 'sata' },
18
- // { text: localization.common.virtio, value: 'virtio' },
19
- // ]
20
- // }
@@ -1,270 +0,0 @@
1
- <template>
2
- <div class="hardware-cd-dvd-drive">
3
- <atoms-stack-block
4
- :has-children="true"
5
- :is-roll-back="props.type === 'removed'"
6
- :removable="isRemovable"
7
- :test-id="`cd-dvd-drive-stack-block-${props.index}`"
8
- @remove="onRemoveCdDvdDrive"
9
- @roll-back="onRollBackCdDvdDrive"
10
- >
11
- <template #stackBlockKey>
12
- <div
13
- :id="`vm-wizard-toggle-block-cd-dvd-drive-${props.index}`"
14
- :data-id="`vm-wizard-toggle-block-cd-dvd-drive-${props.index}`"
15
- class="vm-wizard-toggle-block-cd-dvd-drive vm-wizard-toggle-block-hard-disk"
16
- >
17
- <span>{{ label }}</span>
18
- </div>
19
- </template>
20
- <template #stackBlockContent>
21
- <div class="flex-align-center flex-space-between">
22
- <template v-if="props.type === 'removed'">
23
- <span>{{ localization.common.deviceWillRemoved }}</span>
24
- <div class="flex-align-center" @click.stop>
25
- <input
26
- :id="`cd-dvd-delete-files-from-datastore-${props.index}`"
27
- v-model="deleteFilesFromDatastore"
28
- :data-id="`cd-dvd-delete-files-from-datastore-${props.index}`"
29
- :disabled="props.disabled"
30
- type="checkbox"
31
- class="pointer"
32
- @click.stop
33
- />
34
- <label
35
- :for="`cd-dvd-delete-files-from-datastore-${props.index}`"
36
- :class="[
37
- 'label-text-normal pointer',
38
- props.disabled && 'div-disabled',
39
- ]"
40
- >{{ localization.common.deleteFilesFromDatastore }}</label
41
- >
42
- </div>
43
- </template>
44
- <template v-else>
45
- <div class="select">
46
- <select
47
- id="vm-wizard-cd-dvd-drive-field"
48
- v-model="selectedCdDvdDrive"
49
- :data-id="`vm-wizard-cd-dvd-drive-field-${props.index}`"
50
- class="vm-wizard-cd-dvd-drive-field input-text-color"
51
- @click.stop
52
- @change="changeCdDvdDrive"
53
- >
54
- <option
55
- v-for="(item, key) in cdDvdDriveOptions"
56
- :key="key"
57
- :value="item.value"
58
- >
59
- {{ item.text }}
60
- </option>
61
- </select>
62
- </div>
63
- </template>
64
- </div>
65
- </template>
66
- <template #stackChildren>
67
- <common-vm-actions-common-customize-hardware-virtual-hardware-cd-dvd-drive-media
68
- v-if="selectedCdDvdDrive === 'datastoreIsoFile'"
69
- v-model:cd-dvd-media="cdDvdMedia"
70
- @browse="isShowFileModal = true"
71
- />
72
-
73
- <!-- :short-options="props.type === 'edit'" // поменял из-за задачки PNCWEB-384-->
74
- <common-vm-actions-common-customize-hardware-virtual-hardware-bus
75
- v-model:bus="bus"
76
- :index="indexByHardDisks"
77
- :validation-type="busValidationType"
78
- :error-validation-fields="props.errorValidationFields"
79
- :disabled="isRunning"
80
- :test-id="`vm-wizard-cd-dvd-bus-field-${props.index}`"
81
- short-options
82
- component-type="disk_devices"
83
- :guest-machine-type="props.guestMachineType"
84
- @remove-error-by-title="emits('remove-error-by-title', $event)"
85
- />
86
- </template>
87
- </atoms-stack-block>
88
-
89
- <Teleport to="body">
90
- <common-vm-actions-common-customize-hardware-virtual-hardware-browse-view
91
- v-if="isShowFileModal"
92
- :show="isShowFileModal"
93
- :file-types="fileTypes"
94
- :nodes="props.nodes"
95
- :files="props.files"
96
- @submit="onSelectFile"
97
- @get-storage="emits('get-storage', $event)"
98
- @get-folders-or-files="emits('get-folders-or-files', $event)"
99
- @get-active-device-child="emits('get-active-device-child', $event)"
100
- @show-datastore-child="emits('show-datastore-child', $event)"
101
- @hide="onHideFileModal"
102
- />
103
- </Teleport>
104
- </div>
105
- </template>
106
-
107
- <script lang="ts" setup>
108
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
109
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
110
- import type { UI_T_CdDvdDrive } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/lib/models/types'
111
- import type { UI_I_SendDataNewCdDvdDrive } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
112
- import type {
113
- UI_I_Localization,
114
- UI_I_HTMLSelectElement,
115
- } from '~/lib/models/interfaces'
116
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
117
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
118
- import type { UI_I_FolderOrFileTreePayload } from '~/lib/models/store/storage/interfaces'
119
- import type { UI_T_CdDvdType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
120
- import { cdDvdDriveOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/lib/config/options'
121
- import { fileTypesFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes'
122
-
123
- const props = defineProps<{
124
- hardDisksCount: number
125
- index: number
126
- cdDvdDrive: UI_I_SendDataNewCdDvdDrive
127
- nodes: UI_I_FileTreeNode[]
128
- files: UI_I_FileTreeNode[]
129
- errorValidationFields: UI_I_ErrorValidationField<string>[]
130
- type: UI_T_CdDvdType
131
- isEdit: boolean
132
- state?: string | number
133
- guestMachineType?: UI_I_OptionItem | null
134
- }>()
135
-
136
- const emits = defineEmits<{
137
- (event: 'send-data', value: UI_I_SendDataNewCdDvdDrive): void
138
- (event: 'remove'): void
139
- (event: 'roll-back'): void
140
- (event: 'remove-error-by-title', value: string): void
141
- (event: 'get-storage', value: UI_I_TablePayload): void
142
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
143
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
144
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
145
- }>()
146
-
147
- const localization = computed<UI_I_Localization>(() => useLocal())
148
-
149
- const isRunning = computed<boolean>(() => {
150
- return props.state === 2
151
- })
152
-
153
- const isRemovable = computed<boolean>(() => {
154
- return (
155
- !props.isEdit ||
156
- !isRunning.value ||
157
- (isRunning.value && bus.value === 'virtio')
158
- )
159
- })
160
-
161
- const indexByHardDisks = computed<number>(
162
- () => props.index + props.hardDisksCount
163
- )
164
-
165
- const label = computed<string>(() => {
166
- if (props.type === 'edit' || props.type === 'removed')
167
- // 2 так как из-под капота создается еще один cd/dvd driver
168
- return `${localization.value.common.cdDvdDrive} ${props.index + 2}`
169
-
170
- return `${localization.value.common.newCdDvdDrive} *`
171
- })
172
-
173
- const busValidationType = computed<string>(
174
- () => `disk_devices[${indexByHardDisks}].bus`
175
- )
176
-
177
- const selectedCdDvdDrive = ref<UI_T_CdDvdDrive>('clientDevice')
178
- const cdDvdDriveOptions = ref<UI_I_OptionItem[]>(
179
- cdDvdDriveOptionsFunc(localization.value)
180
- )
181
- const changeCdDvdDrive = (event: UI_I_HTMLSelectElement): void => {
182
- const isDatastoreIsoFile = event.target.value === 'datastoreIsoFile'
183
- if (!isDatastoreIsoFile) {
184
- cdDvdMedia.value = ''
185
- return
186
- }
187
-
188
- isShowFileModal.value = true
189
- }
190
- const isShowFileModal = ref<boolean>(false)
191
- const onHideFileModal = (): void => {
192
- if (!cdDvdMedia.value) {
193
- selectedCdDvdDrive.value = 'clientDevice'
194
- }
195
- isShowFileModal.value = false
196
- }
197
- const onSelectFile = (file: UI_I_FileTreeNode): void => {
198
- cdDvdMedia.value = file.path
199
- }
200
- const fileTypes = computed<UI_I_OptionItem[]>(() =>
201
- fileTypesFunc(localization.value)
202
- )
203
-
204
- const onRemoveCdDvdDrive = (): void => {
205
- emits('remove')
206
- }
207
- const onRollBackCdDvdDrive = (): void => {
208
- emits('roll-back')
209
- }
210
-
211
- const cdDvdMedia = ref<string>('')
212
- // const bus = ref<string>('ide')
213
- const bus = ref<string>('sata') // PNCWEB-384
214
-
215
- const deleteFilesFromDatastore = ref<boolean>(false)
216
-
217
- watch(
218
- [cdDvdMedia, bus, deleteFilesFromDatastore, () => props.type],
219
- () => {
220
- emits('send-data', {
221
- create: props.cdDvdDrive.create,
222
- attach: props.cdDvdDrive.attach,
223
- source: cdDvdMedia.value,
224
- size: 0,
225
- bus: bus.value,
226
- device_type: 'cdrom',
227
- provision_type: 'thick',
228
- disk_mode: 'dependent',
229
- sharing: false,
230
- read_only: true,
231
- shares: 0,
232
- cache: 'none',
233
- io: 'native',
234
- limit_iops: 0,
235
- discard: 'unmap',
236
- target: props.cdDvdDrive.target,
237
- boot_order: props.cdDvdDrive.boot_order,
238
- detach: props.type === 'removed',
239
- remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
240
- })
241
- },
242
- { immediate: true }
243
- )
244
-
245
- // Добавляем данные для редактирования
246
- watch(
247
- () => props.cdDvdDrive,
248
- (newValue) => {
249
- if (newValue.source !== '') {
250
- selectedCdDvdDrive.value = 'datastoreIsoFile'
251
- cdDvdMedia.value = newValue.source
252
- }
253
- if (newValue.bus !== '') {
254
- bus.value = newValue.bus
255
- }
256
- },
257
- { immediate: true }
258
- )
259
- watch(
260
- isRunning,
261
- (newValue) => {
262
- if (newValue && props.type === 'new') {
263
- bus.value = 'virtio'
264
- }
265
- },
266
- { immediate: true }
267
- )
268
- </script>
269
-
270
- <style lang="scss" scoped></style>
@@ -1,9 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
-
4
- export const fileTypesFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_OptionItem[] => [
7
- { text: `${localization.common.isoImage} (*.iso)`, value: 'iso' },
8
- { text: `${localization.common.allFiles} (*.*)`, value: 'all' },
9
- ]
@@ -1,11 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
-
4
- export const cdDvdDriveOptionsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_OptionItem[] => {
7
- return [
8
- { text: localization.common.clientDevice, value: 'clientDevice' },
9
- { text: localization.common.datastoreIsoFile, value: 'datastoreIsoFile' },
10
- ]
11
- }
@@ -1 +0,0 @@
1
- export type UI_T_CdDvdDrive = 'clientDevice' | 'datastoreIsoFile'