bfg-common 1.3.334 → 1.3.336
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 +30 -10
- package/components/common/wizards/datastore/add/nfs/Nfs.vue +12 -2
- package/components/common/wizards/datastore/add/nfs/accessibility/Accessibility.vue +111 -103
- 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
|
+
]
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
:step-position="stepPosition"
|
|
28
28
|
:datastore-type="datastoreType"
|
|
29
29
|
:local-create-name-submit="localCreateNameSubmit"
|
|
30
|
-
:datacenter-hosts="datacenterHosts"
|
|
30
|
+
:datacenter-hosts="props.datacenterHosts"
|
|
31
31
|
:is-main-filter="props.isMainFilter"
|
|
32
32
|
@loading="(e) => (loading = e)"
|
|
33
33
|
@submit="onSaveNameAndNextLocal"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
:step-position="stepPosition"
|
|
41
41
|
:datastore-type="datastoreType"
|
|
42
42
|
:device-selection-submit="deviceSelectionSubmit"
|
|
43
|
-
:datacenter-hosts="datacenterHosts"
|
|
43
|
+
:datacenter-hosts="props.datacenterHosts"
|
|
44
44
|
:is-main-filter="props.isMainFilter"
|
|
45
45
|
@loading="(e) => (loading = e)"
|
|
46
46
|
@submit="onSaveAndNextSharedStorm"
|
|
@@ -54,6 +54,7 @@
|
|
|
54
54
|
:datastore-type="datastoreType"
|
|
55
55
|
:nfs-configuration-submit="nfsConfigurationSubmit"
|
|
56
56
|
:host-accessibility-submit="hostAccessibilitySubmit"
|
|
57
|
+
:hosts="props.nfsHosts"
|
|
57
58
|
@loading="(e) => (loading = e)"
|
|
58
59
|
@change-nfs-version="updateNfsVersion"
|
|
59
60
|
@submit="saveChangesAndNextNfs"
|
|
@@ -94,6 +95,7 @@ const props = defineProps<{
|
|
|
94
95
|
version: UI_T_NfsType
|
|
95
96
|
) => Promise<void>
|
|
96
97
|
datacenterHosts?: UI_I_SelectHostOptions[]
|
|
98
|
+
nfsHosts?: any[]
|
|
97
99
|
isMainFilter?: boolean
|
|
98
100
|
}>()
|
|
99
101
|
const emits = defineEmits<{
|
|
@@ -293,6 +295,7 @@ const saveChangesAndNextNfs = (event: any, next = true): void => {
|
|
|
293
295
|
}
|
|
294
296
|
|
|
295
297
|
const isShowCompleteBlock = computed<boolean>(() => {
|
|
298
|
+
// TODO refactoring
|
|
296
299
|
const localStep = datastoreType.value === 'local' && stepPosition.value === 2
|
|
297
300
|
|
|
298
301
|
const sharesStep =
|
|
@@ -301,14 +304,31 @@ const isShowCompleteBlock = computed<boolean>(() => {
|
|
|
301
304
|
? stepPosition.value === 3
|
|
302
305
|
: stepPosition.value === 2)
|
|
303
306
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
let nfsFirst
|
|
308
|
+
if (props.mode === 'procurator') {
|
|
309
|
+
nfsFirst =
|
|
310
|
+
datastoreType.value === 'nfs' &&
|
|
311
|
+
nfsVersion.value === 'nfs-3' &&
|
|
312
|
+
stepPosition.value === 3
|
|
313
|
+
} else {
|
|
314
|
+
nfsFirst =
|
|
315
|
+
datastoreType.value === 'nfs' &&
|
|
316
|
+
nfsVersion.value === 'nfs-3' &&
|
|
317
|
+
stepPosition.value === 4
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
let nfsSecond
|
|
321
|
+
if (props.mode === 'procurator') {
|
|
322
|
+
nfsSecond =
|
|
323
|
+
datastoreType.value === 'nfs' &&
|
|
324
|
+
nfsVersion.value === 'nfs-4.1' &&
|
|
325
|
+
stepPosition.value === 3
|
|
326
|
+
} else {
|
|
327
|
+
nfsSecond =
|
|
328
|
+
datastoreType.value === 'nfs' &&
|
|
329
|
+
nfsVersion.value === 'nfs-4.1' &&
|
|
330
|
+
stepPosition.value === 4
|
|
331
|
+
}
|
|
312
332
|
|
|
313
333
|
return localStep || sharesStep || nfsFirst || nfsSecond
|
|
314
334
|
})
|
|
@@ -21,9 +21,10 @@
|
|
|
21
21
|
<!-- :nfs-version="nfsVersion"-->
|
|
22
22
|
<!-- />--><!-- TODO Он будет когда будем делать групповое -->
|
|
23
23
|
|
|
24
|
-
<
|
|
24
|
+
<common-wizards-datastore-add-nfs-accessibility
|
|
25
25
|
v-if="showHostAccessibility"
|
|
26
26
|
:host-accessibility-submit="props.hostAccessibilitySubmit"
|
|
27
|
+
:datacenter-hosts="props.hosts"
|
|
27
28
|
@next="applyChangesAndNext"
|
|
28
29
|
/>
|
|
29
30
|
<!-- TODO Он будет когда будем делать групповое -->
|
|
@@ -38,6 +39,7 @@ import {
|
|
|
38
39
|
UI_T_WizardDatastoreMode,
|
|
39
40
|
} from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
40
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'
|
|
41
43
|
import { subTitleFunc } from '~/components/common/wizards/datastore/add/lib/config/stepItems'
|
|
42
44
|
|
|
43
45
|
const props = defineProps<{
|
|
@@ -46,6 +48,7 @@ const props = defineProps<{
|
|
|
46
48
|
datastoreType: UI_T_DatastoreType
|
|
47
49
|
nfsConfigurationSubmit: number
|
|
48
50
|
hostAccessibilitySubmit: number
|
|
51
|
+
hosts?: UI_I_SelectHostOptions[]
|
|
49
52
|
}>()
|
|
50
53
|
const emits = defineEmits<{
|
|
51
54
|
(event: 'loading', value: boolean): void
|
|
@@ -74,9 +77,16 @@ const stepSubTitle = computed<string>(() => {
|
|
|
74
77
|
// )
|
|
75
78
|
// })
|
|
76
79
|
const showHostAccessibility = computed<boolean>(() => {
|
|
77
|
-
return
|
|
80
|
+
return props.mode === 'sphere' && props.stepPosition === 3
|
|
78
81
|
})
|
|
79
82
|
|
|
83
|
+
watch(
|
|
84
|
+
() => props.stepPosition,
|
|
85
|
+
(newValue: number) => {
|
|
86
|
+
console.log(showHostAccessibility.value, newValue, 1111, props.mode)
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
|
|
80
90
|
watch(nfsVersion, (newValue: UI_T_NfsType) => {
|
|
81
91
|
emits('change-nfs-version', newValue)
|
|
82
92
|
})
|
|
@@ -1,103 +1,111 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<atoms-alert
|
|
4
|
-
v-show="errors.length"
|
|
5
|
-
test-id="accessibility"
|
|
6
|
-
status="alert-danger"
|
|
7
|
-
:items="errors"
|
|
8
|
-
@remove="removeValidationErrors"
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
|
-
<div>
|
|
12
|
-
<atoms-tabs
|
|
13
|
-
v-model="activeTab"
|
|
14
|
-
test-id="accessibility"
|
|
15
|
-
:items="tabs"
|
|
16
|
-
size="small"
|
|
17
|
-
/>
|
|
18
|
-
</div>
|
|
19
|
-
<div>
|
|
20
|
-
<common-wizards-datastore-add-nfs-accessibility-tables-view
|
|
21
|
-
v-model:selected-row="selectedHost"
|
|
22
|
-
:data-table="dataTable?.items || []"
|
|
23
|
-
:total-items="dataTable?.total_items || 0"
|
|
24
|
-
:total-pages="dataTable?.total_pages || 1"
|
|
25
|
-
:pagination="pagination"
|
|
26
|
-
:table-type="activeTab"
|
|
27
|
-
@pagination="updatePagination"
|
|
28
|
-
@sort="sortTable"
|
|
29
|
-
/>
|
|
30
|
-
</div>
|
|
31
|
-
</div>
|
|
32
|
-
</template>
|
|
33
|
-
|
|
34
|
-
<script lang="ts" setup>
|
|
35
|
-
import { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
36
|
-
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="errors.length"
|
|
5
|
+
test-id="accessibility"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="errors"
|
|
8
|
+
@remove="removeValidationErrors"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div>
|
|
12
|
+
<atoms-tabs
|
|
13
|
+
v-model="activeTab"
|
|
14
|
+
test-id="accessibility"
|
|
15
|
+
:items="tabs"
|
|
16
|
+
size="small"
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div>
|
|
20
|
+
<common-wizards-datastore-add-nfs-accessibility-tables-view
|
|
21
|
+
v-model:selected-row="selectedHost"
|
|
22
|
+
:data-table="dataTable?.items || []"
|
|
23
|
+
:total-items="dataTable?.total_items || 0"
|
|
24
|
+
:total-pages="dataTable?.total_pages || 1"
|
|
25
|
+
:pagination="pagination"
|
|
26
|
+
:table-type="activeTab"
|
|
27
|
+
@pagination="updatePagination"
|
|
28
|
+
@sort="sortTable"
|
|
29
|
+
/>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script lang="ts" setup>
|
|
35
|
+
import { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
36
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
37
|
+
import { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
|
|
38
|
+
import { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
39
|
+
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
|
+
import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
|
|
42
|
+
// import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
|
|
43
|
+
|
|
44
|
+
const props = defineProps<{
|
|
45
|
+
hostAccessibilitySubmit: number
|
|
46
|
+
hosts?: UI_I_SelectHostOptions[]
|
|
47
|
+
}>()
|
|
48
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
+
const emits = defineEmits<{
|
|
50
|
+
(event: 'next', value: string): void
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
|
|
54
|
+
const tabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
55
|
+
hostAccessibilityTabsFunc(localization.value, ['5', '3'])
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
console.log(444444)
|
|
59
|
+
|
|
60
|
+
// const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
|
|
61
|
+
// TODO refactoring
|
|
62
|
+
const dataTable = computed<API_UI_I_DataTable<UI_I_SelectHostOptions[]>>(() => {
|
|
63
|
+
return {
|
|
64
|
+
items: props.hosts,
|
|
65
|
+
total_items: props.hosts.length,
|
|
66
|
+
total_pages: 1,
|
|
67
|
+
}
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const pagination = ref<UI_I_Pagination>({
|
|
71
|
+
page: 1,
|
|
72
|
+
pageSize: 35,
|
|
73
|
+
})
|
|
74
|
+
const sort = ref<string | null>(null)
|
|
75
|
+
|
|
76
|
+
const selectedHost = ref<number[]>([])
|
|
77
|
+
|
|
78
|
+
const updatePagination = (event: UI_I_Pagination): void => {
|
|
79
|
+
pagination.value = event
|
|
80
|
+
}
|
|
81
|
+
const sortTable = (event: string): void => {
|
|
82
|
+
sort.value = event
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const errors = ref<string[]>([])
|
|
86
|
+
|
|
87
|
+
const showValidationErrors = (text: string): void => {
|
|
88
|
+
errors.value = [text]
|
|
89
|
+
}
|
|
90
|
+
const removeValidationErrors = (): void => {
|
|
91
|
+
errors.value = []
|
|
92
|
+
}
|
|
93
|
+
const submit = async () => {
|
|
94
|
+
if (!selectedHost.value.length) {
|
|
95
|
+
const text = localization.value.selectLeastEntityContinue
|
|
96
|
+
showValidationErrors(text)
|
|
97
|
+
return
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
removeValidationErrors()
|
|
101
|
+
emits('next', '')
|
|
102
|
+
}
|
|
103
|
+
watch(
|
|
104
|
+
() => props.hostAccessibilitySubmit,
|
|
105
|
+
() => {
|
|
106
|
+
submit()
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="scss" scoped></style>
|
|
@@ -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
|
+
}
|