bfg-common 1.3.403 → 1.3.404

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 (62) hide show
  1. package/assets/localization/local_be.json +3 -1
  2. package/assets/localization/local_en.json +3 -1
  3. package/assets/localization/local_hy.json +3 -1
  4. package/assets/localization/local_kk.json +3 -1
  5. package/assets/localization/local_ru.json +3 -1
  6. package/assets/localization/local_zh.json +3 -1
  7. package/components/atoms/loader/Loader.vue +30 -30
  8. package/components/atoms/loader/PreLoader.vue +38 -38
  9. package/components/atoms/switch/Switch.vue +111 -111
  10. package/components/atoms/table/compact/Compact.vue +526 -526
  11. package/components/common/adapterManager/ui/table/Header.vue +93 -93
  12. package/components/common/adapterManager/ui/table/Table.vue +162 -162
  13. package/components/common/context/Context.vue +99 -99
  14. package/components/common/lib/config/states.ts +126 -126
  15. package/components/common/resource/progressBlock/ProgressBlock.vue +142 -142
  16. package/components/common/split/horizontal/Horizontal.vue +70 -70
  17. package/components/common/vm/actions/add/Add.vue +602 -602
  18. package/components/common/vm/actions/clone/Clone.vue +518 -518
  19. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +273 -273
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +697 -697
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +304 -304
  22. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +167 -167
  23. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +82 -82
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +32 -32
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +182 -182
  26. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +114 -114
  27. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +188 -188
  28. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +72 -72
  29. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +164 -164
  30. package/components/common/vm/actions/common/select/name/Name.vue +235 -235
  31. package/components/common/vm/actions/common/select/storage/Storage.vue +198 -198
  32. package/components/common/vm/actions/editSettings/EditSettings.vue +316 -316
  33. package/components/common/weekSelect/lib/config/options.ts +10 -10
  34. package/components/common/wizards/datastore/add/Add.vue +436 -436
  35. package/components/common/wizards/datastore/add/lib/config/stepItems.ts +191 -191
  36. package/components/common/wizards/datastore/add/lib/models/interfaces.ts +38 -38
  37. package/components/common/wizards/datastore/add/lib/utils.ts +70 -70
  38. package/components/common/wizards/datastore/add/local/createName/CreateName.vue +160 -160
  39. package/components/common/wizards/datastore/add/nfs/Nfs.vue +112 -112
  40. package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +104 -104
  41. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -62
  42. package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -53
  43. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +86 -86
  44. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +184 -184
  45. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/DeviceSelection.vue +459 -459
  46. package/components/common/wizards/datastore/add/types/Types.vue +80 -80
  47. package/components/common/wizards/datastore/add/types/lib/config/typeOptions.ts +49 -49
  48. package/composables/useAppVersion.ts +21 -21
  49. package/composables/useEnvLanguage.ts +20 -20
  50. package/lib/utils/sendTask.ts +72 -72
  51. package/minify.js +146 -146
  52. package/package.json +1 -1
  53. package/plugins/spice-console/spice.console.ts +147 -147
  54. package/public/spice-console/application/codec.js +263 -263
  55. package/public/spice-console/lib/rasterEngine.js +907 -907
  56. package/public/spice-console/network/spicechannel.js +375 -375
  57. package/store/main/lib/interfaces.ts +9 -9
  58. package/store/tasks/actions.ts +133 -133
  59. package/store/tasks/getters.ts +25 -25
  60. package/store/tasks/lib/models/interfaces.ts +18 -18
  61. package/store/tasks/mutations.ts +58 -58
  62. package/store/tasks/state.ts +16 -16
@@ -1,182 +1,182 @@
1
- <template>
2
- <div class="hardware-video-card">
3
- <atoms-stack-block :has-children="true">
4
- <template #stackBlockKey>
5
- <div
6
- id="vm-wizard-toggle-block-video-card"
7
- data-id="vm-wizard-toggle-block-video-card"
8
- class="flex-align-center"
9
- >
10
- <span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
11
- <atoms-the-icon
12
- v-show="invalid"
13
- width="24px"
14
- height="24px"
15
- class="is-error tooltip-trigger"
16
- name="info"
17
- />
18
- </div>
19
- </template>
20
- <template #stackBlockContent>
21
- <atoms-tooltip-error
22
- :has-error="!!apiError"
23
- selector=".vm-wizard-video-card"
24
- @remove="onRemoveValidationError"
25
- >
26
- <template #elem>
27
- <div class="select">
28
- <select
29
- id="vm-wizard-video-card"
30
- v-model="selectedVideoCard"
31
- data-id="vm-wizard-video-card-select"
32
- class="vm-wizard-video-card input-text-color"
33
- :disabled="props.isEdit && props.state !== 1"
34
- @click.stop
35
- >
36
- <option
37
- v-for="(item, key) in videoCardOptions"
38
- :key="key"
39
- :value="item.value"
40
- >
41
- {{ item.text }}
42
- </option>
43
- </select>
44
- </div>
45
- </template>
46
- <template #content>{{ apiError }}</template>
47
- </atoms-tooltip-error>
48
- </template>
49
- <template #stackChildren>
50
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
51
- v-model:number-displays="numberDisplays"
52
- :disabled="isDisabled"
53
- :error-validation-fields="props.errorValidationFields"
54
- @remove-error-by-title="emits('remove-error-by-title', $event)"
55
- />
56
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-total-video-memory
57
- v-model:total-video-memory="totalVideoMemory"
58
- :disabled="isDisabled"
59
- :is-edit="props.isEdit"
60
- :error-validation-fields="props.errorValidationFields"
61
- @invalid="invalid = $event"
62
- @remove-error-by-title="emits('remove-error-by-title', $event)"
63
- />
64
- <!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
65
- <!-- v-models:graphics="graphics"-->
66
- <!-- />-->
67
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model
68
- v-model:video-card-model="videoCardModel"
69
- :disabled="isDisabled"
70
- />
71
- </template>
72
- </atoms-stack-block>
73
- </div>
74
- </template>
75
-
76
- <script setup lang="ts">
77
- import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
78
- import { UI_I_Localization } from '~/lib/models/interfaces'
79
- import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
80
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
81
- import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/lib/config/options'
82
- import { videoCardOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options'
83
-
84
- const props = defineProps<{
85
- isEdit: boolean
86
- errorValidationFields: UI_I_ErrorValidationField[]
87
- videoCard?: UI_I_SendDataVideoCard
88
- state?: string | number
89
- }>()
90
- const emits = defineEmits<{
91
- (event: 'send-data', value: UI_I_SendDataVideoCard): void
92
- (event: 'invalid', value: boolean): void
93
- (event: 'remove-error-by-title', value: string): void
94
- }>()
95
-
96
- const localization = computed<UI_I_Localization>(() => useLocal())
97
-
98
- const selectedVideoCard = ref<number>(1)
99
- const videoCardOptions = ref<UI_I_OptionItem[]>(
100
- videoCardOptionsFunc(localization.value)
101
- )
102
-
103
- const isDisabled = computed<boolean>(
104
- () => selectedVideoCard.value === 0 || (props.isEdit && props.state !== 1)
105
- )
106
- watch(isDisabled, (val) => {
107
- if (!val) {
108
- return
109
- }
110
-
111
- numberDisplays.value = '1'
112
- })
113
- const numberDisplays = ref<string>('1')
114
-
115
- const totalVideoMemory = ref<number>(8)
116
- const invalid = ref<boolean>(false)
117
- watch(
118
- invalid,
119
- (newValue) => {
120
- emits('invalid', newValue)
121
- },
122
- { immediate: true }
123
- )
124
-
125
- // const graphics = ref(false)
126
-
127
- const videoCardModel = ref<string>('qxl')
128
- const videoCardModelOptions = ref<UI_I_OptionItem[]>(
129
- videoCardModelOptionsConfig
130
- )
131
- const videoCardModelName = computed<string>(
132
- () =>
133
- videoCardModelOptions.value.find(
134
- (videoCard) => videoCard.value === videoCardModel.value
135
- )?.text || ''
136
- )
137
-
138
- watch(
139
- [numberDisplays, totalVideoMemory, videoCardModel],
140
- () => {
141
- emits('send-data', {
142
- adapter: videoCardModel.value,
143
- displays: +numberDisplays.value,
144
- memory_mb: totalVideoMemory.value,
145
- })
146
- },
147
- { immediate: true }
148
- )
149
-
150
- // Добавляем данные для редактирования
151
- watch(
152
- () => props.videoCard,
153
- (newValue) => {
154
- if (!newValue) return
155
-
156
- selectedVideoCard.value = 1
157
- videoCardModel.value = newValue.adapter
158
- numberDisplays.value = '' + newValue.displays
159
- totalVideoMemory.value = newValue.memory_mb
160
- },
161
- { immediate: true }
162
- )
163
-
164
- const typeError = 'video_card.adapter'
165
-
166
- const apiError = computed<string>(() => {
167
- return (
168
- props.errorValidationFields?.find((message) => message.field === typeError)
169
- ?.error_message || ''
170
- )
171
- })
172
-
173
- const onRemoveValidationError = (): void => {
174
- emits('remove-error-by-title', typeError)
175
- }
176
- </script>
177
-
178
- <style scoped lang="scss">
179
- #network-connect {
180
- margin-right: 4px;
181
- }
182
- </style>
1
+ <template>
2
+ <div class="hardware-video-card">
3
+ <atoms-stack-block :has-children="true">
4
+ <template #stackBlockKey>
5
+ <div
6
+ id="vm-wizard-toggle-block-video-card"
7
+ data-id="vm-wizard-toggle-block-video-card"
8
+ class="flex-align-center"
9
+ >
10
+ <span>{{ localization.videoCard }}: {{ videoCardModelName }}</span>
11
+ <atoms-the-icon
12
+ v-show="invalid"
13
+ width="24px"
14
+ height="24px"
15
+ class="is-error tooltip-trigger"
16
+ name="info"
17
+ />
18
+ </div>
19
+ </template>
20
+ <template #stackBlockContent>
21
+ <atoms-tooltip-error
22
+ :has-error="!!apiError"
23
+ selector=".vm-wizard-video-card"
24
+ @remove="onRemoveValidationError"
25
+ >
26
+ <template #elem>
27
+ <div class="select">
28
+ <select
29
+ id="vm-wizard-video-card"
30
+ v-model="selectedVideoCard"
31
+ data-id="vm-wizard-video-card-select"
32
+ class="vm-wizard-video-card input-text-color"
33
+ :disabled="props.isEdit && props.state !== 1"
34
+ @click.stop
35
+ >
36
+ <option
37
+ v-for="(item, key) in videoCardOptions"
38
+ :key="key"
39
+ :value="item.value"
40
+ >
41
+ {{ item.text }}
42
+ </option>
43
+ </select>
44
+ </div>
45
+ </template>
46
+ <template #content>{{ apiError }}</template>
47
+ </atoms-tooltip-error>
48
+ </template>
49
+ <template #stackChildren>
50
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
51
+ v-model:number-displays="numberDisplays"
52
+ :disabled="isDisabled"
53
+ :error-validation-fields="props.errorValidationFields"
54
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
55
+ />
56
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-total-video-memory
57
+ v-model:total-video-memory="totalVideoMemory"
58
+ :disabled="isDisabled"
59
+ :is-edit="props.isEdit"
60
+ :error-validation-fields="props.errorValidationFields"
61
+ @invalid="invalid = $event"
62
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
63
+ />
64
+ <!-- <templates-home-vm-actions-add-customize-hardware-virtual-hardware-video-card-graphics-->
65
+ <!-- v-models:graphics="graphics"-->
66
+ <!-- />-->
67
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model
68
+ v-model:video-card-model="videoCardModel"
69
+ :disabled="isDisabled"
70
+ />
71
+ </template>
72
+ </atoms-stack-block>
73
+ </div>
74
+ </template>
75
+
76
+ <script setup lang="ts">
77
+ import { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
78
+ import { UI_I_Localization } from '~/lib/models/interfaces'
79
+ import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
80
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
81
+ import { videoCardModelOptionsConfig } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/lib/config/options'
82
+ import { videoCardOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options'
83
+
84
+ const props = defineProps<{
85
+ isEdit: boolean
86
+ errorValidationFields: UI_I_ErrorValidationField[]
87
+ videoCard?: UI_I_SendDataVideoCard
88
+ state?: string | number
89
+ }>()
90
+ const emits = defineEmits<{
91
+ (event: 'send-data', value: UI_I_SendDataVideoCard): void
92
+ (event: 'invalid', value: boolean): void
93
+ (event: 'remove-error-by-title', value: string): void
94
+ }>()
95
+
96
+ const localization = computed<UI_I_Localization>(() => useLocal())
97
+
98
+ const selectedVideoCard = ref<number>(1)
99
+ const videoCardOptions = ref<UI_I_OptionItem[]>(
100
+ videoCardOptionsFunc(localization.value)
101
+ )
102
+
103
+ const isDisabled = computed<boolean>(
104
+ () => selectedVideoCard.value === 0 || (props.isEdit && props.state !== 1)
105
+ )
106
+ watch(isDisabled, (val) => {
107
+ if (!val) {
108
+ return
109
+ }
110
+
111
+ numberDisplays.value = '1'
112
+ })
113
+ const numberDisplays = ref<string>('1')
114
+
115
+ const totalVideoMemory = ref<number>(8)
116
+ const invalid = ref<boolean>(false)
117
+ watch(
118
+ invalid,
119
+ (newValue) => {
120
+ emits('invalid', newValue)
121
+ },
122
+ { immediate: true }
123
+ )
124
+
125
+ // const graphics = ref(false)
126
+
127
+ const videoCardModel = ref<string>('qxl')
128
+ const videoCardModelOptions = ref<UI_I_OptionItem[]>(
129
+ videoCardModelOptionsConfig
130
+ )
131
+ const videoCardModelName = computed<string>(
132
+ () =>
133
+ videoCardModelOptions.value.find(
134
+ (videoCard) => videoCard.value === videoCardModel.value
135
+ )?.text || ''
136
+ )
137
+
138
+ watch(
139
+ [numberDisplays, totalVideoMemory, videoCardModel],
140
+ () => {
141
+ emits('send-data', {
142
+ adapter: videoCardModel.value,
143
+ displays: +numberDisplays.value,
144
+ memory_mb: totalVideoMemory.value,
145
+ })
146
+ },
147
+ { immediate: true }
148
+ )
149
+
150
+ // Добавляем данные для редактирования
151
+ watch(
152
+ () => props.videoCard,
153
+ (newValue) => {
154
+ if (!newValue) return
155
+
156
+ selectedVideoCard.value = 1
157
+ videoCardModel.value = newValue.adapter
158
+ numberDisplays.value = '' + newValue.displays
159
+ totalVideoMemory.value = newValue.memory_mb
160
+ },
161
+ { immediate: true }
162
+ )
163
+
164
+ const typeError = 'video_card.adapter'
165
+
166
+ const apiError = computed<string>(() => {
167
+ return (
168
+ props.errorValidationFields?.find((message) => message.field === typeError)
169
+ ?.error_message || ''
170
+ )
171
+ })
172
+
173
+ const onRemoveValidationError = (): void => {
174
+ emits('remove-error-by-title', typeError)
175
+ }
176
+ </script>
177
+
178
+ <style scoped lang="scss">
179
+ #network-connect {
180
+ margin-right: 4px;
181
+ }
182
+ </style>
@@ -1,114 +1,114 @@
1
- <template>
2
- <div class="boot-options">
3
- <atoms-stack-block :has-children="true">
4
- <template #stackBlockKey>
5
- <div
6
- id="vm-wizard-toggle-block-boot-option"
7
- data-id="vm-wizard-toggle-block-boot-option"
8
- class="flex-align-center"
9
- >
10
- <span>{{ localization.bootOptions }}</span>
11
- </div>
12
- </template>
13
- <template #stackChildren>
14
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-firmware
15
- v-model:firmware="firmware"
16
- :error-validation-fields="props.errorValidationFields"
17
- :is-edit="props.isEdit"
18
- @remove-error-by-title="emits('remove-error-by-title', $event)"
19
- />
20
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-secure
21
- v-if="firmware === 'uefi'"
22
- v-model:secure-boot="secureBoot"
23
- />
24
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-menu
25
- v-model:boot-menu="bootMenu"
26
- />
27
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-delay
28
- v-model:boot-delay="bootDelay"
29
- />
30
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-order
31
- :hard-disks="props.hardDisks"
32
- :cd-dvd-drives="props.cdDvdDrives"
33
- :networks="props.networks"
34
- @change="onChangeBootOrder"
35
- />
36
- </template>
37
- </atoms-stack-block>
38
- </div>
39
- </template>
40
-
41
- <script setup lang="ts">
42
- import { UI_I_SendDataBootOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
43
- import {
44
- UI_I_SendDataNewCdDvdDrive,
45
- UI_I_SendDataNewHardDisk,
46
- UI_I_SendDataNewNetwork,
47
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
48
- import { UI_I_Localization } from '~/lib/models/interfaces'
49
- import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
50
- import { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
51
-
52
- const emits = defineEmits<{
53
- (
54
- event: 'change-boot-order',
55
- value: [
56
- UI_I_SendDataNewHardDisk[],
57
- UI_I_SendDataNewCdDvdDrive[],
58
- UI_I_SendDataNewNetwork[]
59
- ]
60
- ): void
61
- (event: 'send-data', value: UI_I_SendDataBootOptions): void
62
- (event: 'remove-error-by-title', value: string): void
63
- }>()
64
-
65
- const localization = computed<UI_I_Localization>(() => useLocal())
66
-
67
- const props = defineProps<{
68
- errorValidationFields: UI_I_ErrorValidationField[]
69
- hardDisks: UI_I_SendDataNewHardDisk[] | null
70
- cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
71
- networks: UI_I_SendDataNewNetwork[] | null
72
- bootOptions?: UI_I_SendDataBootOptions
73
- isEdit: boolean
74
- }>()
75
-
76
- const firmware = ref<string>('efi')
77
-
78
- const secureBoot = ref<boolean>(true)
79
-
80
- const bootMenu = ref<boolean>(true)
81
-
82
- const bootDelay = ref<number>(1000)
83
-
84
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
85
- emits('change-boot-order', data)
86
- }
87
-
88
- watch(
89
- [firmware, secureBoot, bootMenu, bootDelay],
90
- () => {
91
- emits('send-data', {
92
- firmware: firmware.value,
93
- boot_delay_ms: bootDelay.value,
94
- boot_menu: bootMenu.value,
95
- })
96
- },
97
- { immediate: true }
98
- )
99
-
100
- // Добавляем данные для редактирования
101
- watch(
102
- () => props.bootOptions,
103
- (newValue) => {
104
- if (!newValue || !props.bootOptions) return
105
-
106
- firmware.value = props.bootOptions.firmware
107
- bootDelay.value = props.bootOptions.boot_delay_ms
108
- bootMenu.value = props.bootOptions.boot_menu
109
- },
110
- { immediate: true }
111
- )
112
- </script>
113
-
114
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div class="boot-options">
3
+ <atoms-stack-block :has-children="true">
4
+ <template #stackBlockKey>
5
+ <div
6
+ id="vm-wizard-toggle-block-boot-option"
7
+ data-id="vm-wizard-toggle-block-boot-option"
8
+ class="flex-align-center"
9
+ >
10
+ <span>{{ localization.bootOptions }}</span>
11
+ </div>
12
+ </template>
13
+ <template #stackChildren>
14
+ <common-vm-actions-common-customize-hardware-vmoptions-boot-options-firmware
15
+ v-model:firmware="firmware"
16
+ :error-validation-fields="props.errorValidationFields"
17
+ :is-edit="props.isEdit"
18
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
19
+ />
20
+ <common-vm-actions-common-customize-hardware-vmoptions-boot-options-secure
21
+ v-if="firmware === 'uefi'"
22
+ v-model:secure-boot="secureBoot"
23
+ />
24
+ <common-vm-actions-common-customize-hardware-vmoptions-boot-options-menu
25
+ v-model:boot-menu="bootMenu"
26
+ />
27
+ <common-vm-actions-common-customize-hardware-vmoptions-boot-options-delay
28
+ v-model:boot-delay="bootDelay"
29
+ />
30
+ <common-vm-actions-common-customize-hardware-vmoptions-boot-options-order
31
+ :hard-disks="props.hardDisks"
32
+ :cd-dvd-drives="props.cdDvdDrives"
33
+ :networks="props.networks"
34
+ @change="onChangeBootOrder"
35
+ />
36
+ </template>
37
+ </atoms-stack-block>
38
+ </div>
39
+ </template>
40
+
41
+ <script setup lang="ts">
42
+ import { UI_I_SendDataBootOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
43
+ import {
44
+ UI_I_SendDataNewCdDvdDrive,
45
+ UI_I_SendDataNewHardDisk,
46
+ UI_I_SendDataNewNetwork,
47
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
48
+ import { UI_I_Localization } from '~/lib/models/interfaces'
49
+ import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
50
+ import { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
51
+
52
+ const emits = defineEmits<{
53
+ (
54
+ event: 'change-boot-order',
55
+ value: [
56
+ UI_I_SendDataNewHardDisk[],
57
+ UI_I_SendDataNewCdDvdDrive[],
58
+ UI_I_SendDataNewNetwork[]
59
+ ]
60
+ ): void
61
+ (event: 'send-data', value: UI_I_SendDataBootOptions): void
62
+ (event: 'remove-error-by-title', value: string): void
63
+ }>()
64
+
65
+ const localization = computed<UI_I_Localization>(() => useLocal())
66
+
67
+ const props = defineProps<{
68
+ errorValidationFields: UI_I_ErrorValidationField[]
69
+ hardDisks: UI_I_SendDataNewHardDisk[] | null
70
+ cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
71
+ networks: UI_I_SendDataNewNetwork[] | null
72
+ bootOptions?: UI_I_SendDataBootOptions
73
+ isEdit: boolean
74
+ }>()
75
+
76
+ const firmware = ref<string>('efi')
77
+
78
+ const secureBoot = ref<boolean>(true)
79
+
80
+ const bootMenu = ref<boolean>(true)
81
+
82
+ const bootDelay = ref<number>(1000)
83
+
84
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
85
+ emits('change-boot-order', data)
86
+ }
87
+
88
+ watch(
89
+ [firmware, secureBoot, bootMenu, bootDelay],
90
+ () => {
91
+ emits('send-data', {
92
+ firmware: firmware.value,
93
+ boot_delay_ms: bootDelay.value,
94
+ boot_menu: bootMenu.value,
95
+ })
96
+ },
97
+ { immediate: true }
98
+ )
99
+
100
+ // Добавляем данные для редактирования
101
+ watch(
102
+ () => props.bootOptions,
103
+ (newValue) => {
104
+ if (!newValue || !props.bootOptions) return
105
+
106
+ firmware.value = props.bootOptions.firmware
107
+ bootDelay.value = props.bootOptions.boot_delay_ms
108
+ bootMenu.value = props.bootOptions.boot_menu
109
+ },
110
+ { immediate: true }
111
+ )
112
+ </script>
113
+
114
+ <style scoped lang="scss"></style>