bfg-common 1.4.46 → 1.4.47
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/nfs/accessibility/lib/models/interfaces.ts +4 -0
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +15 -6
- package/components/common/wizards/datastoreNew/add/Add.vue +464 -0
- package/components/common/wizards/datastoreNew/add/lib/config/steps.ts +135 -0
- package/components/common/wizards/datastoreNew/add/lib/models/enums.ts +5 -0
- package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +12 -0
- package/components/common/wizards/datastoreNew/add/lib/models/types.ts +7 -0
- package/components/common/wizards/datastoreNew/add/lib/utils.ts +31 -0
- package/components/common/wizards/datastoreNew/add/local/Local.vue +44 -0
- package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +116 -0
- package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +67 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +63 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +24 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +9 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +5 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +85 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
- package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +11 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +301 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +5 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/DeletePopover.vue +100 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/ServersList.vue +124 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/serversListConfig.ts +41 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/tableKeys.ts +3 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/interfaces.ts +3 -0
- package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/types.ts +1 -0
- package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +55 -0
- package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
- package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +26 -0
- package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +22 -0
- package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +88 -0
- package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +192 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +83 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +262 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +23 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +48 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +8 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/Table.vue +134 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable.ts +87 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +11 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +236 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +64 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +46 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +225 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/version/Version.vue +39 -0
- package/components/common/wizards/datastoreNew/add/sharedStorm/version/lib/config/versionOptions.ts +21 -0
- package/components/common/wizards/datastoreNew/add/types/Types.vue +78 -0
- package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +49 -0
- package/lib/models/interfaces.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="local-step">
|
|
3
|
+
<common-wizards-datastore-new-add-local-create-name
|
|
4
|
+
v-if="isShowCreateLocalNameBlock"
|
|
5
|
+
v-model="model.name"
|
|
6
|
+
:alert-messages="props.alertMessages"
|
|
7
|
+
:messages-fields="props.messagesFields"
|
|
8
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
|
9
|
+
/>
|
|
10
|
+
</div>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script lang="ts" setup>
|
|
14
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
15
|
+
import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
|
|
16
|
+
import type { UI_T_DatastoreType } from '~/components/common/wizards/datastore/add/lib/models/types'
|
|
17
|
+
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
18
|
+
|
|
19
|
+
const props = defineProps<{
|
|
20
|
+
project: UI_T_Project
|
|
21
|
+
stepId: number
|
|
22
|
+
datastoreType: UI_T_DatastoreType
|
|
23
|
+
alertMessages: string[]
|
|
24
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
25
|
+
}>()
|
|
26
|
+
const model = defineModel<any>()
|
|
27
|
+
const emits = defineEmits<{
|
|
28
|
+
(event: 'hide-alert', value: number): void
|
|
29
|
+
}>()
|
|
30
|
+
|
|
31
|
+
const isShowCreateLocalNameBlock = computed<boolean>(
|
|
32
|
+
() => props.project === 'procurator' && props.stepId === 1
|
|
33
|
+
)
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style lang="scss" scoped>
|
|
37
|
+
.local-step {
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
overflow-y: auto;
|
|
41
|
+
overflow-x: hidden;
|
|
42
|
+
height: 100%;
|
|
43
|
+
}
|
|
44
|
+
</style>
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="create-datastore-name">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="props.alertMessages.length"
|
|
5
|
+
test-id="create-storage-name-alert-error"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div class="clr-form-control clr-row">
|
|
12
|
+
<label for="datastore-name" class="clr-control-label clr-col-md-2">
|
|
13
|
+
{{ localization.datastoreName }}
|
|
14
|
+
</label>
|
|
15
|
+
|
|
16
|
+
<div class="clr-control-container" :class="nameErrorText && 'clr-error'">
|
|
17
|
+
<div class="flex-align-center">
|
|
18
|
+
<input
|
|
19
|
+
id="datastore-name"
|
|
20
|
+
v-model.trim="createDatastoreNameLocal"
|
|
21
|
+
data-id="datastore-name-input"
|
|
22
|
+
type="text"
|
|
23
|
+
class="clr-input"
|
|
24
|
+
@blur="initValidation(true)"
|
|
25
|
+
@input="initValidation(false)"
|
|
26
|
+
/>
|
|
27
|
+
<atoms-the-icon class="error-icon" name="info-circle" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div class="clr-subtext" data-id="local-datastore-name-field-require">
|
|
31
|
+
{{ nameErrorText }}
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script lang="ts" setup>
|
|
39
|
+
import type {
|
|
40
|
+
UI_I_Localization,
|
|
41
|
+
UI_I_ArbitraryObject,
|
|
42
|
+
} from '~/lib/models/interfaces'
|
|
43
|
+
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
44
|
+
|
|
45
|
+
const props = defineProps<{
|
|
46
|
+
alertMessages: string[]
|
|
47
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
48
|
+
}>()
|
|
49
|
+
const createDatastoreNameLocal = defineModel<string>()
|
|
50
|
+
const emits = defineEmits<{
|
|
51
|
+
(event: 'hide-alert', value: number): void
|
|
52
|
+
}>()
|
|
53
|
+
|
|
54
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
55
|
+
|
|
56
|
+
/* Validation for Name input */
|
|
57
|
+
const isInitNameValidation = ref<boolean>(false)
|
|
58
|
+
const initValidation = (onlyBlur = false): void => {
|
|
59
|
+
onlyBlur && (isInitNameValidation.value = true)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const nameErrorText = computed<string>(() => {
|
|
63
|
+
if (
|
|
64
|
+
props.messagesFields?.datastoreName?.field &&
|
|
65
|
+
!createDatastoreNameLocal.value
|
|
66
|
+
) {
|
|
67
|
+
return props.messagesFields.datastoreName.field
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!isInitNameValidation.value) return ''
|
|
71
|
+
return !createDatastoreNameLocal.value
|
|
72
|
+
? localization.value.specifyDatastoreName
|
|
73
|
+
: ''
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const onHideAlert = (): void => {
|
|
77
|
+
emits('hide-alert', 1)
|
|
78
|
+
}
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.create-datastore-name {
|
|
83
|
+
&__alert-info {
|
|
84
|
+
:deep(.alert-text) {
|
|
85
|
+
font-size: 11px;
|
|
86
|
+
letter-spacing: normal;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
.clr-form-control {
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: row;
|
|
92
|
+
|
|
93
|
+
.clr-control-container {
|
|
94
|
+
min-height: 48px;
|
|
95
|
+
input {
|
|
96
|
+
width: 375px;
|
|
97
|
+
}
|
|
98
|
+
&.clr-error {
|
|
99
|
+
.clr-subtext,
|
|
100
|
+
.error-icon {
|
|
101
|
+
display: block;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
.clr-subtext,
|
|
105
|
+
.error-icon {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
.error-icon {
|
|
109
|
+
fill: #db2100;
|
|
110
|
+
width: 24px;
|
|
111
|
+
height: 24px;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
</style>
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="nfs-container">
|
|
3
|
+
<common-wizards-datastore-new-add-nfs-version
|
|
4
|
+
v-if="props.stepId === 4"
|
|
5
|
+
v-model="model.nfsVersion"
|
|
6
|
+
/>
|
|
7
|
+
|
|
8
|
+
<common-wizards-datastore-new-add-nfs-configuration
|
|
9
|
+
v-show="props.stepId === 5"
|
|
10
|
+
v-model="model"
|
|
11
|
+
:project="props.project"
|
|
12
|
+
:alert-messages="props.alertMessages"
|
|
13
|
+
:messages-fields="props.messagesFields"
|
|
14
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
|
15
|
+
/>
|
|
16
|
+
|
|
17
|
+
<!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
|
|
18
|
+
<!-- v-show="model.nfsVersion === 'nfs-4.1' && props.stepPosition === 3"-->
|
|
19
|
+
<!-- :nfs-version="model.nfsVersion"-->
|
|
20
|
+
<!-- />--><!-- TODO Он будет когда будем делать групповое -->
|
|
21
|
+
|
|
22
|
+
<common-wizards-datastore-new-add-nfs-accessibility
|
|
23
|
+
v-if="showHostAccessibility"
|
|
24
|
+
v-model="model.hosts"
|
|
25
|
+
:alert-messages="props.alertMessages"
|
|
26
|
+
:hosts="props.hosts"
|
|
27
|
+
@hide-alert="(e) => emits('hide-alert', e)"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts" setup>
|
|
33
|
+
import type {
|
|
34
|
+
UI_I_Localization,
|
|
35
|
+
UI_I_ArbitraryObject,
|
|
36
|
+
} from '~/lib/models/interfaces'
|
|
37
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
38
|
+
import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
|
|
39
|
+
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
project: UI_T_Project
|
|
42
|
+
stepId: number
|
|
43
|
+
alertMessages: string[]
|
|
44
|
+
messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
|
|
45
|
+
hosts?: any
|
|
46
|
+
}>()
|
|
47
|
+
const model = defineModel<any>()
|
|
48
|
+
const emits = defineEmits<{
|
|
49
|
+
(event: 'hide-alert', value: number): void
|
|
50
|
+
}>()
|
|
51
|
+
|
|
52
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
53
|
+
|
|
54
|
+
const showHostAccessibility = computed<boolean>(() => {
|
|
55
|
+
return props.project === 'sphere' && props.stepId === 6
|
|
56
|
+
})
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<style lang="scss" scoped>
|
|
60
|
+
@import '~/assets/scss/common/mixins.scss';
|
|
61
|
+
.nfs-container {
|
|
62
|
+
@include flex($dir: column);
|
|
63
|
+
height: inherit;
|
|
64
|
+
&__desc {
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
</style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="host-accessibility">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="props.alertMessages?.length"
|
|
5
|
+
test-id="accessibility"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:items="props.alertMessages"
|
|
8
|
+
@remove="onHideAlert"
|
|
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-new-add-nfs-accessibility-tables-view
|
|
21
|
+
v-model="modelHosts"
|
|
22
|
+
:data-table="dataTable?.items || []"
|
|
23
|
+
:total-items="dataTable?.total_items || 0"
|
|
24
|
+
:total-pages="dataTable?.total_pages || 1"
|
|
25
|
+
:table-type="activeTab"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
</div>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script lang="ts" setup>
|
|
32
|
+
import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
33
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
34
|
+
import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
|
|
35
|
+
import type { UI_I_CreateDatastoreHosts } from '~/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces'
|
|
36
|
+
import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
|
|
37
|
+
|
|
38
|
+
const props = defineProps<{
|
|
39
|
+
alertMessages: string[]
|
|
40
|
+
hosts?: UI_I_CreateDatastoreHosts
|
|
41
|
+
}>()
|
|
42
|
+
const modelHosts = defineModel<string[]>()
|
|
43
|
+
const emits = defineEmits<{
|
|
44
|
+
(event: 'hide-alert', value: number): void
|
|
45
|
+
}>()
|
|
46
|
+
|
|
47
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
48
|
+
|
|
49
|
+
const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
|
|
50
|
+
const tabs = computed<UI_I_CollapseNavItem[]>(() =>
|
|
51
|
+
hostAccessibilityTabsFunc(localization.value, [
|
|
52
|
+
(props.hosts?.items?.length || 0) + '',
|
|
53
|
+
'0',
|
|
54
|
+
])
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
const dataTable = computed<UI_I_CreateDatastoreHosts>(() => props.hosts)
|
|
58
|
+
const onHideAlert = (): void => {
|
|
59
|
+
emits('hide-alert', 6)
|
|
60
|
+
}
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
|
|
3
|
+
|
|
4
|
+
export const hostAccessibilityTabsFunc = (
|
|
5
|
+
localization: UI_I_Localization,
|
|
6
|
+
hosts: string[]
|
|
7
|
+
) => {
|
|
8
|
+
|
|
9
|
+
const [compatibleHosts, incompatibleHost] = hosts
|
|
10
|
+
|
|
11
|
+
const tabs: UI_I_CollapseNavItem[] = [
|
|
12
|
+
{
|
|
13
|
+
text: localization.compatibleHosts.replace('{0}', compatibleHosts || ''),
|
|
14
|
+
value: 'compatible-hosts',
|
|
15
|
+
disabled: false,
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
text: localization.incompatibleHosts.replace('{0}', incompatibleHost || ''),
|
|
19
|
+
value: 'incompatible-hosts',
|
|
20
|
+
disabled: true,
|
|
21
|
+
},
|
|
22
|
+
]
|
|
23
|
+
return tabs
|
|
24
|
+
}
|
package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table-view">
|
|
3
|
+
<div>
|
|
4
|
+
<atoms-table-data-grid
|
|
5
|
+
v-model:selected-row="selectedHostsIdLocal"
|
|
6
|
+
v-model:page-size="pagination.pageSize"
|
|
7
|
+
v-model:page="pagination.page"
|
|
8
|
+
type="checkbox"
|
|
9
|
+
class="data-table"
|
|
10
|
+
test-id="accessibility-table"
|
|
11
|
+
:head-items="headItems"
|
|
12
|
+
:body-items="bodyItems"
|
|
13
|
+
:total-items="props.totalItems"
|
|
14
|
+
:total-pages="props.totalPages"
|
|
15
|
+
:items-per-page="itemsPerPage"
|
|
16
|
+
:loading="loading"
|
|
17
|
+
>
|
|
18
|
+
<template #icon="{ item }">
|
|
19
|
+
<span :class="['datagrid-cell-icon', item.data.iconClassName]" />
|
|
20
|
+
<span class="text-ellipsis">
|
|
21
|
+
{{ item.text }}
|
|
22
|
+
</span>
|
|
23
|
+
</template>
|
|
24
|
+
</atoms-table-data-grid>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<script lang="ts" setup>
|
|
30
|
+
import type {
|
|
31
|
+
UI_I_HeadItem,
|
|
32
|
+
UI_I_BodyItem,
|
|
33
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
34
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
35
|
+
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
36
|
+
import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
|
|
37
|
+
import type { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
|
|
38
|
+
import {
|
|
39
|
+
I_CompatibleHostsTable,
|
|
40
|
+
I_IncompatibleHostsTable,
|
|
41
|
+
} from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
|
|
42
|
+
import * as compatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable'
|
|
43
|
+
import * as incompatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/incompatibleTable'
|
|
44
|
+
|
|
45
|
+
const props = defineProps<{
|
|
46
|
+
dataTable: I_CompatibleHostsTable[] | I_IncompatibleHostsTable[]
|
|
47
|
+
tableType: T_HostsAccessibilityTab
|
|
48
|
+
totalItems: number
|
|
49
|
+
totalPages: number
|
|
50
|
+
}>()
|
|
51
|
+
const selectedHostsIdLocal = defineModel<string[]>()
|
|
52
|
+
|
|
53
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
+
|
|
55
|
+
const loading = computed<boolean>(() => false)
|
|
56
|
+
|
|
57
|
+
const pagination = ref<UI_I_Pagination>({
|
|
58
|
+
page: 1,
|
|
59
|
+
pageSize: 1,
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
const tables: any = {
|
|
63
|
+
'compatible-hosts': compatibleTable,
|
|
64
|
+
'incompatible-hosts': incompatibleTable,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
68
|
+
tables[props.tableType].headItems(localization.value)
|
|
69
|
+
)
|
|
70
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
71
|
+
return tables[props.tableType].bodyItems(props.dataTable)
|
|
72
|
+
})
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<style lang="scss" scoped>
|
|
76
|
+
.data-table-view {
|
|
77
|
+
height: inherit;
|
|
78
|
+
.data-table {
|
|
79
|
+
height: inherit;
|
|
80
|
+
:deep(.datagrid-outer-wrapper) {
|
|
81
|
+
height: inherit;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
</style>
|
|
@@ -0,0 +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 { 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, '300px', compatibleHostsTableKeys[0]],
|
|
19
|
+
[localization.cluster, true, '300px', 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
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
35
|
+
data.forEach((item: I_CompatibleHostsTable, key) => {
|
|
36
|
+
const hostData = {
|
|
37
|
+
// @ts-ignore
|
|
38
|
+
iconClassName: `vsphere-icon-${hostIconByState[item.state]}`,
|
|
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
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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 { I_IncompatibleHostsTable } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
|
|
7
|
+
import { E_NodeIconsByState } from '~/lib/models/enums'
|
|
8
|
+
import { incompatibleHostsTableKeys } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/tableKeys'
|
|
9
|
+
import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
10
|
+
|
|
11
|
+
const getItems = (
|
|
12
|
+
localization: UI_I_Localization
|
|
13
|
+
): [string, boolean, string, string][] => {
|
|
14
|
+
return [
|
|
15
|
+
[localization.host, true, 'auto', incompatibleHostsTableKeys[0]],
|
|
16
|
+
[
|
|
17
|
+
localization.hostIncompatibilityReason,
|
|
18
|
+
true,
|
|
19
|
+
'auto',
|
|
20
|
+
incompatibleHostsTableKeys[1],
|
|
21
|
+
],
|
|
22
|
+
[localization.cluster, true, 'auto', incompatibleHostsTableKeys[2]],
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
|
|
27
|
+
const result: UI_I_HeadItem[] = []
|
|
28
|
+
getItems(localization).forEach((item, i) => {
|
|
29
|
+
const col = i === 0 || i === 2 ? 'icon' : `col${i}`
|
|
30
|
+
result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
|
|
31
|
+
})
|
|
32
|
+
return result
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const bodyItems = (
|
|
36
|
+
data: I_IncompatibleHostsTable[]
|
|
37
|
+
): UI_I_BodyItem[][] => {
|
|
38
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
39
|
+
data.forEach((item: I_IncompatibleHostsTable, key) => {
|
|
40
|
+
const hostData = {
|
|
41
|
+
iconClassName: E_NodeIconsByState.host_Normal,
|
|
42
|
+
}
|
|
43
|
+
const clusterData = {
|
|
44
|
+
iconClassName: E_NodeIconsByState.host_Normal,
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
bodyItems.push([
|
|
48
|
+
{
|
|
49
|
+
key: 'icon',
|
|
50
|
+
text: item[incompatibleHostsTableKeys[0]],
|
|
51
|
+
data: hostData,
|
|
52
|
+
id: key,
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: 'col1',
|
|
56
|
+
text: item[incompatibleHostsTableKeys[1]],
|
|
57
|
+
id: key,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
key: 'icon',
|
|
61
|
+
text: item[incompatibleHostsTableKeys[2]],
|
|
62
|
+
data: clusterData,
|
|
63
|
+
id: key,
|
|
64
|
+
},
|
|
65
|
+
])
|
|
66
|
+
})
|
|
67
|
+
return bodyItems
|
|
68
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
T_CompatibleHostsTableKeys,
|
|
3
|
+
T_IncompatibleHostsTableKeys,
|
|
4
|
+
} from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
|
|
5
|
+
|
|
6
|
+
export const compatibleHostsTableKeys: T_CompatibleHostsTableKeys[] = [
|
|
7
|
+
'host',
|
|
8
|
+
'cluster',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
export const incompatibleHostsTableKeys: T_IncompatibleHostsTableKeys[] = [
|
|
12
|
+
'host',
|
|
13
|
+
'cluster',
|
|
14
|
+
'host_incompatibility_reason',
|
|
15
|
+
]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface UI_I_CompatibleHostsTableItem {
|
|
4
|
+
id: string
|
|
5
|
+
host: string
|
|
6
|
+
cluster: string
|
|
7
|
+
state: 0 | 1 | 2 | 3
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface UI_I_CreateDatastoreHosts
|
|
11
|
+
extends API_UI_I_DataTable<UI_I_CompatibleHostsTableItem[]> {}
|