bfg-common 1.3.332 → 1.3.334

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,170 +1,191 @@
1
- import type { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
2
- import type { UI_I_Localization } from '~/lib/models/interfaces'
3
- import type {
4
- UI_T_WizardDatastoreMode,
5
- UI_T_DatastoreType,
6
- UI_T_NfsType,
7
- } from '~/components/common/wizards/datastore/add/lib/models/types'
8
-
9
- const stepFromSharedStorm = (
10
- localization: UI_I_Localization,
11
- mode: UI_T_WizardDatastoreMode
12
- ): UI_I_VerticalStepItem[] => {
13
- const steps = [
14
- { text: localization.type, disabled: false, complete: false },
15
- {
16
- text: localization.nameAndDeviceSelection,
17
- disabled: true,
18
- complete: false,
19
- },
20
- // {
21
- // text: localization.vmfsVersion,
22
- // disabled: true,
23
- // complete: false,
24
- // }, <!-- TODO в shared-storm пока верси не будет -->
25
- // {
26
- // text: localization.partitionConfiguration,
27
- // disabled: true,
28
- // complete: false,
29
- // },
30
- ]
31
- // TODO refactoring
32
- if (mode === 'procurator') {
33
- steps.push({
34
- text: localization.partitionConfiguration,
35
- disabled: true,
36
- complete: false,
37
- })
38
- }
39
- steps.push({ text: localization.readyComplete, disabled: true, complete: false })
40
- return steps
41
- }
42
-
43
- const stepFromNfs = (
44
- localization: UI_I_Localization
45
- ): UI_I_VerticalStepItem[] => {
46
- return [
47
- { text: localization.type, disabled: false, complete: false },
48
- { text: localization.nfsVersion, disabled: true, complete: false },
49
- {
50
- text: localization.nameAndConfiguration,
51
- disabled: true,
52
- complete: false,
53
- },
54
- // {
55
- // text: localization.kerberosAuthentication,
56
- // disabled: true,
57
- // complete: false,
58
- // permissions: ['nfs-4.1'],
59
- // },// TODO Пока что не будет чут попоже
60
- // { text: localization.hostsAccessibility, disabled: true, complete: false }, // Он будет когда будем делать групповое
61
- { text: localization.readyComplete, disabled: true, complete: false },
62
- ]
63
-
64
- // console.log(position, 'position')
65
-
66
- // nfsItems = nfsItems.filter((item) => {
67
- // // return item.permissions
68
- // // ? type !== null
69
- // // ? item.permissions.includes(type)
70
- // // : true
71
- // // : false
72
- // return item.permissions ? item.permissions.includes(type) : true
73
- // })
74
- // nfsItems.forEach((x, key) => {
75
- // if (key <= position) {
76
- // // console.log(key, 'key')
77
- // x.complete = true
78
- // x.disabled = false
79
- // }
80
- // })
81
-
82
- // console.log(type, 'typeeeeee')
83
- }
84
-
85
- // const stemFromVvol = (localization: UI_I_Localization): UI_I_VerticalStepItem[] => {
86
- // return [
87
- // { text: localization.type, disabled: false, complete: false },
88
- // {
89
- // text: localization.nameAndContainerSelection,
90
- // disabled: true,
91
- // complete: false,
92
- // },
93
- // { text: localization.hostsAccessibility, disabled: true, complete: false },
94
- // { text: localization.readyComplete, disabled: true, complete: false },
95
- // ]
96
- // }
97
- const stemFromLocal = (
98
- localization: UI_I_Localization,
99
- mode: UI_T_WizardDatastoreMode
100
- ): UI_I_VerticalStepItem[] => {
101
- const isModeProcurator = mode === 'procurator'
102
- return [
103
- { text: localization.type, disabled: false, complete: false },
104
- {
105
- text: localization[
106
- isModeProcurator ? 'selectDatastoreName' : 'nameAndDeviceSelection'
107
- ],
108
- disabled: true,
109
- complete: false,
110
- },
111
- { text: localization.readyComplete, disabled: true, complete: false },
112
- ]
113
- }
114
-
115
- export const stepItemsFunc = (
116
- localization: UI_I_Localization,
117
- type: UI_T_DatastoreType,
118
- mode: UI_T_WizardDatastoreMode
119
- ): UI_I_VerticalStepItem[] => {
120
- const handlers = {
121
- 'shared-storm': stepFromSharedStorm,
122
- nfs: stepFromNfs,
123
- local: stemFromLocal,
124
- }
125
-
126
- return handlers[type](localization, mode)
127
- }
128
-
129
- interface SubTitles {
130
- 'shared-storm': string[]
131
- nfs: string[]
132
- local: string[]
133
- }
134
-
135
- export const subTitleFunc = (
136
- localization: UI_I_Localization,
137
- type: UI_T_DatastoreType,
138
- position: number,
139
- version?: UI_T_NfsType
140
- ): string => {
141
- position = position - 1
142
-
143
- if (type === 'nfs' && version === 'nfs-3' && position === 2) {
144
- position = position + 1
145
- }
146
-
147
- const description: string[] = [
148
- localization.selectNfsVersion,
149
- localization.nameAndConfigurationDesc,
150
- // localization.kerberosAuthenticationDesc.replace(
151
- // '{0}',
152
- // version?.toUpperCase() || ''
153
- // ),
154
- // localization.hostsAccessibilityDesc,
155
- ]
156
-
157
- const sharedStormDesc: string[] = [
158
- localization.nameAndDeviceSelectionDesc,
159
- // localization.vmfsVersionDesc,
160
- localization.partitionConfigurationDesc,
161
- ]
162
-
163
- const subTitles: SubTitles = {
164
- nfs: description,
165
- 'shared-storm': sharedStormDesc,
166
- local: [],
167
- }
168
-
169
- return subTitles[type][position]
170
- }
1
+ import type { UI_I_VerticalStepItem } from '~/components/atoms/lib/models/interfaces'
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
+ import type {
4
+ UI_T_WizardDatastoreMode,
5
+ UI_T_DatastoreType,
6
+ UI_T_NfsType,
7
+ } from '~/components/common/wizards/datastore/add/lib/models/types'
8
+
9
+ const stepFromSharedStorm = (
10
+ localization: UI_I_Localization,
11
+ mode: UI_T_WizardDatastoreMode
12
+ ): UI_I_VerticalStepItem[] => {
13
+ const steps = [
14
+ { text: localization.type, disabled: false, complete: false },
15
+ {
16
+ text: localization.nameAndDeviceSelection,
17
+ disabled: true,
18
+ complete: false,
19
+ },
20
+ // {
21
+ // text: localization.vmfsVersion,
22
+ // disabled: true,
23
+ // complete: false,
24
+ // }, <!-- TODO в shared-storm пока верси не будет -->
25
+ // {
26
+ // text: localization.partitionConfiguration,
27
+ // disabled: true,
28
+ // complete: false,
29
+ // },
30
+ ]
31
+ // TODO refactoring
32
+ if (mode === 'procurator') {
33
+ steps.push({
34
+ text: localization.partitionConfiguration,
35
+ disabled: true,
36
+ complete: false,
37
+ })
38
+ }
39
+ steps.push({
40
+ text: localization.readyComplete,
41
+ disabled: true,
42
+ complete: false,
43
+ })
44
+ return steps
45
+ }
46
+
47
+ const stepFromNfs = (
48
+ localization: UI_I_Localization,
49
+ mode: UI_T_WizardDatastoreMode
50
+ ): UI_I_VerticalStepItem[] => {
51
+ const steps = [
52
+ { text: localization.type, disabled: false, complete: false },
53
+ { text: localization.nfsVersion, disabled: true, complete: false },
54
+ {
55
+ text: localization.nameAndConfiguration,
56
+ disabled: true,
57
+ complete: false,
58
+ },
59
+ // {
60
+ // text: localization.kerberosAuthentication,
61
+ // disabled: true,
62
+ // complete: false,
63
+ // permissions: ['nfs-4.1'],
64
+ // },// TODO Пока что не будет чут попоже
65
+ // { text: localization.hostsAccessibility, disabled: true, complete: false }, // Он будет когда будем делать групповое
66
+ // { text: localization.readyComplete, disabled: true, complete: false },
67
+ ]
68
+
69
+ if (mode === 'sphere') {
70
+ steps.push({
71
+ text: localization.hostsAccessibility,
72
+ disabled: true,
73
+ complete: false,
74
+ })
75
+ }
76
+
77
+ steps.push({
78
+ text: localization.readyComplete,
79
+ disabled: true,
80
+ complete: false,
81
+ })
82
+
83
+ return steps
84
+
85
+ // console.log(position, 'position')
86
+
87
+ // nfsItems = nfsItems.filter((item) => {
88
+ // // return item.permissions
89
+ // // ? type !== null
90
+ // // ? item.permissions.includes(type)
91
+ // // : true
92
+ // // : false
93
+ // return item.permissions ? item.permissions.includes(type) : true
94
+ // })
95
+ // nfsItems.forEach((x, key) => {
96
+ // if (key <= position) {
97
+ // // console.log(key, 'key')
98
+ // x.complete = true
99
+ // x.disabled = false
100
+ // }
101
+ // })
102
+
103
+ // console.log(type, 'typeeeeee')
104
+ }
105
+
106
+ // const stemFromVvol = (localization: UI_I_Localization): UI_I_VerticalStepItem[] => {
107
+ // return [
108
+ // { text: localization.type, disabled: false, complete: false },
109
+ // {
110
+ // text: localization.nameAndContainerSelection,
111
+ // disabled: true,
112
+ // complete: false,
113
+ // },
114
+ // { text: localization.hostsAccessibility, disabled: true, complete: false },
115
+ // { text: localization.readyComplete, disabled: true, complete: false },
116
+ // ]
117
+ // }
118
+ const stemFromLocal = (
119
+ localization: UI_I_Localization,
120
+ mode: UI_T_WizardDatastoreMode
121
+ ): UI_I_VerticalStepItem[] => {
122
+ const isModeProcurator = mode === 'procurator'
123
+ return [
124
+ { text: localization.type, disabled: false, complete: false },
125
+ {
126
+ text: localization[
127
+ isModeProcurator ? 'selectDatastoreName' : 'nameAndDeviceSelection'
128
+ ],
129
+ disabled: true,
130
+ complete: false,
131
+ },
132
+ { text: localization.readyComplete, disabled: true, complete: false },
133
+ ]
134
+ }
135
+
136
+ export const stepItemsFunc = (
137
+ localization: UI_I_Localization,
138
+ type: UI_T_DatastoreType,
139
+ mode: UI_T_WizardDatastoreMode
140
+ ): UI_I_VerticalStepItem[] => {
141
+ const handlers = {
142
+ 'shared-storm': stepFromSharedStorm,
143
+ nfs: stepFromNfs,
144
+ local: stemFromLocal,
145
+ }
146
+
147
+ return handlers[type](localization, mode)
148
+ }
149
+
150
+ interface SubTitles {
151
+ 'shared-storm': string[]
152
+ nfs: string[]
153
+ local: string[]
154
+ }
155
+
156
+ export const subTitleFunc = (
157
+ localization: UI_I_Localization,
158
+ type: UI_T_DatastoreType,
159
+ position: number,
160
+ version?: UI_T_NfsType
161
+ ): string => {
162
+ position = position - 1
163
+
164
+ if (type === 'nfs' && version === 'nfs-3' && position === 2) {
165
+ position = position + 1
166
+ }
167
+
168
+ const description: string[] = [
169
+ localization.selectNfsVersion,
170
+ localization.nameAndConfigurationDesc,
171
+ // localization.kerberosAuthenticationDesc.replace(
172
+ // '{0}',
173
+ // version?.toUpperCase() || ''
174
+ // ),
175
+ // localization.hostsAccessibilityDesc,
176
+ ]
177
+
178
+ const sharedStormDesc: string[] = [
179
+ localization.nameAndDeviceSelectionDesc,
180
+ // localization.vmfsVersionDesc,
181
+ localization.partitionConfigurationDesc,
182
+ ]
183
+
184
+ const subTitles: SubTitles = {
185
+ nfs: description,
186
+ 'shared-storm': sharedStormDesc,
187
+ local: [],
188
+ }
189
+
190
+ return subTitles[type][position]
191
+ }
@@ -1,94 +1,97 @@
1
- <template>
2
- <div class="nfs-container">
3
- <span class="nfs-container__desc">{{ stepSubTitle }}</span>
4
-
5
- <common-wizards-datastore-add-nfs-version
6
- v-show="props.stepPosition === 1"
7
- v-model:version="nfsVersion"
8
- />
9
-
10
- <common-wizards-datastore-add-nfs-configuration
11
- v-show="props.stepPosition === 2"
12
- :mode="props.mode"
13
- :nfs-version="nfsVersion"
14
- :nfs-configuration-submit="nfsConfigurationSubmit"
15
- @loading="(e) => emits('loading', e)"
16
- @next="applyChangesAndNext"
17
- />
18
-
19
- <!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
20
- <!-- v-show="nfsVersion === 'nfs-4.1' && props.stepPosition === 3"-->
21
- <!-- :nfs-version="nfsVersion"-->
22
- <!-- />--><!-- TODO Он будет когда будем делать групповое -->
23
-
24
- <!-- <templates-home-datastore-actions-add-nfs-accessibility-->
25
- <!-- v-if="showHostAccessibility"-->
26
- <!-- :host-accessibility-submit="hostAccessibilitySubmit"-->
27
- <!-- @next="applyChangesAndNext"-->
28
- <!-- />-->
29
- <!-- TODO Он будет когда будем делать групповое -->
30
- </div>
31
- </template>
32
-
33
- <script lang="ts" setup>
34
- import { UI_I_Localization } from '~/lib/models/interfaces'
35
- import {
36
- UI_T_DatastoreType,
37
- UI_T_NfsType,
38
- UI_T_WizardDatastoreMode,
39
- } from '~/components/common/wizards/datastore/add/lib/models/types'
40
- import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
41
- import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
42
-
43
- const props = defineProps<{
44
- mode: UI_T_WizardDatastoreMode
45
- stepPosition: number
46
- datastoreType: UI_T_DatastoreType
47
- nfsConfigurationSubmit: number
48
- hostAccessibilitySubmit: number
49
- }>()
50
- const emits = defineEmits<{
51
- (event: 'loading', value: boolean): void
52
- (event: 'submit', value: UI_I_ConfigurationSendDataNfs): void
53
- (event: 'change-nfs-version', value: UI_T_NfsType): void
54
- }>()
55
-
56
- const localization = computed<UI_I_Localization>(() => useLocal())
57
-
58
- const nfsVersion = ref<UI_T_NfsType>('nfs-3')
59
-
60
- const stepSubTitle = computed<string>(() => {
61
- const { datastoreType, stepPosition } = props
62
- return subTitleFunc(
63
- localization.value,
64
- datastoreType,
65
- stepPosition,
66
- nfsVersion.value
67
- )
68
- })
69
-
70
- // const showHostAccessibility = computed<boolean>(() => {
71
- // return (
72
- // (props.stepPosition === 4 && nfsVersion.value === 'nfs-4.1') ||
73
- // (props.stepPosition === 3 && nfsVersion.value === 'nfs-3')
74
- // )
75
- // })
76
-
77
- watch(nfsVersion, (newValue: UI_T_NfsType) => {
78
- emits('change-nfs-version', newValue)
79
- })
80
-
81
- const applyChangesAndNext = (event: UI_I_ConfigurationSendDataNfs): void => {
82
- emits('submit', event)
83
- }
84
- </script>
85
-
86
- <style lang="scss" scoped>
87
- @import '~/assets/scss/common/mixins.scss';
88
- .nfs-container {
89
- @include flex($dir: column);
90
- height: 100%;
91
- &__desc {
92
- }
93
- }
94
- </style>
1
+ <template>
2
+ <div class="nfs-container">
3
+ <span class="nfs-container__desc">{{ stepSubTitle }}</span>
4
+
5
+ <common-wizards-datastore-add-nfs-version
6
+ v-show="props.stepPosition === 1"
7
+ v-model:version="nfsVersion"
8
+ />
9
+
10
+ <common-wizards-datastore-add-nfs-configuration
11
+ v-show="props.stepPosition === 2"
12
+ :mode="props.mode"
13
+ :nfs-version="nfsVersion"
14
+ :nfs-configuration-submit="nfsConfigurationSubmit"
15
+ @loading="(e) => emits('loading', e)"
16
+ @next="applyChangesAndNext"
17
+ />
18
+
19
+ <!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
20
+ <!-- v-show="nfsVersion === 'nfs-4.1' && props.stepPosition === 3"-->
21
+ <!-- :nfs-version="nfsVersion"-->
22
+ <!-- />--><!-- TODO Он будет когда будем делать групповое -->
23
+
24
+ <templates-home-datastore-actions-add-nfs-accessibility
25
+ v-if="showHostAccessibility"
26
+ :host-accessibility-submit="props.hostAccessibilitySubmit"
27
+ @next="applyChangesAndNext"
28
+ />
29
+ <!-- TODO Он будет когда будем делать групповое -->
30
+ </div>
31
+ </template>
32
+
33
+ <script lang="ts" setup>
34
+ import { UI_I_Localization } from '~/lib/models/interfaces'
35
+ import {
36
+ UI_T_DatastoreType,
37
+ UI_T_NfsType,
38
+ UI_T_WizardDatastoreMode,
39
+ } from '~/components/common/wizards/datastore/add/lib/models/types'
40
+ import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
41
+ import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
42
+
43
+ const props = defineProps<{
44
+ mode: UI_T_WizardDatastoreMode
45
+ stepPosition: number
46
+ datastoreType: UI_T_DatastoreType
47
+ nfsConfigurationSubmit: number
48
+ hostAccessibilitySubmit: number
49
+ }>()
50
+ const emits = defineEmits<{
51
+ (event: 'loading', value: boolean): void
52
+ (event: 'submit', value: UI_I_ConfigurationSendDataNfs): void
53
+ (event: 'change-nfs-version', value: UI_T_NfsType): void
54
+ }>()
55
+
56
+ const localization = computed<UI_I_Localization>(() => useLocal())
57
+
58
+ const nfsVersion = ref<UI_T_NfsType>('nfs-3')
59
+
60
+ const stepSubTitle = computed<string>(() => {
61
+ const { datastoreType, stepPosition } = props
62
+ return subTitleFunc(
63
+ localization.value,
64
+ datastoreType,
65
+ stepPosition,
66
+ nfsVersion.value
67
+ )
68
+ })
69
+
70
+ // const showHostAccessibility = computed<boolean>(() => {
71
+ // return (
72
+ // (props.stepPosition === 4 && nfsVersion.value === 'nfs-4.1') ||
73
+ // (props.stepPosition === 3 && nfsVersion.value === 'nfs-3')
74
+ // )
75
+ // })
76
+ const showHostAccessibility = computed<boolean>(() => {
77
+ return props.mode === 'sphere' && props.stepPosition === 3
78
+ })
79
+
80
+ watch(nfsVersion, (newValue: UI_T_NfsType) => {
81
+ emits('change-nfs-version', newValue)
82
+ })
83
+
84
+ const applyChangesAndNext = (event: UI_I_ConfigurationSendDataNfs): void => {
85
+ emits('submit', event)
86
+ }
87
+ </script>
88
+
89
+ <style lang="scss" scoped>
90
+ @import '~/assets/scss/common/mixins.scss';
91
+ .nfs-container {
92
+ @include flex($dir: column);
93
+ height: 100%;
94
+ &__desc {
95
+ }
96
+ }
97
+ </style>
@@ -37,7 +37,7 @@ import { UI_I_Localization } from '~/lib/models/interfaces'
37
37
  import { UI_I_Pagination } from '~/lib/models/table/interfaces'
38
38
  import { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
39
39
  import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
40
- import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
40
+ // import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
41
41
 
42
42
  const props = defineProps<{
43
43
  hostAccessibilitySubmit: number
@@ -52,7 +52,12 @@ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
52
52
  hostAccessibilityTabsFunc(localization.value, ['5', '3'])
53
53
  )
54
54
 
55
- const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
55
+ // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
56
+ // TODO refactoring
57
+ const { $store } = useNuxtApp()
58
+ const dataTable = computed<any>(() => {
59
+ return $store.getters['storage/getNewDatastoreHosts']
60
+ })
56
61
 
57
62
  const pagination = ref<UI_I_Pagination>({
58
63
  page: 1,
@@ -26,6 +26,7 @@ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
26
26
  }
27
27
 
28
28
  export const bodyItems = (data: I_CompatibleHostsTable[]): UI_I_BodyItem[][] => {
29
+ console.log(data, 11111);
29
30
  const bodyItems: UI_I_BodyItem[][] = []
30
31
  data.forEach((item: I_CompatibleHostsTable, key) => {
31
32
  const hostData = {