bfg-common 1.5.226 → 1.5.227

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.
@@ -3141,5 +3141,13 @@
3141
3141
  "roleManagement": "Кіраванне ролямі",
3142
3142
  "selectRoleToViewItsDetails": "Выберыце ролю для прагляду яе дэталяў.",
3143
3143
  "roleUsage": "Выкарыстанне ролі"
3144
+ },
3145
+ "backup": {
3146
+ "selectName": "Абярыце назву",
3147
+ "specifyBackupStorageType": "Укажыце тып рэзервовага сховішча.",
3148
+ "specifyBackupStorageName": "Укажыце назву рэзервовага сховішча.",
3149
+ "specifyBackupStorageNameAndConfiguration": "Укажыце назву і канфігурацыю рэзервовага сховішча.",
3150
+ "selectHostsThatRequireAccessBackupStorage": "Абярыце хосты, якім патрэбны доступ да рэзервовага сховішча.",
3151
+ "selectDestinationStorageForBackupStorage": "Абярыце мэтавае сховішча для рэзервовага капіявання."
3144
3152
  }
3145
3153
  }
@@ -3145,5 +3145,13 @@
3145
3145
  "roleManagement": "Role Management",
3146
3146
  "selectRoleToViewItsDetails": "Select a role to view its details.",
3147
3147
  "roleUsage": "Role Usage"
3148
+ },
3149
+ "backup": {
3150
+ "selectName": "Select a Name",
3151
+ "specifyBackupStorageType": "Specify backup storage type.",
3152
+ "specifyBackupStorageName": "Specify the backup storage name.",
3153
+ "specifyBackupStorageNameAndConfiguration": "Specify the backup storage name and configuration.",
3154
+ "selectHostsThatRequireAccessBackupStorage": "Select the hosts that require access to the backup storage.",
3155
+ "selectDestinationStorageForBackupStorage": "Select the destination storage for the backup storage."
3148
3156
  }
3149
3157
  }
@@ -3145,5 +3145,13 @@
3145
3145
  "roleManagement": "Դերի կառավարում",
3146
3146
  "selectRoleToViewItsDetails": "Ընտրեք դեր, դրա մանրամասները դիտելու համար:",
3147
3147
  "roleUsage": "Դերի օգտագործումը"
3148
+ },
3149
+ "backup": {
3150
+ "selectName": "Ընտրեք անվանումը",
3151
+ "specifyBackupStorageType": "Նշեք պահուստային պահպանման տիպը։",
3152
+ "specifyBackupStorageName": "Նշեք պահուստային պահպանման անունը։",
3153
+ "specifyBackupStorageNameAndConfiguration": "Նշեք պահուստային պահպանման անունը և կազմաձևերը։",
3154
+ "selectHostsThatRequireAccessBackupStorage": "Ընտրեք հոսթեր, որոնք պետք է հասանելիություն ունենան պահուստային պահպանմանը։",
3155
+ "selectDestinationStorageForBackupStorage": "Ընտրեք նպատակային պահեստը պահուստային պատճենների համար։"
3148
3156
  }
3149
3157
  }
@@ -3144,5 +3144,13 @@
3144
3144
  "roleManagement": "Рөлдерді басқару",
3145
3145
  "selectRoleToViewItsDetails": "Оның мәліметтерін көру үшін рөлді таңдаңыз.",
3146
3146
  "roleUsage": "Рөлді пайдалану"
3147
+ },
3148
+ "backup": {
3149
+ "selectName": "Атауын таңдаңыз",
3150
+ "specifyBackupStorageType": "Резервтік сақтау түрін көрсетіңіз.",
3151
+ "specifyBackupStorageName": "Резервтік сақтау атауын көрсетіңіз.",
3152
+ "specifyBackupStorageNameAndConfiguration": "Резервтік сақтау атауы мен баптауларын көрсетіңіз.",
3153
+ "selectHostsThatRequireAccessBackupStorage": "Резервтік сақтауға қолжетімділік қажет хосттарды таңдаңыз.",
3154
+ "selectDestinationStorageForBackupStorage": "Резервтік сақтау үшін мақсатты сақтау орнын таңдаңыз."
3147
3155
  }
3148
3156
  }
@@ -3144,5 +3144,13 @@
3144
3144
  "roleManagement": "Управление ролями",
3145
3145
  "selectRoleToViewItsDetails": "Выберите роль, чтобы просмотреть сведения о ней.",
3146
3146
  "roleUsage": "Использование ролей"
3147
+ },
3148
+ "backup": {
3149
+ "selectName": "Выберите имя",
3150
+ "specifyBackupStorageType": "Укажите тип хранилища для резервного копирования.",
3151
+ "specifyBackupStorageName": "Укажите имя хранилища для резервного копирования.",
3152
+ "specifyBackupStorageNameAndConfiguration": "Укажите имя и конфигурацию хранилища для резервного копирования.",
3153
+ "selectHostsThatRequireAccessBackupStorage": "Выберите хосты, которым нужен доступ к хранилищу резервных копий.",
3154
+ "selectDestinationStorageForBackupStorage": "Выберите целевое хранилище для резервного копирования."
3147
3155
  }
3148
3156
  }
@@ -3142,5 +3142,13 @@
3142
3142
  "roleManagement": "角色管理",
3143
3143
  "selectRoleToViewItsDetails": "选择角色以查看其细节。",
3144
3144
  "roleUsage": "角色使用"
3145
+ },
3146
+ "backup": {
3147
+ "selectName": "选择名称",
3148
+ "specifyBackupStorageType": "指定备份存储类型。",
3149
+ "specifyBackupStorageName": "指定备份存储名称。",
3150
+ "specifyBackupStorageNameAndConfiguration": "指定备份存储名称和配置。",
3151
+ "selectHostsThatRequireAccessBackupStorage": "选择需要访问备份存储的主机。",
3152
+ "selectDestinationStorageForBackupStorage": "为备份存储选择目标存储。"
3145
3153
  }
3146
3154
  }
@@ -34,7 +34,6 @@
34
34
  </template>
35
35
 
36
36
  <script setup lang="ts">
37
- import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
38
37
  import type { UI_T_Project } from '~/lib/models/types'
39
38
  import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
40
39
  import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
@@ -45,6 +44,8 @@ import type {
45
44
  UI_I_WizardStep,
46
45
  } from '~/components/atoms/wizard/lib/models/interfaces'
47
46
  import type { UI_T_DatastoreTypeCode } from '~/components/common/backup/storage/actions/add/lib/models/types'
47
+ // TODO use from uikit
48
+ import Wizard from "~/components/atoms/wizard/lib/utils/utils";
48
49
  import {
49
50
  stepsFunc,
50
51
  stepsSchemeInitial,
@@ -75,7 +76,7 @@ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
75
76
 
76
77
  const localization = computed<UI_I_Localization>(() => useLocal())
77
78
 
78
- const title = ref(localization.value.common.newDatastore)
79
+ const title = ref(localization.value.common.newBackupStorage)
79
80
 
80
81
  const wizard: Wizard = new Wizard(
81
82
  stepsFunc(localization.value),
@@ -23,6 +23,7 @@
23
23
  v-model="formModelLocal"
24
24
  :project="props.project"
25
25
  :messages-fields="selectedStep.fields"
26
+ :alert-messages="props.alertMessages[dynamicSteps.name]"
26
27
  />
27
28
 
28
29
  <common-backup-storage-actions-add-steps-name-and-configure
@@ -30,17 +31,27 @@
30
31
  v-model="formModelLocal"
31
32
  :project="props.project"
32
33
  :messages-fields="selectedStep.fields"
34
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
33
35
  />
34
36
 
35
- <common-vm-actions-common-select-storage
36
- v-if="selectedStep.id === dynamicSteps.storage"
37
- :datastore="props.datastore"
38
- :get-datastore-table-func="props.getDatastoreTableFunc"
39
- hide-compatibility
40
- hide-alert
41
- class="storage-datatable h-full"
42
- @change-storage="onChangeStorage"
43
- />
37
+ <div v-if="selectedStep.id === dynamicSteps.storage">
38
+ <!-- TODO-->
39
+ <atoms-alert
40
+ v-show="props.alertMessages[dynamicSteps.storage]?.length"
41
+ test-id="configure-error-alert"
42
+ status="alert-danger"
43
+ :items="props.alertMessages[dynamicSteps.storage]"
44
+ />
45
+ <common-vm-actions-common-select-storage
46
+ :datastore="props.datastore"
47
+ :get-datastore-table-func="props.getDatastoreTableFunc"
48
+ hide-compatibility
49
+ hide-alert
50
+ class="storage-datatable h-full"
51
+ :alert-messages="props.alertMessages[dynamicSteps.storage]"
52
+ @change-storage="onChangeStorage"
53
+ />
54
+ </div>
44
55
 
45
56
  <common-backup-storage-actions-add-steps-host-accessibility
46
57
  v-if="selectedStep.id === dynamicSteps.hostAccessibility"
@@ -100,5 +111,4 @@ const onHideModal = (): void => emits('hide')
100
111
  const onCreateDatastore = (): void => emits('submit')
101
112
  </script>
102
113
 
103
- <style scoped lang="scss">
104
- </style>
114
+ <style scoped lang="scss"></style>
@@ -20,7 +20,7 @@ export const stepsFunc = (
20
20
  {
21
21
  id: dynamicSteps.type,
22
22
  title: localization.common.type,
23
- subTitle: localization.common.specifyDatastoreType,
23
+ subTitle: localization.common.specifyBackupStorageType,
24
24
  status: UI_E_WIZARD_STATUS.SELECTED,
25
25
  fields: {},
26
26
  isValid: true,
@@ -28,8 +28,8 @@ export const stepsFunc = (
28
28
  },
29
29
  {
30
30
  id: dynamicSteps.name,
31
- title: localization.common.name,
32
- subTitle: localization.common.nameAndDeviceSelectionDesc,
31
+ title: localization.backup.selectName,
32
+ subTitle: localization.common.specifyBackupStorageName,
33
33
  status: UI_E_WIZARD_STATUS.INACTIVE,
34
34
  fields: {
35
35
  name: {
@@ -43,7 +43,7 @@ export const stepsFunc = (
43
43
  {
44
44
  id: dynamicSteps.nameAndConfigure,
45
45
  title: localization.common.nameAndConfiguration,
46
- subTitle: localization.common.nameAndConfigurationDesc,
46
+ subTitle: localization.backup.specifyBackupStorageNameAndConfiguration,
47
47
  status: UI_E_WIZARD_STATUS.INACTIVE,
48
48
  fields: {
49
49
  name: {
@@ -73,7 +73,7 @@ export const stepsFunc = (
73
73
  {
74
74
  id: dynamicSteps.storage,
75
75
  title: localization.common.selectStorage,
76
- subTitle: localization.common.selectStorageDesc,
76
+ subTitle: localization.backup.selectDestinationStorageForBackupStorage,
77
77
  status: UI_E_WIZARD_STATUS.INACTIVE,
78
78
  fields: {
79
79
  storage: {
@@ -87,7 +87,7 @@ export const stepsFunc = (
87
87
  {
88
88
  id: dynamicSteps.hostAccessibility,
89
89
  title: localization.common.hostsAccessibility,
90
- subTitle: localization.common.hostsAccessibilityDesc,
90
+ subTitle: localization.backup.selectHostsThatRequireAccessBackupStorage,
91
91
  status: UI_E_WIZARD_STATUS.INACTIVE,
92
92
  fields: {
93
93
  hostsAccessibility: {
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <div class="tooltip-info">
3
+ <ui-icon
4
+ :id="`${props.id}-info-trigger`"
5
+ name="info"
6
+ width="16"
7
+ height="16"
8
+ :class="['tooltip-info__icon pointer', { active: isShowInfo }]"
9
+ @click.stop="isShowInfo = !isShowInfo"
10
+ />
11
+ <ui-popup-window
12
+ v-model="isShowInfo"
13
+ top
14
+ left
15
+ width="272px"
16
+ :elem-id="`${props.id}-info-trigger`"
17
+ >
18
+ <div class="common-widget-info">
19
+ <div class="flex justify-between">
20
+ <div class="flex">
21
+ <ui-icon name="info-2" width="16px" height="16px" />
22
+ <span class="title"> {{ localization.common.information }}</span>
23
+ </div>
24
+ <ui-icon
25
+ name="close"
26
+ class="pointer hide-icon"
27
+ width="16px"
28
+ height="16px"
29
+ @click.stop="isShowInfo = false"
30
+ />
31
+ </div>
32
+
33
+ <div class="common-widget-info-description">
34
+ {{ props.description }}
35
+ </div>
36
+ </div>
37
+ </ui-popup-window>
38
+ </div>
39
+ </template>
40
+
41
+ <script lang="ts" setup>
42
+ // TODO move to global
43
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
44
+
45
+ const props = defineProps<{
46
+ id: string
47
+ description: string
48
+ }>()
49
+
50
+ const localization = computed<UI_I_Localization>(() => useLocal())
51
+
52
+ const isShowInfo = ref<boolean>(false)
53
+ </script>
54
+
55
+ <style lang="scss" scoped>
56
+ @import 'assets/scss/common/mixins.scss';
57
+ .tooltip-info {
58
+ @include flex($align: center);
59
+ &__icon {
60
+ color: var(--form-icon-color);
61
+ &:hover {
62
+ color: var(--close-icon);
63
+ }
64
+ &.active {
65
+ color: var(--btn-primary-fill-bg-color);
66
+ }
67
+ }
68
+
69
+ .common-widget-info {
70
+ padding: 16px;
71
+
72
+ .title {
73
+ font-size: 14px;
74
+ font-weight: 500;
75
+ line-height: 16px;
76
+ color: var(--zabbix-text-color);
77
+ margin-left: 8px;
78
+ }
79
+
80
+ .common-widget-info-description {
81
+ font-size: 13px;
82
+ line-height: 15.73px;
83
+ color: var(--zabbix-text-color);
84
+ margin-top: 12px;
85
+ white-space: pre-line;
86
+ }
87
+
88
+ svg {
89
+ color: var(--alert-icon);
90
+ min-width: 16px;
91
+ }
92
+ }
93
+ }
94
+ </style>
@@ -1,41 +1,41 @@
1
- <template>
2
- <common-backup-storage-actions-add-steps-name-and-configure-new
3
- v-if="isNewView"
4
- v-model="formModel"
5
- v-model:alert-info="isShowAlertInfo"
6
- :messages-fields="props.messagesFields"
7
- />
8
-
9
- <common-backup-storage-actions-add-steps-name-and-configure-old
10
- v-else
11
- v-model="formModel"
12
- v-model:alert-info="isShowAlertInfo"
13
- :alert-messages="props.alertMessages"
14
- :messages-fields="props.messagesFields"
15
- @hide-alert="(e) => emits('hide-alert', e)"
16
- />
17
- </template>
18
-
19
- <script lang="ts" setup>
20
- import type { UI_T_Project } from '~/lib/models/types'
21
- import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
22
- import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
23
-
24
- const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
25
- const props = defineProps<{
26
- project: UI_T_Project
27
- alertMessages: string[]
28
- messagesFields: UI_I_WizardStep['fields']
29
- }>()
30
- const emits = defineEmits<{
31
- (event: 'hide-alert', value: number): void
32
- }>()
33
-
34
- const { $store }: any = useNuxtApp()
35
-
36
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
37
-
38
- const isShowAlertInfo = ref<boolean>(props.project === 'procurator')
39
- </script>
40
-
41
- <style lang="scss" scoped></style>
1
+ <template>
2
+ <common-backup-storage-actions-add-steps-name-and-configure-new
3
+ v-if="isNewView"
4
+ v-model="formModel"
5
+ v-model:alert-info="isShowAlertInfo"
6
+ :messages-fields="props.messagesFields"
7
+ />
8
+
9
+ <common-backup-storage-actions-add-steps-name-and-configure-old
10
+ v-else
11
+ v-model="formModel"
12
+ v-model:alert-info="isShowAlertInfo"
13
+ :alert-messages="props.alertMessages"
14
+ :messages-fields="props.messagesFields"
15
+ @hide-alert="(e) => emits('hide-alert', e)"
16
+ />
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import type { UI_T_Project } from '~/lib/models/types'
21
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
22
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
23
+
24
+ const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
25
+ const props = defineProps<{
26
+ project: UI_T_Project
27
+ alertMessages: string[]
28
+ messagesFields: UI_I_WizardStep['fields']
29
+ }>()
30
+ const emits = defineEmits<{
31
+ (event: 'hide-alert', value: number): void
32
+ }>()
33
+
34
+ const { $store }: any = useNuxtApp()
35
+
36
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
37
+
38
+ const isShowAlertInfo = ref<boolean>(true)
39
+ </script>
40
+
41
+ <style lang="scss" scoped></style>
@@ -1,286 +1,294 @@
1
- <template>
2
- <div class="basics-step">
3
- <div class="basics-step-row">
4
- <div class="basics-step-row-title">
5
- <span class="basics-step-row-title-text">
6
- {{ localization.common.name }}
7
- </span>
8
- </div>
9
- <div class="basics-step-row-content">
10
- <ui-input
11
- id="configuration-name-input"
12
- v-model="formModelLocal.name"
13
- test-id="configuration-name-input"
14
- is-focused
15
- :placeholder="localization.common.name"
16
- :error="nameErrorText"
17
- @blur="initValidation(true, ['name'])"
18
- @input="initValidation(false, ['name'])"
19
- />
20
- </div>
21
- </div>
22
-
23
- <div class="basics-step-line"></div>
24
-
25
- <div class="basics-step-row">
26
- <div class="basics-step-row-title">
27
- <span class="basics-step-row-title-text">
28
- {{ localization.common.folder }}
29
- </span>
30
- <common-backup-storage-actions-add-steps-common-tooltip-info
31
- :id="'option.testId'"
32
- :description="'Specify the folder path - for example, /vols/vol0/datastore-001'"
33
- />
34
- </div>
35
- <div class="basics-step-row-content">
36
- <ui-input
37
- id="configuration-folder-input"
38
- v-model="formModelLocal.folder"
39
- test-id="configuration-folder-input"
40
- placeholder="E.g: /vols/vol0/datastore-001"
41
- :error="folderErrorText"
42
- @blur="initValidation(true, ['folder'])"
43
- @input="initValidation(false, ['folder'])"
44
- />
45
- </div>
46
- </div>
47
-
48
- <div class="basics-step-line"></div>
49
-
50
- <div class="basics-step-row">
51
- <div class="basics-step-row-title">
52
- <span class="basics-step-row-title-text">
53
- {{ localization.common.server }}
54
- </span>
55
- <common-backup-storage-actions-add-steps-common-tooltip-info
56
- :id="'option.testIdserver'"
57
- :description="'Specify the server address - for example, nas, nas.it.com or 192.168.0.1.'"
58
- />
59
- </div>
60
- <div class="basics-step-row-content">
61
- <ui-input
62
- id="configuration-server-input"
63
- v-model="formModelLocal.server"
64
- test-id="configuration-server-input"
65
- placeholder="E.g: nas, nas.it.com or 192.168.0.1"
66
- :error="serverErrorText"
67
- @blur="initValidation(true, ['server'])"
68
- @input="initValidation(false, ['server'])"
69
- />
70
- </div>
71
- </div>
72
-
73
- <div class="basics-step-line"></div>
74
-
75
- <div class="basics-step-row">
76
- <div class="basics-step-row-title">
77
- <span class="basics-step-row-title-text">
78
- {{ localization.auth.username }}
79
- </span>
80
- </div>
81
- <div class="basics-step-row-content">
82
- <ui-input
83
- id="configuration-username-input"
84
- v-model="formModelLocal.user"
85
- test-id="configuration-username-input"
86
- :placeholder="localization.auth.username"
87
- :error="usernameErrorText"
88
- @blur="initValidation(true, ['user'])"
89
- @input="initValidation(false, ['user'])"
90
- />
91
- </div>
92
- </div>
93
-
94
- <div class="basics-step-line"></div>
95
-
96
- <div class="basics-step-row">
97
- <div class="basics-step-row-title">
98
- <span class="basics-step-row-title-text">
99
- {{ localization.auth.password }}
100
- </span>
101
- </div>
102
- <div class="basics-step-row-content">
103
- <ui-input
104
- id="configuration-password-input"
105
- v-model="formModelLocal.password"
106
- type="password"
107
- test-id="configuration-password-input"
108
- :placeholder="localization.auth.password"
109
- :error="passwordErrorText"
110
- @blur="initValidation(true, ['password'])"
111
- @input="initValidation(false, ['password'])"
112
- />
113
- </div>
114
- </div>
115
- </div>
116
- </template>
117
-
118
- <script setup lang="ts">
119
- import type { UI_I_Localization } from '~/lib/models/interfaces'
120
- import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
121
- import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
122
- import type {
123
- UI_I_InitialValidationFields
124
- } from "~/components/common/backup/storage/actions/add/steps/nameAndConfigure/lib/models/interfaces";
125
- import type {
126
- UI_T_InitialValidationFields
127
- } from "~/components/common/backup/storage/actions/add/steps/nameAndConfigure/lib/models/types";
128
-
129
- const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
130
- // const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
131
-
132
- const props = defineProps<{
133
- messagesFields: UI_I_WizardStep['fields']
134
- }>()
135
- const emits = defineEmits<{
136
- (event: 'remove-errors'): void
137
- }>()
138
-
139
- const localization = computed<UI_I_Localization>(() => useLocal())
140
-
141
- const initValidationFields = ref<UI_I_InitialValidationFields>({
142
- name: false,
143
- folder: false,
144
- server: false,
145
- user: false,
146
- password: false,
147
- })
148
- const initValidation = (onlyBlur = false, types: UI_T_InitialValidationFields[]): void => {
149
- onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
150
- }
151
-
152
- /* Validation error text for Name input field */
153
- const nameErrorText = computed<string>(() => {
154
- if (props.messagesFields?.name?.field && !formModelLocal.value.name) {
155
- return props.messagesFields.name.field
156
- }
157
-
158
- if (!initValidationFields.value.name) return ''
159
- return !formModelLocal.value.name
160
- ? localization.value.common.fieldRequired
161
- : ''
162
- })
163
-
164
- /* Validation error text for Folder input field */
165
- const folderErrorText = computed<string>(() => {
166
- if (props.messagesFields.folder?.field && !formModelLocal.value.folder) {
167
- return props.messagesFields.folder.field
168
- }
169
-
170
- if (!initValidationFields.value.folder) return ''
171
- return !formModelLocal.value.folder
172
- ? localization.value.common.fieldRequired
173
- : ''
174
- })
175
-
176
- /* Validation error text for Server input field */
177
- const serverErrorText = computed<string>(() => {
178
- if (props.messagesFields.server?.field && !formModelLocal.value.server) {
179
- return props.messagesFields.server.field
180
- }
181
-
182
- if (!initValidationFields.value.server) return ''
183
- return !formModelLocal.value.server
184
- ? localization.value.common.fieldRequired
185
- : ''
186
- })
187
-
188
- /* Validation error text for Username input field */
189
- const usernameErrorText = computed<string>(() => {
190
- if (props.messagesFields.user?.field && !formModelLocal.value.user) {
191
- return props.messagesFields.user.field
192
- }
193
-
194
- if (!initValidationFields.value.user) return ''
195
- return !formModelLocal.value.user
196
- ? localization.value.common.fieldRequired
197
- : ''
198
- })
199
-
200
- /* Validation error text for Password input field */
201
- const passwordErrorText = computed<string>(() => {
202
- if (props.messagesFields.password?.field && !formModelLocal.value.password) {
203
- return props.messagesFields.password.field
204
- }
205
-
206
- if (!initValidationFields.value.password) return ''
207
- return !formModelLocal.value.password
208
- ? localization.value.common.fieldRequired
209
- : ''
210
- })
211
- </script>
212
-
213
- <style scoped lang="scss">
214
- .basics-step {
215
- padding: 16px 0 16px;
216
-
217
- &-row {
218
- min-height: 36px;
219
- width: 100%;
220
- display: flex;
221
- column-gap: 16px;
222
- align-items: center;
223
-
224
- &-title {
225
- padding-top: 8px;
226
- max-width: 240px;
227
- width: 100%;
228
- display: flex;
229
- align-items: center;
230
- column-gap: 8px;
231
- font-weight: 400;
232
- font-size: 13px;
233
- line-height: 20px;
234
- letter-spacing: 0;
235
- vertical-align: middle;
236
- align-self: flex-start;
237
- color: var(--wizard-content-title);
238
- white-space: nowrap;
239
- text-overflow: ellipsis;
240
- overflow: hidden;
241
-
242
- &-text {
243
- display: block;
244
- white-space: nowrap;
245
- text-overflow: ellipsis;
246
- overflow: hidden;
247
- }
248
- }
249
-
250
- &-content {
251
- max-width: 480px;
252
- width: 100%;
253
- font-weight: 400;
254
- font-size: 13px;
255
- line-height: 20px;
256
- letter-spacing: 0;
257
- vertical-align: middle;
258
- color: var(--wizard-content-value);
259
-
260
- &-text {
261
- display: flex;
262
- column-gap: 8px;
263
- align-items: center;
264
-
265
- &-icon {
266
- width: 20px;
267
- min-width: 20px;
268
- height: 20px;
269
- min-height: 20px;
270
- }
271
- }
272
-
273
- &-switch-container {
274
- width: fit-content;
275
- }
276
- }
277
- }
278
-
279
- &-line {
280
- height: 0;
281
- width: 100%;
282
- border-bottom: 1px solid var(--wizard-content-line);
283
- margin: 16px 0;
284
- }
285
- }
286
- </style>
1
+ <template>
2
+ <div class="basics-step">
3
+ <ui-alert
4
+ v-show="isShowAlertInfo"
5
+ test-id="configure-information-alert"
6
+ :messages="[localization.common.nameAndConfigurationAlertInfo]"
7
+ type="info"
8
+ class="mb-4"
9
+ @remove="isShowAlertInfo = false"
10
+ />
11
+
12
+ <div class="basics-step-row">
13
+ <div class="basics-step-row-title">
14
+ <span class="basics-step-row-title-text">
15
+ {{ localization.common.name }}
16
+ </span>
17
+ </div>
18
+ <div class="basics-step-row-content">
19
+ <ui-input
20
+ id="configuration-name-input"
21
+ v-model="formModelLocal.name"
22
+ test-id="configuration-name-input"
23
+ is-focused
24
+ :placeholder="localization.common.name"
25
+ :error="nameErrorText"
26
+ @blur="initValidation(true, ['name'])"
27
+ @input="initValidation(false, ['name'])"
28
+ />
29
+ </div>
30
+ </div>
31
+
32
+ <div class="basics-step-line"></div>
33
+
34
+ <div class="basics-step-row">
35
+ <div class="basics-step-row-title">
36
+ <span class="basics-step-row-title-text">
37
+ {{ localization.common.folder }}
38
+ </span>
39
+ <common-backup-storage-actions-add-steps-common-tooltip-info
40
+ :id="'option.testId'"
41
+ :description="'Specify the folder path - for example, /vols/vol0/datastore-001'"
42
+ />
43
+ </div>
44
+ <div class="basics-step-row-content">
45
+ <ui-input
46
+ id="configuration-folder-input"
47
+ v-model="formModelLocal.folder"
48
+ test-id="configuration-folder-input"
49
+ placeholder="E.g: /vols/vol0/datastore-001"
50
+ :error="folderErrorText"
51
+ @blur="initValidation(true, ['folder'])"
52
+ @input="initValidation(false, ['folder'])"
53
+ />
54
+ </div>
55
+ </div>
56
+
57
+ <div class="basics-step-line"></div>
58
+
59
+ <div class="basics-step-row">
60
+ <div class="basics-step-row-title">
61
+ <span class="basics-step-row-title-text">
62
+ {{ localization.common.server }}
63
+ </span>
64
+ <common-backup-storage-actions-add-steps-common-tooltip-info
65
+ :id="'option.testIdserver'"
66
+ :description="'Specify the server address - for example, nas, nas.it.com or 192.168.0.1.'"
67
+ />
68
+ </div>
69
+ <div class="basics-step-row-content">
70
+ <ui-input
71
+ id="configuration-server-input"
72
+ v-model="formModelLocal.server"
73
+ test-id="configuration-server-input"
74
+ placeholder="E.g: nas, nas.it.com or 192.168.0.1"
75
+ :error="serverErrorText"
76
+ @blur="initValidation(true, ['server'])"
77
+ @input="initValidation(false, ['server'])"
78
+ />
79
+ </div>
80
+ </div>
81
+
82
+ <div class="basics-step-line"></div>
83
+
84
+ <div class="basics-step-row">
85
+ <div class="basics-step-row-title">
86
+ <span class="basics-step-row-title-text">
87
+ {{ localization.auth.username }}
88
+ </span>
89
+ </div>
90
+ <div class="basics-step-row-content">
91
+ <ui-input
92
+ id="configuration-username-input"
93
+ v-model="formModelLocal.user"
94
+ test-id="configuration-username-input"
95
+ :placeholder="localization.auth.username"
96
+ :error="usernameErrorText"
97
+ @blur="initValidation(true, ['user'])"
98
+ @input="initValidation(false, ['user'])"
99
+ />
100
+ </div>
101
+ </div>
102
+
103
+ <div class="basics-step-line"></div>
104
+
105
+ <div class="basics-step-row">
106
+ <div class="basics-step-row-title">
107
+ <span class="basics-step-row-title-text">
108
+ {{ localization.auth.password }}
109
+ </span>
110
+ </div>
111
+ <div class="basics-step-row-content">
112
+ <ui-input
113
+ id="configuration-password-input"
114
+ v-model="formModelLocal.password"
115
+ type="password"
116
+ test-id="configuration-password-input"
117
+ :placeholder="localization.auth.password"
118
+ :error="passwordErrorText"
119
+ @blur="initValidation(true, ['password'])"
120
+ @input="initValidation(false, ['password'])"
121
+ />
122
+ </div>
123
+ </div>
124
+ </div>
125
+ </template>
126
+
127
+ <script setup lang="ts">
128
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
129
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
130
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/backup/storage/actions/add/lib/models/interfaces'
131
+ import type { UI_I_InitialValidationFields } from '~/components/common/backup/storage/actions/add/steps/nameAndConfigure/lib/models/interfaces'
132
+ import type { UI_T_InitialValidationFields } from '~/components/common/backup/storage/actions/add/steps/nameAndConfigure/lib/models/types'
133
+
134
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
135
+ const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
136
+
137
+ const props = defineProps<{
138
+ messagesFields: UI_I_WizardStep['fields']
139
+ }>()
140
+ const emits = defineEmits<{
141
+ (event: 'remove-errors'): void
142
+ }>()
143
+
144
+ const localization = computed<UI_I_Localization>(() => useLocal())
145
+
146
+ const initValidationFields = ref<UI_I_InitialValidationFields>({
147
+ name: false,
148
+ folder: false,
149
+ server: false,
150
+ user: false,
151
+ password: false,
152
+ })
153
+ const initValidation = (
154
+ onlyBlur = false,
155
+ types: UI_T_InitialValidationFields[]
156
+ ): void => {
157
+ onlyBlur && types.forEach((type) => (initValidationFields.value[type] = true))
158
+ }
159
+
160
+ /* Validation error text for Name input field */
161
+ const nameErrorText = computed<string>(() => {
162
+ if (props.messagesFields?.name?.field && !formModelLocal.value.name) {
163
+ return props.messagesFields.name.field
164
+ }
165
+
166
+ if (!initValidationFields.value.name) return ''
167
+ return !formModelLocal.value.name
168
+ ? localization.value.common.fieldRequired
169
+ : ''
170
+ })
171
+
172
+ /* Validation error text for Folder input field */
173
+ const folderErrorText = computed<string>(() => {
174
+ if (props.messagesFields.folder?.field && !formModelLocal.value.folder) {
175
+ return props.messagesFields.folder.field
176
+ }
177
+
178
+ if (!initValidationFields.value.folder) return ''
179
+ return !formModelLocal.value.folder
180
+ ? localization.value.common.fieldRequired
181
+ : ''
182
+ })
183
+
184
+ /* Validation error text for Server input field */
185
+ const serverErrorText = computed<string>(() => {
186
+ if (props.messagesFields.server?.field && !formModelLocal.value.server) {
187
+ return props.messagesFields.server.field
188
+ }
189
+
190
+ if (!initValidationFields.value.server) return ''
191
+ return !formModelLocal.value.server
192
+ ? localization.value.common.fieldRequired
193
+ : ''
194
+ })
195
+
196
+ /* Validation error text for Username input field */
197
+ const usernameErrorText = computed<string>(() => {
198
+ if (props.messagesFields.user?.field && !formModelLocal.value.user) {
199
+ return props.messagesFields.user.field
200
+ }
201
+
202
+ if (!initValidationFields.value.user) return ''
203
+ return !formModelLocal.value.user
204
+ ? localization.value.common.fieldRequired
205
+ : ''
206
+ })
207
+
208
+ /* Validation error text for Password input field */
209
+ const passwordErrorText = computed<string>(() => {
210
+ if (props.messagesFields.password?.field && !formModelLocal.value.password) {
211
+ return props.messagesFields.password.field
212
+ }
213
+
214
+ if (!initValidationFields.value.password) return ''
215
+ return !formModelLocal.value.password
216
+ ? localization.value.common.fieldRequired
217
+ : ''
218
+ })
219
+ </script>
220
+
221
+ <style scoped lang="scss">
222
+ .basics-step {
223
+ padding: 16px 0 16px;
224
+
225
+ &-row {
226
+ min-height: 36px;
227
+ width: 100%;
228
+ display: flex;
229
+ column-gap: 16px;
230
+ align-items: center;
231
+
232
+ &-title {
233
+ padding-top: 8px;
234
+ max-width: 240px;
235
+ width: 100%;
236
+ display: flex;
237
+ align-items: center;
238
+ column-gap: 8px;
239
+ font-weight: 400;
240
+ font-size: 13px;
241
+ line-height: 20px;
242
+ letter-spacing: 0;
243
+ vertical-align: middle;
244
+ align-self: flex-start;
245
+ color: var(--wizard-content-title);
246
+ white-space: nowrap;
247
+ text-overflow: ellipsis;
248
+ overflow: hidden;
249
+
250
+ &-text {
251
+ display: block;
252
+ white-space: nowrap;
253
+ text-overflow: ellipsis;
254
+ overflow: hidden;
255
+ }
256
+ }
257
+
258
+ &-content {
259
+ max-width: 480px;
260
+ width: 100%;
261
+ font-weight: 400;
262
+ font-size: 13px;
263
+ line-height: 20px;
264
+ letter-spacing: 0;
265
+ vertical-align: middle;
266
+ color: var(--wizard-content-value);
267
+
268
+ &-text {
269
+ display: flex;
270
+ column-gap: 8px;
271
+ align-items: center;
272
+
273
+ &-icon {
274
+ width: 20px;
275
+ min-width: 20px;
276
+ height: 20px;
277
+ min-height: 20px;
278
+ }
279
+ }
280
+
281
+ &-switch-container {
282
+ width: fit-content;
283
+ }
284
+ }
285
+ }
286
+
287
+ &-line {
288
+ height: 0;
289
+ width: 100%;
290
+ border-bottom: 1px solid var(--wizard-content-line);
291
+ margin: 16px 0;
292
+ }
293
+ }
294
+ </style>
@@ -48,6 +48,7 @@ export interface UI_I_Localization {
48
48
  adapter: UI_I_ArbitraryObject<string>
49
49
  bottomPanel: UI_I_ArbitraryObject<string>
50
50
  role: UI_I_ArbitraryObject<string>
51
+ backup: UI_I_ArbitraryObject<string>
51
52
  }
52
53
  export interface UI_I_SendTaskParams {
53
54
  method: string
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.226",
4
+ "version": "1.5.227",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",