bfg-common 1.3.339 → 1.3.341

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.
@@ -6,4 +6,5 @@ export interface UI_I_DetailsItem {
6
6
  items: UI_I_DetailsItem[]
7
7
  actions?: UI_I_Button[]
8
8
  permission?: string[]
9
+ data?: any
9
10
  }
@@ -283,11 +283,15 @@ const saveChangesAndNextNfs = (event: any, next = true): void => {
283
283
  nfs.server = event.server
284
284
  nfs.hosts = event.hosts
285
285
 
286
+ // TODO refactoring
287
+ const hostsName = props.nfsHosts.filter(host => event.hosts.includes(host.id)).map(host => host.name)
288
+
286
289
  dataReadyView.value = constructDataReadyViewFunc(
287
290
  localization.value,
288
291
  'nfs',
289
292
  {
290
293
  ...event,
294
+ hosts: hostsName,
291
295
  version: nfsVersion.value,
292
296
  },
293
297
  isWizardModeForSphere.value
@@ -79,13 +79,6 @@ const showHostAccessibility = computed<boolean>(() => {
79
79
  return props.mode === 'sphere' && props.stepPosition === 3
80
80
  })
81
81
 
82
- watch(
83
- () => props.stepPosition,
84
- (newValue: number) => {
85
- console.log(showHostAccessibility.value, newValue, 1111, props.mode)
86
- }
87
- )
88
-
89
82
  watch(nfsVersion, (newValue: UI_T_NfsType) => {
90
83
  emits('change-nfs-version', newValue)
91
84
  })
@@ -50,7 +50,10 @@ const emits = defineEmits<{
50
50
 
51
51
  const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
52
52
  const tabs = computed<UI_I_CollapseNavItem[]>(() =>
53
- hostAccessibilityTabsFunc(localization.value, ['5', '3'])
53
+ hostAccessibilityTabsFunc(localization.value, [
54
+ (props.hosts?.items?.length || 0) + '',
55
+ '0',
56
+ ])
54
57
  )
55
58
 
56
59
  // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
@@ -17,7 +17,7 @@ export const hostAccessibilityTabsFunc = (
17
17
  {
18
18
  text: localization.incompatibleHosts.replace('{0}', incompatibleHost || ''),
19
19
  value: 'incompatible-hosts',
20
- disabled: false,
20
+ disabled: true,
21
21
  },
22
22
  ]
23
23
  return tabs
@@ -15,8 +15,8 @@ const getItems = (
15
15
  localization: UI_I_Localization
16
16
  ): [string, boolean, string, string][] => {
17
17
  return [
18
- [localization.host, true, '96px', compatibleHostsTableKeys[0]],
19
- [localization.cluster, true, '180px', compatibleHostsTableKeys[1]],
18
+ [localization.host, true, '300px', compatibleHostsTableKeys[0]],
19
+ [localization.cluster, true, '300px', compatibleHostsTableKeys[1]],
20
20
  ]
21
21
  }
22
22
 
@@ -31,11 +31,11 @@ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
31
31
  export const bodyItems = (
32
32
  data: I_CompatibleHostsTable[]
33
33
  ): UI_I_BodyItem[][] => {
34
- console.log(data, 11111)
35
34
  const bodyItems: UI_I_BodyItem[][] = []
36
35
  data.forEach((item: I_CompatibleHostsTable, key) => {
37
36
  const hostData = {
38
- iconClassName: `vsphere-icon-${hostIconByState[1]}`,
37
+ // @ts-ignore
38
+ iconClassName: `vsphere-icon-${hostIconByState[item.state]}`,
39
39
  }
40
40
  const clusterData = {
41
41
  iconClassName: `vsphere-icon-${clusterIconByState[1]}`,
@@ -1,78 +1,86 @@
1
- <template>
2
- <div class="ready-complete">
3
- <div class="ready-complete__desc">{{ localization.readyCompleteDesc }}</div>
4
-
5
- <common-details-list :items="properties" class="ready-complete__list list">
6
- <template #default="{ item }">
7
- <common-details-item :has-children="true" open-by-default>
8
- <template #stackBlockKey>
9
- <span class="list__labels">{{
10
- localization.chosenDatastoreName
11
- }}</span>
12
- </template>
13
-
14
- <template #stackChildren>
15
- <template
16
- v-for="(item2, key2) in item.items"
17
- :key="`${item2}_${key2}`"
18
- >
19
- <common-details-item
20
- :has-children="false"
21
- class="list__default-style"
22
- >
23
- <template #stackBlockKey>
24
- <div>
25
- {{ item2.label }}
26
- </div>
27
- </template>
28
- <template #stackBlockContent>
29
- {{ item2.value }}
30
- </template>
31
- </common-details-item>
32
- </template>
33
- </template>
34
- </common-details-item>
35
- </template>
36
- </common-details-list>
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
42
- import { UI_I_Localization } from '~/lib/models/interfaces'
43
-
44
- const props = defineProps<{
45
- dataReadyView: UI_I_DetailsItem[]
46
- }>()
47
- // console.log(props)
48
-
49
- const localization = computed<UI_I_Localization>(() => useLocal())
50
-
51
- const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
52
- </script>
53
-
54
- <style lang="scss" scoped>
55
- @import '~/assets/scss/common/mixins.scss';
56
- .ready-complete {
57
- &__list {
58
- @include flex($dir: column);
59
- padding: 12px 0;
60
- row-gap: 15px;
61
- }
62
- }
63
- .list {
64
- &__labels {
65
- @include text($fs: 13px, $fw: 700);
66
- }
67
- :deep(.list__default-style) {
68
- .stack-block {
69
- &__label {
70
- align-items: flex-start;
71
- }
72
- &-content {
73
- white-space: pre-line;
74
- }
75
- }
76
- }
77
- }
78
- </style>
1
+ <template>
2
+ <div class="ready-complete">
3
+ <div class="ready-complete__desc">{{ localization.readyCompleteDesc }}</div>
4
+
5
+ <common-details-list :items="properties" class="ready-complete__list list">
6
+ <template #default="{ item }">
7
+ <common-details-item :has-children="true" open-by-default>
8
+ <template #stackBlockKey>
9
+ <span class="list__labels">{{
10
+ localization.chosenDatastoreName
11
+ }}</span>
12
+ </template>
13
+
14
+ <template #stackChildren>
15
+ <template
16
+ v-for="(item2, key2) in item.items"
17
+ :key="`${item2}_${key2}`"
18
+ >
19
+ <common-details-item
20
+ :has-children="false"
21
+ class="list__default-style"
22
+ >
23
+ <template #stackBlockKey>
24
+ <div>
25
+ {{ item2.label }}
26
+ </div>
27
+ </template>
28
+ <template #stackBlockContent>
29
+ <div v-if="item2.data">
30
+ <span v-for="item3 in item2.data">
31
+ <span class="vsphere-icon-host"></span>
32
+ <span>{{ item3 }}</span>
33
+ </span>
34
+ </div>
35
+ <span v-else>
36
+ {{ item2.value }}
37
+ </span>
38
+ </template>
39
+ </common-details-item>
40
+ </template>
41
+ </template>
42
+ </common-details-item>
43
+ </template>
44
+ </common-details-list>
45
+ </div>
46
+ </template>
47
+
48
+ <script lang="ts" setup>
49
+ import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
50
+ import { UI_I_Localization } from '~/lib/models/interfaces'
51
+
52
+ const props = defineProps<{
53
+ dataReadyView: UI_I_DetailsItem[]
54
+ }>()
55
+ // console.log(props)
56
+
57
+ const localization = computed<UI_I_Localization>(() => useLocal())
58
+
59
+ const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
60
+ </script>
61
+
62
+ <style lang="scss" scoped>
63
+ @import '~/assets/scss/common/mixins.scss';
64
+ .ready-complete {
65
+ &__list {
66
+ @include flex($dir: column);
67
+ padding: 12px 0;
68
+ row-gap: 15px;
69
+ }
70
+ }
71
+ .list {
72
+ &__labels {
73
+ @include text($fs: 13px, $fw: 700);
74
+ }
75
+ :deep(.list__default-style) {
76
+ .stack-block {
77
+ &__label {
78
+ align-items: flex-start;
79
+ }
80
+ &-content {
81
+ white-space: pre-line;
82
+ }
83
+ }
84
+ }
85
+ }
86
+ </style>
@@ -1,165 +1,184 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
3
- import { UI_I_LunDisk } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
4
- import { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
5
- import { UI_I_ReadyDataForLocal } from '~/components/common/wizards/datastore/add/readyComplete/lib/models/interfaces'
6
-
7
- const constructLunDiskItems = (disks: any): string => {
8
- const { $binary } = useNuxtApp()
9
-
10
- let result = ''
11
- disks.forEach((disk: UI_I_LunDisk) => {
12
- const capacity = $binary.round(disk.capacity)
13
- result += `${disk.name} - ${capacity} \n`
14
- })
15
- return result
16
- }
17
-
18
- const nfsDetailsFunc = (
19
- localization: UI_I_Localization,
20
- data: any
21
- ): UI_I_DetailsItem[] => {
22
- const { name, server, folder, version } = data
23
- // const accessMode = readonly ? 'Read-only' : 'Read-write'
24
-
25
- return [
26
- {
27
- label: localization.vmfsVersion,
28
- value: '',
29
- items: [
30
- {
31
- label: localization.version,
32
- value: version.toUpperCase(),
33
- items: [],
34
- },
35
- ],
36
- actions: [],
37
- },
38
- {
39
- label: localization.nameAndConfiguration,
40
- value: '',
41
- items: [
42
- {
43
- label: localization.datastoreName,
44
- value: name,
45
- items: [],
46
- },
47
- {
48
- label: localization.server,
49
- value: server,
50
- items: [],
51
- },
52
- {
53
- label: localization.folder,
54
- value: folder,
55
- items: [],
56
- },
57
- // {
58
- // label: localization.accessMode,
59
- // value: accessMode,
60
- // items: [],
61
- // },
62
- ],
63
- actions: [],
64
- },
65
- ]
66
- }
67
-
68
- const localDetailsFunc = (
69
- localization: UI_I_Localization,
70
- event: UI_I_ReadyDataForLocal | string,
71
- isSphereWizard: boolean
72
- ): UI_I_DetailsItem[] => {
73
- const data = [
74
- {
75
- label: localization.selectName,
76
- value: '',
77
- items: [
78
- {
79
- label: localization.datastoreName,
80
- value: isSphereWizard ? event.name : event,
81
- items: [],
82
- },
83
- ],
84
- actions: [],
85
- },
86
- ]
87
-
88
- if (isSphereWizard) {
89
- data[0].items.push({
90
- label: localization.host,
91
- value: event.host,
92
- items: [],
93
- })
94
- }
95
- return data
96
- }
97
-
98
- const sharedStormDetailsFunc = (
99
- localization: UI_I_Localization,
100
- data: { name: string; lunDisk: string[] } // пока так ставляем тип но надо будет поменять когда будем добавлять осталние настройки
101
- ): UI_I_DetailsItem[] => {
102
- const { name, lunDisk } = data
103
-
104
- return [
105
- {
106
- label: localization.nameAndDeviceSelection,
107
- value: '',
108
- items: [
109
- {
110
- label: localization.datastoreName,
111
- value: name,
112
- items: [],
113
- },
114
- {
115
- label: localization.diskLun,
116
- value: constructLunDiskItems(lunDisk),
117
- items: [],
118
- },
119
- ],
120
- actions: [],
121
- },
122
- // {
123
- // label: localization.partitionConfiguration,
124
- // value: '',
125
- // items: [
126
- // {
127
- // label: localization.method,
128
- // value: 'None',
129
- // items: [],
130
- // },
131
- // {
132
- // label: localization.partitionFormat,
133
- // value: 'None',
134
- // items: [],
135
- // },
136
- // {
137
- // label: localization.blockSize,
138
- // value: 'None',
139
- // items: [],
140
- // },
141
- // {
142
- // label: localization.spaceReclamationGranularity,
143
- // value: 'None',
144
- // items: [],
145
- // },
146
- // ],
147
- // actions: [],
148
- // }, /* TODO данные с нее пока никуда не вставляем */
149
- ]
150
- }
151
-
152
- export const constructDataReadyViewFunc = <T>(
153
- localization: UI_I_Localization,
154
- type: UI_T_DatastoreType,
155
- data: T,
156
- isSphereWizard: boolean
157
- ): UI_I_DetailsItem[] => {
158
- const details = {
159
- local: localDetailsFunc,
160
- 'shared-storm': sharedStormDetailsFunc,
161
- nfs: nfsDetailsFunc,
162
- }
163
-
164
- return details[type](localization, data, isSphereWizard)
165
- }
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
3
+ import { UI_I_LunDisk } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
4
+ import { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
5
+ import { UI_I_ReadyDataForLocal } from '~/components/common/wizards/datastore/add/readyComplete/lib/models/interfaces'
6
+
7
+ const constructLunDiskItems = (disks: any): string => {
8
+ const { $binary } = useNuxtApp()
9
+
10
+ let result = ''
11
+ disks.forEach((disk: UI_I_LunDisk) => {
12
+ const capacity = $binary.round(disk.capacity)
13
+ result += `${disk.name} - ${capacity} \n`
14
+ })
15
+ return result
16
+ }
17
+
18
+ const nfsDetailsFunc = (
19
+ localization: UI_I_Localization,
20
+ data: any,
21
+ isSphereWizard: boolean
22
+ ): UI_I_DetailsItem[] => {
23
+ const { name, server, folder, version, hosts } = data
24
+ // const accessMode = readonly ? 'Read-only' : 'Read-write'
25
+
26
+ const details: UI_I_DetailsItem[] = [
27
+ {
28
+ label: localization.vmfsVersion,
29
+ value: '',
30
+ items: [
31
+ {
32
+ label: localization.version,
33
+ value: version.toUpperCase(),
34
+ items: [],
35
+ },
36
+ ],
37
+ actions: [],
38
+ },
39
+ {
40
+ label: localization.nameAndConfiguration,
41
+ value: '',
42
+ items: [
43
+ {
44
+ label: localization.datastoreName,
45
+ value: name,
46
+ items: [],
47
+ },
48
+ {
49
+ label: localization.server,
50
+ value: server,
51
+ items: [],
52
+ },
53
+ {
54
+ label: localization.folder,
55
+ value: folder,
56
+ items: [],
57
+ },
58
+ // {
59
+ // label: localization.accessMode,
60
+ // value: accessMode,
61
+ // items: [],
62
+ // },
63
+ ],
64
+ actions: [],
65
+ },
66
+ ]
67
+
68
+ if (isSphereWizard) {
69
+ details.push({
70
+ label: localization.hostsAccessibility,
71
+ value: '',
72
+ items: [
73
+ {
74
+ label: localization.hosts,
75
+ value: '',
76
+ data: hosts,
77
+ items: [],
78
+ },
79
+ ],
80
+ actions: [],
81
+ },)
82
+ }
83
+
84
+ return details
85
+ }
86
+
87
+ const localDetailsFunc = (
88
+ localization: UI_I_Localization,
89
+ event: UI_I_ReadyDataForLocal | string,
90
+ isSphereWizard: boolean
91
+ ): UI_I_DetailsItem[] => {
92
+ const data = [
93
+ {
94
+ label: localization.selectName,
95
+ value: '',
96
+ items: [
97
+ {
98
+ label: localization.datastoreName,
99
+ value: isSphereWizard ? event.name : event,
100
+ items: [],
101
+ },
102
+ ],
103
+ actions: [],
104
+ },
105
+ ]
106
+
107
+ if (isSphereWizard) {
108
+ data[0].items.push({
109
+ label: localization.host,
110
+ value: event.host,
111
+ items: [],
112
+ })
113
+ }
114
+ return data
115
+ }
116
+
117
+ const sharedStormDetailsFunc = (
118
+ localization: UI_I_Localization,
119
+ data: { name: string; lunDisk: string[] } // пока так ставляем тип но надо будет поменять когда будем добавлять осталние настройки
120
+ ): UI_I_DetailsItem[] => {
121
+ const { name, lunDisk } = data
122
+
123
+ return [
124
+ {
125
+ label: localization.nameAndDeviceSelection,
126
+ value: '',
127
+ items: [
128
+ {
129
+ label: localization.datastoreName,
130
+ value: name,
131
+ items: [],
132
+ },
133
+ {
134
+ label: localization.diskLun,
135
+ value: constructLunDiskItems(lunDisk),
136
+ items: [],
137
+ },
138
+ ],
139
+ actions: [],
140
+ },
141
+ // {
142
+ // label: localization.partitionConfiguration,
143
+ // value: '',
144
+ // items: [
145
+ // {
146
+ // label: localization.method,
147
+ // value: 'None',
148
+ // items: [],
149
+ // },
150
+ // {
151
+ // label: localization.partitionFormat,
152
+ // value: 'None',
153
+ // items: [],
154
+ // },
155
+ // {
156
+ // label: localization.blockSize,
157
+ // value: 'None',
158
+ // items: [],
159
+ // },
160
+ // {
161
+ // label: localization.spaceReclamationGranularity,
162
+ // value: 'None',
163
+ // items: [],
164
+ // },
165
+ // ],
166
+ // actions: [],
167
+ // }, /* TODO данные с нее пока никуда не вставляем */
168
+ ]
169
+ }
170
+
171
+ export const constructDataReadyViewFunc = <T>(
172
+ localization: UI_I_Localization,
173
+ type: UI_T_DatastoreType,
174
+ data: T,
175
+ isSphereWizard: boolean
176
+ ): UI_I_DetailsItem[] => {
177
+ const details = {
178
+ local: localDetailsFunc,
179
+ 'shared-storm': sharedStormDetailsFunc,
180
+ nfs: nfsDetailsFunc,
181
+ }
182
+
183
+ return details[type](localization, data, isSphereWizard)
184
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.339",
4
+ "version": "1.3.341",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",