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,210 +1,214 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.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
- @click.stop
22
- @select="selectLimit"
23
- />
24
- </template>
25
- <template #content>{{ limitLocalAndApiErrorsTexts }}</template>
26
- </atoms-tooltip-error>
27
- </div>
28
- <div class="select">
29
- <select
30
- id="vm-wizard-limit-type-select"
31
- v-model="limitTypeLocal"
32
- :disabled="props.disabled"
33
- >
34
- <option
35
- v-for="(item, key) in limitTypeOptions"
36
- :key="key"
37
- :value="item.value"
38
- >
39
- {{ item.text }}
40
- </option>
41
- </select>
42
- </div>
43
- </div>
44
- </template>
45
- </atoms-stack-block>
46
- </div>
47
- </template>
48
-
49
- <script setup lang="ts">
50
- import {
51
- limitOptionsFunc,
52
- limitTypeOptionsFunc,
53
- } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/config/options'
54
- import { UI_I_Localization } from '~/models/interfaces'
55
- import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
56
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
57
-
58
- const localization = computed<UI_I_Localization>(() => useLocal())
59
-
60
- const props = withDefaults(
61
- defineProps<{
62
- limit: string
63
- limitType: string
64
- type: 'mb' | 'mhz'
65
- componentType: string
66
- errorValidationFields: UI_I_ErrorValidationField<string>[]
67
- disabled?: boolean
68
- limitOptions?: UI_I_OptionItem[]
69
- }>(),
70
- {
71
- limitOptions: undefined,
72
- }
73
- )
74
- const emits = defineEmits<{
75
- (event: 'update:limit', value: string): void
76
- (event: 'update:limit-type', value: string): void
77
- (event: 'invalid', value: boolean): void
78
- (event: 'remove-error-by-title', value: string): void
79
- }>()
80
-
81
- const typeError = computed<string>(() => `${props.componentType}.limit_mb`)
82
-
83
- const apiErrorLocal = computed<string>(() => {
84
- return (
85
- props.errorValidationFields?.find(
86
- (message) => message.field === typeError.value
87
- )?.error_message || ''
88
- )
89
- })
90
-
91
- const binaryKeys: [string, string] =
92
- props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
93
-
94
- const limitOptionsLocal = computed<UI_I_OptionItem[]>(
95
- () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys)
96
- )
97
- const limitTypeOptions = ref<UI_I_OptionItem[]>(
98
- limitTypeOptionsFunc(localization.value, binaryKeys)
99
- )
100
-
101
- const limitLocalByLocalization = computed<string>({
102
- get() {
103
- return limitLocal.value === 'Unlimited'
104
- ? localization.value.unlimited
105
- : limitLocal.value
106
- },
107
- set(newValue) {
108
- limitLocal.value =
109
- newValue === localization.value.unlimited ? 'Unlimited' : newValue
110
- },
111
- })
112
- const limitLocal = computed<string>({
113
- get() {
114
- return $binary.universalFromTo(
115
- props.limit,
116
- binaryKeys[0],
117
- limitTypeLocal.value,
118
- 8
119
- )
120
- },
121
- set(newValue) {
122
- emits(
123
- 'update:limit',
124
- '' +
125
- $binary.universalFromTo(
126
- newValue,
127
- limitTypeLocal.value,
128
- binaryKeys[0],
129
- 8
130
- )
131
- )
132
- },
133
- })
134
- const limitTypeLocal = computed<string>({
135
- get() {
136
- return props.limitType
137
- },
138
- set(newValue) {
139
- emits('update:limit-type', newValue)
140
- },
141
- })
142
-
143
- const { $binary } = useNuxtApp()
144
- const selectLimit = (value: 0 | 'Unlimited'): void => {
145
- if (limitTypeLocal.value === binaryKeys[0] || value === 'Unlimited') {
146
- limitLocal.value = '' + value
147
- return
148
- }
149
-
150
- limitLocal.value =
151
- '' + $binary.universalFromTo(value, binaryKeys[0], binaryKeys[1], 8)
152
- }
153
-
154
- const limitErrorLocalText = computed<string>(() => {
155
- const value = $binary.universalFromTo(
156
- +limitLocal.value,
157
- limitTypeLocal.value,
158
- binaryKeys[0],
159
- 8
160
- )
161
- const minValue = limitOptionsLocal.value[0].value
162
- const maxValue = limitOptionsLocal.value[1].value
163
- if (value < minValue) {
164
- return localization.value.limitMustBe.replace(
165
- '{0}',
166
- `${minValue} ${localization.value[binaryKeys[0]]}`
167
- )
168
- }
169
- if (props.limitOptions && value > maxValue) {
170
- return localization.value.limitMustBeMax.replace(
171
- '{0}',
172
- `${maxValue} ${localization.value[binaryKeys[0]]}`
173
- )
174
- }
175
-
176
- const validValue = /^\d+(\.\d+)?$/.test(limitLocal.value)
177
- if (
178
- !validValue &&
179
- (limitLocal.value !== limitOptionsLocal.value[1].value ||
180
- props.limitOptions)
181
- ) {
182
- return localization.value.inputContainsInvalidCharacters
183
- }
184
-
185
- return ''
186
- })
187
- const limitInvalid = computed<boolean>(() => !!limitErrorLocalText.value)
188
- watch(limitInvalid, (val) => {
189
- emits('invalid', val)
190
- })
191
-
192
- const limitLocalAndApiErrorsTexts = computed<string>(() => {
193
- const localError = limitErrorLocalText.value
194
- const apiError = apiErrorLocal.value
195
-
196
- let result = ''
197
- if (localError && !apiError) result = localError
198
- if (!localError && apiError) result = apiError
199
- if (localError && apiError) result = localError + ', ' + apiError
200
- if (!localError && apiError) result = apiError
201
-
202
- return result
203
- })
204
-
205
- const onRemoveValidationError = (): void => {
206
- emits('remove-error-by-title', typeError.value)
207
- }
208
- </script>
209
-
210
- <style scoped></style>
1
+ <template>
2
+ <div class="">
3
+ <atoms-stack-block :has-children="false">
4
+ <template #stackBlockKey>
5
+ {{ localization.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
+ @click.stop
22
+ @select="selectLimit"
23
+ />
24
+ </template>
25
+ <template #content>{{ limitLocalAndApiErrorsTexts }}</template>
26
+ </atoms-tooltip-error>
27
+ </div>
28
+ <div class="select">
29
+ <select
30
+ id="vm-wizard-limit-type-select"
31
+ v-model="limitTypeLocal"
32
+ :disabled="props.disabled"
33
+ >
34
+ <option
35
+ v-for="(item, key) in limitTypeOptions"
36
+ :key="key"
37
+ :value="item.value"
38
+ >
39
+ {{ item.text }}
40
+ </option>
41
+ </select>
42
+ </div>
43
+ </div>
44
+ </template>
45
+ </atoms-stack-block>
46
+ </div>
47
+ </template>
48
+
49
+ <script setup lang="ts">
50
+ import {
51
+ limitOptionsFunc,
52
+ limitTypeOptionsFunc,
53
+ } from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/config/options'
54
+ import { UI_I_Localization } from '~/models/interfaces'
55
+ import { UI_I_ErrorValidationField } from '~/models/store/interfaces'
56
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
57
+
58
+ const localization = computed<UI_I_Localization>(() => useLocal())
59
+
60
+ const props = withDefaults(
61
+ defineProps<{
62
+ limit: string
63
+ limitType: string
64
+ type: 'mb' | 'mhz'
65
+ componentType: string
66
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
67
+ disabled?: boolean
68
+ limitOptions?: UI_I_OptionItem[]
69
+ }>(),
70
+ {
71
+ limitOptions: undefined,
72
+ }
73
+ )
74
+ const emits = defineEmits<{
75
+ (event: 'update:limit', value: string): void
76
+ (event: 'update:limit-type', value: string): void
77
+ (event: 'invalid', value: boolean): void
78
+ (event: 'remove-error-by-title', value: string): void
79
+ }>()
80
+
81
+ const typeError = computed<string>(() => `${props.componentType}.limit_mb`)
82
+
83
+ const apiErrorLocal = computed<string>(() => {
84
+ return (
85
+ props.errorValidationFields?.find(
86
+ (message) => message.field === typeError.value
87
+ )?.error_message || ''
88
+ )
89
+ })
90
+
91
+ const binaryKeys: [string, string] =
92
+ props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
93
+
94
+ const limitOptionsLocal = computed<UI_I_OptionItem[]>(
95
+ () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys)
96
+ )
97
+ const limitTypeOptions = ref<UI_I_OptionItem[]>(
98
+ limitTypeOptionsFunc(localization.value, binaryKeys)
99
+ )
100
+
101
+ const limitLocalByLocalization = computed<string>({
102
+ get() {
103
+ return limitLocal.value === 'Unlimited'
104
+ ? localization.value.unlimited
105
+ : limitLocal.value
106
+ },
107
+ set(newValue) {
108
+ limitLocal.value =
109
+ newValue === localization.value.unlimited ? 'Unlimited' : newValue
110
+ },
111
+ })
112
+ const limitLocal = computed<string>({
113
+ get() {
114
+ return $binary.universalFromTo(
115
+ props.limit,
116
+ binaryKeys[0],
117
+ limitTypeLocal.value,
118
+ 8
119
+ )
120
+ },
121
+ set(newValue) {
122
+ emits(
123
+ 'update:limit',
124
+ '' +
125
+ $binary.universalFromTo(
126
+ newValue,
127
+ limitTypeLocal.value,
128
+ binaryKeys[0],
129
+ 8
130
+ )
131
+ )
132
+ },
133
+ })
134
+ const limitTypeLocal = computed<string>({
135
+ get() {
136
+ return props.limitType
137
+ },
138
+ set(newValue) {
139
+ emits('update:limit-type', newValue)
140
+ },
141
+ })
142
+
143
+ const { $binary } = useNuxtApp()
144
+ const selectLimit = (value: 0 | 'Unlimited'): void => {
145
+ if (limitTypeLocal.value === binaryKeys[0] || value === 'Unlimited') {
146
+ limitLocal.value = '' + value
147
+ return
148
+ }
149
+
150
+ limitLocal.value =
151
+ '' + $binary.universalFromTo(value, binaryKeys[0], binaryKeys[1], 8)
152
+ }
153
+
154
+ const limitErrorLocalText = computed<string>(() => {
155
+ const value = $binary.universalFromTo(
156
+ +limitLocal.value,
157
+ limitTypeLocal.value,
158
+ binaryKeys[0],
159
+ 8
160
+ )
161
+ const minValue = limitOptionsLocal.value[0].value
162
+ const maxValue = limitOptionsLocal.value[1].value
163
+ if (value < minValue) {
164
+ return localization.value.limitMustBe.replace(
165
+ '{0}',
166
+ `${minValue} ${localization.value[binaryKeys[0]]}`
167
+ )
168
+ }
169
+ if (props.limitOptions && value > maxValue) {
170
+ return localization.value.limitMustBeMax.replace(
171
+ '{0}',
172
+ `${maxValue} ${localization.value[binaryKeys[0]]}`
173
+ )
174
+ }
175
+
176
+ const validValue = /^\d+(\.\d+)?$/.test(limitLocal.value)
177
+ if (
178
+ !validValue &&
179
+ (limitLocal.value !== limitOptionsLocal.value[1].value ||
180
+ props.limitOptions)
181
+ ) {
182
+ return localization.value.inputContainsInvalidCharacters
183
+ }
184
+
185
+ return ''
186
+ })
187
+ const limitInvalid = computed<boolean>(() => !!limitErrorLocalText.value)
188
+ watch(
189
+ limitInvalid,
190
+ (newValue) => {
191
+ emits('invalid', newValue)
192
+ },
193
+ { immediate: true }
194
+ )
195
+
196
+ const limitLocalAndApiErrorsTexts = computed<string>(() => {
197
+ const localError = limitErrorLocalText.value
198
+ const apiError = apiErrorLocal.value
199
+
200
+ let result = ''
201
+ if (localError && !apiError) result = localError
202
+ if (!localError && apiError) result = apiError
203
+ if (localError && apiError) result = localError + ', ' + apiError
204
+ if (!localError && apiError) result = apiError
205
+
206
+ return result
207
+ })
208
+
209
+ const onRemoveValidationError = (): void => {
210
+ emits('remove-error-by-title', typeError.value)
211
+ }
212
+ </script>
213
+
214
+ <style scoped></style>