bfg-common 1.3.440 → 1.3.442

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.
Files changed (56) hide show
  1. package/components/common/vm/actions/editSettings/EditSettings.vue +30 -30
  2. package/components/common/wizards/datastoreNew/add/Add.vue +611 -0
  3. package/components/common/wizards/datastoreNew/add/lib/config/stepItems.ts +191 -0
  4. package/components/common/wizards/datastoreNew/add/lib/config/steps.ts +202 -0
  5. package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +38 -0
  6. package/components/common/wizards/datastoreNew/add/lib/models/types.ts +14 -0
  7. package/components/common/wizards/datastoreNew/add/lib/utils.ts +72 -0
  8. package/components/common/wizards/datastoreNew/add/local/Local.vue +44 -0
  9. package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +129 -0
  10. package/components/common/wizards/datastoreNew/add/local/createName/lib/config/defaultForm.ts +15 -0
  11. package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +99 -0
  12. package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +104 -0
  13. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +24 -0
  14. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +9 -0
  15. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +5 -0
  16. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +142 -0
  17. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  18. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -0
  19. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  20. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  21. package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +385 -0
  22. package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/config/defaultForm.ts +33 -0
  23. package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +12 -0
  24. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/DeletePopover.vue +100 -0
  25. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/ServersList.vue +124 -0
  26. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/serversListConfig.ts +41 -0
  27. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/tableKeys.ts +3 -0
  28. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/interfaces.ts +11 -0
  29. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/types.ts +1 -0
  30. package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +55 -0
  31. package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  32. package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +42 -0
  33. package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +20 -0
  34. package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +88 -0
  35. package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +175 -0
  36. package/components/common/wizards/datastoreNew/add/readyComplete/lib/models/interfaces.ts +4 -0
  37. package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +90 -0
  38. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +424 -0
  39. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/defaultForm.ts +18 -0
  40. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +14 -0
  41. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +58 -0
  42. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +14 -0
  43. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/Table.vue +134 -0
  44. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable.ts +87 -0
  45. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +11 -0
  46. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +232 -0
  47. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +64 -0
  48. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +46 -0
  49. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +225 -0
  50. package/components/common/wizards/datastoreNew/add/sharedStorm/version/Version.vue +39 -0
  51. package/components/common/wizards/datastoreNew/add/sharedStorm/version/lib/config/versionOptions.ts +21 -0
  52. package/components/common/wizards/datastoreNew/add/types/Types.vue +71 -0
  53. package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +49 -0
  54. package/lib/models/interfaces.ts +1 -0
  55. package/lib/utils/sendTask.ts +2 -1
  56. package/package.json +1 -1
@@ -0,0 +1,15 @@
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+
3
+ export const defaultFormFunc = (localization: UI_I_Localization): any => {
4
+ return {
5
+ name: {
6
+ value: '',
7
+ validations: [
8
+ {
9
+ value: 'required',
10
+ errorText: localization.specifyDatastoreName,
11
+ },
12
+ ],
13
+ },
14
+ }
15
+ }
@@ -0,0 +1,99 @@
1
+ <template>
2
+ <div class="nfs-container">
3
+ <common-wizards-datastore-add-nfs-version
4
+ v-show="props.stepId === 4"
5
+ v-model:version="nfsVersion"
6
+ />
7
+
8
+ <common-wizards-datastore-add-nfs-configuration
9
+ v-show="props.stepId === 5"
10
+ :mode="props.mode"
11
+ :nfs-version="nfsVersion"
12
+ :nfs-configuration-submit="nfsConfigurationSubmit"
13
+ @loading="(e) => emits('loading', e)"
14
+ @next="onChangeConfigurationAndNext"
15
+ />
16
+
17
+ <!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
18
+ <!-- v-show="nfsVersion === 'nfs-4.1' && props.stepPosition === 3"-->
19
+ <!-- :nfs-version="nfsVersion"-->
20
+ <!-- />--><!-- TODO Он будет когда будем делать групповое -->
21
+
22
+ <common-wizards-datastore-add-nfs-accessibility
23
+ v-if="showHostAccessibility"
24
+ :host-accessibility-submit="props.hostAccessibilitySubmit"
25
+ :hosts="props.hosts"
26
+ @next="onChangeAccessibilityAndNext"
27
+ />
28
+ <!-- TODO Он будет когда будем делать групповое -->
29
+ </div>
30
+ </template>
31
+
32
+ <script lang="ts" setup>
33
+ import { UI_I_Localization } from '~/lib/models/interfaces'
34
+ import {
35
+ UI_T_DatastoreType,
36
+ UI_T_NfsType,
37
+ UI_T_WizardDatastoreMode,
38
+ } from '~/components/common/wizards/datastore/add/lib/models/types'
39
+ import { UI_I_ConfigurationSendDataNfs } from '~/components/common/wizards/datastore/add/nfs/configuration/lib/models/interfaces'
40
+
41
+ const props = defineProps<{
42
+ mode: UI_T_WizardDatastoreMode
43
+ stepId: number
44
+ datastoreType: UI_T_DatastoreType
45
+ nfsConfigurationSubmit: number
46
+ hostAccessibilitySubmit: number
47
+ hosts?: any
48
+ }>()
49
+ const emits = defineEmits<{
50
+ (event: 'loading', value: boolean): void
51
+ (event: 'submit', value: UI_I_ConfigurationSendDataNfs): void
52
+ (event: 'change-nfs-version', value: UI_T_NfsType): void
53
+ }>()
54
+
55
+ const localization = computed<UI_I_Localization>(() => useLocal())
56
+
57
+ const nfsVersion = ref<UI_T_NfsType>('nfs-3')
58
+
59
+ // const showHostAccessibility = computed<boolean>(() => {
60
+ // return (
61
+ // (props.stepPosition === 4 && nfsVersion.value === 'nfs-4.1') ||
62
+ // (props.stepPosition === 3 && nfsVersion.value === 'nfs-3')
63
+ // )
64
+ // })
65
+ const showHostAccessibility = computed<boolean>(() => {
66
+ return props.mode === 'sphere' && props.stepId === 6
67
+ })
68
+
69
+ watch(nfsVersion, (newValue: UI_T_NfsType) => {
70
+ emits('change-nfs-version', newValue)
71
+ })
72
+
73
+ let sendData: any = null
74
+ const onChangeConfigurationAndNext = (
75
+ event: UI_I_ConfigurationSendDataNfs
76
+ ): void => {
77
+ sendData = {
78
+ name: event.name,
79
+ folder: event.folder,
80
+ server: event.server,
81
+ hosts: [],
82
+ }
83
+ emits('submit', sendData)
84
+ }
85
+ const onChangeAccessibilityAndNext = (hosts: string[]): void => {
86
+ sendData.hosts = hosts
87
+ emits('submit', sendData)
88
+ }
89
+ </script>
90
+
91
+ <style lang="scss" scoped>
92
+ @import '~/assets/scss/common/mixins.scss';
93
+ .nfs-container {
94
+ @include flex($dir: column);
95
+ height: 100%;
96
+ &__desc {
97
+ }
98
+ }
99
+ </style>
@@ -0,0 +1,104 @@
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="selectedHosts"
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 { UI_I_Pagination } from '~/lib/models/table/interfaces'
38
+ import { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
39
+ import { hostAccessibilityTabsFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/config/tabsPannel'
40
+ // import { hostsAccessibilityTablesFunc } from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/hostsTableItems'
41
+
42
+ const props = defineProps<{
43
+ hostAccessibilitySubmit: number
44
+ hosts?: any
45
+ }>()
46
+ const localization = computed<UI_I_Localization>(() => useLocal())
47
+ const emits = defineEmits<{
48
+ (event: 'next', value: string[]): void
49
+ }>()
50
+
51
+ const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
52
+ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
53
+ hostAccessibilityTabsFunc(localization.value, [
54
+ (props.hosts?.items?.length || 0) + '',
55
+ '0',
56
+ ])
57
+ )
58
+
59
+ // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
60
+ // TODO refactoring
61
+ const dataTable = computed<any>(() => props.hosts)
62
+
63
+ const pagination = ref<UI_I_Pagination>({
64
+ page: 1,
65
+ pageSize: 35,
66
+ })
67
+ const sort = ref<string | null>(null)
68
+
69
+ const selectedHosts = ref<string[]>([])
70
+
71
+ const updatePagination = (event: UI_I_Pagination): void => {
72
+ pagination.value = event
73
+ }
74
+ const sortTable = (event: string): void => {
75
+ sort.value = event
76
+ }
77
+
78
+ const errors = ref<string[]>([])
79
+
80
+ const showValidationErrors = (text: string): void => {
81
+ errors.value = [text]
82
+ }
83
+ const removeValidationErrors = (): void => {
84
+ errors.value = []
85
+ }
86
+ const submit = async () => {
87
+ if (!selectedHosts.value.length) {
88
+ const text = localization.value.selectLeastEntityContinue
89
+ showValidationErrors(text)
90
+ return
91
+ }
92
+
93
+ removeValidationErrors()
94
+ emits('next', selectedHosts.value)
95
+ }
96
+ watch(
97
+ () => props.hostAccessibilitySubmit,
98
+ () => {
99
+ submit()
100
+ }
101
+ )
102
+ </script>
103
+
104
+ <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
+ }
@@ -0,0 +1,9 @@
1
+ export interface I_CompatibleHostsTable {
2
+ id: number,
3
+ host: string,
4
+ cluster: string
5
+ }
6
+
7
+ export interface I_IncompatibleHostsTable extends I_CompatibleHostsTable{
8
+ host_incompatibility_reason: string
9
+ }
@@ -0,0 +1,5 @@
1
+ export type T_HostsAccessibilityTab = 'compatible-hosts' | 'incompatible-hosts'
2
+
3
+ export type T_CompatibleHostsTableKeys = 'host' | 'cluster'
4
+
5
+ export type T_IncompatibleHostsTableKeys = 'host' | 'cluster' | 'host_incompatibility_reason'
@@ -0,0 +1,142 @@
1
+ <template>
2
+ <div class="data-table-view">
3
+ <div>
4
+ <atoms-table-data-grid
5
+ v-model:selected-row="selected"
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
+ @filtering="filtering"
18
+ @sorting="sorting"
19
+ >
20
+ <template #icon="{ item }">
21
+ <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
22
+ <span class="text-ellipsis">
23
+ {{ item.text }}
24
+ </span>
25
+ </template>
26
+ </atoms-table-data-grid>
27
+ </div>
28
+ </div>
29
+ </template>
30
+
31
+ <script lang="ts" setup>
32
+ import {
33
+ UI_I_HeadItem,
34
+ UI_I_BodyItem,
35
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
36
+ import { UI_I_Localization } from '~/lib/models/interfaces'
37
+ import { UI_I_Pagination } from '~/lib/models/table/interfaces'
38
+ import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
39
+ import { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
40
+ import {
41
+ I_CompatibleHostsTable,
42
+ I_IncompatibleHostsTable,
43
+ } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
44
+ import * as compatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/compatibleTable'
45
+ import * as incompatibleTable from '~/components/common/wizards/datastore/add/nfs/accessibility/tablesView/lib/config/incompatibleTable'
46
+
47
+ const props = defineProps<{
48
+ dataTable: I_CompatibleHostsTable[] | I_IncompatibleHostsTable[]
49
+ selectedRow: number[]
50
+ tableType: T_HostsAccessibilityTab
51
+ totalItems: number
52
+ totalPages: number
53
+ pagination: UI_I_Pagination
54
+ }>()
55
+ const emits = defineEmits<{
56
+ (event: 'update:selected-row', value: number[]): void
57
+ (event: 'pagination', value: UI_I_Pagination): void
58
+ (event: 'sort', value: string): void
59
+ }>()
60
+
61
+ const localization = computed<UI_I_Localization>(() => useLocal())
62
+
63
+ const loading = computed<boolean>(() => false)
64
+
65
+ const selected = computed<number[]>({
66
+ get() {
67
+ return props.selectedRow
68
+ },
69
+ set(value) {
70
+ emits('update:selected-row', value)
71
+ },
72
+ })
73
+
74
+ const filtering = (e: [string, string][]): void => {
75
+ console.log(e, 111)
76
+ }
77
+ const sorting = (e: [number, boolean]): void => {
78
+ const [column, status] = e
79
+ const direction = status ? 'desc' : 'asc'
80
+
81
+ const sort = `${column}.${direction}`
82
+
83
+ emits('sort', sort)
84
+ }
85
+
86
+ const pagination = ref<UI_I_Pagination>({
87
+ page: 1,
88
+ pageSize: 1,
89
+ })
90
+ watch(
91
+ () => props.pagination,
92
+ (newValue) => {
93
+ pagination.value = newValue
94
+ },
95
+ { immediate: true }
96
+ )
97
+ watch(
98
+ pagination,
99
+ (newValue) => {
100
+ emits('pagination', newValue)
101
+ },
102
+ { deep: true, immediate: true }
103
+ )
104
+ interface TablesView {
105
+ 'compatible-hosts': any
106
+ 'incompatible-hosts': any
107
+ }
108
+ const tables: TablesView = {
109
+ 'compatible-hosts': compatibleTable,
110
+ 'incompatible-hosts': incompatibleTable,
111
+ }
112
+
113
+ const headItems = computed<UI_I_HeadItem[]>(() =>
114
+ tables[props.tableType].headItems(localization.value)
115
+ )
116
+
117
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
118
+ watch(
119
+ () => props.dataTable,
120
+ (newValue) => {
121
+ if (!newValue?.length) {
122
+ bodyItems.value = []
123
+ return
124
+ }
125
+
126
+ bodyItems.value = tables[props.tableType].bodyItems(newValue)
127
+ },
128
+ { deep: true, immediate: true }
129
+ )
130
+ </script>
131
+
132
+ <style lang="scss" scoped>
133
+ .data-table-view {
134
+ height: inherit;
135
+ .data-table {
136
+ height: inherit;
137
+ :deep(.datagrid-outer-wrapper) {
138
+ height: inherit;
139
+ }
140
+ }
141
+ }
142
+ </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,53 @@
1
+ import {
2
+ I_CompatibleHostsTable,
3
+ I_IncompatibleHostsTable,
4
+ } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces'
5
+ import { T_HostsAccessibilityTab } from '~/components/common/wizards/datastore/add/nfs/accessibility/lib/models/types'
6
+ import { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
7
+
8
+ const compatibleHostsTable: API_UI_I_DataTable<I_CompatibleHostsTable[]> = {
9
+ items: [
10
+ {
11
+ id: 1,
12
+ host: 'esxi0.иридиум',
13
+ cluster: 'Cluster00',
14
+ },
15
+ {
16
+ id: 2,
17
+ host: ' esxi0.иридиум',
18
+ cluster: 'Cluster00',
19
+ },
20
+ {
21
+ id: 3,
22
+ host: 'esxi3.иридиум',
23
+ cluster: 'Cluster00',
24
+ },
25
+ {
26
+ id: 4,
27
+ host: 'esxi4.иридиум',
28
+ cluster: 'Cluster00',
29
+ },
30
+ {
31
+ id: 5,
32
+ host: 'esxi1.иридиум',
33
+ cluster: 'Cluster01',
34
+ },
35
+ ],
36
+ total_items: 5,
37
+ total_pages: 1,
38
+ }
39
+ const incompatibleHostsTable: API_UI_I_DataTable<I_IncompatibleHostsTable[]> = {
40
+ items: [],
41
+ total_items: 0,
42
+ total_pages: 1,
43
+ }
44
+
45
+ export { incompatibleHostsTable, compatibleHostsTable }
46
+ export const hostsAccessibilityTablesFunc = (type: T_HostsAccessibilityTab) => {
47
+ const hostItems = {
48
+ 'compatible-hosts': compatibleHostsTable,
49
+ 'incompatible-hosts': incompatibleHostsTable,
50
+ }
51
+
52
+ return hostItems[type]
53
+ }
@@ -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
+ ]