bfg-common 1.3.497 → 1.3.498

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 (49) hide show
  1. package/components/common/vm/actions/editSettings/EditSettings.vue +16 -16
  2. package/components/common/wizards/datastoreNew/add/Add.vue +487 -0
  3. package/components/common/wizards/datastoreNew/add/lib/config/steps.ts +135 -0
  4. package/components/common/wizards/datastoreNew/add/lib/models/enums.ts +5 -0
  5. package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +12 -0
  6. package/components/common/wizards/datastoreNew/add/lib/models/types.ts +7 -0
  7. package/components/common/wizards/datastoreNew/add/lib/utils.ts +31 -0
  8. package/components/common/wizards/datastoreNew/add/local/Local.vue +44 -0
  9. package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +116 -0
  10. package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +67 -0
  11. package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +80 -0
  12. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +24 -0
  13. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +9 -0
  14. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +5 -0
  15. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +117 -0
  16. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  17. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  18. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  19. package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +293 -0
  20. package/components/common/wizards/datastoreNew/add/nfs/configuration/lib/models/interfaces.ts +5 -0
  21. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/DeletePopover.vue +100 -0
  22. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/ServersList.vue +124 -0
  23. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/serversListConfig.ts +41 -0
  24. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/config/tableKeys.ts +3 -0
  25. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/interfaces.ts +3 -0
  26. package/components/common/wizards/datastoreNew/add/nfs/configuration/serversList/lib/models/types.ts +1 -0
  27. package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +55 -0
  28. package/components/common/wizards/datastoreNew/add/nfs/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  29. package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +26 -0
  30. package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +20 -0
  31. package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +88 -0
  32. package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +183 -0
  33. package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +85 -0
  34. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +350 -0
  35. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +14 -0
  36. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +53 -0
  37. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +8 -0
  38. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/Table.vue +134 -0
  39. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable.ts +87 -0
  40. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +11 -0
  41. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +232 -0
  42. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +64 -0
  43. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +46 -0
  44. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +225 -0
  45. package/components/common/wizards/datastoreNew/add/sharedStorm/version/Version.vue +39 -0
  46. package/components/common/wizards/datastoreNew/add/sharedStorm/version/lib/config/versionOptions.ts +21 -0
  47. package/components/common/wizards/datastoreNew/add/types/Types.vue +77 -0
  48. package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +49 -0
  49. package/package.json +1 -1
@@ -0,0 +1,7 @@
1
+ export type UI_T_DatastoreType = 'local' | 'shared-storm' | 'nfs'
2
+ export type UI_T_NfsType = 'nfs-3' | 'nfs-4.1'
3
+ export type UI_T_VmfsType = 'vmfs-6' | 'vmfs-5'
4
+ export type UI_T_KerberosAuthentication =
5
+ | 'dont-use'
6
+ | 'use-only-krb5'
7
+ | 'use-integrity'
@@ -0,0 +1,31 @@
1
+ import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
+ import Wizard from '~/components/atoms/wizard/lib/utils/utils'
4
+
5
+ export const checkValidityName = async (
6
+ name: string,
7
+ wizard: Wizard,
8
+ project: UI_T_Project,
9
+ sendMessage: (message: string) => void,
10
+ ): Promise<void> => {
11
+ // TODO move to projects!!!
12
+
13
+ wizard.setLoader(true)
14
+ const kind = 10 // TODO move in global space
15
+ const url =
16
+ project === 'procurator'
17
+ ? `/ui/ds/validate?name=${name}`
18
+ : `/ui/object/validate_name?name=${name}&kind=${kind}`
19
+ // @ts-ignore
20
+ const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
21
+ method: 'GET',
22
+ })
23
+ wizard.setLoader(false)
24
+
25
+ if (error.value && error.value.data.error_code !== 0) {
26
+ const existError = error.value.data?.error_message || error.value.data
27
+ sendMessage(existError)
28
+ return
29
+ }
30
+ sendMessage('')
31
+ }
@@ -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="datastore-creat-name"
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 ng-star-inserted">
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,80 @@
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
+ :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 type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
36
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
37
+ import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
38
+ import type { 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
+
41
+ const props = defineProps<{
42
+ alertMessages: string[]
43
+ hosts?: any
44
+ }>()
45
+ const modelHosts = defineModel<string[]>()
46
+ const emits = defineEmits<{
47
+ (event: 'hide-alert', value: number): void
48
+ }>()
49
+
50
+ const localization = computed<UI_I_Localization>(() => useLocal())
51
+
52
+ const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
53
+ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
54
+ hostAccessibilityTabsFunc(localization.value, [
55
+ (props.hosts?.items?.length || 0) + '',
56
+ '0',
57
+ ])
58
+ )
59
+
60
+ // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
61
+ // TODO refactoring
62
+ const dataTable = computed<any>(() => props.hosts)
63
+
64
+ const pagination = ref<UI_I_Pagination>({
65
+ page: 1,
66
+ pageSize: 35,
67
+ })
68
+ const sort = ref<string | null>(null)
69
+ const updatePagination = (event: UI_I_Pagination): void => {
70
+ pagination.value = event
71
+ }
72
+ const sortTable = (event: string): void => {
73
+ sort.value = event
74
+ }
75
+ const onHideAlert = (): void => {
76
+ emits('hide-alert', 6)
77
+ }
78
+ </script>
79
+
80
+ <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,117 @@
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
+ @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
+ tableType: T_HostsAccessibilityTab
50
+ totalItems: number
51
+ totalPages: number
52
+ pagination: UI_I_Pagination
53
+ }>()
54
+ const selectedHostsIdLocal = defineModel<string[]>()
55
+ const emits = defineEmits<{
56
+ (event: 'pagination', value: UI_I_Pagination): void
57
+ (event: 'sort', value: string): void
58
+ }>()
59
+
60
+ const localization = computed<UI_I_Localization>(() => useLocal())
61
+
62
+ const loading = computed<boolean>(() => false)
63
+ const filtering = (e: [string, string][]): void => {
64
+ console.log(e, 111)
65
+ }
66
+ const sorting = (e: [number, boolean]): void => {
67
+ const [column, status] = e
68
+ const direction = status ? 'desc' : 'asc'
69
+
70
+ const sort = `${column}.${direction}`
71
+
72
+ emits('sort', sort)
73
+ }
74
+
75
+ const pagination = ref<UI_I_Pagination>({
76
+ page: 1,
77
+ pageSize: 1,
78
+ })
79
+ watch(
80
+ () => props.pagination,
81
+ (newValue) => {
82
+ pagination.value = newValue
83
+ },
84
+ { immediate: true }
85
+ )
86
+ watch(
87
+ pagination,
88
+ (newValue) => {
89
+ emits('pagination', newValue)
90
+ },
91
+ { deep: true, immediate: true }
92
+ )
93
+
94
+ const tables: any = {
95
+ 'compatible-hosts': compatibleTable,
96
+ 'incompatible-hosts': incompatibleTable,
97
+ }
98
+
99
+ const headItems = computed<UI_I_HeadItem[]>(() =>
100
+ tables[props.tableType].headItems(localization.value)
101
+ )
102
+ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
103
+ return tables[props.tableType].bodyItems(props.dataTable)
104
+ })
105
+ </script>
106
+
107
+ <style lang="scss" scoped>
108
+ .data-table-view {
109
+ height: inherit;
110
+ .data-table {
111
+ height: inherit;
112
+ :deep(.datagrid-outer-wrapper) {
113
+ height: inherit;
114
+ }
115
+ }
116
+ }
117
+ </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
+ ]