bfg-common 1.5.85 → 1.5.86
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.
- package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityNew.vue +35 -14
- package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityOld.vue +0 -3
- package/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/New.vue +20 -13
- package/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/lib/config/compatibleTable.ts +28 -45
- package/components/common/wizards/datastore/add/steps/hostAccessibility/table/old/lib/config/compatibleTable.ts +6 -10
- package/package.json +1 -1
package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityNew.vue
CHANGED
|
@@ -1,27 +1,48 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="host-accessibility">
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
<ui-tabs
|
|
4
|
+
v-model="activeTabModel"
|
|
5
|
+
test-id="accessibility"
|
|
6
|
+
:tabs="tabsLocal"
|
|
7
|
+
type="outline"
|
|
8
|
+
class="host-accessibility__tab"
|
|
9
|
+
>
|
|
10
|
+
</ui-tabs>
|
|
11
|
+
|
|
12
|
+
<common-wizards-datastore-add-steps-host-accessibility-table
|
|
13
|
+
v-model="formHostsLocal"
|
|
14
|
+
:data="props.hosts"
|
|
15
|
+
:table-type="activeTabModel"
|
|
16
|
+
/>
|
|
5
17
|
</div>
|
|
6
18
|
</template>
|
|
7
19
|
|
|
8
20
|
<script lang="ts" setup>
|
|
9
21
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
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'
|
|
22
|
+
import type { UI_I_CompatibleHosts } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
|
|
23
|
+
import type { UI_T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/types'
|
|
14
24
|
|
|
25
|
+
const formHostsLocal = defineModel<string[]>({ required: true })
|
|
26
|
+
const activeTabModel = defineModel<UI_T_HostsAccessibilityTab>('activeTab', {
|
|
27
|
+
required: true,
|
|
28
|
+
})
|
|
15
29
|
const props = defineProps<{
|
|
16
|
-
|
|
17
|
-
|
|
30
|
+
hosts?: UI_I_CompatibleHosts
|
|
31
|
+
tabOptions: UI_I_CollapseNavItem[]
|
|
18
32
|
}>()
|
|
19
|
-
const modelHosts = defineModel<string[]>()
|
|
20
|
-
// const emits = defineEmits<{
|
|
21
|
-
// (event: 'hide-alert', value: number): void
|
|
22
|
-
// }>()
|
|
23
33
|
|
|
24
|
-
|
|
34
|
+
const tabsLocal = computed<UI_I_CollapseNavItem[]>(() =>
|
|
35
|
+
props.tabOptions.map((tab: UI_I_CollapseNavItem) => ({
|
|
36
|
+
...tab,
|
|
37
|
+
name: tab.text,
|
|
38
|
+
}))
|
|
39
|
+
)
|
|
25
40
|
</script>
|
|
26
41
|
|
|
27
|
-
<style lang="scss" scoped
|
|
42
|
+
<style lang="scss" scoped>
|
|
43
|
+
.host-accessibility {
|
|
44
|
+
&__tab {
|
|
45
|
+
padding: 16px 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|
package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityOld.vue
CHANGED
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
|
|
27
27
|
<script lang="ts" setup>
|
|
28
28
|
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
29
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
30
29
|
import type { UI_I_CompatibleHosts } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
|
|
31
30
|
import type { UI_T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/types'
|
|
32
31
|
import { dynamicSteps } from '~/components/common/wizards/datastore/add/lib/config/steps'
|
|
@@ -44,8 +43,6 @@ const emits = defineEmits<{
|
|
|
44
43
|
(event: 'hide-alert', value: number): void
|
|
45
44
|
}>()
|
|
46
45
|
|
|
47
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
48
|
-
|
|
49
46
|
const onHideAlert = (): void =>
|
|
50
47
|
emits('hide-alert', dynamicSteps.hostAccessibility)
|
|
51
48
|
</script>
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ui-data-table
|
|
3
|
-
test-id="
|
|
3
|
+
test-id="accessibility-table"
|
|
4
4
|
:data="data"
|
|
5
5
|
:options="options"
|
|
6
6
|
:loading="props.loading"
|
|
7
7
|
:total-pages="props.totalPages"
|
|
8
8
|
:total-items="props.totalItems"
|
|
9
9
|
:texts="texts"
|
|
10
|
-
class="
|
|
10
|
+
class="accessibility-host-table"
|
|
11
|
+
size="sm"
|
|
11
12
|
@select-row="onSelectRow"
|
|
12
13
|
>
|
|
14
|
+
<template #insteadOfTitleActions>
|
|
15
|
+
<h3 class="storage-count">
|
|
16
|
+
{{ tableData?.length }}
|
|
17
|
+
</h3>
|
|
18
|
+
</template>
|
|
13
19
|
</ui-data-table>
|
|
14
20
|
</template>
|
|
15
21
|
|
|
@@ -26,10 +32,11 @@ import {
|
|
|
26
32
|
getHeaderDataFunc,
|
|
27
33
|
getBodyDataFunc,
|
|
28
34
|
} from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/new/lib/config/compatibleTable'
|
|
35
|
+
import { UI_I_CompatibleHostsTableItem } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
|
|
29
36
|
|
|
30
|
-
const
|
|
37
|
+
const selectedHostsIdLocal = defineModel<string[]>({ required: true })
|
|
31
38
|
const props = defineProps<{
|
|
32
|
-
tableData:
|
|
39
|
+
tableData: UI_I_CompatibleHostsTableItem[]
|
|
33
40
|
totalItems: number
|
|
34
41
|
totalPages: number
|
|
35
42
|
loading: boolean
|
|
@@ -53,31 +60,31 @@ const texts = computed<UI_I_TableTexts>(() => ({
|
|
|
53
60
|
}))
|
|
54
61
|
|
|
55
62
|
const data = computed<UI_I_DataTable>(() => ({
|
|
56
|
-
id: '
|
|
57
|
-
header:
|
|
58
|
-
body:
|
|
63
|
+
id: 'accessibility-host-table',
|
|
64
|
+
header: hostHeadItems.value,
|
|
65
|
+
body: hostBodyItems.value,
|
|
59
66
|
}))
|
|
60
67
|
|
|
61
|
-
const
|
|
68
|
+
const hostHeadItems = computed<UI_I_DataTableHeader[]>(() =>
|
|
62
69
|
getHeaderDataFunc(localization.value)
|
|
63
70
|
)
|
|
64
71
|
|
|
65
|
-
const
|
|
72
|
+
const hostBodyItems = ref<UI_I_DataTableBody[]>([])
|
|
66
73
|
watch(
|
|
67
74
|
() => props.tableData,
|
|
68
|
-
(newValue) => {
|
|
75
|
+
(newValue: UI_I_CompatibleHostsTableItem[]) => {
|
|
69
76
|
if (!newValue?.length) {
|
|
70
|
-
|
|
77
|
+
hostBodyItems.value = []
|
|
71
78
|
return
|
|
72
79
|
}
|
|
73
80
|
|
|
74
|
-
|
|
81
|
+
hostBodyItems.value = getBodyDataFunc(newValue)
|
|
75
82
|
},
|
|
76
83
|
{ deep: true, immediate: true }
|
|
77
84
|
)
|
|
78
85
|
|
|
79
86
|
const onSelectRow = (value: UI_I_DataTableBody[]): void => {
|
|
80
|
-
|
|
87
|
+
selectedHostsIdLocal.value = value?.[0].row
|
|
81
88
|
}
|
|
82
89
|
</script>
|
|
83
90
|
|
|
@@ -4,57 +4,32 @@ import type {
|
|
|
4
4
|
UI_I_DataTableHeader,
|
|
5
5
|
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
6
6
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
import type { UI_I_CompatibleHostsTableItem } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
|
|
8
|
+
import {
|
|
9
|
+
hostIconByState,
|
|
10
|
+
clusterIconByState,
|
|
11
|
+
} from '~/components/common/lib/config/states'
|
|
7
12
|
|
|
8
13
|
export const getHeaderDataFunc = (
|
|
9
14
|
localization: UI_I_Localization
|
|
10
15
|
): UI_I_DataTableHeader[] => [
|
|
11
16
|
{
|
|
12
17
|
col: 'col0',
|
|
13
|
-
colName: '
|
|
14
|
-
text: localization.
|
|
18
|
+
colName: 'host',
|
|
19
|
+
text: localization.common.host,
|
|
15
20
|
isSortable: true,
|
|
16
21
|
sort: 'asc',
|
|
17
|
-
width: '
|
|
22
|
+
width: '250px',
|
|
18
23
|
show: true,
|
|
19
24
|
filter: false,
|
|
20
25
|
},
|
|
21
26
|
{
|
|
22
27
|
col: 'col1',
|
|
23
|
-
colName: '
|
|
24
|
-
text: localization.
|
|
28
|
+
colName: 'cluster',
|
|
29
|
+
text: localization.common.cluster,
|
|
25
30
|
isSortable: true,
|
|
26
31
|
sort: 'asc',
|
|
27
|
-
width: '
|
|
28
|
-
show: true,
|
|
29
|
-
filter: false,
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
col: 'col2',
|
|
33
|
-
colName: 'product',
|
|
34
|
-
text: localization.common.product,
|
|
35
|
-
isSortable: true,
|
|
36
|
-
sort: 'asc',
|
|
37
|
-
width: '96px',
|
|
38
|
-
show: true,
|
|
39
|
-
filter: false,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
col: 'col3',
|
|
43
|
-
colName: 'usage',
|
|
44
|
-
text: localization.common.usage,
|
|
45
|
-
isSortable: true,
|
|
46
|
-
sort: 'asc',
|
|
47
|
-
width: '96px',
|
|
48
|
-
show: true,
|
|
49
|
-
filter: false,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
col: 'col4',
|
|
53
|
-
colName: 'capacity',
|
|
54
|
-
text: localization.common.capacity,
|
|
55
|
-
isSortable: true,
|
|
56
|
-
sort: 'asc',
|
|
57
|
-
width: '96px',
|
|
32
|
+
width: '250px',
|
|
58
33
|
show: true,
|
|
59
34
|
filter: false,
|
|
60
35
|
},
|
|
@@ -73,30 +48,38 @@ export const options: UI_I_DataTableOptions = {
|
|
|
73
48
|
showSelectedRows: false,
|
|
74
49
|
showColumnManager: false,
|
|
75
50
|
withActions: false,
|
|
76
|
-
selectType: '
|
|
51
|
+
selectType: 'checkbox',
|
|
77
52
|
inBlock: true,
|
|
78
53
|
showExport: false,
|
|
79
54
|
withCollapse: false,
|
|
80
55
|
}
|
|
81
56
|
|
|
82
57
|
export const getBodyDataFunc = (
|
|
83
|
-
bodyData:
|
|
58
|
+
bodyData: UI_I_CompatibleHostsTableItem[]
|
|
84
59
|
): UI_I_DataTableBody[] => {
|
|
85
|
-
return bodyData.map((
|
|
60
|
+
return bodyData.map((host, _index: number) => {
|
|
86
61
|
return {
|
|
87
|
-
row: Number(
|
|
62
|
+
row: Number(host.id),
|
|
88
63
|
collapse: false,
|
|
89
64
|
isHiddenCollapse: false,
|
|
90
65
|
collapseToggle: false,
|
|
91
66
|
data: [
|
|
92
|
-
{ col: 'col0', text: license.licence },
|
|
93
67
|
{
|
|
68
|
+
key: 'icon',
|
|
69
|
+
col: 'col0',
|
|
70
|
+
text: host.host,
|
|
71
|
+
data: {
|
|
72
|
+
iconClassName: `vsphere-icon-${hostIconByState[host.state]}`,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
key: 'icon',
|
|
94
77
|
col: 'col1',
|
|
95
|
-
text:
|
|
78
|
+
text: host.cluster || '--',
|
|
79
|
+
data: {
|
|
80
|
+
iconClassName: `vsphere-icon-${clusterIconByState[1]}`,
|
|
81
|
+
},
|
|
96
82
|
},
|
|
97
|
-
{ col: 'col2', text: license.product },
|
|
98
|
-
{ col: 'col3', text: license.usage },
|
|
99
|
-
{ col: 'col4', text: license.capacity || '--' },
|
|
100
83
|
],
|
|
101
84
|
}
|
|
102
85
|
})
|
|
@@ -3,8 +3,8 @@ import type {
|
|
|
3
3
|
UI_I_BodyItem,
|
|
4
4
|
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
5
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
-
import
|
|
7
|
-
import type {
|
|
6
|
+
import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
|
|
7
|
+
import type { UI_I_CompatibleHostsTableItem } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/lib/models/interfaces'
|
|
8
8
|
import { compatibleHostsTableKeys } from '~/components/common/wizards/datastore/add/steps/hostAccessibility/table/old/lib/config/tableKeys'
|
|
9
9
|
import {
|
|
10
10
|
hostIconByState,
|
|
@@ -19,22 +19,18 @@ const getItems = (
|
|
|
19
19
|
[localization.common.cluster, true, '300px', compatibleHostsTableKeys[1]],
|
|
20
20
|
]
|
|
21
21
|
}
|
|
22
|
-
|
|
23
22
|
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
result.push(constructHeadItem('icon', item[0], item[3], false, item[2]))
|
|
23
|
+
return defaultSettings.defaultHeadItems(getItems(localization), {
|
|
24
|
+
icon: [0, 1],
|
|
27
25
|
})
|
|
28
|
-
return result
|
|
29
26
|
}
|
|
30
27
|
|
|
31
28
|
export const bodyItems = (
|
|
32
|
-
data:
|
|
29
|
+
data: UI_I_CompatibleHostsTableItem[]
|
|
33
30
|
): UI_I_BodyItem[][] => {
|
|
34
31
|
const bodyItems: UI_I_BodyItem[][] = []
|
|
35
|
-
data.forEach((item:
|
|
32
|
+
data.forEach((item: UI_I_CompatibleHostsTableItem, key) => {
|
|
36
33
|
const hostData = {
|
|
37
|
-
// @ts-ignore
|
|
38
34
|
iconClassName: `vsphere-icon-${hostIconByState[item.state]}`,
|
|
39
35
|
}
|
|
40
36
|
const clusterData = {
|