bfg-common 1.0.14 → 1.0.16

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 (38) hide show
  1. package/components/common/vm/actions/add/Add.vue +1 -1
  2. package/components/common/vm/actions/add/FolderTreeView.vue +1 -1
  3. package/components/common/vm/actions/add/customizeHardware/CustomizeHardware.vue +1 -1
  4. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +1 -1
  5. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/Cpu.vue +371 -368
  6. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CpuModel.vue +2 -2
  7. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/MaxCpu.vue +105 -99
  8. package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/shares/Shares.vue +155 -151
  9. package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/Limit.vue +214 -210
  10. package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/Memory.vue +282 -278
  11. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/Location.vue +10 -10
  12. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +10 -6
  13. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +1 -1
  14. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +7 -3
  15. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +2 -2
  16. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/Location.vue +1 -1
  17. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +256 -252
  18. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +1 -1
  19. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +6 -6
  20. package/components/common/vm/actions/add/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +3 -3
  21. package/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/Reservation.vue +231 -228
  22. package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +1 -1
  23. package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/VideoCard.vue +173 -169
  24. package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +1 -1
  25. package/components/common/vm/actions/add/customizeHardware/vmoptions/Vmoptions.vue +145 -141
  26. package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/BootOptions.vue +1 -1
  27. package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +1 -1
  28. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +230 -226
  29. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +1 -1
  30. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +1 -1
  31. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +1 -1
  32. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +1 -1
  33. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +1 -1
  34. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +1 -1
  35. package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +1 -1
  36. package/components/common/vm/actions/add/select/compatibility/Compatibility.vue +6 -6
  37. package/components/common/vm/actions/add/select/os/os.vue +7 -7
  38. package/package.json +1 -1
@@ -1,228 +1,231 @@
1
- <template>
2
- <div>
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.reservation }}
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="!!reservationLocalAndApiErrorsTexts"
12
- :selector="`#vm-wizard-${props.componentType}-reservation input`"
13
- @remove="onRemoveValidationError"
14
- >
15
- <template #elem>
16
- <atoms-combobox
17
- :id="`vm-wizard-${props.componentType}-reservation`"
18
- v-model="reservationLocal"
19
- :items="reservationOptions"
20
- :disabled="props.disabled"
21
- @click.stop
22
- @select="onSelectReservation"
23
- />
24
- </template>
25
- <template #content>{{
26
- reservationLocalAndApiErrorsTexts
27
- }}</template>
28
- </atoms-tooltip-error>
29
- </div>
30
- <div class="select">
31
- <select
32
- id="reserve-type-select"
33
- :disabled="props.disabled"
34
- v-model="reservationTypeLocal"
35
- >
36
- <option
37
- v-for="(item, key) in reservationTypeOptions"
38
- :key="key"
39
- :value="item.value"
40
- >
41
- {{ item.text }}
42
- </option>
43
- </select>
44
- </div>
45
- </div>
46
- <div
47
- v-if="props.reserveGuestMemory !== undefined"
48
- class="flex-align-center"
49
- >
50
- <input
51
- id="reserve-guest-memory"
52
- :value="props.reserveGuestMemory"
53
- type="checkbox"
54
- disabled
55
- />
56
- <label
57
- for="reserve-guest-memory"
58
- :class="['label-text-normal all-memory', { 'div-disabled': true }]"
59
- >{{ localization.reserveGuestMemory }}</label
60
- >
61
- </div>
62
- </template>
63
- </atoms-stack-block>
64
- </div>
65
- </template>
66
-
67
- <script setup lang="ts">
68
- import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
69
- import { UI_I_Localization } from '~/models/interfaces'
70
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
71
- import {
72
- reservationOptionsFunc,
73
- reservationTypeOptionsFunc,
74
- } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/config/options'
75
-
76
- const localization = computed<UI_I_Localization>(() => useLocal())
77
-
78
- const props = withDefaults(
79
- defineProps<{
80
- reservation: string
81
- reservationType: string
82
- type: 'mb' | 'mhz'
83
- componentType: string
84
- errorValidationFields: UI_I_ErrorValidationField<string>[]
85
- disabled?: boolean
86
- reserveGuestMemory?: boolean
87
- multiply?: number
88
- }>(),
89
- {
90
- reserveGuestMemory: undefined,
91
- multiply: 1,
92
- }
93
- )
94
- const emits = defineEmits<{
95
- (event: 'update:reservation', value: string): void
96
- (event: 'update:reservation-type', value: string): void
97
- (event: 'invalid', value: boolean): void
98
- (event: 'remove-error-by-title', value: string): void
99
- }>()
100
-
101
- const { $binary } = useNuxtApp()
102
-
103
- const binaryKeys: [string, string] =
104
- props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
105
-
106
- const minReservation = props.type === 'mb' ? 2 : 0
107
- const maxReservation = props.type === 'mb' ? 16384 : 4794
108
- const reservationOptions = computed<UI_I_OptionItem[]>(() => {
109
- const max = $binary.universalFromTo(
110
- maxReservation,
111
- binaryKeys[0],
112
- binaryKeys[1],
113
- 5
114
- )
115
- return reservationOptionsFunc(
116
- localization.value,
117
- minReservation,
118
- max,
119
- binaryKeys
120
- )
121
- })
122
- const onSelectReservation = ({
123
- value,
124
- type,
125
- }: {
126
- value: number
127
- type: string
128
- }): void => {
129
- if (reservationTypeLocal.value === type) {
130
- reservationLocal.value = '' + value
131
- return
132
- }
133
-
134
- reservationLocal.value =
135
- '' + $binary.universalFromTo(value, type, reservationTypeLocal.value, 12)
136
- }
137
-
138
- const reservationTypeOptions = ref<UI_I_OptionItem[]>(
139
- reservationTypeOptionsFunc(localization.value, binaryKeys)
140
- )
141
-
142
- const reservationLocal = computed<string>({
143
- get() {
144
- return props.reservation
145
- },
146
- set(newValue) {
147
- emits('update:reservation', '' + newValue)
148
- },
149
- })
150
- const reservationTypeLocal = computed<string>({
151
- get() {
152
- return props.reservationType
153
- },
154
- set(newValue) {
155
- emits('update:reservation-type', newValue)
156
- },
157
- })
158
-
159
- const reservationErrorLocalText = computed<string>(() => {
160
- const value =
161
- reservationTypeLocal.value === binaryKeys[0]
162
- ? +reservationLocal.value
163
- : $binary.universalFromTo(
164
- reservationLocal.value,
165
- binaryKeys[1],
166
- binaryKeys[0],
167
- 12
168
- )
169
- if (value < minReservation || value > maxReservation) {
170
- return localization.value.reservationMustBe
171
- .replace('{0}', `${minReservation} ${localization.value[binaryKeys[0]]}`)
172
- .replace('{1}', `${maxReservation} ${localization.value[binaryKeys[0]]}`)
173
- }
174
-
175
- const validValue = /^\d+(\.\d+)?$/.test(reservationLocal.value + '')
176
- if (!validValue) {
177
- return localization.value.inputContainsInvalidCharacters
178
- }
179
-
180
- if (value % props.multiply !== 0) {
181
- return localization.value.valueShouldMultiple.replace(
182
- '{0}',
183
- `${props.multiply} ${binaryKeys[0].toUpperCase()}`
184
- )
185
- }
186
-
187
- return ''
188
- })
189
-
190
- const typeError = computed<string>(
191
- () => `${props.componentType}.reservation_mb`
192
- )
193
-
194
- const apiError = computed<string>(() => {
195
- return (
196
- props.errorValidationFields?.find(
197
- (message) => message.field === typeError.value
198
- )?.error_message || ''
199
- )
200
- })
201
- const reservationLocalAndApiErrorsTexts = computed<string>(() => {
202
- const localError = reservationErrorLocalText.value
203
-
204
- let result = ''
205
- if (localError && !apiError.value) result = localError
206
- if (!localError && apiError.value) result = apiError.value
207
- if (localError && apiError.value) result = localError + ', ' + apiError.value
208
-
209
- return result
210
- })
211
- const reservationInvalid = computed<boolean>(
212
- () => !!reservationErrorLocalText.value
213
- )
214
- watch(reservationInvalid, (val) => {
215
- emits('invalid', val)
216
- })
217
-
218
- const onRemoveValidationError = (): void => {
219
- emits('remove-error-by-title', typeError.value)
220
- }
221
-
222
- </script>
223
-
224
- <style scoped>
225
- .all-memory {
226
- margin-left: 7px;
227
- }
228
- </style>
1
+ <template>
2
+ <div>
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.reservation }}
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="!!reservationLocalAndApiErrorsTexts"
12
+ :selector="`#vm-wizard-${props.componentType}-reservation input`"
13
+ @remove="onRemoveValidationError"
14
+ >
15
+ <template #elem>
16
+ <atoms-combobox
17
+ :id="`vm-wizard-${props.componentType}-reservation`"
18
+ v-model="reservationLocal"
19
+ :items="reservationOptions"
20
+ :disabled="props.disabled"
21
+ @click.stop
22
+ @select="onSelectReservation"
23
+ />
24
+ </template>
25
+ <template #content>{{
26
+ reservationLocalAndApiErrorsTexts
27
+ }}</template>
28
+ </atoms-tooltip-error>
29
+ </div>
30
+ <div class="select">
31
+ <select
32
+ id="reserve-type-select"
33
+ :disabled="props.disabled"
34
+ v-model="reservationTypeLocal"
35
+ >
36
+ <option
37
+ v-for="(item, key) in reservationTypeOptions"
38
+ :key="key"
39
+ :value="item.value"
40
+ >
41
+ {{ item.text }}
42
+ </option>
43
+ </select>
44
+ </div>
45
+ </div>
46
+ <div
47
+ v-if="props.reserveGuestMemory !== undefined"
48
+ class="flex-align-center"
49
+ >
50
+ <input
51
+ id="reserve-guest-memory"
52
+ :value="props.reserveGuestMemory"
53
+ type="checkbox"
54
+ disabled
55
+ />
56
+ <label
57
+ for="reserve-guest-memory"
58
+ :class="['label-text-normal all-memory', { 'div-disabled': true }]"
59
+ >{{ localization.reserveGuestMemory }}</label
60
+ >
61
+ </div>
62
+ </template>
63
+ </atoms-stack-block>
64
+ </div>
65
+ </template>
66
+
67
+ <script setup lang="ts">
68
+ import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
69
+ import { UI_I_Localization } from '~/models/interfaces'
70
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
71
+ import {
72
+ reservationOptionsFunc,
73
+ reservationTypeOptionsFunc,
74
+ } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/config/options'
75
+
76
+ const localization = computed<UI_I_Localization>(() => useLocal())
77
+
78
+ const props = withDefaults(
79
+ defineProps<{
80
+ reservation: string
81
+ reservationType: string
82
+ type: 'mb' | 'mhz'
83
+ componentType: string
84
+ errorValidationFields: UI_I_ErrorValidationField[]
85
+ disabled?: boolean
86
+ reserveGuestMemory?: boolean
87
+ multiply?: number
88
+ }>(),
89
+ {
90
+ reserveGuestMemory: undefined,
91
+ multiply: 1,
92
+ }
93
+ )
94
+ const emits = defineEmits<{
95
+ (event: 'update:reservation', value: string): void
96
+ (event: 'update:reservation-type', value: string): void
97
+ (event: 'invalid', value: boolean): void
98
+ (event: 'remove-error-by-title', value: string): void
99
+ }>()
100
+
101
+ const { $binary } = useNuxtApp()
102
+
103
+ const binaryKeys: [string, string] =
104
+ props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
105
+
106
+ const minReservation = props.type === 'mb' ? 2 : 0
107
+ const maxReservation = props.type === 'mb' ? 16384 : 4794
108
+ const reservationOptions = computed<UI_I_OptionItem[]>(() => {
109
+ const max = $binary.universalFromTo(
110
+ maxReservation,
111
+ binaryKeys[0],
112
+ binaryKeys[1],
113
+ 5
114
+ )
115
+ return reservationOptionsFunc(
116
+ localization.value,
117
+ minReservation,
118
+ max,
119
+ binaryKeys
120
+ )
121
+ })
122
+ const onSelectReservation = ({
123
+ value,
124
+ type,
125
+ }: {
126
+ value: number
127
+ type: string
128
+ }): void => {
129
+ if (reservationTypeLocal.value === type) {
130
+ reservationLocal.value = '' + value
131
+ return
132
+ }
133
+
134
+ reservationLocal.value =
135
+ '' + $binary.universalFromTo(value, type, reservationTypeLocal.value, 12)
136
+ }
137
+
138
+ const reservationTypeOptions = ref<UI_I_OptionItem[]>(
139
+ reservationTypeOptionsFunc(localization.value, binaryKeys)
140
+ )
141
+
142
+ const reservationLocal = computed<string>({
143
+ get() {
144
+ return props.reservation
145
+ },
146
+ set(newValue) {
147
+ emits('update:reservation', '' + newValue)
148
+ },
149
+ })
150
+ const reservationTypeLocal = computed<string>({
151
+ get() {
152
+ return props.reservationType
153
+ },
154
+ set(newValue) {
155
+ emits('update:reservation-type', newValue)
156
+ },
157
+ })
158
+
159
+ const reservationErrorLocalText = computed<string>(() => {
160
+ const value =
161
+ reservationTypeLocal.value === binaryKeys[0]
162
+ ? +reservationLocal.value
163
+ : $binary.universalFromTo(
164
+ reservationLocal.value,
165
+ binaryKeys[1],
166
+ binaryKeys[0],
167
+ 12
168
+ )
169
+ if (value < minReservation || value > maxReservation) {
170
+ return localization.value.reservationMustBe
171
+ .replace('{0}', `${minReservation} ${localization.value[binaryKeys[0]]}`)
172
+ .replace('{1}', `${maxReservation} ${localization.value[binaryKeys[0]]}`)
173
+ }
174
+
175
+ const validValue = /^\d+(\.\d+)?$/.test(reservationLocal.value + '')
176
+ if (!validValue) {
177
+ return localization.value.inputContainsInvalidCharacters
178
+ }
179
+
180
+ if (value % props.multiply !== 0) {
181
+ return localization.value.valueShouldMultiple.replace(
182
+ '{0}',
183
+ `${props.multiply} ${binaryKeys[0].toUpperCase()}`
184
+ )
185
+ }
186
+
187
+ return ''
188
+ })
189
+
190
+ const typeError = computed<string>(
191
+ () => `${props.componentType}.reservation_mb`
192
+ )
193
+
194
+ const apiError = computed<string>(() => {
195
+ return (
196
+ props.errorValidationFields?.find(
197
+ (message) => message.field === typeError.value
198
+ )?.error_message || ''
199
+ )
200
+ })
201
+ const reservationLocalAndApiErrorsTexts = computed<string>(() => {
202
+ const localError = reservationErrorLocalText.value
203
+
204
+ let result = ''
205
+ if (localError && !apiError.value) result = localError
206
+ if (!localError && apiError.value) result = apiError.value
207
+ if (localError && apiError.value) result = localError + ', ' + apiError.value
208
+
209
+ return result
210
+ })
211
+ const reservationInvalid = computed<boolean>(
212
+ () => !!reservationErrorLocalText.value
213
+ )
214
+ watch(
215
+ reservationInvalid,
216
+ (newValue) => {
217
+ emits('invalid', newValue)
218
+ },
219
+ { immediate: true }
220
+ )
221
+
222
+ const onRemoveValidationError = (): void => {
223
+ emits('remove-error-by-title', typeError.value)
224
+ }
225
+ </script>
226
+
227
+ <style scoped>
228
+ .all-memory {
229
+ margin-left: 7px;
230
+ }
231
+ </style>
@@ -45,7 +45,7 @@ const props = defineProps<{
45
45
  totalVideoMemory: number
46
46
  disabled: boolean
47
47
  isEdit: boolean
48
- errorValidationFields: UI_I_ErrorValidationField<string>[]
48
+ errorValidationFields: UI_I_ErrorValidationField[]
49
49
  }>()
50
50
  const emits = defineEmits<{
51
51
  (event: 'update:total-video-memory', value: number): void