bfg-common 1.5.76 → 1.5.78

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 (32) hide show
  1. package/components/common/wizards/datastore/add/Add.vue +11 -20
  2. package/components/common/wizards/datastore/add/New.vue +24 -45
  3. package/components/common/wizards/datastore/add/Old.vue +29 -16
  4. package/components/common/wizards/datastore/add/lib/config/steps.ts +18 -15
  5. package/components/common/wizards/datastore/add/lib/validations.ts +29 -13
  6. package/components/common/wizards/datastore/add/nfs/Nfs.vue +0 -5
  7. package/components/common/wizards/datastore/add/{nfs/version/Version.vue → steps/_nfsVersion/NfsVersion.vue} +1 -0
  8. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibility.vue +60 -0
  9. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityNew.vue +27 -0
  10. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityOld.vue +60 -0
  11. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/config/tabsPannel.ts +31 -0
  12. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/interfaces.ts +9 -0
  13. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/types.ts +5 -0
  14. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/TablesView.vue +85 -0
  15. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  16. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  17. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/tableKeys.ts +15 -0
  18. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/models/interfaces.ts +11 -0
  19. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +95 -0
  20. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +123 -0
  21. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +234 -0
  22. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/DeletePopover.vue +100 -0
  23. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/ServersList.vue +123 -0
  24. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/config/serversListConfig.ts +40 -0
  25. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/config/tableKeys.ts +3 -0
  26. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/models/interfaces.ts +3 -0
  27. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/models/types.ts +1 -0
  28. package/components/common/wizards/datastore/add/steps/nameAndConfigure/lib/models/interfaces.ts +5 -0
  29. package/package.json +1 -1
  30. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +0 -92
  31. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +0 -142
  32. /package/components/common/wizards/datastore/add/{nfs/version → steps/_nfsVersion}/lib/config/versionOptions.ts +0 -0
@@ -42,9 +42,10 @@ import {
42
42
  stepsFunc,
43
43
  stepsSchemeInitial,
44
44
  getStepScheme,
45
+ dynamicSteps,
45
46
  } from '~/components/common/wizards/datastore/add/lib/config/steps'
46
47
  import { datastoreDefaultFormFunc } from '~/components/common/wizards/datastore/add/lib/config/createDatastore'
47
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
48
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
48
49
  import * as validation from '~/components/common/wizards/datastore/add/lib/validations'
49
50
 
50
51
  const props = defineProps<{
@@ -72,7 +73,7 @@ const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
72
73
 
73
74
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
74
75
 
75
- const title = computed<string>(() => localization.value.common.addHost)
76
+ const title = computed<string>(() => localization.value.common.newDatastore)
76
77
 
77
78
  const form = ref<UI_I_CreateDatastoreForm>(
78
79
  useDeepCopy(datastoreDefaultFormFunc(props.hostId))
@@ -84,22 +85,6 @@ const validationFunc = async (
84
85
  ): Promise<UI_I_ValidationReturn> => {
85
86
  let stepHasError = false
86
87
 
87
- if (wizard.isValidateForStep(1, currentStep.id, nextStep.id)) {
88
- const nameValidation = await validation.checkDatastoreNameAsync(
89
- localization.value,
90
- value,
91
- form.value,
92
- 1,
93
- 'datastoreName',
94
- wizard,
95
- props.project
96
- )
97
-
98
- value = nameValidation.newValue
99
-
100
- stepHasError = nameValidation.stepHasError
101
- }
102
-
103
88
  if (wizard.isValidateForStep(2, currentStep.id, nextStep.id)) {
104
89
  const nameValidation = await validation.checkDatastoreNameAsync(
105
90
  localization.value,
@@ -127,12 +112,18 @@ const validationFunc = async (
127
112
  stepHasError = nameValidation.stepHasError || lunDiskValidation.stepHasError
128
113
  }
129
114
 
130
- if (wizard.isValidateForStep(4, currentStep.id, nextStep.id)) {
115
+ if (
116
+ wizard.isValidateForStep(
117
+ dynamicSteps.nameAndConfigure,
118
+ currentStep.id,
119
+ nextStep.id
120
+ )
121
+ ) {
131
122
  const nameValidation = await validation.checkDatastoreNameAsync(
132
123
  localization.value,
133
124
  value,
134
125
  form.value,
135
- 4,
126
+ dynamicSteps.nameAndConfigure,
136
127
  'name',
137
128
  wizard,
138
129
  props.project
@@ -9,7 +9,7 @@
9
9
  test-id="add-datastore-wizard"
10
10
  @change-steps="onChangeSteps"
11
11
  @hide="onHideModal"
12
- @submit="onFinish"
12
+ @submit="onCreateDatastore"
13
13
  >
14
14
  <template #content="{ selectedStep, isLoading }">
15
15
  <ui-wizard-block
@@ -56,7 +56,6 @@
56
56
  v-if="selectedStep.id === dynamicSteps.nameAndDevice"
57
57
  v-model="formModelLocal"
58
58
  :project="props.project"
59
- :alert-messages="alertMessages[selectedStep.id]"
60
59
  :messages-fields="selectedStep.fields"
61
60
  :hosts="props.nfsHosts"
62
61
  :host-id="props.hostId"
@@ -66,20 +65,18 @@
66
65
  </ui-wizard-block>
67
66
 
68
67
  <ui-wizard-block
69
- v-if="selectedStep.id === dynamicSteps.hostSummary"
68
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
70
69
  :sub-title-height="height2"
71
70
  >
72
71
  <template #subTitle>
73
72
  <div ref="subTitleBlock2">
74
73
  <div class="subtitle-block">
75
74
  <ui-alert
76
- v-if="hostAssociated"
75
+ v-if="props.alertMessages[dynamicSteps.nameAndConfigure].length"
77
76
  test-id="add-host-connection-settings-error-alert"
78
77
  type="error"
79
78
  size="md"
80
- :messages="[
81
- localization.common.errorProcuratorHostAlreadyConnectedSphere,
82
- ]"
79
+ :messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
83
80
  class="subtitle-block__alert"
84
81
  />
85
82
 
@@ -88,36 +85,31 @@
88
85
  </div>
89
86
  </template>
90
87
  <template #content>
91
- <common-wizards-datastore-add-shared-storm
92
- v-show="datastoreType === 'shared-storm'"
93
- v-model="form"
88
+ <common-wizards-datastore-add-steps-name-and-configure
89
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
90
+ v-model="formModelLocal"
94
91
  :project="props.project"
95
- :step-id="selectedStep.id"
96
- :datastore-type="datastoreType"
97
- :alert-messages="alertMessages[selectedStep.id]"
98
92
  :messages-fields="selectedStep.fields"
99
- :hosts="props.nfsHosts"
100
- :is-main-filter="props.isMainFilter"
101
- :host-id="props.hostId"
102
- @hide-alert="onHideAlert"
103
- @main-filter="emits('main-filter', $event)"
93
+ @hide-alert="(e) => emits('hide-alert', e)"
104
94
  />
105
95
  </template>
106
96
  </ui-wizard-block>
107
97
 
108
98
  <ui-wizard-block
109
- v-if="selectedStep.id === dynamicSteps.assignLicense"
99
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
110
100
  :sub-title-height="height3"
111
101
  >
112
102
  <template #subTitle>
113
103
  <div ref="subTitleBlock3">
114
104
  <div class="subtitle-block">
115
105
  <ui-alert
116
- v-if="props.alertMessages[dynamicSteps.assignLicense].length"
106
+ v-if="
107
+ props.alertMessages[dynamicSteps.hostAccessibility].length
108
+ "
117
109
  test-id="add-host-assign-license-error-alert"
118
110
  type="error"
119
111
  size="md"
120
- :messages="props.alertMessages[dynamicSteps.assignLicense]"
112
+ :messages="props.alertMessages[dynamicSteps.hostAccessibility]"
121
113
  class="subtitle-block__alert"
122
114
  />
123
115
 
@@ -126,38 +118,30 @@
126
118
  </div>
127
119
  </template>
128
120
  <template #content>
129
- <common-wizards-datastore-add-nfs
130
- v-show="datastoreType === 'nfs'"
131
- v-model="form"
132
- :project="props.project"
133
- :step-id="selectedStep.id"
134
- :alert-messages="alertMessages[selectedStep.id]"
135
- :messages-fields="selectedStep.fields"
121
+ <common-wizards-datastore-add-steps-host-accessibility
122
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
123
+ v-model="formModelLocal.hosts"
124
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndDevice]"
136
125
  :hosts="props.nfsHosts"
126
+ @hide-alert="(e) => emits('hide-alert', e)"
137
127
  />
138
128
  </template>
139
129
  </ui-wizard-block>
140
130
 
141
131
  <ui-wizard-block
142
- v-if="selectedStep.id === dynamicSteps.lockdownMode"
132
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
143
133
  :sub-title-height="height4"
144
134
  >
145
135
  <template #subTitle>
146
136
  <div ref="subTitleBlock4">
147
137
  <div class="subtitle-block">
148
138
  <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
149
- <ui-wizard-subtitle
150
- :sub-title="localization.common.whenEnabledLockdown"
151
- />
152
- <ui-wizard-subtitle
153
- :sub-title="localization.common.leaveLockdownDefault"
154
- />
155
139
  </div>
156
140
  </div>
157
141
  </template>
158
142
  <template #content>
159
- <common-wizards-datastore-add-ready-complete
160
- v-show="selectedStep.id === 11"
143
+ <common-wizards-datastore-add-steps-ready-complete
144
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
161
145
  :data-ready-view="dataReadyView"
162
146
  />
163
147
  </template>
@@ -179,7 +163,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
179
163
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
180
164
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
181
165
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
182
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
166
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
183
167
  import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
184
168
 
185
169
  const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
@@ -230,7 +214,6 @@ const { height: height3 } = useElementSize(subTitleBlock3)
230
214
  const subTitleBlock4 = ref<HTMLElement | null>(null)
231
215
  const { height: height4 } = useElementSize(subTitleBlock4)
232
216
 
233
-
234
217
  const datastoreType = ref<UI_T_DatastoreTypeCode>(2)
235
218
  const form = ref<UI_I_CreateDatastoreForm>({
236
219
  name: 'Datastore',
@@ -257,12 +240,8 @@ const dataReadyView = computed<UI_I_DetailsItem>(() =>
257
240
  const onHideAlert = (stepId: number): void => {
258
241
  emits('hide-alert', stepId)
259
242
  }
260
- const onHideModal = (): void => {
261
- emits('hide')
262
- }
263
- const onFinish = (): void => {
264
- emits('submit')
265
- }
243
+ const onHideModal = (): void => emits('hide')
244
+ const onCreateDatastore = (): void => emits('submit')
266
245
  </script>
267
246
 
268
247
  <style scoped lang="scss">
@@ -10,7 +10,7 @@
10
10
  test-id="add-datastore-wizard"
11
11
  @change-steps="onChangeSteps"
12
12
  @hide="onHideModal"
13
- @submit="onFinish"
13
+ @submit="onCreateDatastore"
14
14
  >
15
15
  <template #modalBody="{ selectedStep }">
16
16
  <common-wizards-datastore-add-steps-type-mode
@@ -22,7 +22,7 @@
22
22
  v-if="selectedStep.id === dynamicSteps.nameAndDevice"
23
23
  v-model="formModelLocal"
24
24
  :project="props.project"
25
- :alert-messages="alertMessages[selectedStep.id]"
25
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndDevice]"
26
26
  :messages-fields="selectedStep.fields"
27
27
  :hosts="props.nfsHosts"
28
28
  :host-id="props.hostId"
@@ -31,8 +31,30 @@
31
31
  @main-filter="emits('main-filter', $event)"
32
32
  />
33
33
 
34
+ <common-wizards-datastore-add-steps-name-and-configure
35
+ v-if="selectedStep.id === dynamicSteps.nameAndConfigure"
36
+ v-model="formModelLocal"
37
+ :project="props.project"
38
+ :alert-messages="props.alertMessages[dynamicSteps.nameAndConfigure]"
39
+ :messages-fields="selectedStep.fields"
40
+ @hide-alert="(e) => emits('hide-alert', e)"
41
+ />
42
+
43
+ <common-wizards-datastore-add-steps-host-accessibility
44
+ v-if="selectedStep.id === dynamicSteps.hostAccessibility"
45
+ v-model="formModelLocal.hosts"
46
+ :alert-messages="props.alertMessages[dynamicSteps.hostAccessibility]"
47
+ :hosts="props.nfsHosts"
48
+ @hide-alert="(e) => emits('hide-alert', e)"
49
+ />
50
+
51
+ <common-wizards-datastore-add-steps-ready-complete
52
+ v-if="selectedStep.id === dynamicSteps.readyComplete"
53
+ :data-ready-view="dataReadyView"
54
+ />
55
+
34
56
  <common-wizards-datastore-add-shared-storm
35
- v-show="datastoreType === 'shared-storm'"
57
+ v-if="datastoreType === 'shared-storm'"
36
58
  v-model="formModelLocal"
37
59
  :project="props.project"
38
60
  :step-id="selectedStep.id"
@@ -47,7 +69,7 @@
47
69
  />
48
70
 
49
71
  <common-wizards-datastore-add-nfs
50
- v-show="datastoreType === 'nfs'"
72
+ v-if="datastoreType === 'nfs'"
51
73
  v-model="formModelLocal"
52
74
  :project="props.project"
53
75
  :step-id="selectedStep.id"
@@ -55,11 +77,6 @@
55
77
  :messages-fields="selectedStep.fields"
56
78
  :hosts="props.nfsHosts"
57
79
  />
58
-
59
- <common-wizards-datastore-add-ready-complete
60
- v-show="selectedStep.id === 11"
61
- :data-ready-view="dataReadyView"
62
- />
63
80
  </template>
64
81
  </atoms-wizard>
65
82
  </div>
@@ -74,7 +91,7 @@ import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datasto
74
91
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
75
92
  import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
76
93
  import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
77
- import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails'
94
+ import { constructDataReadyViewFunc } from '~/components/common/wizards/datastore/add/steps/readyComplete/lib/config/propertiesDetails'
78
95
  import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
79
96
 
80
97
  const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
@@ -114,12 +131,8 @@ const dataReadyView = computed<UI_I_DetailsItem>(() =>
114
131
  const onHideAlert = (stepId: number): void => {
115
132
  emits('hide-alert', stepId)
116
133
  }
117
- const onHideModal = (): void => {
118
- emits('hide')
119
- }
120
- const onFinish = (): void => {
121
- emits('submit')
122
- }
134
+ const onHideModal = (): void => emits('hide')
135
+ const onCreateDatastore = (): void => emits('submit')
123
136
  </script>
124
137
 
125
138
  <style scoped lang="scss">
@@ -4,14 +4,11 @@ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/inter
4
4
  import { UI_E_WIZARD_STATUS } from '~/components/atoms/wizard/lib/models/enums'
5
5
  import type { UI_I_ChangeStepsSchemes } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
6
6
  import type { UI_T_DatastoreTypeCode } from '~/components/common/wizards/datastore/add/lib/models/types'
7
-
8
7
  export const dynamicSteps = {
9
8
  type: 0,
10
9
  nameAndDevice: 1,
11
- hostSummary: 2,
12
- assignLicense: 3,
13
- lockdownMode: 4,
14
- vmLocation: 5,
10
+ nameAndConfigure: 2,
11
+ hostAccessibility: 3,
15
12
  readyComplete: 6,
16
13
  }
17
14
  export const stepsFunc = (
@@ -81,7 +78,7 @@ export const stepsFunc = (
81
78
  // testId: 'create-datastore-select-nfs-version',
82
79
  // },
83
80
  {
84
- id: 4,
81
+ id: dynamicSteps.nameAndConfigure,
85
82
  title: localization.common.nameAndConfiguration,
86
83
  subTitle: localization.common.nameAndConfigurationDesc,
87
84
  status: UI_E_WIZARD_STATUS.INACTIVE,
@@ -104,7 +101,7 @@ export const stepsFunc = (
104
101
  },
105
102
 
106
103
  {
107
- id: 5,
104
+ id: dynamicSteps.hostAccessibility,
108
105
  title: localization.common.hostsAccessibility,
109
106
  subTitle: localization.common.hostsAccessibilityDesc,
110
107
  status: UI_E_WIZARD_STATUS.INACTIVE,
@@ -131,24 +128,30 @@ export const stepsFunc = (
131
128
  // testId: 'select-kerberos-authentication',
132
129
  // },
133
130
  {
134
- id: 11,
131
+ id: dynamicSteps.readyComplete,
135
132
  title: localization.common.readyComplete,
136
133
  subTitle: localization.common.readyCompleteDesc,
137
134
  status: UI_E_WIZARD_STATUS.INACTIVE,
138
135
  fields: {},
139
136
  isValid: true,
140
137
  testId: 'create-datastore-ready-complete',
141
- // testId: 'create-datastore-storm-ready-complete',
142
- // testId: 'create-datastore-nfs-ready-complete',
143
- // testId: 'create-datastore-local-ready-complete',
144
138
  },
145
139
  ]
146
140
 
147
141
  export const stepsSchemeInitial: number[][] = [
148
- [dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Procurator Scheme for "shared-storm" type
149
- [dynamicSteps.type, 4, 11], // Procurator Scheme for "nfs" type
150
- [dynamicSteps.type, dynamicSteps.nameAndDevice, 11], // Sphere Scheme for "shared-storm" type
151
- [dynamicSteps.type, 4, 5, 11], // Sphere Scheme for "nfs" type
142
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Procurator Scheme for "shared-storm" type
143
+ [
144
+ dynamicSteps.type,
145
+ dynamicSteps.nameAndConfigure,
146
+ dynamicSteps.readyComplete,
147
+ ], // Procurator Scheme for "nfs" type
148
+ [dynamicSteps.type, dynamicSteps.nameAndDevice, dynamicSteps.readyComplete], // Sphere Scheme for "shared-storm" type
149
+ [
150
+ dynamicSteps.type,
151
+ dynamicSteps.nameAndConfigure,
152
+ dynamicSteps.hostAccessibility,
153
+ dynamicSteps.readyComplete,
154
+ ], // Sphere Scheme for "nfs" type (not used from <host Context Menu>)
152
155
  ]
153
156
 
154
157
  export const getStepScheme = (
@@ -8,7 +8,7 @@ import type Wizard from '~/components/atoms/wizard/lib/utils/utils'
8
8
  import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
9
9
  import type { UI_T_Project } from '~/lib/models/types'
10
10
  import { checkValidityName } from '~/components/common/wizards/datastore/add/lib/utils'
11
-
11
+ import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
12
12
  const checkName = async (
13
13
  form: UI_I_CreateDatastoreForm,
14
14
  localization: UI_I_Localization,
@@ -108,12 +108,20 @@ export const checkNfsFolderSync = (
108
108
  let stepHasError = false
109
109
 
110
110
  if (!name) {
111
- stepHasError = wizard.setValidation(4, 'folder', {
112
- fieldMessage: localization.common.specifyFolderName,
113
- alertMessage: '',
114
- })
115
- } else if (wizard.hasMessage(4, 'folder')) {
116
- value = wizard.removeValidation(4, 'folder', value)
111
+ stepHasError = wizard.setValidation(
112
+ dynamicSteps.nameAndConfigure,
113
+ 'folder',
114
+ {
115
+ fieldMessage: localization.common.specifyFolderName,
116
+ alertMessage: '',
117
+ }
118
+ )
119
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'folder')) {
120
+ value = wizard.removeValidation(
121
+ dynamicSteps.nameAndConfigure,
122
+ 'folder',
123
+ value
124
+ )
117
125
  }
118
126
 
119
127
  return {
@@ -131,12 +139,20 @@ export const checkNfsServerSync = (
131
139
  let stepHasError = false
132
140
 
133
141
  if (!name) {
134
- stepHasError = wizard.setValidation(4, 'server', {
135
- fieldMessage: localization.common.specifyServerName,
136
- alertMessage: '',
137
- })
138
- } else if (wizard.hasMessage(4, 'server')) {
139
- value = wizard.removeValidation(4, 'server', value)
142
+ stepHasError = wizard.setValidation(
143
+ dynamicSteps.nameAndConfigure,
144
+ 'server',
145
+ {
146
+ fieldMessage: localization.common.specifyServerName,
147
+ alertMessage: '',
148
+ }
149
+ )
150
+ } else if (wizard.hasMessage(dynamicSteps.nameAndConfigure, 'server')) {
151
+ value = wizard.removeValidation(
152
+ dynamicSteps.nameAndConfigure,
153
+ 'server',
154
+ value
155
+ )
140
156
  }
141
157
 
142
158
  return {
@@ -1,10 +1,5 @@
1
1
  <template>
2
2
  <div class="nfs-container">
3
- <!-- <common-wizards-datastore-add-nfs-version-->
4
- <!-- v-if="props.stepId === 4"-->
5
- <!-- v-model="model.nfsVersion"-->
6
- <!-- />-->
7
-
8
3
  <common-wizards-datastore-add-nfs-configuration
9
4
  v-show="props.stepId === 4"
10
5
  v-model="model"
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <!-- TODO: если использовать этот компонент, нужно отрефакторить весь код — сейчас всё по-старому -->
2
3
  <section class="nfs-version">
3
4
  <common-select-radio-group
4
5
  v-model="selectedNfsVersionLocal"
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div class="host-accessibility">
3
+ <atoms-alert
4
+ v-show="props.alertMessages?.length"
5
+ test-id="accessibility"
6
+ status="alert-danger"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
+ />
10
+
11
+ <atoms-tabs
12
+ v-model="activeTab"
13
+ test-id="accessibility"
14
+ :items="tabs"
15
+ size="small"
16
+ class="w-100"
17
+ />
18
+ <common-wizards-datastore-add-nfs-accessibility-tables-view
19
+ v-model="modelHosts"
20
+ :data-table="dataTable?.items || []"
21
+ :total-items="dataTable?.total_items || 0"
22
+ :total-pages="dataTable?.total_pages || 1"
23
+ :table-type="activeTab"
24
+ />
25
+ </div>
26
+ </template>
27
+
28
+ <script lang="ts" setup>
29
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
30
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
31
+ import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
32
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
33
+ import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
34
+
35
+ const props = defineProps<{
36
+ alertMessages: string[]
37
+ hosts?: UI_I_CreateDatastoreHosts
38
+ }>()
39
+ const modelHosts = defineModel<string[]>()
40
+ const emits = defineEmits<{
41
+ (event: 'hide-alert', value: number): void
42
+ }>()
43
+
44
+ const localization = computed<UI_I_Localization>(() => useLocal())
45
+
46
+ const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
47
+ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
48
+ hostAccessibilityTabsFunc(localization.value, [
49
+ (props.hosts?.items?.length || 0) + '',
50
+ '0',
51
+ ])
52
+ )
53
+
54
+ const dataTable = computed<UI_I_CreateDatastoreHosts>(() => props.hosts)
55
+ const onHideAlert = (): void => {
56
+ emits('hide-alert', 6)
57
+ }
58
+ </script>
59
+
60
+ <style lang="scss" scoped></style>
@@ -0,0 +1,27 @@
1
+ <template>
2
+ <div class="host-accessibility">
3
+ {{ props }}
4
+ {{ modelHosts }}
5
+ </div>
6
+ </template>
7
+
8
+ <script lang="ts" setup>
9
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
10
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
11
+ import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
12
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
13
+ import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
14
+
15
+ const props = defineProps<{
16
+ alertMessages: string[]
17
+ hosts?: UI_I_CreateDatastoreHosts
18
+ }>()
19
+ const modelHosts = defineModel<string[]>()
20
+ // const emits = defineEmits<{
21
+ // (event: 'hide-alert', value: number): void
22
+ // }>()
23
+
24
+ // const localization = computed<UI_I_Localization>(() => useLocal())
25
+ </script>
26
+
27
+ <style lang="scss" scoped></style>
@@ -0,0 +1,60 @@
1
+ <template>
2
+ <div class="host-accessibility">
3
+ <atoms-alert
4
+ v-show="props.alertMessages?.length"
5
+ test-id="accessibility"
6
+ status="alert-danger"
7
+ :items="props.alertMessages"
8
+ @remove="onHideAlert"
9
+ />
10
+
11
+ <atoms-tabs
12
+ v-model="activeTab"
13
+ test-id="accessibility"
14
+ :items="tabs"
15
+ size="small"
16
+ class="w-100"
17
+ />
18
+ <common-wizards-datastore-add-nfs-accessibility-tables-view
19
+ v-model="modelHosts"
20
+ :data-table="dataTable?.items || []"
21
+ :total-items="dataTable?.total_items || 0"
22
+ :total-pages="dataTable?.total_pages || 1"
23
+ :table-type="activeTab"
24
+ />
25
+ </div>
26
+ </template>
27
+
28
+ <script lang="ts" setup>
29
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
30
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
31
+ import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
32
+ import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/models/interfaces'
33
+ import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
34
+
35
+ const props = defineProps<{
36
+ alertMessages: string[]
37
+ hosts?: UI_I_CreateDatastoreHosts
38
+ }>()
39
+ const modelHosts = defineModel<string[]>()
40
+ const emits = defineEmits<{
41
+ (event: 'hide-alert', value: number): void
42
+ }>()
43
+
44
+ const localization = computed<UI_I_Localization>(() => useLocal())
45
+
46
+ const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
47
+ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
48
+ hostAccessibilityTabsFunc(localization.value, [
49
+ (props.hosts?.items?.length || 0) + '',
50
+ '0',
51
+ ])
52
+ )
53
+
54
+ const dataTable = computed<UI_I_CreateDatastoreHosts>(() => props.hosts)
55
+ const onHideAlert = (): void => {
56
+ emits('hide-alert', 6)
57
+ }
58
+ </script>
59
+
60
+ <style lang="scss" scoped></style>
@@ -0,0 +1,31 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
3
+
4
+ export const hostAccessibilityTabsFunc = (
5
+ localization: UI_I_Localization,
6
+ hosts: string[]
7
+ ) => {
8
+ const [compatibleHosts, incompatibleHost] = hosts
9
+
10
+ const tabs: UI_I_CollapseNavItem[] = [
11
+ {
12
+ text: localization.common.compatibleHosts.replace(
13
+ '{0}',
14
+ compatibleHosts || ''
15
+ ),
16
+ value: 'compatible-hosts',
17
+ disabled: false,
18
+ testId: 'host-accessibility-compatible',
19
+ },
20
+ {
21
+ text: localization.common.incompatibleHosts.replace(
22
+ '{0}',
23
+ incompatibleHost || ''
24
+ ),
25
+ value: 'incompatible-hosts',
26
+ disabled: true,
27
+ testId: 'host-accessibility-incompatible',
28
+ },
29
+ ]
30
+ return tabs
31
+ }
@@ -0,0 +1,9 @@
1
+ export interface I_CompatibleHostsTable {
2
+ id: number,
3
+ host: string,
4
+ cluster: string
5
+ }
6
+
7
+ export interface I_IncompatibleHostsTable extends I_CompatibleHostsTable{
8
+ host_incompatibility_reason: string
9
+ }