bfg-common 1.3.374 → 1.3.376

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.
@@ -9,11 +9,13 @@ export const navItemsFunc = (
9
9
  text: localization.virtualHardware,
10
10
  value: 0,
11
11
  disabled: false,
12
+ testId: 'virtual-hardware'
12
13
  },
13
14
  {
14
15
  text: localization.vMOptions,
15
16
  value: 1,
16
17
  disabled: false,
18
+ testId: 'vm-options'
17
19
  },
18
20
  ]
19
21
  }
@@ -1,110 +1,114 @@
1
- <template>
2
- <div class="boot-options">
3
- <atoms-stack-block :has-children="true">
4
- <template #stackBlockKey>
5
- <div id="vm-wizard-toggle-block-boot-option" class="flex-align-center">
6
- <span>{{ localization.bootOptions }}</span>
7
- </div>
8
- </template>
9
- <template #stackChildren>
10
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-firmware
11
- v-model:firmware="firmware"
12
- :error-validation-fields="props.errorValidationFields"
13
- :is-edit="props.isEdit"
14
- @remove-error-by-title="emits('remove-error-by-title', $event)"
15
- />
16
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-secure
17
- v-if="firmware === 'uefi'"
18
- v-model:secure-boot="secureBoot"
19
- />
20
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-menu
21
- v-model:boot-menu="bootMenu"
22
- />
23
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-delay
24
- v-model:boot-delay="bootDelay"
25
- />
26
- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-order
27
- :hard-disks="props.hardDisks"
28
- :cd-dvd-drives="props.cdDvdDrives"
29
- :networks="props.networks"
30
- @change="onChangeBootOrder"
31
- />
32
- </template>
33
- </atoms-stack-block>
34
- </div>
35
- </template>
36
-
37
- <script setup lang="ts">
38
- import { UI_I_SendDataBootOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
39
- import {
40
- UI_I_SendDataNewCdDvdDrive,
41
- UI_I_SendDataNewHardDisk,
42
- UI_I_SendDataNewNetwork,
43
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
44
- import { UI_I_Localization } from '~/lib/models/interfaces'
45
- import { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
46
- import { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
47
-
48
- const emits = defineEmits<{
49
- (
50
- event: 'change-boot-order',
51
- value: [
52
- UI_I_SendDataNewHardDisk[],
53
- UI_I_SendDataNewCdDvdDrive[],
54
- UI_I_SendDataNewNetwork[]
55
- ]
56
- ): void
57
- (event: 'send-data', value: UI_I_SendDataBootOptions): void
58
- (event: 'remove-error-by-title', value: string): void
59
- }>()
60
-
61
- const localization = computed<UI_I_Localization>(() => useLocal())
62
-
63
- const props = defineProps<{
64
- errorValidationFields: UI_I_ErrorValidationField[]
65
- hardDisks: UI_I_SendDataNewHardDisk[] | null
66
- cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
67
- networks: UI_I_SendDataNewNetwork[] | null
68
- bootOptions?: UI_I_SendDataBootOptions
69
- isEdit: boolean
70
- }>()
71
-
72
- const firmware = ref<string>('efi')
73
-
74
- const secureBoot = ref<boolean>(true)
75
-
76
- const bootMenu = ref<boolean>(true)
77
-
78
- const bootDelay = ref<number>(1000)
79
-
80
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
81
- emits('change-boot-order', data)
82
- }
83
-
84
- watch(
85
- [firmware, secureBoot, bootMenu, bootDelay],
86
- () => {
87
- emits('send-data', {
88
- firmware: firmware.value,
89
- boot_delay_ms: bootDelay.value,
90
- boot_menu: bootMenu.value,
91
- })
92
- },
93
- { immediate: true }
94
- )
95
-
96
- // Добавляем данные для редактирования
97
- watch(
98
- () => props.bootOptions,
99
- (newValue) => {
100
- if (!newValue || !props.bootOptions) return
101
-
102
- firmware.value = props.bootOptions.firmware
103
- bootDelay.value = props.bootOptions.boot_delay_ms
104
- bootMenu.value = props.bootOptions.boot_menu
105
- },
106
- { immediate: true }
107
- )
108
- </script>
109
-
110
- <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>
@@ -1,184 +1,188 @@
1
- <template>
2
- <div class="general-options">
3
- <atoms-stack-block :has-children="true" @toggle="blockIsOpen = $event">
4
- <template #stackBlockKey>
5
- <div class="flex-align-center">
6
- <span>{{ localization.generalOptions }}</span>
7
- </div>
8
- </template>
9
- <template #stackBlockContent>
10
- <div v-show="!blockIsOpen">
11
- {{ localization.vmName }}: {{ vmNameLocal }}
12
- </div>
13
- </template>
14
- <template #stackChildren>
15
- <atoms-stack-block :has-children="false">
16
- <template #stackBlockKey>
17
- {{ localization.vmName }}
18
- </template>
19
- <template #stackBlockContent>
20
- <span>{{ vmNameLocal }}</span>
21
- <!-- <span v-if="!props.isEdit">{{ vmNameLocal }}</span>-->
22
- <!-- <input-->
23
- <!-- v-else-->
24
- <!-- id="general-option-vm-name"-->
25
- <!-- v-models="vmNameLocal"-->
26
- <!-- type="text"-->
27
- <!-- />-->
28
- </template>
29
- </atoms-stack-block>
30
-
31
- <atoms-stack-block :has-children="false">
32
- <template #stackBlockKey>
33
- {{ localization.machineType }}
34
- </template>
35
- <template #stackBlockContent>
36
- <select
37
- v-if="props.guestMachineType"
38
- id="guest-machine-type-select"
39
- v-model="guestMachineTypeLocal"
40
- :disabled="isDisabled"
41
- data-id="guest-machine-type-select"
42
- >
43
- <option
44
- v-for="item in machineTypeOptions"
45
- :key="item.value"
46
- :value="item"
47
- >
48
- {{ item.text }}
49
- </option>
50
- </select>
51
- </template>
52
- </atoms-stack-block>
53
-
54
- <atoms-stack-block :has-children="false">
55
- <template #stackBlockKey>
56
- {{ localization.guestOsFamily }}
57
- </template>
58
- <template #stackBlockContent>
59
- <select
60
- v-if="props.guestOsFamily"
61
- id="guest-os-family-select"
62
- v-model="guestOsFamilyLocal"
63
- data-id="guest-os-family-select"
64
- :disabled="isDisabled"
65
- @change="onChangeOS"
66
- >
67
- <option v-for="item in osOptions" :key="item.value" :value="item">
68
- {{ item.text }}
69
- </option>
70
- </select>
71
- </template>
72
- </atoms-stack-block>
73
-
74
- <atoms-stack-block :has-children="false">
75
- <template #stackBlockKey>
76
- {{ localization.guestOsVersion }}
77
- </template>
78
- <template #stackBlockContent>
79
- <select
80
- v-if="props.guestOsVersion"
81
- id="guest-os-version-select"
82
- v-model="guestOsVersionLocal"
83
- data-id="guest-os-version-select"
84
- :disabled="isDisabled"
85
- >
86
- <option
87
- v-for="item in versionsOptions"
88
- :key="item.value"
89
- :value="item"
90
- >
91
- {{ item.text }}
92
- </option>
93
- </select>
94
- </template>
95
- </atoms-stack-block>
96
- </template>
97
- </atoms-stack-block>
98
- </div>
99
- </template>
100
-
101
- <script setup lang="ts">
102
- import { UI_I_Localization } from '~/lib/models/interfaces'
103
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
104
- import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
105
-
106
- const localization = computed<UI_I_Localization>(() => useLocal())
107
-
108
- const props = defineProps<{
109
- vmName: string
110
- guestMachineType: UI_I_OptionItem | null
111
- guestOsFamily: UI_I_OptionItem | null
112
- guestOsVersion: UI_I_OptionItem | null
113
- isEdit: boolean
114
- isClone: boolean
115
- state?: string | number
116
- }>()
117
- const emits = defineEmits<{
118
- (event: 'update:vm-name', value: string): void
119
- (event: 'update:guest-machine-type', value: UI_I_OptionItem | null): void
120
- (event: 'update:guest-os-family', value: UI_I_OptionItem | null): void
121
- (event: 'update:guest-os-version', value: UI_I_OptionItem | null): void
122
- }>()
123
-
124
- const isDisabled = computed<boolean>(
125
- () => (!props.isEdit && !props.isClone) || (props.isEdit && props.state !== 1)
126
- )
127
-
128
- const vmNameLocal = computed<string>({
129
- get() {
130
- return props.vmName
131
- },
132
- set(newValue) {
133
- emits('update:vm-name', newValue)
134
- },
135
- })
136
-
137
- const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
138
- get() {
139
- return props.guestMachineType
140
- },
141
- set(newValue) {
142
- emits('update:guest-machine-type', newValue)
143
- },
144
- })
145
- const machineTypeOptions = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
146
-
147
- const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
148
- get() {
149
- return props.guestOsFamily
150
- },
151
- set(newValue) {
152
- emits('update:guest-os-family', newValue)
153
- },
154
- })
155
- const osOptions = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
156
- const onChangeOS = (): void => {
157
- guestOsVersionLocal.value = versionsOptions.value[0]
158
- }
159
-
160
- const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
161
- get() {
162
- return props.guestOsVersion
163
- },
164
- set(newValue) {
165
- emits('update:guest-os-version', newValue)
166
- },
167
- })
168
- const versionsOptions = computed<UI_I_OptionItem[]>(() => {
169
- if (!guestOsFamilyLocal.value) return []
170
-
171
- return capabilities.guestOsVersions[guestOsFamilyLocal.value.value] || []
172
- })
173
- watch(
174
- versionsOptions,
175
- () => {
176
- guestOsVersionLocal.value = versionsOptions.value[0]
177
- }
178
- // { immediate: true }
179
- )
180
-
181
- const blockIsOpen = ref<boolean>(false)
182
- </script>
183
-
184
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div class="general-options">
3
+ <atoms-stack-block :has-children="true" @toggle="blockIsOpen = $event">
4
+ <template #stackBlockKey>
5
+ <div
6
+ id="vm-wizard-toggle-block-general-options"
7
+ data-id="vm-wizard-toggle-block-general-options"
8
+ class="flex-align-center"
9
+ >
10
+ <span>{{ localization.generalOptions }}</span>
11
+ </div>
12
+ </template>
13
+ <template #stackBlockContent>
14
+ <div v-show="!blockIsOpen">
15
+ {{ localization.vmName }}: {{ vmNameLocal }}
16
+ </div>
17
+ </template>
18
+ <template #stackChildren>
19
+ <atoms-stack-block :has-children="false">
20
+ <template #stackBlockKey>
21
+ {{ localization.vmName }}
22
+ </template>
23
+ <template #stackBlockContent>
24
+ <span>{{ vmNameLocal }}</span>
25
+ <!-- <span v-if="!props.isEdit">{{ vmNameLocal }}</span>-->
26
+ <!-- <input-->
27
+ <!-- v-else-->
28
+ <!-- id="general-option-vm-name"-->
29
+ <!-- v-models="vmNameLocal"-->
30
+ <!-- type="text"-->
31
+ <!-- />-->
32
+ </template>
33
+ </atoms-stack-block>
34
+
35
+ <atoms-stack-block :has-children="false">
36
+ <template #stackBlockKey>
37
+ {{ localization.machineType }}
38
+ </template>
39
+ <template #stackBlockContent>
40
+ <select
41
+ v-if="props.guestMachineType"
42
+ id="guest-machine-type-select"
43
+ v-model="guestMachineTypeLocal"
44
+ :disabled="isDisabled"
45
+ data-id="guest-machine-type-select"
46
+ >
47
+ <option
48
+ v-for="item in machineTypeOptions"
49
+ :key="item.value"
50
+ :value="item"
51
+ >
52
+ {{ item.text }}
53
+ </option>
54
+ </select>
55
+ </template>
56
+ </atoms-stack-block>
57
+
58
+ <atoms-stack-block :has-children="false">
59
+ <template #stackBlockKey>
60
+ {{ localization.guestOsFamily }}
61
+ </template>
62
+ <template #stackBlockContent>
63
+ <select
64
+ v-if="props.guestOsFamily"
65
+ id="guest-os-family-select"
66
+ v-model="guestOsFamilyLocal"
67
+ data-id="guest-os-family-select"
68
+ :disabled="isDisabled"
69
+ @change="onChangeOS"
70
+ >
71
+ <option v-for="item in osOptions" :key="item.value" :value="item">
72
+ {{ item.text }}
73
+ </option>
74
+ </select>
75
+ </template>
76
+ </atoms-stack-block>
77
+
78
+ <atoms-stack-block :has-children="false">
79
+ <template #stackBlockKey>
80
+ {{ localization.guestOsVersion }}
81
+ </template>
82
+ <template #stackBlockContent>
83
+ <select
84
+ v-if="props.guestOsVersion"
85
+ id="guest-os-version-select"
86
+ v-model="guestOsVersionLocal"
87
+ data-id="guest-os-version-select"
88
+ :disabled="isDisabled"
89
+ >
90
+ <option
91
+ v-for="item in versionsOptions"
92
+ :key="item.value"
93
+ :value="item"
94
+ >
95
+ {{ item.text }}
96
+ </option>
97
+ </select>
98
+ </template>
99
+ </atoms-stack-block>
100
+ </template>
101
+ </atoms-stack-block>
102
+ </div>
103
+ </template>
104
+
105
+ <script setup lang="ts">
106
+ import { UI_I_Localization } from '~/lib/models/interfaces'
107
+ import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
108
+ import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
109
+
110
+ const localization = computed<UI_I_Localization>(() => useLocal())
111
+
112
+ const props = defineProps<{
113
+ vmName: string
114
+ guestMachineType: UI_I_OptionItem | null
115
+ guestOsFamily: UI_I_OptionItem | null
116
+ guestOsVersion: UI_I_OptionItem | null
117
+ isEdit: boolean
118
+ isClone: boolean
119
+ state?: string | number
120
+ }>()
121
+ const emits = defineEmits<{
122
+ (event: 'update:vm-name', value: string): void
123
+ (event: 'update:guest-machine-type', value: UI_I_OptionItem | null): void
124
+ (event: 'update:guest-os-family', value: UI_I_OptionItem | null): void
125
+ (event: 'update:guest-os-version', value: UI_I_OptionItem | null): void
126
+ }>()
127
+
128
+ const isDisabled = computed<boolean>(
129
+ () => (!props.isEdit && !props.isClone) || (props.isEdit && props.state !== 1)
130
+ )
131
+
132
+ const vmNameLocal = computed<string>({
133
+ get() {
134
+ return props.vmName
135
+ },
136
+ set(newValue) {
137
+ emits('update:vm-name', newValue)
138
+ },
139
+ })
140
+
141
+ const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
142
+ get() {
143
+ return props.guestMachineType
144
+ },
145
+ set(newValue) {
146
+ emits('update:guest-machine-type', newValue)
147
+ },
148
+ })
149
+ const machineTypeOptions = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
150
+
151
+ const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
152
+ get() {
153
+ return props.guestOsFamily
154
+ },
155
+ set(newValue) {
156
+ emits('update:guest-os-family', newValue)
157
+ },
158
+ })
159
+ const osOptions = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
160
+ const onChangeOS = (): void => {
161
+ guestOsVersionLocal.value = versionsOptions.value[0]
162
+ }
163
+
164
+ const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
165
+ get() {
166
+ return props.guestOsVersion
167
+ },
168
+ set(newValue) {
169
+ emits('update:guest-os-version', newValue)
170
+ },
171
+ })
172
+ const versionsOptions = computed<UI_I_OptionItem[]>(() => {
173
+ if (!guestOsFamilyLocal.value) return []
174
+
175
+ return capabilities.guestOsVersions[guestOsFamilyLocal.value.value] || []
176
+ })
177
+ watch(
178
+ versionsOptions,
179
+ () => {
180
+ guestOsVersionLocal.value = versionsOptions.value[0]
181
+ }
182
+ // { immediate: true }
183
+ )
184
+
185
+ const blockIsOpen = ref<boolean>(false)
186
+ </script>
187
+
188
+ <style scoped lang="scss"></style>
@@ -4,6 +4,7 @@
4
4
  <template #stackBlockKey>
5
5
  <div
6
6
  id="vm-wizard-toggle-block-remote-console"
7
+ data-id="vm-wizard-toggle-block-remote-console"
7
8
  class="flex-align-center"
8
9
  >
9
10
  <span>{{ localization.remoteConsoleOptions }}</span>