bfg-common 1.4.46 → 1.4.48

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 (52) hide show
  1. package/components/common/wizards/datastore/add/nfs/accessibility/lib/models/interfaces.ts +4 -0
  2. package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +15 -6
  3. package/components/common/wizards/datastoreNew/add/Add.vue +464 -0
  4. package/components/common/wizards/datastoreNew/add/lib/config/steps.ts +135 -0
  5. package/components/common/wizards/datastoreNew/add/lib/models/enums.ts +5 -0
  6. package/components/common/wizards/datastoreNew/add/lib/models/interfaces.ts +12 -0
  7. package/components/common/wizards/datastoreNew/add/lib/models/types.ts +7 -0
  8. package/components/common/wizards/datastoreNew/add/lib/utils.ts +31 -0
  9. package/components/common/wizards/datastoreNew/add/local/Local.vue +44 -0
  10. package/components/common/wizards/datastoreNew/add/local/createName/CreateName.vue +116 -0
  11. package/components/common/wizards/datastoreNew/add/nfs/Nfs.vue +62 -0
  12. package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/KerberosAuthentication.vue +55 -0
  13. package/components/common/wizards/datastoreNew/add/nfs/_kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  14. package/components/common/wizards/datastoreNew/add/nfs/accessibility/Accessibility.vue +63 -0
  15. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/config/tabsPannel.ts +24 -0
  16. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/interfaces.ts +9 -0
  17. package/components/common/wizards/datastoreNew/add/nfs/accessibility/lib/models/types.ts +5 -0
  18. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/TablesView.vue +85 -0
  19. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  20. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  21. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  22. package/components/common/wizards/datastoreNew/add/nfs/accessibility/tablesView/lib/models/interfaces.ts +11 -0
  23. package/components/common/wizards/datastoreNew/add/nfs/configuration/Configuration.vue +236 -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 +123 -0
  26. package/components/common/wizards/datastoreNew/add/nfs/configuration/_serversList/lib/config/serversListConfig.ts +40 -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 +3 -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/configuration/lib/models/interfaces.ts +5 -0
  31. package/components/common/wizards/datastoreNew/add/nfs/version/Version.vue +26 -0
  32. package/components/common/wizards/datastoreNew/add/nfs/version/lib/config/versionOptions.ts +22 -0
  33. package/components/common/wizards/datastoreNew/add/readyComplete/ReadyComplete.vue +88 -0
  34. package/components/common/wizards/datastoreNew/add/readyComplete/lib/config/propertiesDetails.ts +140 -0
  35. package/components/common/wizards/datastoreNew/add/sharedStorm/SharedStorm.vue +83 -0
  36. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/DeviceSelection.vue +262 -0
  37. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/config/selectOptions.ts +23 -0
  38. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces.ts +48 -0
  39. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/types.ts +8 -0
  40. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/Table.vue +134 -0
  41. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/hostsTable.ts +87 -0
  42. package/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/table/lib/config/tableKeys.ts +11 -0
  43. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +236 -0
  44. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/graphicTooltip/graphicTooltip.vue +64 -0
  45. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/lib/config/selectOptions.ts +46 -0
  46. package/components/common/wizards/datastoreNew/add/sharedStorm/partitionConfiguration/sizeGraphic/sizeGraphic.vue +225 -0
  47. package/components/common/wizards/datastoreNew/add/sharedStorm/version/Version.vue +39 -0
  48. package/components/common/wizards/datastoreNew/add/sharedStorm/version/lib/config/versionOptions.ts +21 -0
  49. package/components/common/wizards/datastoreNew/add/types/Types.vue +78 -0
  50. package/components/common/wizards/datastoreNew/add/types/lib/config/typeOptions.ts +49 -0
  51. package/lib/models/interfaces.ts +1 -0
  52. 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,62 @@
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
+ <common-wizards-datastore-new-add-nfs-accessibility
18
+ v-if="showHostAccessibility"
19
+ v-model="model.hosts"
20
+ :alert-messages="props.alertMessages"
21
+ :hosts="props.hosts"
22
+ @hide-alert="(e) => emits('hide-alert', e)"
23
+ />
24
+ </div>
25
+ </template>
26
+
27
+ <script lang="ts" setup>
28
+ import type {
29
+ UI_I_Localization,
30
+ UI_I_ArbitraryObject,
31
+ } from '~/lib/models/interfaces'
32
+ import type { UI_T_Project } from '~/lib/models/types'
33
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
34
+
35
+ const props = defineProps<{
36
+ project: UI_T_Project
37
+ stepId: number
38
+ alertMessages: string[]
39
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
40
+ hosts?: any
41
+ }>()
42
+ const model = defineModel<any>()
43
+ const emits = defineEmits<{
44
+ (event: 'hide-alert', value: number): void
45
+ }>()
46
+
47
+ const localization = computed<UI_I_Localization>(() => useLocal())
48
+
49
+ const showHostAccessibility = computed<boolean>(() => {
50
+ return props.project === 'sphere' && props.stepId === 6
51
+ })
52
+ </script>
53
+
54
+ <style lang="scss" scoped>
55
+ @import '~/assets/scss/common/mixins.scss';
56
+ .nfs-container {
57
+ @include flex($dir: column);
58
+ height: inherit;
59
+ &__desc {
60
+ }
61
+ }
62
+ </style>
@@ -0,0 +1,55 @@
1
+ <template>
2
+ <div class="kerberos-auth">
3
+ <atoms-alert
4
+ v-show="isShowAlert"
5
+ test-id="kerberos-authentication"
6
+ status="alert-warning"
7
+ :items="[localization.common.kerberosAuthenticationAlert]"
8
+ @remove="isShowAlert = false"
9
+ />
10
+
11
+ <div class="kerberos-auth__inner">
12
+ <div v-for="item in kerberosTypes" :key="item.value" class="radio">
13
+ <input
14
+ :id="item.label"
15
+ v-model="kerberosType"
16
+ :data-id="item.testId"
17
+ type="radio"
18
+ :value="item.value"
19
+ />
20
+ <label :for="item.label">
21
+ {{ item.label }}
22
+ </label>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </template>
27
+
28
+ <script lang="ts" setup>
29
+ import { UI_I_Localization } from '~/lib/models/interfaces'
30
+ import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
31
+ import { UI_T_KerberosAuthentication } from '~/components/common/wizards/datastore/add/lib/models/types'
32
+ import { kerberosOptionsFunc } from '~/components/common/wizards/datastore/add/nfs/kerberosAuthentication/lib/config/radioOptions'
33
+
34
+ const localization = computed<UI_I_Localization>(() => useLocal())
35
+
36
+ const kerberosType = ref<UI_T_KerberosAuthentication>('dont-use')
37
+ const isShowAlert = ref<boolean>(true)
38
+
39
+ const kerberosTypes = readonly<UI_I_RadioOption[]>(
40
+ kerberosOptionsFunc(localization.value)
41
+ )
42
+ </script>
43
+
44
+ <style lang="scss" scoped>
45
+ .kerberos-auth {
46
+ &__inner {
47
+ margin-top: 12px;
48
+ }
49
+ }
50
+
51
+ input[type='radio']:focus:checked + label::before,
52
+ input[type='radio']:focus + label::before {
53
+ box-shadow: inset 0 0 0 0.25rem #0094d2;
54
+ }
55
+ </style>
@@ -0,0 +1,27 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
3
+
4
+ export const kerberosOptionsFunc = (
5
+ localization: UI_I_Localization
6
+ ): UI_I_RadioOption[] => {
7
+ return [
8
+ {
9
+ label: localization.common.dontUseKerberosAuthentication,
10
+ value: 'dont-use',
11
+ disabled: false,
12
+ testId: 'dont-use-value',
13
+ },
14
+ {
15
+ label: localization.common.useKerberosAuthenticationKrb5,
16
+ value: 'use-only-krb5',
17
+ disabled: false,
18
+ testId: 'use-only-krb5-value',
19
+ },
20
+ {
21
+ label: localization.common.useKerberosAuthenticationIntegrity,
22
+ value: 'use-integrity',
23
+ disabled: false,
24
+ testId: 'use-integrity-value',
25
+ },
26
+ ]
27
+ }
@@ -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 type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { 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.common.compatibleHosts.replace('{0}', compatibleHosts || ''),
14
+ value: 'compatible-hosts',
15
+ disabled: false,
16
+ },
17
+ {
18
+ text: localization.common.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,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 type {
2
+ UI_I_HeadItem,
3
+ UI_I_BodyItem,
4
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
6
+ import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
7
+ import type { 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.common.host, true, '300px', compatibleHostsTableKeys[0]],
19
+ [localization.common.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 type {
2
+ UI_I_HeadItem,
3
+ UI_I_BodyItem,
4
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
6
+ import type { 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.common.host, true, 'auto', incompatibleHostsTableKeys[0]],
16
+ [
17
+ localization.common.hostIncompatibilityReason,
18
+ true,
19
+ 'auto',
20
+ incompatibleHostsTableKeys[1],
21
+ ],
22
+ [localization.common.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 type {
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[]> {}