bfg-common 1.5.69 → 1.5.71

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.
@@ -1,218 +0,0 @@
1
- <template>
2
- <div class="select-os">
3
- <p class="select-os-block">
4
- {{ localization.common.identifyingGuestSystemInstallation }}
5
- </p>
6
- <div class="select-os-block os-select-wrap table-row">
7
- <label for="machine-type-select" class="table-cell"
8
- >{{ localization.common.machineType }}:</label
9
- >
10
-
11
- <atoms-tooltip-error
12
- :has-error="!!apiErrorMachineType"
13
- selector="#vm-wizard-machine-type-select"
14
- @remove="onRemoveValidationError('machine_type')"
15
- >
16
- <template #elem>
17
- <select
18
- id="vm-wizard-machine-type-select"
19
- v-model="machineType"
20
- data-id="vm-wizard-machine-type-select"
21
- class="table-cell"
22
- >
23
- <option
24
- v-for="item in machineTypeOptions"
25
- :key="item.value"
26
- :value="item"
27
- >
28
- {{ item.text }}
29
- </option>
30
- </select>
31
- </template>
32
- <template #content>{{ apiErrorMachineType }}</template>
33
- </atoms-tooltip-error>
34
- </div>
35
- <div class="select-os-block os-select-wrap table-row">
36
- <label for="os-select" class="table-cell"
37
- >{{ localization.common.guestOsFamily }}:</label
38
- >
39
-
40
- <atoms-tooltip-error
41
- :has-error="!!apiErrorGuestOsFamily"
42
- selector="#vm-wizard-os-select"
43
- @remove="onRemoveValidationError('guest_os_family')"
44
- >
45
- <template #elem>
46
- <select
47
- id="vm-wizard-os-select"
48
- v-model="guestOsFamily"
49
- data-id="vm-wizard-os-select"
50
- class="table-cell"
51
- @change="onChangeOS"
52
- >
53
- <option v-for="item in osOptions" :key="item.value" :value="item">
54
- {{ item.text }}
55
- </option>
56
- </select>
57
- </template>
58
- <template #content>{{ apiErrorGuestOsFamily }}</template>
59
- </atoms-tooltip-error>
60
- </div>
61
- <div class="select-os-block os-select-wrap table-row">
62
- <label for="os-version-select" class="table-cell"
63
- >{{ localization.common.guestOsVersion }}:</label
64
- >
65
-
66
- <atoms-tooltip-error
67
- :has-error="!!apiErrorGuestOsVersion"
68
- selector="#vm-wizard-os-version-select"
69
- @remove="onRemoveValidationError('guest_os_version')"
70
- >
71
- <template #elem>
72
- <select
73
- id="vm-wizard-os-version-select"
74
- v-model="guestOsVersion"
75
- data-id="vm-wizard-os-version-select"
76
- class="table-cell"
77
- >
78
- <option
79
- v-for="item in versionsOptions"
80
- :key="item.value"
81
- :value="item"
82
- >
83
- {{ item.text }}
84
- </option>
85
- </select>
86
- </template>
87
- <template #content>{{ apiErrorGuestOsVersion }}</template>
88
- </atoms-tooltip-error>
89
- </div>
90
- </div>
91
- </template>
92
-
93
- <script setup lang="ts">
94
- import type { UI_I_OsChange } from '~/components/common/vm/actions/common/select/lib/models/interfaces'
95
- import type {
96
- UI_I_Localization,
97
- UI_I_ArbitraryObject,
98
- } from '~/lib/models/interfaces'
99
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
100
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
101
-
102
- const machineType = defineModel<UI_I_OptionItem | null>('machine-type', {required: true})
103
- const guestOsFamily = defineModel<UI_I_OptionItem | null>('guest-os-family', {required: true})
104
- const guestOsVersion = defineModel<UI_I_OptionItem | null>('guest-os-version', {required: true})
105
-
106
- const props = defineProps<{
107
- familiesOptions: UI_I_OptionItem[]
108
- machineTypesOptions: UI_I_OptionItem[]
109
- versionsOptions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
110
- errorValidationFields: UI_I_ErrorValidationField[]
111
- }>()
112
- const emits = defineEmits<{
113
- (event: 'remove-error-by-title', value: string): void
114
- }>()
115
- const localization = computed<UI_I_Localization>(() => useLocal())
116
-
117
- const machineTypeOptions = ref<UI_I_OptionItem[]>(props.machineTypesOptions)
118
- watch(
119
- () => props.machineTypesOptions,
120
- (newValue) => {
121
- machineTypeOptions.value = [...newValue]
122
- if (machineType.value) return
123
-
124
- const q35MachineIndex = newValue.findIndex(item => item.value.toLowerCase().includes('q35'))
125
- if (q35MachineIndex === -1) {
126
- machineType.value = newValue[0]
127
- } else {
128
- machineType.value = newValue[q35MachineIndex]
129
- }
130
- },
131
- { immediate: true }
132
- )
133
-
134
- const osOptions = ref<UI_I_OptionItem[]>(props.familiesOptions)
135
- watch(
136
- () => props.familiesOptions,
137
- (newValue) => {
138
- osOptions.value = [...newValue]
139
- if (guestOsFamily.value) return
140
- guestOsFamily.value = newValue[0]
141
- },
142
- { immediate: true }
143
- )
144
- const onChangeOS = (): void => {
145
- guestOsVersion.value = versionsOptions.value[0]
146
- }
147
-
148
- const versionsOptions = computed<UI_I_OptionItem[]>(() => {
149
- if (!guestOsFamily.value) return []
150
-
151
- return props.versionsOptions[guestOsFamily.value.value] || []
152
- })
153
- watch(
154
- versionsOptions,
155
- () => {
156
- if (guestOsVersion.value) return
157
-
158
- guestOsVersion.value = versionsOptions.value[0]
159
- },
160
- { immediate: true }
161
- )
162
-
163
- const apiErrorMachineType = computed<string>(() => {
164
- return (
165
- props.errorValidationFields?.find(
166
- (message) => message.field === 'machine_type'
167
- )?.error_message || ''
168
- )
169
- })
170
-
171
- const apiErrorGuestOsFamily = computed<string>(() => {
172
- return (
173
- props.errorValidationFields?.find(
174
- (message) => message.field === 'guest_os_family'
175
- )?.error_message || ''
176
- )
177
- })
178
-
179
- const apiErrorGuestOsVersion = computed<string>(() => {
180
- return (
181
- props.errorValidationFields?.find(
182
- (message) => message.field === 'guest_os_version'
183
- )?.error_message || ''
184
- )
185
- })
186
-
187
- const onRemoveValidationError = (type: string): void => {
188
- emits('remove-error-by-title', type)
189
- }
190
- </script>
191
-
192
- <style scoped lang="scss">
193
- .select-os {
194
- .select-os-block {
195
- label:not(.windows-virtualization-label) {
196
- padding: 0 5px 5px 0;
197
- }
198
-
199
- .windows-virtualization-label {
200
- padding: 0 4px;
201
- }
202
- }
203
- }
204
-
205
- #os-select-help-icon {
206
- h3 {
207
- margin-top: 7px;
208
- font-size: 22px;
209
- color: #565656;
210
- }
211
- p {
212
- width: 310px;
213
- margin-top: 24px;
214
- font-size: 14px;
215
- color: #565656;
216
- }
217
- }
218
- </style>
@@ -1,83 +0,0 @@
1
- <template>
2
- <section class="datastore-types">
3
- <div class="header-row">
4
- <span class="datastore-types__subtitle">
5
- {{ localization.common.specifyDatastoreType }}
6
- </span>
7
- <div id="type-select-help-icon" class="signpost-container relative">
8
- <atoms-the-icon
9
- data-id="toggle-type-select-help-icon"
10
- fill="#0072a3"
11
- width="24px"
12
- height="24px"
13
- name="info-circle"
14
- @click="isShowTypeHelp = !isShowTypeHelp"
15
- />
16
- <atoms-tooltip-signpost
17
- v-if="isShowTypeHelp"
18
- elem-id="type-select-help-icon"
19
- test-id="select-datastore-type"
20
- @hide="isShowTypeHelp = false"
21
- >
22
- <p class="help-desc">
23
- {{ localization.common.datastoreTypeHelpDesc }}
24
- </p>
25
- </atoms-tooltip-signpost>
26
- </div>
27
- </div>
28
-
29
- <common-select-radio-group
30
- v-model="selectedDatastoreTypeLocal"
31
- :options="datastoreTypes"
32
- @change="onChangeType"
33
- />
34
- </section>
35
- </template>
36
-
37
- <script lang="ts" setup>
38
- import type { UI_I_Localization } from '~/lib/models/interfaces'
39
- import type { UI_T_Project } from '~/lib/models/types'
40
- import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
41
- import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
42
- import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
43
- import { E_DatastoreTypeKode } from '~/components/common/wizards/datastore/add/lib/models/enums'
44
- import { datastoreTypesFunc } from '~/components/common/wizards/datastore/add/types/lib/config/typeOptions'
45
-
46
- const props = defineProps<{
47
- project: UI_T_Project
48
- }>()
49
- const selectedDatastoreTypeLocal =
50
- defineModel<UI_T_DatastoreTypeCode>('datastoreType')
51
- const model = defineModel<UI_I_CreateDatastoreForm>({ required: true })
52
-
53
- const localization = computed<UI_I_Localization>(() => useLocal())
54
-
55
- const datastoreTypes = ref<UI_I_RadioOption[]>(
56
- datastoreTypesFunc(localization.value)
57
- )
58
- const onChangeType = (): void => {
59
- model.value.type_code = E_DatastoreTypeKode[selectedDatastoreTypeLocal.value]
60
-
61
- model.value.name = 'Datastore' // default value is 'Datastore' every time
62
- }
63
-
64
- const isShowTypeHelp = ref<boolean>(false)
65
- </script>
66
-
67
- <style lang="scss" scoped>
68
- .datastore-types {
69
- .signpost-container {
70
- display: flex;
71
- cursor: pointer;
72
-
73
- .help-desc-container {
74
- max-width: 350px;
75
- }
76
- }
77
- .header-row {
78
- display: flex;
79
- align-items: center;
80
- gap: 10px;
81
- }
82
- }
83
- </style>
@@ -1,41 +0,0 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { UI_T_Project } from '~/lib/models/types'
3
- import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
4
-
5
- export const datastoreTypesFunc = (
6
- localization: UI_I_Localization,
7
- _project?: UI_T_Project
8
- ): UI_I_RadioOption[] => {
9
- return [
10
- {
11
- label: localization.common.stormSharedStorage,
12
- value: 'shared-storm',
13
- disabled: false,
14
- description: localization.common.sharedStormDesc,
15
- isTooltip: false,
16
- tooltipContent: localization.common.stormSharedStorageHelpDesc,
17
- testId: 'datastore-type-shared-storm',
18
- },
19
- {
20
- label: localization.common.nfs,
21
- value: 'nfs',
22
- disabled: false,
23
- description: localization.common.nfsDesc,
24
- isTooltip: false,
25
- tooltipContent: localization.common.nfsHelpDesc,
26
- testId: 'datastore-type-nfs',
27
- },
28
- ]
29
-
30
- // if (project === 'procurator') {
31
- // types.unshift({
32
- // label: localization.common.localStorage,
33
- // value: 'local',
34
- // disabled: false,
35
- // description: localization.common.localDesc,
36
- // isTooltip: false,
37
- // tooltipContent: localization.common.localStorageHelpDesc,
38
- // testId: 'datastore-type-local',
39
- // })
40
- // }
41
- }