bfg-common 1.5.76 → 1.5.78

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 (32) hide show
  1. package/components/common/wizards/datastore/add/Add.vue +11 -20
  2. package/components/common/wizards/datastore/add/New.vue +24 -45
  3. package/components/common/wizards/datastore/add/Old.vue +29 -16
  4. package/components/common/wizards/datastore/add/lib/config/steps.ts +18 -15
  5. package/components/common/wizards/datastore/add/lib/validations.ts +29 -13
  6. package/components/common/wizards/datastore/add/nfs/Nfs.vue +0 -5
  7. package/components/common/wizards/datastore/add/{nfs/version/Version.vue → steps/_nfsVersion/NfsVersion.vue} +1 -0
  8. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibility.vue +60 -0
  9. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityNew.vue +27 -0
  10. package/components/common/wizards/datastore/add/steps/hostAccessibility/HostAccessibilityOld.vue +60 -0
  11. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/config/tabsPannel.ts +31 -0
  12. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/interfaces.ts +9 -0
  13. package/components/common/wizards/datastore/add/steps/hostAccessibility/lib/models/types.ts +5 -0
  14. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/TablesView.vue +85 -0
  15. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  16. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  17. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/config/tableKeys.ts +15 -0
  18. package/components/common/wizards/datastore/add/steps/hostAccessibility/tablesView/lib/models/interfaces.ts +11 -0
  19. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +95 -0
  20. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +123 -0
  21. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +234 -0
  22. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/DeletePopover.vue +100 -0
  23. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/ServersList.vue +123 -0
  24. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/config/serversListConfig.ts +40 -0
  25. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/config/tableKeys.ts +3 -0
  26. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/models/interfaces.ts +3 -0
  27. package/components/common/wizards/datastore/add/steps/nameAndConfigure/_serversList/lib/models/types.ts +1 -0
  28. package/components/common/wizards/datastore/add/steps/nameAndConfigure/lib/models/interfaces.ts +5 -0
  29. package/package.json +1 -1
  30. package/components/common/wizards/datastore/add/readyComplete/ReadyComplete.vue +0 -92
  31. package/components/common/wizards/datastore/add/readyComplete/lib/config/propertiesDetails.ts +0 -142
  32. /package/components/common/wizards/datastore/add/{nfs/version → steps/_nfsVersion}/lib/config/versionOptions.ts +0 -0
@@ -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
+ hide-page-size
16
+ :loading="loading"
17
+ server-off
18
+ >
19
+ <template #icon="{ item }">
20
+ <span :class="['datagrid-cell-icon', item.data.iconClassName]" />
21
+ <span class="text-ellipsis">
22
+ {{ item.text }}
23
+ </span>
24
+ </template>
25
+ </atoms-table-data-grid>
26
+ </div>
27
+ </div>
28
+ </template>
29
+
30
+ <script lang="ts" setup>
31
+ import type {
32
+ UI_I_HeadItem,
33
+ UI_I_BodyItem,
34
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
35
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
36
+ import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
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[]> {}
@@ -0,0 +1,95 @@
1
+ <template>
2
+ <common-wizards-datastore-add-steps-name-and-configure-new
3
+ v-if="isNewView"
4
+ v-model="formModel"
5
+ v-model:alert-info="isShowAlertInfo"
6
+ :messages-fields="props.messagesFields"
7
+ />
8
+
9
+ <common-wizards-datastore-add-steps-name-and-configure-old
10
+ v-else
11
+ v-model="formModel"
12
+ v-model:alert-info="isShowAlertInfo"
13
+ :alert-messages="props.alertMessages"
14
+ :messages-fields="props.messagesFields"
15
+ @hide-alert="(e) => emits('hide-alert', e)"
16
+ />
17
+ </template>
18
+
19
+ <script lang="ts" setup>
20
+ import type { UI_T_Project } from '~/lib/models/types'
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
23
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
24
+
25
+ const formModel = defineModel<UI_I_CreateDatastoreForm>({ required: true })
26
+ const props = defineProps<{
27
+ project: UI_T_Project
28
+ alertMessages: string[]
29
+ messagesFields: UI_I_WizardStep['fields']
30
+ }>()
31
+ const emits = defineEmits<{
32
+ (event: 'hide-alert', value: number): void
33
+ }>()
34
+
35
+ const localization = computed<UI_I_Localization>(() => useLocal())
36
+ const { $store }: any = useNuxtApp()
37
+
38
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
39
+
40
+ const isShowAlertInfo = ref<boolean>(props.project === 'procurator')
41
+ </script>
42
+
43
+ <style lang="scss" scoped>
44
+ @import '~/assets/scss/common/mixins.scss';
45
+ .configuration {
46
+ @include flex($dir: column, $just: space-between);
47
+ height: 100%;
48
+ & > h6 {
49
+ font-weight: 500;
50
+ font-size: 14px;
51
+ padding-top: 6px;
52
+ }
53
+
54
+ &__alert-info {
55
+ :deep(.alert-text) {
56
+ font-size: 11px;
57
+ letter-spacing: normal;
58
+ }
59
+ }
60
+ .clr-form-control {
61
+ margin-top: 0;
62
+ display: flex;
63
+ flex-direction: row;
64
+
65
+ .clr-control-container {
66
+ min-height: 48px;
67
+ &.clr-error {
68
+ .clr-subtext,
69
+ .error-icon {
70
+ display: block;
71
+ }
72
+ }
73
+ .error-icon {
74
+ display: none;
75
+ }
76
+ .error-icon {
77
+ fill: #db2100;
78
+ width: 24px;
79
+ height: 24px;
80
+ }
81
+ }
82
+ }
83
+ &__servers-list {
84
+ height: 170px;
85
+ }
86
+ }
87
+ .flex-align-center {
88
+ &.input-action-wrapper {
89
+ width: 260px;
90
+ }
91
+ input {
92
+ width: 210px;
93
+ }
94
+ }
95
+ </style>
@@ -0,0 +1,123 @@
1
+ <template>
2
+ <div class="basics-step">
3
+ <div class="basics-step-row">
4
+ <div class="basics-step-row-title">
5
+ <span class="basics-step-row-title-text">
6
+ {{ localization.common.name }}
7
+ </span>
8
+ </div>
9
+ <div class="basics-step-row-content">
10
+ <ui-input
11
+ id="name"
12
+ v-model="formModelLocal.name"
13
+ test-id="new-host-name-field"
14
+ :placeholder="localization.common.hostNameOrIPAddress"
15
+ is-focused
16
+ :error="errorText"
17
+ @input="onRemoveValidationErrors"
18
+ />
19
+ </div>
20
+ </div>
21
+
22
+ <div class="basics-step-line"></div>
23
+
24
+ {{ isShowAlertInfo }}
25
+ </div>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
30
+ import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
31
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastore/add/lib/models/interfaces'
32
+
33
+ const formModelLocal = defineModel<UI_I_CreateDatastoreForm>({ required: true })
34
+ const isShowAlertInfo = defineModel<boolean>('alertInfo', { required: true })
35
+
36
+ const props = defineProps<{
37
+ messagesFields: UI_I_WizardStep['fields']
38
+ }>()
39
+ const emits = defineEmits<{
40
+ (event: 'remove-errors'): void
41
+ }>()
42
+
43
+ const localization = computed<UI_I_Localization>(() => useLocal())
44
+
45
+ const onRemoveValidationErrors = (): void => {
46
+ emits('remove-errors')
47
+ }
48
+ </script>
49
+
50
+ <style scoped lang="scss">
51
+ .basics-step {
52
+ padding: 16px 0 16px;
53
+
54
+ &-row {
55
+ min-height: 36px;
56
+ width: 100%;
57
+ display: flex;
58
+ column-gap: 16px;
59
+ align-items: center;
60
+
61
+ &-title {
62
+ padding-top: 8px;
63
+ max-width: 240px;
64
+ width: 100%;
65
+ display: flex;
66
+ align-items: center;
67
+ column-gap: 8px;
68
+ font-weight: 400;
69
+ font-size: 13px;
70
+ line-height: 20px;
71
+ letter-spacing: 0;
72
+ vertical-align: middle;
73
+ align-self: flex-start;
74
+ color: var(--wizard-content-title);
75
+ white-space: nowrap;
76
+ text-overflow: ellipsis;
77
+ overflow: hidden;
78
+
79
+ &-text {
80
+ display: block;
81
+ white-space: nowrap;
82
+ text-overflow: ellipsis;
83
+ overflow: hidden;
84
+ }
85
+ }
86
+
87
+ &-content {
88
+ max-width: 480px;
89
+ width: 100%;
90
+ font-weight: 400;
91
+ font-size: 13px;
92
+ line-height: 20px;
93
+ letter-spacing: 0;
94
+ vertical-align: middle;
95
+ color: var(--wizard-content-value);
96
+
97
+ &-text {
98
+ display: flex;
99
+ column-gap: 8px;
100
+ align-items: center;
101
+
102
+ &-icon {
103
+ width: 20px;
104
+ min-width: 20px;
105
+ height: 20px;
106
+ min-height: 20px;
107
+ }
108
+ }
109
+
110
+ &-switch-container {
111
+ width: fit-content;
112
+ }
113
+ }
114
+ }
115
+
116
+ &-line {
117
+ height: 0;
118
+ width: 100%;
119
+ border-bottom: 1px solid var(--wizard-content-line);
120
+ margin: 16px 0;
121
+ }
122
+ }
123
+ </style>