bfg-common 1.4.398 → 1.4.399

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 +1 -1
  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,57 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.cdDvdMedia }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <input
10
- id="vm-wizard-dvd-media-input"
11
- v-model="cdDvdMediaLocal"
12
- data-id="vm-wizard-dvd-media-input"
13
- type="text"
14
- disabled
15
- />
16
- <button
17
- id="vm-wizard-dvd-media-input"
18
- data-id="vm-wizard-dvd-media-input"
19
- class="button btn btn-default btn-sm"
20
- @click="onBrowse"
21
- >
22
- {{ localization.common.browse }}...
23
- </button>
24
- </div>
25
- </template>
26
- </atoms-stack-block>
27
- </div>
28
- </template>
29
-
30
- <script setup lang="ts">
31
- import type { UI_I_Localization } from '~/lib/models/interfaces'
32
-
33
- const props = defineProps<{
34
- cdDvdMedia: string
35
- }>()
36
- const emits = defineEmits<{
37
- (event: 'update:cd-dvd-media', value: string): void
38
- (event: 'browse'): void
39
- }>()
40
-
41
- const localization = computed<UI_I_Localization>(() => useLocal())
42
-
43
- const cdDvdMediaLocal = computed<string>({
44
- get() {
45
- return props.cdDvdMedia
46
- },
47
- set(newValue) {
48
- emits('update:cd-dvd-media', newValue)
49
- },
50
- })
51
-
52
- const onBrowse = (): void => {
53
- emits('browse')
54
- }
55
- </script>
56
-
57
- <style scoped></style>
@@ -1,110 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.coresPerSocket }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="clr-control-container">
9
- <div class="clr-select-wrapper">
10
- <atoms-tooltip-error
11
- :has-error="!!apiError"
12
- selector="#vm-wizard-core-per-socket-field"
13
- @remove="onRemoveValidationError"
14
- >
15
- <template #elem>
16
- <select
17
- id="vm-wizard-core-per-socket-field"
18
- v-model="selectedCorePerSocketLocal"
19
- data-id="vm-wizard-core-per-socket-field"
20
- :disabled="props.disabled"
21
- >
22
- <option
23
- v-for="(item, key) in socketOptions"
24
- :key="key"
25
- :value="item"
26
- >
27
- {{ item }}
28
- </option>
29
- </select>
30
- </template>
31
- <template #content>{{ apiError }}</template>
32
- </atoms-tooltip-error>
33
- </div>
34
- <div class="clr-subtext">
35
- {{ localization.common.sockets }}: {{ socketsCount }}
36
- </div>
37
- </div>
38
- </template>
39
- </atoms-stack-block>
40
- </div>
41
- </template>
42
-
43
- <script setup lang="ts">
44
- import type { UI_I_Localization } from '~/lib/models/interfaces'
45
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
46
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
47
-
48
- const localization = computed<UI_I_Localization>(() => useLocal())
49
-
50
- const props = defineProps<{
51
- cpuOptions: UI_I_OptionItem[]
52
- selectedCpus: number[]
53
- selectedCorePerSocket: number
54
- isEdit: boolean
55
- disabled: boolean
56
- errorValidationFields: UI_I_ErrorValidationField[]
57
- }>()
58
- const emits = defineEmits<{
59
- (event: 'update:selected-core-per-socket', value: number): void
60
- (event: 'remove-error-by-title', value: string): void
61
- }>()
62
-
63
- const apiError = computed<string>(() => {
64
- return (
65
- props.errorValidationFields?.find(
66
- (message) => message.field === 'cpu.core_per_socket'
67
- )?.error_message || ''
68
- )
69
- })
70
-
71
- const socketOptions = computed<number[]>(() => {
72
- const result = []
73
- const cpus = props.cpuOptions[1].value
74
- for (let i = 1; i <= cpus; i++) {
75
- const isCommonDivisor = props.selectedCpus.every(
76
- (cpu) => i <= cpu && (cpu % i === 0 || i === 1)
77
- )
78
- if (isCommonDivisor || props.disabled) {
79
- result.push(i)
80
- }
81
- }
82
- return result
83
- })
84
- watch(
85
- socketOptions,
86
- () => {
87
- !socketOptions.value.includes(selectedCorePerSocketLocal.value) &&
88
- !props.disabled &&
89
- (selectedCorePerSocketLocal.value = 1)
90
- },
91
- { deep: true }
92
- )
93
- const socketsCount = computed<number>(() => {
94
- return props.selectedCpus[0] / props.selectedCorePerSocket
95
- })
96
- const selectedCorePerSocketLocal = computed<number>({
97
- get() {
98
- return props.selectedCorePerSocket
99
- },
100
- set(newValue) {
101
- emits('update:selected-core-per-socket', +newValue)
102
- },
103
- })
104
-
105
- const onRemoveValidationError = (): void => {
106
- emits('remove-error-by-title', 'cpu.core_per_socket')
107
- }
108
- </script>
109
-
110
- <style scoped></style>
@@ -1,403 +0,0 @@
1
- <template>
2
- <div class="hardware-cpu">
3
- <atoms-stack-block :has-children="true" test-id="cpu-stack-block">
4
- <template #stackBlockKey>
5
- <div
6
- id="vm-wizard-toggle-block-cpu"
7
- data-id="vm-wizard-toggle-block-cpu"
8
- class="flex-align-center"
9
- >
10
- <span>{{ localization.common.cpu }}</span>
11
- <atoms-the-icon
12
- v-show="cpuInvalid"
13
- width="24px"
14
- height="24px"
15
- class="is-error tooltip-trigger"
16
- name="info"
17
- />
18
- </div>
19
- </template>
20
- <template #stackBlockContent>
21
- <div class="flex-align-center flex-space-between">
22
- <div class="flex-align-center">
23
- <atoms-tooltip-error
24
- :has-error="!!vcpusLocalAndApiErrorsTexts"
25
- selector="#vm-wizard-vcpus-field input"
26
- @remove="onRemoveValidationError"
27
- >
28
- <template #elem>
29
- <atoms-combobox
30
- id="vm-wizard-vcpus-field"
31
- class="input-text-color"
32
- v-model.number="selectedCpu"
33
- :items="cpuOptions"
34
- :disabled="isCpuDisabled"
35
- test-id="vm-wizard-cpu-combobox"
36
- @click.stop
37
- />
38
- </template>
39
- <template #content>{{ vcpusLocalAndApiErrorsTexts }}</template>
40
- </atoms-tooltip-error>
41
- </div>
42
-
43
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-tooltip
44
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
45
- />
46
- </div>
47
- </template>
48
- <template #stackChildren>
49
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-cores-per-socket
50
- v-model:selected-core-per-socket="selectedCorePerSocket"
51
- :selected-cpus="selectedCpus"
52
- :cpu-options="cpuOptions"
53
- :is-edit="props.isEdit"
54
- :disabled="isDisabled"
55
- :error-validation-fields="props.errorValidationFields"
56
- @remove-error-by-title="emits('remove-error-by-title', $event)"
57
- />
58
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-hot-plug
59
- v-model:enable-cpu-hot-add="enableCpuHotAdd"
60
- :disabled="enableCpuHotAddDisabled"
61
- />
62
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-max-cpu
63
- v-show="enableCpuHotAdd"
64
- v-model:selected-max-cpu.number="selectedMaxCpu"
65
- :cpu-options="maxCpuOptions"
66
- :error-validation-fields="props.errorValidationFields"
67
- :disabled="isDisabled"
68
- @invalid="maxCpuInvalid = $event"
69
- @remove-error-by-title="emits('remove-error-by-title', $event)"
70
- />
71
- <common-vm-actions-common-customize-hardware-virtual-hardware-reservation
72
- v-model:reservation="reservation"
73
- v-model:reservation-type="reservationType"
74
- :error-validation-fields="props.errorValidationFields"
75
- :disabled="isDisabled"
76
- type="mhz"
77
- component-type="cpu"
78
- @invalid="reservationInvalid = $event"
79
- @remove-error-by-title="emits('remove-error-by-title', $event)"
80
- />
81
- <common-vm-actions-common-customize-hardware-virtual-hardware-limit
82
- v-model:limit="limit"
83
- v-model:limit-type="limitType"
84
- :error-validation-fields="props.errorValidationFields"
85
- :disabled="isDisabled"
86
- type="mhz"
87
- component-type="cpu"
88
- @invalid="limitInvalid = $event"
89
- @remove-error-by-title="emits('remove-error-by-title', $event)"
90
- />
91
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-shares
92
- v-model:shares="shares"
93
- v-model:shares-type="sharesType"
94
- :error-validation-fields="props.errorValidationFields"
95
- :disabled="isDisabled"
96
- @remove-error-by-title="emits('remove-error-by-title', $event)"
97
- @invalid="sharesInvalid = $event"
98
- />
99
- <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-hv-->
100
- <!-- v-models:hardwareVirtualization="hardwareVirtualization"-->
101
- <!-- />-->
102
- <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-pc-->
103
- <!-- v-models:performanceCounters="performanceCounters"-->
104
- <!-- />-->
105
- <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-sa-->
106
- <!-- v-models:schedulingAffinity="schedulingAffinity"-->
107
- <!-- />-->
108
- <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-iommu-->
109
- <!-- v-models:iommu="iommu"-->
110
- <!-- />-->
111
- <common-vm-actions-common-customize-hardware-virtual-hardware-cpu-model
112
- v-model:cpu-model="cpuModel"
113
- v-model:passthrough-host-cpu="passthroughHostCpu"
114
- v-model:host-model-cpu="hostModelCpu"
115
- :cpu-models="props.cpuModels"
116
- :is-edit="props.isEdit"
117
- :error-validation-fields="props.errorValidationFields"
118
- :disabled="isDisabled"
119
- @remove-error-by-title="emits('remove-error-by-title', $event)"
120
- />
121
- </template>
122
- </atoms-stack-block>
123
- </div>
124
- </template>
125
-
126
- <script setup lang="ts">
127
- import type { UI_I_SendDataCpu } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
128
- import type { UI_I_Localization } from '~/lib/models/interfaces'
129
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
130
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
131
- import type { API_UI_I_VmEditCpu } from '~/lib/models/store/vm/interfaces'
132
- import { cpuOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/lib/config/cpuOptions'
133
-
134
- const props = defineProps<{
135
- maxCpus: number
136
- cpuModels: UI_I_OptionItem[]
137
- isEdit: boolean
138
- errorValidationFields: UI_I_ErrorValidationField<string>[]
139
- vmCpuHelpTextSecond?: string
140
- state?: string | number
141
- cpu?: API_UI_I_VmEditCpu
142
- }>()
143
- const emits = defineEmits<{
144
- (event: 'send-data', value: UI_I_SendDataCpu): void
145
- (event: 'invalid', value: boolean): void
146
- (event: 'remove-error-by-title', value: string): void
147
- }>()
148
-
149
- const localization = computed<UI_I_Localization>(() => useLocal())
150
-
151
- const isDisabled = computed<boolean>(() => {
152
- return props.state === 2
153
- })
154
-
155
- const cpuOptions = computed<UI_I_OptionItem[]>(() =>
156
- cpuOptionsFunc(localization.value, 1, props.maxCpus)
157
- )
158
-
159
- const enableCpuHotAdd = ref<boolean>(false)
160
- const enableCpuHotAddDisabled = computed<boolean>(
161
- () => selectedCpu.value >= props.maxCpus || isDisabled.value
162
- )
163
- watch(enableCpuHotAdd, (newValue) => {
164
- console.log(newValue, 333)
165
- if (newValue) return
166
-
167
- maxCpuInvalid.value = false
168
- selectedMaxCpu.value = 1
169
- })
170
-
171
- const selectedCpu = ref<number>(
172
- isDisabled.value && enableCpuHotAdd.value ? props.maxCpus : 2
173
- )
174
- const isCpuDisabled = computed<boolean>(
175
- () => isDisabled.value && !enableCpuHotAdd.value
176
- )
177
- watch(selectedCpu, (newValue) => {
178
- selectedCpu.value = Math.floor(+newValue)
179
- if (!(selectedCpu.value % selectedCorePerSocket.value) || isDisabled.value)
180
- return
181
- selectedCorePerSocket.value = 1
182
- })
183
- const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
184
- cpuOptionsFunc(localization.value, selectedCpu.value, props.maxCpus)
185
- )
186
- watch(selectedCpu, (newValue) => {
187
- if (newValue >= props.maxCpus) {
188
- console.log(444)
189
- enableCpuHotAdd.value = false
190
- }
191
- // selectedMaxCpu.value =
192
- // selectedMaxCpu.value <= newValue ? newValue + 1 : selectedMaxCpu.value
193
- // if (selectedMaxCpu.value > props.maxCpus) selectedMaxCpu.value = props.maxCpus
194
- })
195
- const selectedMaxCpu = ref<number>(1)
196
- watch(
197
- () => props.maxCpus,
198
- (newValue) => {
199
- selectedMaxCpu.value = newValue
200
- }
201
- )
202
-
203
- const selectedCpus = computed<number[]>(() =>
204
- enableCpuHotAdd.value
205
- ? [selectedCpu.value, selectedMaxCpu.value]
206
- : [selectedCpu.value]
207
- )
208
-
209
- const selectedCorePerSocket = ref<number>(1)
210
-
211
- const cpuErrorLocalText = computed<string>(() => {
212
- const validValue = /^\d+(\.\d+)?$/.test(selectedCpu.value + '')
213
- if (!validValue) {
214
- return localization.value.common.inputContainsInvalidCharacters
215
- }
216
-
217
- const min = cpuOptions.value[0].value
218
- const max = cpuOptions.value[1].value
219
- if (selectedCpu.value < min || selectedCpu.value > max) {
220
- return localization.value.common.memoryMustBe
221
- .replace('{0}', min)
222
- .replace('{1}', max)
223
- }
224
-
225
- return ''
226
- })
227
-
228
- const apiVcpusError = computed<string>(() => {
229
- return (
230
- props.errorValidationFields?.find(
231
- (message) => message.field === 'cpu.vcpus'
232
- )?.error_message || ''
233
- )
234
- })
235
-
236
- const vcpusLocalAndApiErrorsTexts = computed<string>(() => {
237
- const localError = cpuErrorLocalText.value
238
- const apiError = apiVcpusError.value
239
-
240
- let result = ''
241
- if (localError && !apiError) result = localError
242
- if (!localError && apiError) result = apiError
243
- if (localError && apiError) result = localError + ', ' + apiError
244
- if (!localError && apiError) result = apiError
245
-
246
- return result
247
- })
248
- const reservationInvalid = ref<boolean>(false)
249
- const limitInvalid = ref<boolean>(false)
250
- const sharesInvalid = ref<boolean>(false)
251
- const maxCpuInvalid = ref<boolean>(false)
252
- const cpuInvalid = computed<boolean>(
253
- () =>
254
- !!cpuErrorLocalText.value ||
255
- reservationInvalid.value ||
256
- limitInvalid.value ||
257
- sharesInvalid.value ||
258
- (enableCpuHotAdd.value &&
259
- selectedCpu.value < props.maxCpus &&
260
- maxCpuInvalid.value)
261
- )
262
- watch(
263
- cpuInvalid,
264
- (newValue: boolean) => {
265
- emits('invalid', newValue)
266
- },
267
- { immediate: true }
268
- )
269
-
270
- const reservation = ref<string>('1')
271
- const reservationType = ref<string>('mhz')
272
-
273
- const limit = ref<string>('Unlimited')
274
- const limitType = ref<string>('mhz')
275
-
276
- const shares = ref<string>('2000')
277
- const sharesType = ref<string>('2000')
278
-
279
- // const hardwareVirtualization = ref<boolean>(false)
280
- //
281
- // const performanceCounters = ref<boolean>(false)
282
- //
283
- // const schedulingAffinity = ref<string>('')
284
- //
285
- // const iommu = ref<boolean>(false)
286
-
287
- // const cpuModel = ref<string>(props.cpuModels[0]?.value || '')
288
- const cpuModel = ref<string>('host-model') // PNCWEB-389
289
- watch(
290
- () => props.cpuModels,
291
- (newValue) => {
292
- cpuModel.value = newValue[0].value
293
- }
294
- )
295
- const passthroughHostCpu = ref<boolean>(false)
296
- const hostModelCpu = ref<boolean>(false)
297
-
298
- // const isShowCpuHelp = ref<boolean>(false)
299
-
300
- const { $binary } = useNuxtApp()
301
- watch(
302
- [
303
- reservation,
304
- reservationType,
305
- limit,
306
- limitType,
307
- shares,
308
- selectedCpu,
309
- selectedMaxCpu,
310
- selectedCorePerSocket,
311
- enableCpuHotAdd,
312
- cpuModel,
313
- passthroughHostCpu,
314
- hostModelCpu,
315
- ],
316
- () => {
317
- const reservationInMhz =
318
- reservationType.value === 'ghz'
319
- ? $binary.ghzToMhz(+reservation.value)
320
- : +reservation.value
321
- const limitInMhz =
322
- limit.value === 'Unlimited'
323
- ? limit.value
324
- : limitType.value === 'ghz'
325
- ? $binary.ghzToMhz(+limit.value)
326
- : +limit.value
327
- const model = passthroughHostCpu.value
328
- ? 'host-passthrough'
329
- : hostModelCpu.value
330
- ? 'host-model'
331
- : cpuModel.value
332
-
333
- emits('send-data', {
334
- model,
335
- vcpus: selectedCpu.value,
336
- max_vcpus: enableCpuHotAdd.value ? selectedMaxCpu.value : 0,
337
- core_per_socket: selectedCorePerSocket.value,
338
- reservation_mhz: reservationInMhz,
339
- limit_mhz: limitInMhz,
340
- shares: +shares.value,
341
- hotplug: enableCpuHotAdd.value,
342
- })
343
- },
344
- {
345
- immediate: true,
346
- }
347
- )
348
-
349
- // Добавляем данные для редактирования
350
- watch(
351
- () => props.cpu,
352
- (newValue) => {
353
- if (!newValue) return
354
-
355
- console.log(newValue.hotplug, 555)
356
- enableCpuHotAdd.value = newValue.hotplug
357
- selectedCpu.value = newValue.vcpus
358
- selectedMaxCpu.value = newValue.hotplug ? newValue.max_vcpus : 1
359
- selectedCorePerSocket.value = newValue.core_per_socket
360
- reservation.value = '' + newValue.reservation_mhz
361
- limit.value = '' + newValue.limit_mhz
362
- shares.value = '' + newValue.shares
363
-
364
- switch (newValue.model) {
365
- case 'host-passthrough':
366
- passthroughHostCpu.value = true
367
- cpuModel.value = ''
368
- break
369
- case 'host-model':
370
- hostModelCpu.value = true
371
- cpuModel.value = ''
372
- break
373
- default:
374
- cpuModel.value =
375
- props.cpuModels.find((model) => model.value === newValue.model)
376
- ?.value || cpuModel.value
377
- }
378
- },
379
- { immediate: true }
380
- )
381
-
382
- const onRemoveValidationError = (): void => {
383
- emits('remove-error-by-title', 'cpu.vcpus')
384
- }
385
- </script>
386
-
387
- <style scoped lang="scss">
388
- h3.cpu-help-title {
389
- margin-top: 7px;
390
- font-size: 22px;
391
- color: #565656;
392
- }
393
- p.cpu-help-text {
394
- width: 310px;
395
- margin-top: 24px;
396
- font-size: 14px;
397
- color: #565656;
398
- }
399
- a.cpu-more-info {
400
- color: #00648f;
401
- font-size: 14px;
402
- }
403
- </style>
@@ -1,56 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.cpuHotPlug }}
6
- </template>
7
- <template #stackBlockContent>
8
- <input
9
- id="enable-cpu-hot-add"
10
- v-model="enableCpuHotAddLocal"
11
- data-id="enable-cpu-hot-add"
12
- type="checkbox"
13
- :disabled="props.disabled"
14
- />
15
- <label
16
- for="enable-cpu-hot-add"
17
- :class="['label-text-normal', props.disabled && 'div-disabled']"
18
- >{{ localization.common.enableCpuHotAdd }}</label
19
- >
20
- </template>
21
- </atoms-stack-block>
22
- </div>
23
- </template>
24
-
25
- <script setup lang="ts">
26
- import type { UI_I_Localization } from '~/lib/models/interfaces'
27
-
28
- const localization = computed<UI_I_Localization>(() => useLocal())
29
-
30
- const props = defineProps<{
31
- enableCpuHotAdd: boolean
32
- disabled: boolean
33
- }>()
34
- const emits = defineEmits<{
35
- (event: 'update:enable-cpu-hot-add', value: boolean): void
36
- }>()
37
-
38
- // const enableCpuHotAddLocal = ref(false)
39
- // const enableCpuHotAddLocal = defineModel('enableCpuHotAdd', {
40
- // required: true,
41
- // })
42
- const enableCpuHotAddLocal = computed<boolean>({
43
- get() {
44
- return props.enableCpuHotAdd
45
- },
46
- set(newValue) {
47
- emits('update:enable-cpu-hot-add', newValue)
48
- },
49
- })
50
- </script>
51
-
52
- <style scoped lang="scss">
53
- #enable-cpu-hot-add {
54
- margin: 4px 4px 0 0;
55
- }
56
- </style>