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,462 +0,0 @@
1
- <template>
2
- <div class="hardware-hard-disk">
3
- <atoms-stack-block
4
- :has-children="true"
5
- :is-roll-back="props.type === 'removed'"
6
- :removable="isRemovable"
7
- :test-id="`hard-disk-stack-block-${props.index}`"
8
- @remove="onRemoveHardDisk"
9
- @roll-back="onRollBackHardDisk"
10
- >
11
- <template #stackBlockKey>
12
- <div
13
- :id="`vm-wizard-toggle-block-hard-disk-${props.index}`"
14
- :data-id="`vm-wizard-toggle-block-hard-disk-${props.index}`"
15
- class="vm-wizard-toggle-block-hard-disk flex-align-center"
16
- >
17
- <span>{{ label }}</span>
18
- <atoms-the-icon
19
- v-show="hardDiskInvalid"
20
- width="24px"
21
- height="24px"
22
- class="is-error tooltip-trigger"
23
- name="info"
24
- />
25
- </div>
26
- </template>
27
- <template #stackBlockContent>
28
- <div class="flex-align-center flex-space-between mr-1">
29
- <template v-if="props.type === 'removed'">
30
- <span>{{ localization.common.deviceWillRemoved }}</span>
31
- <div class="flex-align-center" @click.stop>
32
- <input
33
- :id="`hard-disk-delete-files-from-datastore-${props.index}`"
34
- v-model="deleteFilesFromDatastore"
35
- :data-id="`hard-disk-delete-files-from-datastore-${props.index}`"
36
- :disabled="props.disabled"
37
- type="checkbox"
38
- class="pointer"
39
- @click.stop
40
- />
41
- <label
42
- :for="`hard-disk-delete-files-from-datastore-${props.index}`"
43
- :class="[
44
- 'label-text-normal pointer',
45
- props.disabled && 'div-disabled',
46
- ]"
47
- >{{ localization.common.deleteFilesFromDatastore }}</label
48
- >
49
- </div>
50
- </template>
51
- <template v-else>
52
- <atoms-tooltip-error
53
- :has-error="!!hardDiskLocalAndApiErrorsTexts"
54
- :selector="`#vm-wizard-hard-disk-${props.index}`"
55
- @remove="
56
- emits(
57
- 'remove-error-by-title',
58
- `disk_devices[${props.index}].size`
59
- )
60
- "
61
- >
62
- <template #elem>
63
- <input
64
- :id="`vm-wizard-hard-disk-${props.index}`"
65
- v-model.number="size"
66
- :data-id="`vm-wizard-hard-disk-${props.index}`"
67
- type="number"
68
- :class="[
69
- 'spinfree edit-setting-input input-text-color',
70
- { 'has-error': hardDiskTypeErrorLocalText },
71
- ]"
72
- :disabled="isDisabledSize"
73
- @blur="onValidateSize"
74
- @click.stop
75
- />
76
- </template>
77
- <template #content>
78
- {{ hardDiskLocalAndApiErrorsTexts }}
79
- </template>
80
- </atoms-tooltip-error>
81
- <div class="select ml-1">
82
- <select
83
- :id="`hard-disk-type-select-${props.index}`"
84
- v-model="hardDiskType"
85
- :data-id="`hard-disk-type-select-${props.index}`"
86
- :disabled="props.type === 'exist'"
87
- class="input-text-color"
88
- @change="onValidateSize"
89
- @click.stop
90
- >
91
- <option
92
- v-for="(item, key) in hardDiskTypeOptions"
93
- :key="key"
94
- :value="item.value"
95
- >
96
- {{ item.text }}
97
- </option>
98
- </select>
99
- </div>
100
- </template>
101
- </div>
102
- </template>
103
- <template #stackChildren>
104
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-maximum-size
105
- :free-mb="maxHardDisk"
106
- />
107
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-location
108
- v-if="props.type === 'new'"
109
- :location="location"
110
- :index="props.index"
111
- :error-validation-fields="props.errorValidationFields"
112
- :get-datastore-table-func="props.getDatastoreTableFunc"
113
- :datastore="props.datastore"
114
- @change="onChangeStorage"
115
- @remove-error-by-title="emits('remove-error-by-title', $event)"
116
- />
117
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-file
118
- v-else
119
- :path="props.hardDisk?.source"
120
- />
121
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-provisioning
122
- v-model:disk-provisioning="diskProvisioning"
123
- :index="props.index"
124
- :error-validation-fields="props.errorValidationFields"
125
- :disabled="(props.isEdit && props.type !== 'new') || isRunning"
126
- @remove-error-by-title="emits('remove-error-by-title', $event)"
127
- />
128
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-sharing
129
- v-model:sharing="sharing"
130
- :index="props.index"
131
- :error-validation-fields="props.errorValidationFields"
132
- :disabled="isRunning && props.type !== 'new'"
133
- @remove-error-by-title="emits('remove-error-by-title', $event)"
134
- />
135
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-limit-iops
136
- v-model:limit-iops="limitIops"
137
- v-model:limit-iops-type="limitIopsType"
138
- :index="props.index"
139
- :error-validation-fields="props.errorValidationFields"
140
- @valid="limitIopsInvalid = $event"
141
- @remove-error-by-title="emits('remove-error-by-title', $event)"
142
- />
143
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-mode
144
- v-model:diskMode="diskMode"
145
- :index="props.index"
146
- :error-validation-fields="props.errorValidationFields"
147
- :disabled="isRunning && props.type !== 'new'"
148
- @remove-error-by-title="emits('remove-error-by-title', $event)"
149
- />
150
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-hard-disk-cache
151
- v-model:cache="cache"
152
- :index="props.index"
153
- :error-validation-fields="props.errorValidationFields"
154
- :disabled="(props.isEdit && props.type !== 'new') || isRunning"
155
- @remove-error-by-title="emits('remove-error-by-title', $event)"
156
- />
157
- <common-vm-actions-common-customize-hardware-virtual-hardware-bus
158
- v-model:bus="bus"
159
- :index="props.index"
160
- :error-validation-fields="props.errorValidationFields"
161
- :disabled="isRunning"
162
- :help-text="localization.common.busVirtioHelpDesc"
163
- :test-id="`vm-wizard-disk-bus-field-${props.index}`"
164
- component-type="disk_devices"
165
- :guest-machine-type="props.guestMachineType"
166
- @remove-error-by-title="emits('remove-error-by-title', $event)"
167
- />
168
- </template>
169
- </atoms-stack-block>
170
- </div>
171
- </template>
172
-
173
- <script setup lang="ts">
174
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
175
- import type {
176
- UI_I_SendDataNewHardDisk,
177
- UI_I_SendDataNewHardDiskStorage,
178
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
179
- import type { UI_T_HardDiskType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
180
- import type { UI_I_Localization } from '~/lib/models/interfaces'
181
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
182
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
183
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
184
- import { binaryOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/binaryOptions'
185
-
186
- const props = defineProps<{
187
- storage: UI_I_DatastoreTableItem | null
188
- hardDisk: UI_I_SendDataNewHardDisk
189
- type: UI_T_HardDiskType
190
- index: number
191
- errorValidationFields: UI_I_ErrorValidationField<string>[]
192
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
193
- datastore: UI_I_DatastoreTableItem[]
194
- isEdit: boolean
195
- state?: string | number
196
- guestMachineType?: UI_I_OptionItem | null
197
- }>()
198
- const emits = defineEmits<{
199
- (event: 'send-data', value: UI_I_SendDataNewHardDisk): void
200
- (event: 'invalid', value: boolean): void
201
- (event: 'remove'): void
202
- (event: 'roll-back'): void
203
- (event: 'remove-error-by-title', value: string): void
204
- }>()
205
-
206
- const localization = computed<UI_I_Localization>(() => useLocal())
207
-
208
- const isRunning = computed<boolean>(() => {
209
- return props.state === 2
210
- })
211
-
212
- const isRemovable = computed<boolean>(() => {
213
- return (
214
- !props.isEdit ||
215
- !isRunning.value ||
216
- (isRunning.value && bus.value === 'virtio')
217
- )
218
- })
219
-
220
- const typeError = computed<string>(() => `disk_devices[${props.index}].size`)
221
-
222
- const apiErrorLocal = computed<string>(() => {
223
- return (
224
- props.errorValidationFields?.find(
225
- (message) => message.field === typeError.value
226
- )?.error_message || ''
227
- )
228
- })
229
-
230
- const { $binary } = useNuxtApp()
231
-
232
- const label = computed<string>(() => {
233
- if (props.type === 'edit' || props.type === 'removed')
234
- return `${localization.value.common.hardDisk} ${props.index + 1}`
235
-
236
- return `${localization.value.common.newHardDisk} *`
237
- })
238
-
239
- const maxHardDisk = computed<number>(() => {
240
- if (props.type === 'exist') return $binary.gbToMb(props.hardDisk.size)
241
-
242
- if (!storage.value) return 0
243
-
244
- if (props.isEdit)
245
- return storage.value.capacity.free_mb + $binary.gbToMb(props.hardDisk.size)
246
-
247
- return storage.value.capacity.free_mb
248
- })
249
- const hardDiskTypeErrorLocalText = computed<string>(() => {
250
- if (+sizeInMb.value > maxHardDisk.value) {
251
- return localization.value.common.diskCapacitySpecifiedGreater
252
- }
253
-
254
- if (+sizeInMb.value <= 0) {
255
- return localization.value.common.diskCapacityCannotZero
256
- }
257
-
258
- return ''
259
- })
260
-
261
- const hardDiskLocalAndApiErrorsTexts = computed<string>(() => {
262
- const localError = hardDiskTypeErrorLocalText.value
263
- const apiError = apiErrorLocal.value
264
-
265
- let result = ''
266
- if (localError && !apiError) result = localError
267
- if (!localError && apiError) result = apiError
268
- if (localError && apiError) result = localError + ', ' + apiError
269
- if (!localError && apiError) result = apiError
270
-
271
- return result
272
- })
273
-
274
- const deleteFilesFromDatastore = ref<boolean>(false)
275
-
276
- const hardDiskType = ref<string>('gb')
277
- const hardDiskTypeOptions = ref<UI_I_OptionItem[]>(
278
- binaryOptionsFunc(localization.value)
279
- )
280
-
281
- const size = ref<number>(props.hardDisk.size) // Изначально всегда приходит в gb
282
- const sizeInMb = computed<number>(() => {
283
- if (hardDiskType.value === 'mb') {
284
- return size.value
285
- }
286
-
287
- return $binary.universalFromTo(size.value, hardDiskType.value, 'mb')
288
- })
289
- const onValidateSize = (): void => {
290
- if (props.type !== 'edit') return
291
- if (sizeInMb.value < $binary.gbToMb(props.hardDisk.size)) {
292
- size.value = $binary.universalFromTo(
293
- props.hardDisk.size,
294
- 'gb',
295
- hardDiskType.value
296
- )
297
- }
298
- }
299
-
300
- const isDisabledSize = computed<boolean>(() => {
301
- return props.type === 'exist' || (props.type === 'edit' && readOnly.value)
302
- })
303
-
304
- const onRemoveHardDisk = (): void => {
305
- emits('remove')
306
- }
307
- const onRollBackHardDisk = (): void => {
308
- emits('roll-back')
309
- }
310
-
311
- const location = ref<UI_I_DatastoreTableItem | null>(props.storage || null)
312
- watch(
313
- () => props.storage,
314
- (newValue) => {
315
- location.value = newValue
316
- storage.value = newValue
317
- }
318
- )
319
- const storage = ref<UI_I_DatastoreTableItem | null>(props.storage)
320
- const onChangeStorage = (item: UI_I_DatastoreTableItem): void => {
321
- storage.value = item
322
- }
323
-
324
- const diskProvisioning = ref<string>('thick')
325
- const sharing = ref<string>('')
326
- const shares = ref<number>(0)
327
-
328
- const limitIops = ref<number>(16)
329
- const limitIopsType = ref<string>('unlimited')
330
- const limitIopsInvalid = ref<boolean>(false)
331
-
332
- const diskMode = ref<string>('dependent')
333
-
334
- const cache = ref<string>('none')
335
-
336
- const bus = ref<string>('ide')
337
-
338
- const readOnly = ref<boolean>(false)
339
-
340
- const discard = ref<string>('')
341
-
342
- const io = ref<string>('')
343
-
344
- const target = ref<string>('')
345
-
346
- watch(
347
- [
348
- sizeInMb,
349
- storage,
350
- diskProvisioning,
351
- sharing,
352
- limitIops,
353
- limitIopsType,
354
- diskMode,
355
- cache,
356
- bus,
357
- deleteFilesFromDatastore,
358
- (): void => props.type,
359
- ],
360
- () => {
361
- const limitIopsLocal =
362
- limitIopsType.value === 'unlimited' ? 0 : limitIops.value
363
- const storageLocal: UI_I_SendDataNewHardDiskStorage = {
364
- id: storage.value?.id || '',
365
- name: storage.value?.name || '',
366
- type: storage.value?.type_text || '',
367
- pool: storage.value?.pool_name || '',
368
- user: '',
369
- endpoint: '',
370
- password: '',
371
- protocol: '',
372
- options: '',
373
- }
374
-
375
- emits('send-data', {
376
- create: props.hardDisk.create,
377
- attach: props.hardDisk.attach,
378
- source: props.hardDisk.source,
379
- size: Math.ceil(sizeInMb.value),
380
- bus: bus.value,
381
- target: target.value,
382
- storage: storageLocal,
383
- device_type: 'disk',
384
- provision_type: diskProvisioning.value,
385
- disk_mode: diskMode.value,
386
- sharing: sharing.value === 'yes',
387
- read_only: readOnly.value,
388
- shares: shares.value,
389
- cache: cache.value,
390
- io: io.value,
391
- limit_iops: limitIopsLocal,
392
- discard: discard.value,
393
- capacity: Math.ceil(sizeInMb.value),
394
- boot_order: props.hardDisk.boot_order,
395
- detach: props.type === 'removed',
396
- remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
397
- })
398
- },
399
- { immediate: true }
400
- )
401
-
402
- // Добавляем данные для редактирования
403
- watch(
404
- () => props.hardDisk,
405
- (newValue) => {
406
- // TODO refactoring
407
- if (props.type === 'exist') {
408
- diskProvisioning.value = newValue.provision_type || 'thick'
409
- return
410
- }
411
- if (props.type !== 'edit') return
412
-
413
- diskProvisioning.value = newValue.provision_type || 'thick'
414
- sharing.value = newValue.sharing ? 'yes' : ''
415
- shares.value = newValue.shares || 0
416
- // limitIopsType.value = newValue.io === 'native' ? 'unlimited' : 'custom'
417
- limitIopsType.value = newValue.limit_iops === 0 ? 'unlimited' : 'custom'
418
- limitIops.value = newValue.limit_iops || 16
419
- diskMode.value = newValue.disk_mode || 'dependent'
420
- cache.value = newValue.cache || 'none'
421
- bus.value = newValue.bus || 'ide'
422
- readOnly.value = newValue.read_only || false
423
- discard.value = newValue.discard || ''
424
- io.value = newValue.io || ''
425
- target.value = newValue.target || ''
426
- },
427
- { immediate: true }
428
- )
429
- watch(
430
- isRunning,
431
- (newValue) => {
432
- if (newValue && props.type === 'new') {
433
- bus.value = 'virtio'
434
- }
435
- },
436
- { immediate: true }
437
- )
438
-
439
- const hardDiskInvalid = computed<boolean>(() => {
440
- return !!hardDiskTypeErrorLocalText.value || limitIopsInvalid.value
441
- })
442
- watch(
443
- hardDiskInvalid,
444
- (newValue) => {
445
- emits('invalid', newValue)
446
- },
447
- { immediate: true }
448
- )
449
- </script>
450
-
451
- <style scoped lang="scss">
452
- .hardware-cpu {
453
- #hard-disk {
454
- width: 100px;
455
- -webkit-appearance: none;
456
-
457
- &.has-error {
458
- border: 1px solid #db2100;
459
- }
460
- }
461
- }
462
- </style>
@@ -1,81 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.cache }}
6
- </template>
7
- <template #stackBlockContent>
8
- <atoms-tooltip-error
9
- :has-error="!!apiError"
10
- :selector="`.vm-wizard-disk-device-cache-field-${props.index}`"
11
- @remove="onRemoveValidationError"
12
- >
13
- <template #elem>
14
- <div class="select">
15
- <select
16
- :id="`vm-wizard-disk-device-cache-field-${props.index}`"
17
- v-model="cacheLocal"
18
- :data-id="`vm-wizard-disk-device-cache-field-${props.index}`"
19
- :class="`vm-wizard-disk-device-cache-field-${props.index}`"
20
- :disabled="props.disabled"
21
- >
22
- <option
23
- v-for="(item, key) in cacheOptions"
24
- :key="key"
25
- :value="item.value"
26
- >
27
- {{ item.text }}
28
- </option>
29
- </select>
30
- </div>
31
- </template>
32
- <template #content>{{ apiError }}</template>
33
- </atoms-tooltip-error>
34
- </template>
35
- </atoms-stack-block>
36
- </div>
37
- </template>
38
-
39
- <script setup lang="ts">
40
- import type { UI_I_Localization } from '~/lib/models/interfaces'
41
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
42
- import { cacheOptions } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options'
43
-
44
- const localization = computed<UI_I_Localization>(() => useLocal())
45
-
46
- const props = defineProps<{
47
- cache: string
48
- index: number
49
- disabled: boolean
50
- errorValidationFields: UI_I_ErrorValidationField[]
51
- }>()
52
- const emits = defineEmits<{
53
- (event: 'update:cache', value: string): void
54
- (event: 'remove-error-by-title', value: string): void
55
- }>()
56
-
57
- const cacheLocal = computed<string>({
58
- get() {
59
- return props.cache
60
- },
61
- set(newValue) {
62
- emits('update:cache', newValue)
63
- },
64
- })
65
-
66
- const typeError = computed<string>(() => `disk_devices[${props.index}].cache`)
67
-
68
- const apiError = computed<string>(() => {
69
- return (
70
- props.errorValidationFields?.find(
71
- (message) => message.field === typeError.value
72
- )?.error_message || ''
73
- )
74
- })
75
-
76
- const onRemoveValidationError = (): void => {
77
- emits('remove-error-by-title', typeError.value)
78
- }
79
- </script>
80
-
81
- <style scoped></style>
@@ -1,7 +0,0 @@
1
- export const cacheOptions = [
2
- { text: 'None', value: 'none' },
3
- { text: 'Write Through', value: 'writethrough' },
4
- { text: 'Write Back', value: 'writeback' },
5
- { text: 'Direct Sync', value: 'directsync' },
6
- { text: 'Unsafe', value: 'unsafe' },
7
- ]
@@ -1,153 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.limitIops }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <atoms-tooltip-error
10
- :has-error="!!apiError"
11
- :selector="`.vm-wizard-disk-device-io-field-${props.index}`"
12
- @remove="onRemoveValidationError"
13
- >
14
- <template #elem>
15
- <div class="select mr-1">
16
- <select
17
- :id="`vm-wizard-disk-device-io-field-${props.index}`"
18
- v-model="limitIopsTypeLocal"
19
- :data-id="`vm-wizard-disk-device-io-field-${props.index}`"
20
- :class="`vm-wizard-disk-device-io-field-${props.index}`"
21
- @click.stop
22
- >
23
- <option
24
- v-for="(item, key) in limitIopsTypeOptions"
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
-
36
- <atoms-combobox
37
- v-show="limitIopsType !== 'unlimited'"
38
- v-model.number="limitIopsLocal"
39
- :items="limitIopsOptions"
40
- :test-id="`limit-iops-combobox-${props.index}`"
41
- @click.stop
42
- />
43
- <div v-show="limitIopsErrorText" class="flex-align-center">
44
- <atoms-tooltip>
45
- <template #elem>
46
- <atoms-the-icon
47
- width="24px"
48
- height="24px"
49
- class="is-error tooltip-trigger"
50
- name="info"
51
- />
52
- </template>
53
- <template #content>
54
- {{ limitIopsErrorText }}
55
- </template>
56
- </atoms-tooltip>
57
- </div>
58
- </div>
59
- </template>
60
- </atoms-stack-block>
61
- </div>
62
- </template>
63
-
64
- <script setup lang="ts">
65
- import type { UI_I_Localization } from '~/lib/models/interfaces'
66
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
67
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
68
- import {
69
- limitIopsOptionsFunc,
70
- limitIopsTypeOptionsFunc,
71
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options'
72
-
73
- const localization = computed<UI_I_Localization>(() => useLocal())
74
-
75
- const props = defineProps<{
76
- limitIops: number
77
- limitIopsType: string
78
- index: number
79
- errorValidationFields: UI_I_ErrorValidationField<string>[]
80
- }>()
81
- const emits = defineEmits<{
82
- (event: 'update:limit-iops', value: number): void
83
- (event: 'update:limit-iops-type', value: string): void
84
- (event: 'valid', value: boolean): void
85
- (event: 'remove-error-by-title', value: string): void
86
- }>()
87
-
88
- const limitIopsTypeOptions = ref<UI_I_OptionItem[]>(
89
- limitIopsTypeOptionsFunc(localization.value)
90
- )
91
-
92
- const minLimitIops = 16
93
- const maxLimitIops = 2_147_483_647
94
- const limitIopsOptions = ref<UI_I_OptionItem[]>(
95
- limitIopsOptionsFunc(localization.value, minLimitIops, maxLimitIops)
96
- )
97
-
98
- const limitIopsLocal = computed<number>({
99
- get() {
100
- return props.limitIops
101
- },
102
- set(newValue) {
103
- emits('update:limit-iops', +newValue)
104
- },
105
- })
106
- const limitIopsTypeLocal = computed<string>({
107
- get() {
108
- return props.limitIopsType
109
- },
110
- set(newValue) {
111
- emits('update:limit-iops-type', newValue)
112
- },
113
- })
114
-
115
- const limitIopsErrorText = computed<string>(() => {
116
- if (limitIopsTypeLocal.value === 'unlimited') return ''
117
-
118
- const validValue = /^\d+(\.\d+)?$/.test(props.limitIops + '')
119
- if (!validValue) {
120
- return localization.value.common.inputContainsInvalidCharacters
121
- }
122
-
123
- if (+props.limitIops < minLimitIops || +props.limitIops > maxLimitIops) {
124
- return localization.value.common.enterValueBetween
125
- .replace('{0}', '' + minLimitIops)
126
- .replace('{1}', '' + maxLimitIops)
127
- }
128
- return ''
129
- })
130
- watch(
131
- limitIopsErrorText,
132
- (newValue) => {
133
- emits('valid', !!newValue)
134
- },
135
- { immediate: true }
136
- )
137
-
138
- const typeError = computed<string>(() => `disk_devices[${props.index}].io`)
139
-
140
- const apiError = computed<string>(() => {
141
- return (
142
- props.errorValidationFields?.find(
143
- (message) => message.field === typeError.value
144
- )?.error_message || ''
145
- )
146
- })
147
-
148
- const onRemoveValidationError = (): void => {
149
- emits('remove-error-by-title', typeError.value)
150
- }
151
- </script>
152
-
153
- <style scoped></style>