bfg-common 1.4.397 → 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 (123) hide show
  1. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +1 -1
  2. package/components/common/vm/actions/editSettings/EditSettingsNew.vue +1 -1
  3. package/package.json +1 -1
  4. package/components/common/vm/actions/common/_customizeHardware/CustomizeHardware.vue +0 -274
  5. package/components/common/vm/actions/common/_customizeHardware/lib/config/navItems.ts +0 -21
  6. package/components/common/vm/actions/common/_customizeHardware/lib/models/interfaces.ts +0 -7
  7. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue +0 -702
  8. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/BrowseView.vue +0 -203
  9. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/lib/models/interfaces.ts +0 -8
  10. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/Bus.vue +0 -156
  11. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/lib/config/options.ts +0 -20
  12. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +0 -270
  13. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes.ts +0 -9
  14. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +0 -11
  15. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/models/types.ts +0 -1
  16. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +0 -57
  17. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +0 -110
  18. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Cpu.vue +0 -403
  19. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +0 -56
  20. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuModel.vue +0 -225
  21. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Hv.vue +0 -99
  22. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Iommu.vue +0 -55
  23. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/MaxCpu.vue +0 -106
  24. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Pc.vue +0 -55
  25. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Sa.vue +0 -106
  26. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/lib/config/cpuOptions.ts +0 -21
  27. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/Shares.vue +0 -160
  28. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +0 -28
  29. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +0 -59
  30. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/binaryOptions.ts +0 -12
  31. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/dropdownItems.ts +0 -66
  32. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/interfaces.ts +0 -118
  33. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/types.ts +0 -4
  34. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/Limit.vue +0 -236
  35. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/lib/config/options.ts +0 -28
  36. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/Memory.vue +0 -329
  37. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +0 -54
  38. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/lib/config/memoryOptions.ts +0 -35
  39. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/DiskFile.vue +0 -24
  40. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/MaximumSize.vue +0 -27
  41. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +0 -462
  42. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +0 -81
  43. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options.ts +0 -7
  44. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +0 -153
  45. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options.ts +0 -28
  46. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/Location.vue +0 -172
  47. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +0 -52
  48. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -175
  49. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -167
  50. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +0 -88
  51. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/lib/config/options.ts +0 -18
  52. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +0 -88
  53. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options.ts +0 -15
  54. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +0 -86
  55. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options.ts +0 -12
  56. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/Location.vue +0 -145
  57. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +0 -305
  58. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +0 -87
  59. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/lib/config/options.ts +0 -9
  60. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +0 -148
  61. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/lib/config/options.ts +0 -11
  62. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +0 -168
  63. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -48
  64. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +0 -49
  65. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/lib/config/options.ts +0 -10
  66. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +0 -7
  67. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/note/Note.vue +0 -27
  68. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +0 -42
  69. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +0 -57
  70. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +0 -82
  71. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/lib/config/options.ts +0 -6
  72. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/InputDevices.vue +0 -21
  73. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/Other.vue +0 -32
  74. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/Reservation.vue +0 -237
  75. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/lib/config/options.ts +0 -33
  76. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/Graphics.vue +0 -50
  77. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +0 -121
  78. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/VideoCard.vue +0 -182
  79. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/lib/config/options.ts +0 -11
  80. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/Model.vue +0 -59
  81. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/lib/config/options.ts +0 -10
  82. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +0 -83
  83. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/lib/config/options.ts +0 -14
  84. package/components/common/vm/actions/common/_customizeHardware/vmoptions/Vmoptions.vue +0 -181
  85. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/BootOptions.vue +0 -114
  86. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Menu.vue +0 -50
  87. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Secure.vue +0 -50
  88. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/Delay.vue +0 -54
  89. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/lib/config/config.ts +0 -14
  90. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +0 -84
  91. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/lib/config/config.ts +0 -11
  92. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/Order.vue +0 -201
  93. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +0 -9
  94. package/components/common/vm/actions/common/_customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +0 -192
  95. package/components/common/vm/actions/common/_customizeHardware/vmoptions/lib/models/interfaces.ts +0 -34
  96. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +0 -52
  97. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -52
  98. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -51
  99. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +0 -52
  100. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +0 -50
  101. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +0 -254
  102. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +0 -85
  103. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/lib/config/config.ts +0 -14
  104. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +0 -85
  105. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/lib/config/config.ts +0 -12
  106. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +0 -56
  107. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/lib/config/config.ts +0 -6
  108. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +0 -57
  109. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/lib/config/config.ts +0 -11
  110. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +0 -142
  111. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces.ts +0 -5
  112. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils.ts +0 -12
  113. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +0 -56
  114. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/lib/config/config.ts +0 -11
  115. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +0 -85
  116. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/lib/config/config.ts +0 -12
  117. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +0 -85
  118. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/lib/config/config.ts +0 -7
  119. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +0 -57
  120. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config.ts +0 -14
  121. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +0 -85
  122. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/lib/config/config.ts +0 -12
  123. package/components/common/vm/actions/common/_customizeHardware/vmoptions/tools/Tools.vue +0 -72
@@ -1,160 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.shares }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <div class="select">
10
- <select
11
- id="vm-wizard-cpu-shares-type-select"
12
- v-model="sharesTypeLocal"
13
- data-id="vm-wizard-cpu-shares-type-select"
14
- :disabled="props.disabled"
15
- @change="onChangeSharesType"
16
- >
17
- <option
18
- v-for="(item, key) in sharesTypeOptions"
19
- :key="key"
20
- :value="item.value"
21
- >
22
- {{ item.text }}
23
- </option>
24
- </select>
25
- </div>
26
- <div class="tooltip-top-left combobox-container flex-align-center">
27
- <atoms-tooltip-error
28
- :has-error="!!sharesLocalAndApiErrorsTexts"
29
- selector="#vm-wizard-shares-field input"
30
- @remove="onRemoveValidationError"
31
- >
32
- <template #elem>
33
- <atoms-combobox
34
- id="vm-wizard-shares-field"
35
- v-model="sharesLocal"
36
- :items="sharesOptions"
37
- :disabled="isDisabledShares"
38
- test-id="vm-wizard-shares-field"
39
- @click.stop
40
- />
41
- </template>
42
- <template #content>{{ sharesLocalAndApiErrorsTexts }}</template>
43
- </atoms-tooltip-error>
44
- </div>
45
- </div>
46
- </template>
47
- </atoms-stack-block>
48
- </div>
49
- </template>
50
-
51
- <script setup lang="ts">
52
- import type {
53
- UI_I_Localization,
54
- UI_I_HTMLSelectElement,
55
- } from '~/lib/models/interfaces'
56
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
57
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
58
- import {
59
- sharesTypeOptionsFunc,
60
- sharesOptionsFunc,
61
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options'
62
-
63
- const localization = computed<UI_I_Localization>(() => useLocal())
64
-
65
- const props = defineProps<{
66
- shares: string
67
- sharesType: string
68
- disabled: boolean
69
- errorValidationFields: UI_I_ErrorValidationField<string>[]
70
- }>()
71
- const emits = defineEmits<{
72
- (event: 'update:shares', value: string): void
73
- (event: 'update:shares-type', value: string): void
74
- (event: 'invalid', value: boolean): void
75
- (event: 'remove-error-by-title', value: string): void
76
- }>()
77
-
78
- const apiErrorLocal = computed<string>(() => {
79
- return (
80
- props.errorValidationFields?.find(
81
- (message) => message.field === 'cpu.shares'
82
- )?.error_message || ''
83
- )
84
- })
85
-
86
- const maxShares = 100_000
87
- const sharesOptions = computed<UI_I_OptionItem[]>(() => {
88
- return sharesOptionsFunc(localization.value, maxShares)
89
- })
90
-
91
- const sharesTypeOptions = ref<UI_I_OptionItem[]>(
92
- sharesTypeOptionsFunc(localization.value)
93
- )
94
-
95
- const isDisabledShares = computed<boolean>(
96
- () => sharesTypeLocal.value !== '0' || props.disabled
97
- )
98
- const sharesLocal = computed<string>({
99
- get() {
100
- return props.shares
101
- },
102
- set(newValue) {
103
- emits('update:shares', newValue)
104
- },
105
- })
106
- const sharesTypeLocal = computed<string>({
107
- get() {
108
- return props.sharesType
109
- },
110
- set(newValue) {
111
- emits('update:shares-type', newValue)
112
- },
113
- })
114
- const onChangeSharesType = (event: UI_I_HTMLSelectElement): void => {
115
- const value = event.target.value
116
- if (value === '0') return
117
- sharesLocal.value = event.target.value
118
- }
119
-
120
- const sharesErrorLocalText = computed<string>(() => {
121
- if (+sharesLocal.value < 0 || +sharesLocal.value > maxShares) {
122
- return localization.value.common.sharesMustBe
123
- .replace('{0}', '0')
124
- .replace('{1}', maxShares + '')
125
- }
126
-
127
- const validValue = /^\d+(\.\d+)?$/.test(sharesLocal.value + '')
128
- if (!validValue) {
129
- return localization.value.common.inputContainsInvalidCharacters
130
- }
131
-
132
- return ''
133
- })
134
- const sharesInvalid = computed<boolean>(() => !!sharesErrorLocalText.value)
135
- watch(
136
- sharesInvalid,
137
- (newValue) => {
138
- emits('invalid', newValue)
139
- },
140
- { immediate: true }
141
- )
142
-
143
- const sharesLocalAndApiErrorsTexts = computed<string>(() => {
144
- const localError = sharesErrorLocalText.value
145
- const apiError = apiErrorLocal.value
146
-
147
- let result = ''
148
- if (localError && !apiError) result = localError
149
- if (localError && apiError) result = localError + ', ' + apiError
150
- if (!localError) result = apiError
151
-
152
- return result
153
- })
154
-
155
- const onRemoveValidationError = (): void => {
156
- emits('remove-error-by-title', 'cpu.shares')
157
- }
158
- </script>
159
-
160
- <style scoped></style>
@@ -1,28 +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 sharesOptionsFunc = (
5
- localization: UI_I_Localization,
6
- maxShares: number
7
- ): UI_I_OptionItem[] => {
8
- return [
9
- {
10
- text: `${localization.common.minimum} 0`,
11
- value: 0,
12
- },
13
- {
14
- text: `${localization.common.maximum} ${maxShares}`,
15
- value: maxShares,
16
- },
17
- ]
18
- }
19
- export const sharesTypeOptionsFunc = (
20
- localization: UI_I_Localization
21
- ): UI_I_OptionItem[] => {
22
- return [
23
- { text: localization.common.low, value: '1000' },
24
- { text: localization.common.normal, value: '2000' },
25
- { text: localization.common.high, value: '4000' },
26
- { text: localization.common.custom, value: '0' },
27
- ]
28
- }
@@ -1,59 +0,0 @@
1
- <template>
2
- <div id="cpu-help-icon" class="flex-align-center relative">
3
- <atoms-the-icon
4
- fill="#0072a3"
5
- width="24px"
6
- height="24px"
7
- name="info-circle"
8
- data-id="show-cpu-help-icon"
9
- @click.stop="isShowCpuHelp = !isShowCpuHelp"
10
- />
11
- <Teleport to="body">
12
- <atoms-tooltip-signpost
13
- v-if="isShowCpuHelp"
14
- elem-id="cpu-help-icon"
15
- @hide="isShowCpuHelp = false"
16
- >
17
- <h3 class="cpu-help-title">
18
- {{ localization.mainNavigation.help }}
19
- </h3>
20
-
21
- <p class="cpu-help-text">
22
- {{ localization.common.vmCpuHelpText1 }}
23
- </p>
24
- <p class="cpu-help-text">
25
- {{ props.vmCpuHelpTextSecond }}
26
- </p>
27
- <p class="cpu-help-text">
28
- {{ localization.common.vmCpuHelpText3 }}
29
- </p>
30
- <p class="cpu-help-text">
31
- {{ localization.common.vmCpuHelpText4 }}
32
- </p>
33
-
34
- <div class="flex-justify-end mt-1">
35
- <a
36
- id="cpu-more-info-link"
37
- href="javascript:void(0)"
38
- class="cpu-more-info"
39
- >{{ localization.common.moreInformation }}</a
40
- >
41
- </div>
42
- </atoms-tooltip-signpost>
43
- </Teleport>
44
- </div>
45
- </template>
46
-
47
- <script lang="ts" setup>
48
- import type { UI_I_Localization } from '~/lib/models/interfaces'
49
-
50
- const props = defineProps<{
51
- vmCpuHelpTextSecond: string
52
- }>()
53
-
54
- const localization = computed<UI_I_Localization>(() => useLocal())
55
-
56
- const isShowCpuHelp = ref<boolean>(false)
57
- </script>
58
-
59
- <style lang="scss" scoped></style>
@@ -1,12 +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 binaryOptionsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_OptionItem[] => {
7
- return [
8
- { text: localization.common.mb, value: 'mb' },
9
- { text: localization.common.gb, value: 'gb' },
10
- { text: localization.common.tb, value: 'tb' },
11
- ]
12
- }
@@ -1,66 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_DropdownTreeItem } from '~/components/atoms/dropdown/tree/lib/models/interfaces'
3
- import type { UI_I_PciDevice } from '~/lib/models/store/vm/interfaces'
4
-
5
- export const dropdownItemsFunc = (
6
- localization: UI_I_Localization,
7
- state: string | number | undefined,
8
- passthroughDevices?: UI_I_PciDevice[]
9
- ): UI_I_DropdownTreeItem[] => {
10
- const { $text } = useNuxtApp()
11
-
12
- return [
13
- {
14
- text: localization.common.disksDrivesStorage,
15
- children: [
16
- {
17
- text: $text.toCapitalizeEveryWord(localization.common.hardDisk),
18
- value: 1,
19
- testId: 'disks-drives-storage',
20
- },
21
- {
22
- text: $text.toCapitalizeEveryWord(localization.common.existingHardDisk),
23
- value: 2,
24
- testId: 'existing-hard-disk',
25
- },
26
- // { text: 'RDM Disk', value: 2 },
27
- // { text: 'Host USB Device', value: 3 },
28
- // { text: 'NVDIMM', value: 4 },
29
- { text: localization.common.cdDvdDrive, value: 5, testId: 'cd-dvd-drive' },
30
- ],
31
- },
32
- // {
33
- // text: 'Controllers',
34
- // children: [
35
- // { text: 'NVMe Controller', value: 6 },
36
- // { text: 'SATA Controller', value: 7 },
37
- // { text: 'SCSI Controller', value: 8 },
38
- // { text: 'USB Controller', value: 9 },
39
- // ],
40
- // },
41
- {
42
- text: 'Other Devices',
43
- children: [
44
- {
45
- text: 'PCI Device',
46
- value: 10,
47
- disabled: state === 2 || !passthroughDevices?.length,
48
- testId: 'pci-device',
49
- },
50
- // { text: 'Watchdog Timer', value: 11 },
51
- // { text: 'Precision Clock', value: 12 },
52
- // { text: 'Serial Port', value: 13 },
53
- ],
54
- },
55
- {
56
- text: localization.common.network,
57
- children: [
58
- {
59
- text: $text.toCapitalizeEveryWord(localization.common.networkAdapter),
60
- value: 14,
61
- testId: 'network-adapter',
62
- },
63
- ],
64
- },
65
- ]
66
- }
@@ -1,118 +0,0 @@
1
- export interface UI_I_InvalidKeys {
2
- [key: number]: boolean
3
- }
4
-
5
- export interface UI_I_SendDataVirtualHardware {
6
- cpu: UI_I_SendDataCpu | null
7
- memory: UI_I_SendDataMemory | null
8
- hardDisks: UI_I_SendDataNewHardDisk[]
9
- networks: UI_I_SendDataNewNetwork[]
10
- cdDvdDrives: UI_I_SendDataNewCdDvdDrive[]
11
- usbController: string | null
12
- pciDevices: UI_I_SendDataNewPciDevice[]
13
- videoCard: UI_I_SendDataVideoCard | null
14
- }
15
-
16
- export interface UI_I_SendDataCpu {
17
- vcpus: number
18
- max_vcpus: number
19
- core_per_socket: number
20
- model: string
21
- reservation_mhz: number
22
- limit_mhz: string
23
- shares: number
24
- hotplug: boolean
25
- }
26
-
27
- export interface UI_I_SendDataMemory {
28
- memory: string
29
- hotplug: boolean
30
- reservation_mb: string
31
- limit_mb: string
32
- }
33
-
34
- export interface UI_I_SendDataVideoCard {
35
- adapter: string
36
- displays: number
37
- memory_mb: number
38
- }
39
-
40
- export interface UI_I_SendDataNewHardDiskStorage {
41
- id: string
42
- name: string
43
- type: string
44
- pool: string
45
- endpoint: string
46
- user: string
47
- password: string
48
- protocol: string
49
- options: string
50
- }
51
- export interface UI_I_SendDataNewHardDisk {
52
- create: boolean
53
- source: string
54
- size: number
55
- bus?: string
56
- target?: string
57
- storage?: UI_I_SendDataNewHardDiskStorage
58
- device_type?: string
59
- provision_type?: string
60
- disk_mode?: string
61
- sharing?: boolean
62
- read_only?: boolean
63
- shares?: number
64
- cache?: string
65
- io?: string
66
- limit_iops?: number
67
- discard?: string
68
- storage_id?: string
69
- capacity?: number
70
- boot_order?: number
71
- attach?: boolean
72
- detach?: boolean
73
- remove?: boolean
74
- }
75
-
76
- export interface UI_I_SendDataNewNetwork {
77
- network: string
78
- net_bridge: string
79
- mac: string
80
- target: string
81
- model: string
82
- boot_order: number
83
- }
84
- export interface UI_I_SendDataNewCdDvdDrive {
85
- create: boolean
86
- source: string
87
- bus: string
88
- device_type: 'cdrom'
89
- boot_order: number
90
- size?: number
91
- target?: string
92
- storage_id?: string
93
- provision_type?: string
94
- disk_mode?: string
95
- sharing?: boolean
96
- read_only?: boolean
97
- shares?: number
98
- cache?: string
99
- io?: string
100
- limit_iops?: number
101
- discard?: string
102
- attach?: boolean
103
- detach?: boolean
104
- remove?: boolean
105
- }
106
- export interface UI_I_SendDataNewPciDevice {
107
- address: string
108
- class_name: string
109
- device_name: string
110
- vendor_name: string
111
- }
112
-
113
- export interface UI_I_HardDisk {
114
- create: boolean
115
- size: number
116
- path: string
117
- index: number
118
- }
@@ -1,4 +0,0 @@
1
- export type UI_T_HardDiskType = 'new' | 'edit' | 'exist' | 'removed'
2
- export type UI_T_PciDeviceType = 'new' | 'edit'
3
- export type UI_T_NetworkType = 'new' | 'edit'
4
- export type UI_T_CdDvdType = 'new' | 'edit' | 'removed'
@@ -1,236 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.limit }}
6
- </template>
7
- <template #stackBlockContent>
8
- <div class="flex-align-center">
9
- <div class="tooltip-top-left combobox-container flex-align-center">
10
- <atoms-tooltip-error
11
- :has-error="!!limitLocalAndApiErrorsTexts"
12
- :selector="`#vm-wizard-${props.componentType}-limit input`"
13
- @remove="onRemoveValidationError"
14
- >
15
- <template #elem>
16
- <atoms-combobox
17
- :id="`vm-wizard-${props.componentType}-limit`"
18
- v-model="limitLocalByLocalization"
19
- :items="limitOptionsLocal"
20
- :disabled="props.disabled"
21
- :test-id="`vm-wizard-${props.componentType}-limit`"
22
- @click.stop
23
- @select="onSelectLimit"
24
- />
25
- </template>
26
- <template #content>{{ limitLocalAndApiErrorsTexts }}</template>
27
- </atoms-tooltip-error>
28
- </div>
29
- <div class="select">
30
- <select
31
- id="vm-wizard-limit-type-select"
32
- v-model="limitTypeLocal"
33
- :data-id="`vm-wizard-${props.componentType}-limit-type-select`"
34
- :disabled="props.disabled"
35
- >
36
- <option
37
- v-for="(item, key) in limitTypeOptions"
38
- :key="key"
39
- :value="item.value"
40
- >
41
- {{ item.text }}
42
- </option>
43
- </select>
44
- </div>
45
- </div>
46
- </template>
47
- </atoms-stack-block>
48
- </div>
49
- </template>
50
-
51
- <script setup lang="ts">
52
- import {
53
- limitOptionsFunc,
54
- limitTypeOptionsFunc,
55
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/lib/config/options'
56
- import type { UI_I_Localization } from '~/lib/models/interfaces'
57
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
58
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
59
-
60
- const localization = computed<UI_I_Localization>(() => useLocal())
61
-
62
- const props = withDefaults(
63
- defineProps<{
64
- limit: string
65
- limitType: string
66
- type: 'mb' | 'mhz'
67
- componentType: string
68
- errorValidationFields: UI_I_ErrorValidationField<string>[]
69
- disabled?: boolean
70
- limitOptions?: UI_I_OptionItem[]
71
- multiply?: number
72
- }>(),
73
- {
74
- limitOptions: undefined,
75
- multiply: 1,
76
- }
77
- )
78
- const emits = defineEmits<{
79
- (event: 'update:limit', value: string): void
80
- (event: 'update:limit-type', value: string): void
81
- (event: 'invalid', value: boolean): void
82
- (event: 'remove-error-by-title', value: string): void
83
- }>()
84
-
85
- const typeError = computed<string>(() => `${props.componentType}.limit_mb`)
86
-
87
- const apiErrorLocal = computed<string>(() => {
88
- return (
89
- props.errorValidationFields?.find(
90
- (message) => message.field === typeError.value
91
- )?.error_message || ''
92
- )
93
- })
94
-
95
- const binaryKeys: [string, string] =
96
- props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
97
-
98
- const limitOptionsLocal = computed<UI_I_OptionItem[]>(
99
- () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys)
100
- )
101
- const limitTypeOptions = ref<UI_I_OptionItem[]>(
102
- limitTypeOptionsFunc(localization.value, binaryKeys)
103
- )
104
-
105
- const limitLocalByLocalization = computed<string>({
106
- get() {
107
- return limitLocal.value === 'Unlimited'
108
- ? localization.value.common.unlimited
109
- : limitLocal.value
110
- },
111
- set(newValue) {
112
- limitLocal.value =
113
- newValue === localization.value.common.unlimited ? 'Unlimited' : newValue
114
- },
115
- })
116
- const limitLocal = computed<string>({
117
- get() {
118
- return props.limit
119
- },
120
- set(newValue) {
121
- emits('update:limit', '' + newValue)
122
- },
123
- })
124
- const limitTypeLocal = computed<string>({
125
- get() {
126
- return props.limitType
127
- },
128
- set(newValue) {
129
- emits('update:limit-type', newValue)
130
- },
131
- })
132
-
133
- const { $binary } = useNuxtApp()
134
- const onSelectLimit = ({
135
- value,
136
- type,
137
- }: {
138
- value: number | 'Unlimited'
139
- type: string
140
- }): void => {
141
- limitLocal.value = '' + value
142
- if (limitTypeLocal.value !== type) {
143
- limitTypeLocal.value = type
144
- }
145
-
146
- // if (limitTypeLocal.value === binaryKeys[0] || value === 'Unlimited') {
147
- // limitLocal.value = '' + value
148
- // return
149
- // }
150
- //
151
- // limitLocal.value =
152
- // '' + $binary.universalFromTo(value, binaryKeys[0], binaryKeys[1], 8)
153
- }
154
-
155
- const limitErrorLocalText = computed<string>(() => {
156
- const valueForMin = $binary.universalFromTo(
157
- +limitLocal.value,
158
- limitTypeLocal.value,
159
- limitOptionsLocal.value[0].value.type,
160
- 0
161
- )
162
- const valueForMax = $binary.universalFromTo(
163
- +limitLocal.value,
164
- limitTypeLocal.value,
165
- limitOptionsLocal.value[1].value.type,
166
- 0
167
- )
168
- const minValue = limitOptionsLocal.value[0].value.value
169
- const maxValue = limitOptionsLocal.value[1].value.value
170
- if (valueForMin < minValue) {
171
- return localization.value.common.limitMustBe.replace(
172
- '{0}',
173
- `${minValue} ${localization.value.common[binaryKeys[0]]}`
174
- )
175
- }
176
- if (props.limitOptions && valueForMax > maxValue) {
177
- return localization.value.common.limitMustBeMax.replace(
178
- '{0}',
179
- `${maxValue} ${localization.value.common[binaryKeys[0]]}`
180
- )
181
- }
182
-
183
- const validValue = /^\d+(\.\d+)?$/.test(limitLocal.value)
184
- if (
185
- !validValue &&
186
- (limitLocal.value !== limitOptionsLocal.value[1].value.value ||
187
- props.limitOptions)
188
- ) {
189
- return localization.value.common.inputContainsInvalidCharacters
190
- }
191
-
192
- if (limitLocal.value !== 'Unlimited') {
193
- const value = $binary.universalFromTo(
194
- +limitLocal.value,
195
- limitTypeLocal.value,
196
- binaryKeys[0],
197
- 0
198
- )
199
- if (value % props.multiply !== 0) {
200
- return localization.value.common.valueShouldMultiple.replace(
201
- '{0}',
202
- `${props.multiply} ${binaryKeys[0].toUpperCase()}`
203
- )
204
- }
205
- }
206
-
207
- return ''
208
- })
209
- const limitInvalid = computed<boolean>(() => !!limitErrorLocalText.value)
210
- watch(
211
- limitInvalid,
212
- (newValue) => {
213
- emits('invalid', newValue)
214
- },
215
- { immediate: true }
216
- )
217
-
218
- const limitLocalAndApiErrorsTexts = computed<string>(() => {
219
- const localError = limitErrorLocalText.value
220
- const apiError = apiErrorLocal.value
221
-
222
- let result = ''
223
- if (localError && !apiError) result = localError
224
- if (!localError && apiError) result = apiError
225
- if (localError && apiError) result = localError + ', ' + apiError
226
- if (!localError && apiError) result = apiError
227
-
228
- return result
229
- })
230
-
231
- const onRemoveValidationError = (): void => {
232
- emits('remove-error-by-title', typeError.value)
233
- }
234
- </script>
235
-
236
- <style scoped></style>