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.
@@ -0,0 +1,152 @@
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="!!props.apiErrorMachineType"
13
+ selector="#vm-wizard-machine-type-select"
14
+ @remove="emits('remove-error-by-title', '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 props.machineTypeOptions"
25
+ :key="item.value"
26
+ :value="item"
27
+ >
28
+ {{ item.text }}
29
+ </option>
30
+ </select>
31
+ </template>
32
+ <template #content>{{ props.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="!!props.apiErrorGuestOsFamily"
42
+ selector="#vm-wizard-os-select"
43
+ @remove="emits('remove-error-by-title', '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="emits('change-os')"
52
+ >
53
+ <option
54
+ v-for="item in props.osOptions"
55
+ :key="item.value"
56
+ :value="item"
57
+ >
58
+ {{ item.text }}
59
+ </option>
60
+ </select>
61
+ </template>
62
+ <template #content>{{ props.apiErrorGuestOsFamily }}</template>
63
+ </atoms-tooltip-error>
64
+ </div>
65
+ <div class="select-os-block os-select-wrap table-row">
66
+ <label for="os-version-select" class="table-cell"
67
+ >{{ localization.common.guestOsVersion }}:</label
68
+ >
69
+
70
+ <atoms-tooltip-error
71
+ :has-error="!!props.apiErrorGuestOsVersion"
72
+ selector="#vm-wizard-os-version-select"
73
+ @remove="emits('remove-error-by-title', 'guest_os_version')"
74
+ >
75
+ <template #elem>
76
+ <select
77
+ id="vm-wizard-os-version-select"
78
+ v-model="guestOsVersion"
79
+ data-id="vm-wizard-os-version-select"
80
+ class="table-cell"
81
+ >
82
+ <option
83
+ v-for="item in props.versionsOptions"
84
+ :key="item.value"
85
+ :value="item"
86
+ >
87
+ {{ item.text }}
88
+ </option>
89
+ </select>
90
+ </template>
91
+ <template #content>{{ props.apiErrorGuestOsVersion }}</template>
92
+ </atoms-tooltip-error>
93
+ </div>
94
+ </div>
95
+ </template>
96
+
97
+ <script setup lang="ts">
98
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
99
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
100
+
101
+ const machineType = defineModel<UI_I_OptionItem | null>('machine-type', {
102
+ required: true,
103
+ })
104
+ const guestOsFamily = defineModel<UI_I_OptionItem | null>('guest-os-family', {
105
+ required: true,
106
+ })
107
+ const guestOsVersion = defineModel<UI_I_OptionItem | null>('guest-os-version', {
108
+ required: true,
109
+ })
110
+
111
+ const props = defineProps<{
112
+ apiErrorMachineType: string
113
+ machineTypeOptions: UI_I_OptionItem[]
114
+ apiErrorGuestOsFamily: string
115
+ osOptions: UI_I_OptionItem[]
116
+ apiErrorGuestOsVersion: string
117
+ versionsOptions: UI_I_OptionItem[]
118
+ }>()
119
+ const emits = defineEmits<{
120
+ (event: 'remove-error-by-title', value: string): void
121
+ (event: 'change-os'): void
122
+ }>()
123
+ const localization = computed<UI_I_Localization>(() => useLocal())
124
+ </script>
125
+
126
+ <style scoped lang="scss">
127
+ .select-os {
128
+ .select-os-block {
129
+ label:not(.windows-virtualization-label) {
130
+ padding: 0 5px 5px 0;
131
+ }
132
+
133
+ .windows-virtualization-label {
134
+ padding: 0 4px;
135
+ }
136
+ }
137
+ }
138
+
139
+ #os-select-help-icon {
140
+ h3 {
141
+ margin-top: 7px;
142
+ font-size: 22px;
143
+ color: #565656;
144
+ }
145
+ p {
146
+ width: 310px;
147
+ margin-top: 24px;
148
+ font-size: 14px;
149
+ color: #565656;
150
+ }
151
+ }
152
+ </style>
@@ -0,0 +1,139 @@
1
+ <template>
2
+ <common-vm-actions-common-select-os-new
3
+ v-if="isNewView"
4
+ v-model:machine-type="machineType"
5
+ v-model:guest-os-family="guestOsFamily"
6
+ v-model:guest-os-version="guestOsVersion"
7
+ :api-error-machine-type="apiErrorMachineType"
8
+ :machine-type-options="machineTypeOptions"
9
+ :api-error-guest-os-family="apiErrorGuestOsFamily"
10
+ :os-options="osOptions"
11
+ :api-error-guest-os-version="apiErrorGuestOsVersion"
12
+ :versions-options="versionsOptions"
13
+ @change-os="onChangeOs"
14
+ @remove-error-by-title="onRemoveValidationError"
15
+ />
16
+ <common-vm-actions-common-select-os-old
17
+ v-else
18
+ v-model:machine-type="machineType"
19
+ v-model:guest-os-family="guestOsFamily"
20
+ v-model:guest-os-version="guestOsVersion"
21
+ :api-error-machine-type="apiErrorMachineType"
22
+ :machine-type-options="machineTypeOptions"
23
+ :api-error-guest-os-family="apiErrorGuestOsFamily"
24
+ :os-options="osOptions"
25
+ :api-error-guest-os-version="apiErrorGuestOsVersion"
26
+ :versions-options="versionsOptions"
27
+ @change-os="onChangeOs"
28
+ @remove-error-by-title="onRemoveValidationError"
29
+ />
30
+ </template>
31
+
32
+ <script setup lang="ts">
33
+ import type {
34
+ UI_I_ArbitraryObject,
35
+ } from '~/lib/models/interfaces'
36
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
37
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
38
+
39
+ const machineType = defineModel<UI_I_OptionItem | null>('machine-type', {
40
+ required: true,
41
+ })
42
+ const guestOsFamily = defineModel<UI_I_OptionItem | null>('guest-os-family', {
43
+ required: true,
44
+ })
45
+ const guestOsVersion = defineModel<UI_I_OptionItem | null>('guest-os-version', {
46
+ required: true,
47
+ })
48
+
49
+ const props = defineProps<{
50
+ familiesOptions: UI_I_OptionItem[]
51
+ machineTypesOptions: UI_I_OptionItem[]
52
+ versionsOptions: UI_I_ArbitraryObject<UI_I_OptionItem[]>
53
+ errorValidationFields: UI_I_ErrorValidationField[]
54
+ }>()
55
+ const emits = defineEmits<{
56
+ (event: 'remove-error-by-title', value: string): void
57
+ }>()
58
+
59
+ const { $store }: any = useNuxtApp()
60
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
61
+
62
+ const machineTypeOptions = ref<UI_I_OptionItem[]>(props.machineTypesOptions)
63
+ watch(
64
+ () => props.machineTypesOptions,
65
+ (newValue) => {
66
+ machineTypeOptions.value = [...newValue]
67
+ if (machineType.value) return
68
+
69
+ const q35MachineIndex = newValue.findIndex((item) =>
70
+ item.value.toLowerCase().includes('q35')
71
+ )
72
+ if (q35MachineIndex === -1) {
73
+ machineType.value = newValue[0]
74
+ } else {
75
+ machineType.value = newValue[q35MachineIndex]
76
+ }
77
+ },
78
+ { immediate: true }
79
+ )
80
+
81
+ const osOptions = ref<UI_I_OptionItem[]>(props.familiesOptions)
82
+ watch(
83
+ () => props.familiesOptions,
84
+ (newValue) => {
85
+ osOptions.value = [...newValue]
86
+ if (guestOsFamily.value) return
87
+ guestOsFamily.value = newValue[0]
88
+ },
89
+ { immediate: true }
90
+ )
91
+ const onChangeOs = (): void => {
92
+ guestOsVersion.value = versionsOptions.value[0]
93
+ }
94
+
95
+ const versionsOptions = computed<UI_I_OptionItem[]>(() => {
96
+ if (!guestOsFamily.value) return []
97
+
98
+ return props.versionsOptions[guestOsFamily.value.value] || []
99
+ })
100
+ watch(
101
+ versionsOptions,
102
+ () => {
103
+ if (guestOsVersion.value) return
104
+
105
+ guestOsVersion.value = versionsOptions.value[0]
106
+ },
107
+ { immediate: true }
108
+ )
109
+
110
+ const apiErrorMachineType = computed<string>(() => {
111
+ return (
112
+ props.errorValidationFields?.find(
113
+ (message) => message.field === 'machine_type'
114
+ )?.error_message || ''
115
+ )
116
+ })
117
+
118
+ const apiErrorGuestOsFamily = computed<string>(() => {
119
+ return (
120
+ props.errorValidationFields?.find(
121
+ (message) => message.field === 'guest_os_family'
122
+ )?.error_message || ''
123
+ )
124
+ })
125
+
126
+ const apiErrorGuestOsVersion = computed<string>(() => {
127
+ return (
128
+ props.errorValidationFields?.find(
129
+ (message) => message.field === 'guest_os_version'
130
+ )?.error_message || ''
131
+ )
132
+ })
133
+
134
+ const onRemoveValidationError = (type: string): void => {
135
+ emits('remove-error-by-title', type)
136
+ }
137
+ </script>
138
+
139
+ <style scoped lang="scss"></style>
@@ -236,12 +236,12 @@ const { height: height4 } = useElementSize(subTitleBlock4)
236
236
  // const datastoreType = ref<UI_T_DatastoreTypeCode>(
237
237
  // props.project === 'procurator' ? 'local' : 'shared-storm'
238
238
  // )
239
- const datastoreType = ref<UI_T_DatastoreTypeCode>('shared-storm')
239
+ const datastoreType = ref<UI_T_DatastoreTypeCode>(2)
240
240
  const form = ref<UI_I_CreateDatastoreForm>({
241
241
  name: 'Datastore',
242
242
  lunDisk: [],
243
243
  hosts: props.hostId ? [props?.hostId] : [],
244
- type_code: E_DatastoreTypeKode[datastoreType.value],
244
+ type_code: 2,
245
245
  nfsVersion: 'nfs-4.1',
246
246
  readonly: false,
247
247
  server: '',
@@ -61,7 +61,6 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
61
61
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
62
62
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
63
63
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
64
- import { E_DatastoreTypeKode } from '~/components/common/wizards/datastore/add/lib/models/enums'
65
64
  import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
66
65
  import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
67
66
 
@@ -89,12 +88,12 @@ const localization = computed<UI_I_Localization>(() => useLocal())
89
88
  // const datastoreType = ref<UI_T_DatastoreTypeCode>(
90
89
  // props.project === 'procurator' ? 'local' : 'shared-storm'
91
90
  // )
92
- const datastoreType = ref<UI_T_DatastoreTypeCode>('shared-storm')
91
+ const datastoreType = ref<UI_T_DatastoreTypeCode>(2)
93
92
  const form = ref<UI_I_CreateDatastoreForm>({
94
93
  name: 'Datastore',
95
94
  lunDisk: [],
96
95
  hosts: props.hostId ? [props?.hostId] : [],
97
- type_code: E_DatastoreTypeKode[datastoreType.value],
96
+ type_code: 2,
98
97
  nfsVersion: 'nfs-4.1',
99
98
  readonly: false,
100
99
  server: '',
@@ -15,7 +15,7 @@
15
15
  <script lang="ts" setup>
16
16
  import type { UI_I_Localization } from '~/lib/models/interfaces'
17
17
  import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
18
- import { datastoreTypesFunc } from '~/components/common/wizards/datastore/add/types/lib/config/typeOptions'
18
+ import { datastoreTypesFunc } from '~/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions'
19
19
 
20
20
  const formDatastoreTypeMode = defineModel<number>({ required: true })
21
21
 
@@ -15,6 +15,46 @@
15
15
  {{ option.description }}
16
16
  </span>
17
17
  </template>
18
+
19
+ <template #tooltip>
20
+ <ui-icon
21
+ :id="`${option.testId}-info-icon-trigger`"
22
+ name="info"
23
+ width="16"
24
+ height="16"
25
+ class="headline__icon pointer"
26
+ :class="isShowInfo && 'active'"
27
+ @click="isShowInfo = !isShowInfo"
28
+ />
29
+
30
+ <ui-popup-window
31
+ v-model="isShowInfo"
32
+ width="232px"
33
+ :elem-id="`${option.testId}-info-icon-trigger`"
34
+ >
35
+ <div class="common-widget-info">
36
+ <div class="flex justify-between">
37
+ <div class="flex">
38
+ <ui-icon name="info-2" width="16px" height="16px" />
39
+ <span class="title">
40
+ {{ localization.common.information }}
41
+ </span>
42
+ </div>
43
+ <ui-icon
44
+ name="close"
45
+ class="pointer hide-icon"
46
+ width="16px"
47
+ height="16px"
48
+ @click="isShowInfo = false"
49
+ />
50
+ </div>
51
+
52
+ <div class="common-widget-info-description">
53
+ {{ option.tooltipContent }}
54
+ </div>
55
+ </div>
56
+ </ui-popup-window>
57
+ </template>
18
58
  </ui-radio>
19
59
  </div>
20
60
  </section>
@@ -30,6 +70,8 @@ const props = defineProps<{
30
70
  }>()
31
71
 
32
72
  const localization = computed<UI_I_Localization>(() => useLocal())
73
+
74
+ const isShowInfo = ref<boolean>(false)
33
75
  </script>
34
76
 
35
77
  <style>
@@ -43,6 +85,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
43
85
  }
44
86
  </style>
45
87
  <style lang="scss" scoped>
88
+ @import 'assets/scss/common/mixins.scss';
46
89
  .datastore-type {
47
90
  container-type: inline-size;
48
91
  margin-top: 16px;
@@ -50,7 +93,7 @@ const localization = computed<UI_I_Localization>(() => useLocal())
50
93
  &__radio {
51
94
  &-container {
52
95
  display: grid;
53
- grid-template-columns: 1fr 1fr 1fr;
96
+ grid-template-columns: 1fr 1fr;
54
97
  gap: 12px;
55
98
  }
56
99
  &-description {
@@ -80,10 +123,54 @@ const localization = computed<UI_I_Localization>(() => useLocal())
80
123
  }
81
124
  }
82
125
  }
126
+
127
+ .headline {
128
+ @include flex($align: center);
129
+ margin: 32px 0 16px;
130
+
131
+ &__icon {
132
+ color: var(--feedback-tooltip-trigger-color);
133
+ &:hover {
134
+ color: var(--feedback-tooltip-hover-trigger-color);
135
+ }
136
+ &.active {
137
+ color: var(--feedback-tooltip-acctive-trigger-color);
138
+ }
139
+ }
140
+ &__label {
141
+ line-height: 19.36px;
142
+ font-size: 16px;
143
+ font-weight: 500;
144
+ color: var(--feedback-text-color);
145
+ margin-right: 8px;
146
+ }
147
+ .common-widget-info {
148
+ padding: 16px;
149
+ .title {
150
+ font-size: 14px;
151
+ font-weight: 500;
152
+ line-height: 16.94px;
153
+ color: var(--feedback-text-color);
154
+ margin-left: 8px;
155
+ }
156
+
157
+ .common-widget-info-description {
158
+ font-size: 13px;
159
+ line-height: 15.73px;
160
+ color: var(--feedback-text-color);
161
+ margin-top: 12px;
162
+ }
163
+
164
+ svg {
165
+ color: var(--feedback-tooltip-close-color);
166
+ min-width: 16px;
167
+ }
168
+ }
169
+ }
83
170
  }
84
171
 
85
172
  @container (max-width:600px) {
86
- .lockdown-mode__radio-container {
173
+ .datastore-type__radio-container {
87
174
  grid-template-columns: 1fr;
88
175
  }
89
176
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.69",
4
+ "version": "1.5.71",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.22",
38
- "bfg-uikit": "1.0.403",
38
+ "bfg-uikit": "1.0.410",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }