bfg-common 1.3.335 → 1.3.337
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/lib/config/states.ts +126 -111
- package/components/common/wizards/datastore/add/Add.vue +2 -1
- package/components/common/wizards/datastore/add/nfs/Nfs.vue +2 -3
- package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +2 -10
- package/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -55
- package/package.json +1 -1
|
@@ -1,111 +1,126 @@
|
|
|
1
|
-
export const
|
|
2
|
-
'unknown',
|
|
3
|
-
'connected',
|
|
4
|
-
'warning',
|
|
5
|
-
'error',
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
'
|
|
38
|
-
'
|
|
39
|
-
'
|
|
40
|
-
'
|
|
41
|
-
'
|
|
42
|
-
'
|
|
43
|
-
'
|
|
44
|
-
'
|
|
45
|
-
'
|
|
46
|
-
'
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
'
|
|
52
|
-
'
|
|
53
|
-
'
|
|
54
|
-
'
|
|
55
|
-
'
|
|
56
|
-
'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
'
|
|
66
|
-
'
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
'
|
|
78
|
-
'
|
|
79
|
-
'
|
|
80
|
-
'
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
'
|
|
86
|
-
'
|
|
87
|
-
'
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
'
|
|
93
|
-
'
|
|
94
|
-
'
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
]
|
|
104
|
-
|
|
105
|
-
export const
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
'
|
|
110
|
-
|
|
111
|
-
|
|
1
|
+
export const clusterLocalizationByState = [
|
|
2
|
+
'unknown',
|
|
3
|
+
'connected',
|
|
4
|
+
'warning',
|
|
5
|
+
'error',
|
|
6
|
+
]
|
|
7
|
+
|
|
8
|
+
export const clusterIconByState = [
|
|
9
|
+
'cluster-error',
|
|
10
|
+
'cluster',
|
|
11
|
+
'cluster-warning',
|
|
12
|
+
'cluster-error',
|
|
13
|
+
// TODO Добавил на скорую руку нужно дополнить, если есть что добавить
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
export const hostLocalizationByState = [
|
|
17
|
+
'unknown',
|
|
18
|
+
'connected',
|
|
19
|
+
'warning',
|
|
20
|
+
'error',
|
|
21
|
+
'maintenance',
|
|
22
|
+
'notResponding',
|
|
23
|
+
'disconnected',
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
export const hostIconByState = [
|
|
27
|
+
'host-error',
|
|
28
|
+
'host',
|
|
29
|
+
'host-warning',
|
|
30
|
+
'host-error',
|
|
31
|
+
'host-maintenance',
|
|
32
|
+
'host-not-responding',
|
|
33
|
+
'host-disconnected',
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
export const vmLocalizationByState = [
|
|
37
|
+
'unknown',
|
|
38
|
+
'powerOff',
|
|
39
|
+
'poweredOn',
|
|
40
|
+
'suspended',
|
|
41
|
+
'error',
|
|
42
|
+
'warning',
|
|
43
|
+
'pending',
|
|
44
|
+
'paused',
|
|
45
|
+
'blocked',
|
|
46
|
+
'shuttingDown',
|
|
47
|
+
'shuttingOff',
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
export const vmIconByState = [
|
|
51
|
+
'vm-error',
|
|
52
|
+
'vm',
|
|
53
|
+
'vm-on',
|
|
54
|
+
'vm-suspended',
|
|
55
|
+
'vm-error',
|
|
56
|
+
'vm-warning',
|
|
57
|
+
'vm-warning',
|
|
58
|
+
'vm-suspended',
|
|
59
|
+
'vm-warning',
|
|
60
|
+
'vm-warning',
|
|
61
|
+
'vm-warning',
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
export const datastoreLocalizationByState = [
|
|
65
|
+
'unknown',
|
|
66
|
+
'connected',
|
|
67
|
+
'warning',
|
|
68
|
+
'error',
|
|
69
|
+
'maintenance',
|
|
70
|
+
'inaccessible',
|
|
71
|
+
'disconnected',
|
|
72
|
+
]
|
|
73
|
+
|
|
74
|
+
export const datastoreIconByState = [
|
|
75
|
+
'datastore-error',
|
|
76
|
+
'datastore',
|
|
77
|
+
'datastore-warning',
|
|
78
|
+
'datastore-error',
|
|
79
|
+
'datastore-maintenance',
|
|
80
|
+
'datastore-inaccessible',
|
|
81
|
+
'datastore-unmount', // 'datastore-disconnected',
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
export const networkLocalizationByState = [
|
|
85
|
+
'unknown',
|
|
86
|
+
'connected',
|
|
87
|
+
'warning',
|
|
88
|
+
'error',
|
|
89
|
+
]
|
|
90
|
+
|
|
91
|
+
export const networkIconByState = [
|
|
92
|
+
'network-error',
|
|
93
|
+
'network',
|
|
94
|
+
'network-warning',
|
|
95
|
+
'network-error',
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
export const switchLocalizationByState = [
|
|
99
|
+
'unknown',
|
|
100
|
+
'connected',
|
|
101
|
+
'warning',
|
|
102
|
+
'error',
|
|
103
|
+
]
|
|
104
|
+
|
|
105
|
+
export const switchIconByState = [
|
|
106
|
+
'switch-error',
|
|
107
|
+
'switch',
|
|
108
|
+
'switch-warning',
|
|
109
|
+
'switch-error',
|
|
110
|
+
]
|
|
111
|
+
|
|
112
|
+
export const resourcePoolLocalizationByState = [
|
|
113
|
+
'unknown',
|
|
114
|
+
'normal',
|
|
115
|
+
'warning',
|
|
116
|
+
'error',
|
|
117
|
+
'alert',
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
export const resourcePoolIconByState = [
|
|
121
|
+
'resourcePoolAlert',
|
|
122
|
+
'resource-pool',
|
|
123
|
+
'resourcePoolWarning',
|
|
124
|
+
'resourcePoolAlert',
|
|
125
|
+
'resourcePoolAlert',
|
|
126
|
+
]
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
:datastore-type="datastoreType"
|
|
55
55
|
:nfs-configuration-submit="nfsConfigurationSubmit"
|
|
56
56
|
:host-accessibility-submit="hostAccessibilitySubmit"
|
|
57
|
-
:
|
|
57
|
+
:hosts="props.nfsHosts"
|
|
58
58
|
@loading="(e) => (loading = e)"
|
|
59
59
|
@change-nfs-version="updateNfsVersion"
|
|
60
60
|
@submit="saveChangesAndNextNfs"
|
|
@@ -95,6 +95,7 @@ const props = defineProps<{
|
|
|
95
95
|
version: UI_T_NfsType
|
|
96
96
|
) => Promise<void>
|
|
97
97
|
datacenterHosts?: UI_I_SelectHostOptions[]
|
|
98
|
+
nfsHosts?: any
|
|
98
99
|
isMainFilter?: boolean
|
|
99
100
|
}>()
|
|
100
101
|
const emits = defineEmits<{
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
<common-wizards-datastore-add-nfs-accessibility
|
|
25
25
|
v-if="showHostAccessibility"
|
|
26
26
|
:host-accessibility-submit="props.hostAccessibilitySubmit"
|
|
27
|
-
:datacenter-hosts="props.
|
|
27
|
+
:datacenter-hosts="props.hosts"
|
|
28
28
|
@next="applyChangesAndNext"
|
|
29
29
|
/>
|
|
30
30
|
<!-- TODO Он будет когда будем делать групповое -->
|
|
@@ -39,7 +39,6 @@ import {
|
|
|
39
39
|
UI_T_WizardDatastoreMode,
|
|
40
40
|
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
41
41
|
import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
|
|
42
|
-
import { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
43
42
|
import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
|
|
44
43
|
|
|
45
44
|
const props = defineProps<{
|
|
@@ -48,7 +47,7 @@ const props = defineProps<{
|
|
|
48
47
|
datastoreType: UI_T_DatastoreType
|
|
49
48
|
nfsConfigurationSubmit: number
|
|
50
49
|
hostAccessibilitySubmit: number
|
|
51
|
-
|
|
50
|
+
hosts?: any
|
|
52
51
|
}>()
|
|
53
52
|
const emits = defineEmits<{
|
|
54
53
|
(event: 'loading', value: boolean): void
|
|
@@ -34,16 +34,14 @@
|
|
|
34
34
|
<script lang="ts" setup>
|
|
35
35
|
import { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
36
36
|
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
37
|
-
import { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
|
|
38
37
|
import { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
39
38
|
import { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
|
|
40
|
-
import { UI_I_SelectHostOptions } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
|
|
41
39
|
import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
|
|
42
40
|
// import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
|
|
43
41
|
|
|
44
42
|
const props = defineProps<{
|
|
45
43
|
hostAccessibilitySubmit: number
|
|
46
|
-
|
|
44
|
+
hosts?: any
|
|
47
45
|
}>()
|
|
48
46
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
47
|
const emits = defineEmits<{
|
|
@@ -59,13 +57,7 @@ console.log(444444)
|
|
|
59
57
|
|
|
60
58
|
// const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
|
|
61
59
|
// TODO refactoring
|
|
62
|
-
const dataTable = computed<
|
|
63
|
-
return {
|
|
64
|
-
items: props.datacenterHosts,
|
|
65
|
-
total_items: props.datacenterHosts.length,
|
|
66
|
-
total_pages: 1,
|
|
67
|
-
}
|
|
68
|
-
})
|
|
60
|
+
const dataTable = computed<any>(() => props.hosts)
|
|
69
61
|
|
|
70
62
|
const pagination = ref<UI_I_Pagination>({
|
|
71
63
|
page: 1,
|
|
@@ -1,55 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
UI_I_HeadItem,
|
|
3
|
-
UI_I_BodyItem,
|
|
4
|
-
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
|
-
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
-
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
7
|
-
import { I_CompatibleHostsTable } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
1
|
+
import {
|
|
2
|
+
UI_I_HeadItem,
|
|
3
|
+
UI_I_BodyItem,
|
|
4
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
5
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
6
|
+
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
7
|
+
import { I_CompatibleHostsTable } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
|
|
8
|
+
import { compatibleHostsTableKeys } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys'
|
|
9
|
+
import {
|
|
10
|
+
hostIconByState,
|
|
11
|
+
clusterIconByState,
|
|
12
|
+
} from '~/components/common/lib/config/states'
|
|
13
|
+
|
|
14
|
+
const getItems = (
|
|
15
|
+
localization: UI_I_Localization
|
|
16
|
+
): [string, boolean, string, string][] => {
|
|
17
|
+
return [
|
|
18
|
+
[localization.host, true, '96px', compatibleHostsTableKeys[0]],
|
|
19
|
+
[localization.cluster, true, '180px', compatibleHostsTableKeys[1]],
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
24
|
+
const result: UI_I_HeadItem[] = []
|
|
25
|
+
getItems(localization).forEach((item) => {
|
|
26
|
+
result.push(constructHeadItem('icon', item[0], item[3], false, item[2]))
|
|
27
|
+
})
|
|
28
|
+
return result
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const bodyItems = (
|
|
32
|
+
data: I_CompatibleHostsTable[]
|
|
33
|
+
): UI_I_BodyItem[][] => {
|
|
34
|
+
console.log(data, 11111)
|
|
35
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
36
|
+
data.forEach((item: I_CompatibleHostsTable, key) => {
|
|
37
|
+
const hostData = {
|
|
38
|
+
iconClassName: `vsphere-icon-${hostIconByState[1]}`,
|
|
39
|
+
}
|
|
40
|
+
const clusterData = {
|
|
41
|
+
iconClassName: `vsphere-icon-${clusterIconByState[1]}`,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
bodyItems.push([
|
|
45
|
+
{
|
|
46
|
+
key: 'icon',
|
|
47
|
+
text: item[compatibleHostsTableKeys[0]],
|
|
48
|
+
data: hostData,
|
|
49
|
+
id: item.id,
|
|
50
|
+
testId: `host-table-item-${item.host}`,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: 'icon',
|
|
54
|
+
text: item[compatibleHostsTableKeys[1]],
|
|
55
|
+
data: clusterData,
|
|
56
|
+
id: item.id,
|
|
57
|
+
testId: `host-table-item-${item.host}`,
|
|
58
|
+
},
|
|
59
|
+
])
|
|
60
|
+
})
|
|
61
|
+
return bodyItems
|
|
62
|
+
}
|