bfg-common 1.3.233 → 1.3.235

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 (39) hide show
  1. package/assets/localization/local_be.json +4 -1
  2. package/assets/localization/local_en.json +4 -1
  3. package/assets/localization/local_hy.json +4 -1
  4. package/assets/localization/local_kk.json +4 -1
  5. package/assets/localization/local_ru.json +4 -1
  6. package/assets/localization/local_zh.json +4 -1
  7. package/assets/scss/common/normalize.scss +4 -0
  8. package/components/atoms/switch/Switch.vue +111 -111
  9. package/components/atoms/table/compact/Compact.vue +526 -526
  10. package/components/common/diagramMain/lib/models/interfaces.ts +1 -1
  11. package/components/common/diagramMain/modals/lib/config/networkModal.ts +5 -5
  12. package/components/common/pages/Tasks.vue +120 -120
  13. package/components/common/recursionTree/RecursionTree.vue +203 -203
  14. package/components/common/vm/actions/add/Add.vue +575 -575
  15. package/components/common/vm/actions/clone/Clone.vue +518 -518
  16. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +294 -294
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
  22. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  23. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  24. package/components/common/weekSelect/WeekSelect.vue +112 -112
  25. package/components/common/weekSelect/lib/config/options.ts +10 -10
  26. package/composables/useAppVersion.ts +21 -21
  27. package/composables/useEnvLanguage.ts +20 -20
  28. package/lib/utils/sendTask.ts +72 -72
  29. package/minify.js +146 -146
  30. package/package.json +1 -1
  31. package/public/spice-console/application/codec.js +257 -257
  32. package/public/spice-console/lib/rasterEngine.js +907 -907
  33. package/public/spice-console/network/spicechannel.js +369 -369
  34. package/store/main/lib/interfaces.ts +9 -9
  35. package/store/tasks/actions.ts +133 -133
  36. package/store/tasks/getters.ts +25 -25
  37. package/store/tasks/lib/models/interfaces.ts +18 -18
  38. package/store/tasks/mutations.ts +58 -58
  39. package/store/tasks/state.ts +16 -16
@@ -1,294 +1,294 @@
1
- <template>
2
- <div class="hardware-network">
3
- <atoms-stack-block
4
- :has-children="true"
5
- :removable="isRemovable"
6
- @remove="removeNetwork"
7
- >
8
- <template #stackBlockKey>
9
- <div class="vm-wizard-toggle-block-network flex-align-center">
10
- <span>{{ label }}</span>
11
- <atoms-the-icon
12
- v-show="newNetworkInvalid"
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
- <atoms-tooltip-error
23
- :has-error="!!apiError"
24
- :selector="`.vm-wizard-network-field-${props.index}`"
25
- @remove="onRemoveValidationError"
26
- >
27
- <template #elem>
28
- <div class="select">
29
- <select
30
- :id="`vm-wizard-network-field-${props.index}`"
31
- v-model="selectedLocation"
32
- :class="`vm-wizard-network-field-${props.index} input-text-color`"
33
- :disabled="props.type === 'edit' && state !== 1"
34
- @click.stop
35
- @change="changeLocation"
36
- >
37
- <option
38
- v-for="(item, key) in locationOptions"
39
- :key="key"
40
- :value="item.value"
41
- >
42
- {{ item.text }}
43
- </option>
44
- </select>
45
- </div>
46
- </template>
47
- <template #content>{{ apiError }}</template>
48
- </atoms-tooltip-error>
49
- </div>
50
- </template>
51
- <template #stackChildren>
52
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-adapter-type
53
- v-model:adapter-type="adapterType"
54
- :index="props.index"
55
- :disabled="props.type === 'edit' || isRunning"
56
- :error-validation-fields="props.errorValidationFields"
57
- @remove-error-by-title="emits('remove-error-by-title', $event)"
58
- />
59
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-mac-address
60
- v-model:mac-address="macAddress"
61
- v-model:mac-address-type="macAddressType"
62
- :index="props.index"
63
- :disabled="props.type === 'edit'"
64
- :error-validation-fields="props.errorValidationFields"
65
- @invalid="newNetworkInvalid = $event"
66
- @remove-error-by-title="emits('remove-error-by-title', $event)"
67
- />
68
- </template>
69
- </atoms-stack-block>
70
-
71
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-location
72
- :location-modal-is-show="locationModalIsShow"
73
- :networks-table="networksTable"
74
- @hide="onHideLocationModal"
75
- @select="onSelectLocation"
76
- />
77
- </div>
78
- </template>
79
-
80
- <script setup lang="ts">
81
- import { UI_I_TablePayload } from '~/lib/models/table/interfaces'
82
- import { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
83
- import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
84
- import { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
85
- import { UI_T_NetworkType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
86
- import {
87
- UI_I_Localization,
88
- UI_I_HTMLSelectElement,
89
- } from '~/lib/models/interfaces'
90
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
91
-
92
- const props = defineProps<{
93
- index: number
94
- type: UI_T_NetworkType
95
- network: UI_I_SendDataNewNetwork
96
- networksTable: UI_I_NetworkTableItem[]
97
- errorValidationFields: UI_I_ErrorValidationField[]
98
- isEdit: boolean
99
- state?: string | number
100
- }>()
101
-
102
- const emits = defineEmits<{
103
- (event: 'send-data', value: UI_I_SendDataNewNetwork): void
104
- (event: 'invalid', value: boolean): void
105
- (event: 'remove'): void
106
- (event: 'remove-error-by-title', value: string): void
107
- (event: 'get-networks-table', value: UI_I_TablePayload): void
108
- }>()
109
-
110
- const localization = computed<UI_I_Localization>(() => useLocal())
111
-
112
- const isRunning = computed<boolean>(() => {
113
- return props.state === 2
114
- })
115
-
116
- const isRemovable = computed<boolean>(() => {
117
- return (
118
- !props.isEdit ||
119
- !isRunning.value ||
120
- (isRunning.value && adapterType.value === 'virtio')
121
- )
122
- })
123
-
124
- const label = computed<string>(() => {
125
- if (props.type === 'edit')
126
- return `${localization.value.networkAdapter} ${props.index + 1}`
127
-
128
- return `${localization.value.newNetwork} *`
129
- })
130
-
131
- const removeNetwork = (): void => {
132
- emits('remove')
133
- }
134
-
135
- const selectedLocationOld = ref<string>('')
136
- const selectedLocation = ref<string>('')
137
- const locationOptions = ref<UI_I_OptionItem[]>([])
138
-
139
- const getNetworks = (): void => {
140
- // if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
141
-
142
- const payload: UI_I_TablePayload = {
143
- pagination: {
144
- page: 1,
145
- pageSize: 100,
146
- },
147
- schema: 'full',
148
- type: 'network',
149
- sortBy: null,
150
- }
151
- emits('get-networks-table', payload)
152
- }
153
- getNetworks()
154
- watch(
155
- () => props.networksTable,
156
- (newValue) => {
157
- const isExistValue = newValue.some(
158
- (network) => network.net_bridge === selectedLocation.value
159
- )
160
- if (!newValue.length || props.type === 'edit' || isExistValue) return
161
-
162
- selectedLocationOld.value = newValue[0].net_bridge
163
- selectedLocation.value = newValue[0].net_bridge
164
-
165
- locationOptions.value = [
166
- { text: newValue[0].name, value: newValue[0].net_bridge },
167
- { text: `${localization.value.browse}...`, value: '' },
168
- ]
169
- },
170
- { immediate: true }
171
- )
172
-
173
- const locationModalIsShow = ref<boolean>(false)
174
- const onHideLocationModal = (): void => {
175
- locationModalIsShow.value = false
176
- selectedLocation.value = selectedLocationOld.value
177
- }
178
- const changeLocation = (event: UI_I_HTMLSelectElement): void => {
179
- const value = event.target.value
180
- if (value === '') {
181
- locationModalIsShow.value = true
182
- return
183
- }
184
-
185
- selectedLocationOld.value = value
186
- selectedLocation.value = value
187
- // netBridge.value = value
188
- }
189
- const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
190
- locationModalIsShow.value = false
191
-
192
- selectedLocationOld.value = network.net_bridge
193
- selectedLocation.value = network.net_bridge
194
-
195
- const hasNetwork = locationOptions.value.some(
196
- (option) => option.value === network.net_bridge
197
- )
198
- if (hasNetwork) {
199
- return
200
- }
201
-
202
- locationOptions.value = [
203
- ...locationOptions.value.slice(0, -1),
204
- { text: network.name, value: network.net_bridge },
205
- locationOptions.value[locationOptions.value.length - 1],
206
- ]
207
- }
208
-
209
- const adapterType = ref<string>('rtl8139')
210
-
211
- const target = ref<string>('')
212
-
213
- const macAddress = ref<string>('')
214
- const macAddressType = ref<string>('automatic')
215
- const newNetworkInvalid = ref<boolean>(false)
216
- watch(
217
- newNetworkInvalid,
218
- (newValue) => {
219
- emits('invalid', newValue)
220
- },
221
- { immediate: true }
222
- )
223
-
224
- watch(
225
- [selectedLocation, adapterType, macAddress, macAddressType, locationOptions],
226
- () => {
227
- const option = locationOptions.value.find(
228
- (option) => option.value === selectedLocation.value
229
- )
230
- if (!option) return
231
-
232
- emits('send-data', {
233
- network: option.text,
234
- net_bridge: option.value,
235
- target: target.value,
236
- model: adapterType.value,
237
- mac: macAddress.value,
238
- boot_order: props.network.boot_order,
239
- })
240
- },
241
- { immediate: true }
242
- )
243
-
244
- // Добавляем данные для редактирования
245
- watch(
246
- () => props.network,
247
- (newValue) => {
248
- if (props.type !== 'edit') return
249
-
250
- locationOptions.value = [
251
- { text: newValue.network, value: newValue.net_bridge },
252
- { text: `${localization.value.browse}...`, value: '' },
253
- ]
254
- selectedLocation.value = newValue.net_bridge
255
-
256
- adapterType.value = newValue.model
257
- macAddress.value = newValue.mac
258
- target.value = newValue.target
259
- },
260
- { immediate: true }
261
- )
262
-
263
- watch(
264
- isRunning,
265
- (newValue) => {
266
- if (newValue && props.type === 'new') {
267
- adapterType.value = 'virtio'
268
- }
269
- },
270
- { immediate: true }
271
- )
272
-
273
- const typeError = computed<string>(
274
- () => `network_devices[${props.index}].network`
275
- )
276
-
277
- const apiError = computed<string>(() => {
278
- return (
279
- props.errorValidationFields?.find(
280
- (message) => message.field === typeError.value
281
- )?.error_message || ''
282
- )
283
- })
284
-
285
- const onRemoveValidationError = (): void => {
286
- emits('remove-error-by-title', typeError.value)
287
- }
288
- </script>
289
-
290
- <style scoped lang="scss">
291
- #network-connect {
292
- margin-right: 4px;
293
- }
294
- </style>
1
+ <template>
2
+ <div class="hardware-network">
3
+ <atoms-stack-block
4
+ :has-children="true"
5
+ :removable="isRemovable"
6
+ @remove="removeNetwork"
7
+ >
8
+ <template #stackBlockKey>
9
+ <div class="vm-wizard-toggle-block-network flex-align-center">
10
+ <span>{{ label }}</span>
11
+ <atoms-the-icon
12
+ v-show="newNetworkInvalid"
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
+ <atoms-tooltip-error
23
+ :has-error="!!apiError"
24
+ :selector="`.vm-wizard-network-field-${props.index}`"
25
+ @remove="onRemoveValidationError"
26
+ >
27
+ <template #elem>
28
+ <div class="select">
29
+ <select
30
+ :id="`vm-wizard-network-field-${props.index}`"
31
+ v-model="selectedLocation"
32
+ :class="`vm-wizard-network-field-${props.index} input-text-color`"
33
+ :disabled="props.type === 'edit' && state !== 1"
34
+ @click.stop
35
+ @change="changeLocation"
36
+ >
37
+ <option
38
+ v-for="(item, key) in locationOptions"
39
+ :key="key"
40
+ :value="item.value"
41
+ >
42
+ {{ item.text }}
43
+ </option>
44
+ </select>
45
+ </div>
46
+ </template>
47
+ <template #content>{{ apiError }}</template>
48
+ </atoms-tooltip-error>
49
+ </div>
50
+ </template>
51
+ <template #stackChildren>
52
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-adapter-type
53
+ v-model:adapter-type="adapterType"
54
+ :index="props.index"
55
+ :disabled="props.type === 'edit' || isRunning"
56
+ :error-validation-fields="props.errorValidationFields"
57
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
58
+ />
59
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-mac-address
60
+ v-model:mac-address="macAddress"
61
+ v-model:mac-address-type="macAddressType"
62
+ :index="props.index"
63
+ :disabled="props.type === 'edit'"
64
+ :error-validation-fields="props.errorValidationFields"
65
+ @invalid="newNetworkInvalid = $event"
66
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
67
+ />
68
+ </template>
69
+ </atoms-stack-block>
70
+
71
+ <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-location
72
+ :location-modal-is-show="locationModalIsShow"
73
+ :networks-table="networksTable"
74
+ @hide="onHideLocationModal"
75
+ @select="onSelectLocation"
76
+ />
77
+ </div>
78
+ </template>
79
+
80
+ <script setup lang="ts">
81
+ import { UI_I_TablePayload } from '~/lib/models/table/interfaces'
82
+ import { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
83
+ import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
84
+ import { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
85
+ import { UI_T_NetworkType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
86
+ import {
87
+ UI_I_Localization,
88
+ UI_I_HTMLSelectElement,
89
+ } from '~/lib/models/interfaces'
90
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
91
+
92
+ const props = defineProps<{
93
+ index: number
94
+ type: UI_T_NetworkType
95
+ network: UI_I_SendDataNewNetwork
96
+ networksTable: UI_I_NetworkTableItem[]
97
+ errorValidationFields: UI_I_ErrorValidationField[]
98
+ isEdit: boolean
99
+ state?: string | number
100
+ }>()
101
+
102
+ const emits = defineEmits<{
103
+ (event: 'send-data', value: UI_I_SendDataNewNetwork): void
104
+ (event: 'invalid', value: boolean): void
105
+ (event: 'remove'): void
106
+ (event: 'remove-error-by-title', value: string): void
107
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
108
+ }>()
109
+
110
+ const localization = computed<UI_I_Localization>(() => useLocal())
111
+
112
+ const isRunning = computed<boolean>(() => {
113
+ return props.state === 2
114
+ })
115
+
116
+ const isRemovable = computed<boolean>(() => {
117
+ return (
118
+ !props.isEdit ||
119
+ !isRunning.value ||
120
+ (isRunning.value && adapterType.value === 'virtio')
121
+ )
122
+ })
123
+
124
+ const label = computed<string>(() => {
125
+ if (props.type === 'edit')
126
+ return `${localization.value.networkAdapter} ${props.index + 1}`
127
+
128
+ return `${localization.value.newNetwork} *`
129
+ })
130
+
131
+ const removeNetwork = (): void => {
132
+ emits('remove')
133
+ }
134
+
135
+ const selectedLocationOld = ref<string>('')
136
+ const selectedLocation = ref<string>('')
137
+ const locationOptions = ref<UI_I_OptionItem[]>([])
138
+
139
+ const getNetworks = (): void => {
140
+ // if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
141
+
142
+ const payload: UI_I_TablePayload = {
143
+ pagination: {
144
+ page: 1,
145
+ pageSize: 100,
146
+ },
147
+ schema: 'full',
148
+ type: 'network',
149
+ sortBy: null,
150
+ }
151
+ emits('get-networks-table', payload)
152
+ }
153
+ getNetworks()
154
+ watch(
155
+ () => props.networksTable,
156
+ (newValue) => {
157
+ const isExistValue = newValue.some(
158
+ (network) => network.net_bridge === selectedLocation.value
159
+ )
160
+ if (!newValue.length || props.type === 'edit' || isExistValue) return
161
+
162
+ selectedLocationOld.value = newValue[0].net_bridge
163
+ selectedLocation.value = newValue[0].net_bridge
164
+
165
+ locationOptions.value = [
166
+ { text: newValue[0].name, value: newValue[0].net_bridge },
167
+ { text: `${localization.value.browse}...`, value: '' },
168
+ ]
169
+ },
170
+ { immediate: true }
171
+ )
172
+
173
+ const locationModalIsShow = ref<boolean>(false)
174
+ const onHideLocationModal = (): void => {
175
+ locationModalIsShow.value = false
176
+ selectedLocation.value = selectedLocationOld.value
177
+ }
178
+ const changeLocation = (event: UI_I_HTMLSelectElement): void => {
179
+ const value = event.target.value
180
+ if (value === '') {
181
+ locationModalIsShow.value = true
182
+ return
183
+ }
184
+
185
+ selectedLocationOld.value = value
186
+ selectedLocation.value = value
187
+ // netBridge.value = value
188
+ }
189
+ const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
190
+ locationModalIsShow.value = false
191
+
192
+ selectedLocationOld.value = network.net_bridge
193
+ selectedLocation.value = network.net_bridge
194
+
195
+ const hasNetwork = locationOptions.value.some(
196
+ (option) => option.value === network.net_bridge
197
+ )
198
+ if (hasNetwork) {
199
+ return
200
+ }
201
+
202
+ locationOptions.value = [
203
+ ...locationOptions.value.slice(0, -1),
204
+ { text: network.name, value: network.net_bridge },
205
+ locationOptions.value[locationOptions.value.length - 1],
206
+ ]
207
+ }
208
+
209
+ const adapterType = ref<string>('rtl8139')
210
+
211
+ const target = ref<string>('')
212
+
213
+ const macAddress = ref<string>('')
214
+ const macAddressType = ref<string>('automatic')
215
+ const newNetworkInvalid = ref<boolean>(false)
216
+ watch(
217
+ newNetworkInvalid,
218
+ (newValue) => {
219
+ emits('invalid', newValue)
220
+ },
221
+ { immediate: true }
222
+ )
223
+
224
+ watch(
225
+ [selectedLocation, adapterType, macAddress, macAddressType, locationOptions],
226
+ () => {
227
+ const option = locationOptions.value.find(
228
+ (option) => option.value === selectedLocation.value
229
+ )
230
+ if (!option) return
231
+
232
+ emits('send-data', {
233
+ network: option.text,
234
+ net_bridge: option.value,
235
+ target: target.value,
236
+ model: adapterType.value,
237
+ mac: macAddress.value,
238
+ boot_order: props.network.boot_order,
239
+ })
240
+ },
241
+ { immediate: true }
242
+ )
243
+
244
+ // Добавляем данные для редактирования
245
+ watch(
246
+ () => props.network,
247
+ (newValue) => {
248
+ if (props.type !== 'edit') return
249
+
250
+ locationOptions.value = [
251
+ { text: newValue.network, value: newValue.net_bridge },
252
+ { text: `${localization.value.browse}...`, value: '' },
253
+ ]
254
+ selectedLocation.value = newValue.net_bridge
255
+
256
+ adapterType.value = newValue.model
257
+ macAddress.value = newValue.mac
258
+ target.value = newValue.target
259
+ },
260
+ { immediate: true }
261
+ )
262
+
263
+ watch(
264
+ isRunning,
265
+ (newValue) => {
266
+ if (newValue && props.type === 'new') {
267
+ adapterType.value = 'virtio'
268
+ }
269
+ },
270
+ { immediate: true }
271
+ )
272
+
273
+ const typeError = computed<string>(
274
+ () => `network_devices[${props.index}].network`
275
+ )
276
+
277
+ const apiError = computed<string>(() => {
278
+ return (
279
+ props.errorValidationFields?.find(
280
+ (message) => message.field === typeError.value
281
+ )?.error_message || ''
282
+ )
283
+ })
284
+
285
+ const onRemoveValidationError = (): void => {
286
+ emits('remove-error-by-title', typeError.value)
287
+ }
288
+ </script>
289
+
290
+ <style scoped lang="scss">
291
+ #network-connect {
292
+ margin-right: 4px;
293
+ }
294
+ </style>