bfg-common 1.5.211 → 1.5.213

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 (92) hide show
  1. package/components/common/backup/lib/utils/getBackupOrBackupStorageId.ts +29 -0
  2. package/components/common/backup/storage/actions/add/Add.vue +36 -0
  3. package/components/common/backup/storage/actions/add/temp/Add.vue +508 -0
  4. package/components/common/backup/storage/actions/add/temp/lib/config/stepItems.ts +203 -0
  5. package/components/common/backup/storage/actions/add/temp/lib/models/interfaces.ts +58 -0
  6. package/components/common/backup/storage/actions/add/temp/lib/models/types.ts +14 -0
  7. package/components/common/backup/storage/actions/add/temp/lib/utils.ts +70 -0
  8. package/components/common/backup/storage/actions/add/temp/local/Local.vue +65 -0
  9. package/components/common/backup/storage/actions/add/temp/local/createName/CreateName.vue +158 -0
  10. package/components/common/backup/storage/actions/add/temp/local/createName/lib/config/defaultForm.ts +15 -0
  11. package/components/common/backup/storage/actions/add/temp/nfs/Nfs.vue +106 -0
  12. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/Accessibility.vue +104 -0
  13. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/config/tabsPannel.ts +25 -0
  14. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/interfaces.ts +9 -0
  15. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/types.ts +5 -0
  16. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/TablesView.vue +141 -0
  17. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  18. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -0
  19. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  20. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  21. package/components/common/backup/storage/actions/add/temp/nfs/configuration/Configuration.vue +469 -0
  22. package/components/common/backup/storage/actions/add/temp/nfs/configuration/lib/config/defaultForm.ts +51 -0
  23. package/components/common/backup/storage/actions/add/temp/nfs/configuration/lib/models/interfaces.ts +14 -0
  24. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/DeletePopover.vue +99 -0
  25. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/ServersList.vue +125 -0
  26. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/config/serversListConfig.ts +40 -0
  27. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/config/tableKeys.ts +3 -0
  28. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/models/interfaces.ts +13 -0
  29. package/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/models/types.ts +1 -0
  30. package/components/common/backup/storage/actions/add/temp/nfs/kerberosAuthentication/KerberosAuthentication.vue +55 -0
  31. package/components/common/backup/storage/actions/add/temp/nfs/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  32. package/components/common/backup/storage/actions/add/temp/nfs/version/Version.vue +42 -0
  33. package/components/common/backup/storage/actions/add/temp/nfs/version/lib/config/versionOptions.ts +22 -0
  34. package/components/common/backup/storage/actions/add/temp/readyComplete/ReadyComplete.vue +85 -0
  35. package/components/common/backup/storage/actions/add/temp/readyComplete/lib/config/propertiesDetails.ts +139 -0
  36. package/components/common/backup/storage/actions/add/temp/readyComplete/lib/models/interfaces.ts +4 -0
  37. package/components/common/backup/storage/actions/add/temp/samba/Samba.vue +95 -0
  38. package/components/common/backup/storage/actions/add/temp/samba/accessibility/Accessibility.vue +104 -0
  39. package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/config/tabsPannel.ts +25 -0
  40. package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/interfaces.ts +9 -0
  41. package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/types.ts +5 -0
  42. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/TablesView.vue +141 -0
  43. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  44. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/hostsTableItems.ts +53 -0
  45. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  46. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  47. package/components/common/backup/storage/actions/add/temp/samba/configuration/Configuration.vue +470 -0
  48. package/components/common/backup/storage/actions/add/temp/samba/configuration/lib/config/defaultForm.ts +51 -0
  49. package/components/common/backup/storage/actions/add/temp/samba/configuration/lib/models/interfaces.ts +14 -0
  50. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/DeletePopover.vue +99 -0
  51. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/ServersList.vue +124 -0
  52. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/config/serversListConfig.ts +40 -0
  53. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/config/tableKeys.ts +3 -0
  54. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/interfaces.ts +13 -0
  55. package/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/types.ts +1 -0
  56. package/components/common/backup/storage/actions/add/temp/samba/kerberosAuthentication/KerberosAuthentication.vue +55 -0
  57. package/components/common/backup/storage/actions/add/temp/samba/kerberosAuthentication/lib/config/radioOptions.ts +27 -0
  58. package/components/common/backup/storage/actions/add/temp/sharedStorm/SharedStorm.vue +80 -0
  59. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/CreateName.vue +156 -0
  60. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/lib/config/defaultForm.ts +15 -0
  61. package/components/common/backup/storage/actions/add/temp/sharedStorm/storage/Storage.vue +71 -0
  62. package/components/common/backup/storage/actions/add/temp/sharedStorm/storage/lib/config/defaultForm.ts +15 -0
  63. package/components/common/backup/storage/actions/add/temp/types/Types.vue +78 -0
  64. package/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions.ts +52 -0
  65. package/components/common/backup/storage/actions/delete/Delete.vue +65 -0
  66. package/components/common/backup/storage/actions/delete/lib/models/interfaces.ts +5 -0
  67. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  68. package/components/common/browse/lib/models/interfaces.ts +5 -5
  69. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  70. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  71. package/components/common/diagramMain/lib/models/types.ts +21 -21
  72. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  73. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  74. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  75. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  76. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  77. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  78. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  79. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  80. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  81. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  82. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  83. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  84. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  85. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  86. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  87. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  88. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  89. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  90. package/components/common/diagramMain/port/Ports.vue +47 -47
  91. package/components/common/pages/shortcuts/block/BlockNew.vue +2 -7
  92. package/package.json +2 -2
@@ -0,0 +1,124 @@
1
+ <template>
2
+ <div class="servers-list">
3
+ <atoms-table-data-grid
4
+ v-model:selected-row="selectedDisk"
5
+ v-model:page-size="pagination.pageSize"
6
+ v-model:page="pagination.page"
7
+ type="any"
8
+ class="data-table"
9
+ test-id="servers-list-table"
10
+ :head-items="headItems"
11
+ :body-items="bodyItems"
12
+ :total-items="1"
13
+ :total-pages="1"
14
+ off-select-by-row
15
+ :loading="loading"
16
+ hide-footer
17
+ >
18
+ <template #type="{ item }">
19
+ <div class="data-table__action-icon">
20
+ <atoms-popover
21
+ test-id="servers-list"
22
+ @click="onShowTooltipForRemove(item)"
23
+ >
24
+ <template #elem>
25
+ <atoms-the-icon name="ellipsis-vertical" />
26
+ </template>
27
+ <template #content>
28
+ <common-backup-storage-actions-add-temp-samba-configuration-servers-list-delete-popover
29
+ v-if="showTooltip && item[0].id === selectedServerForRemove"
30
+ class="data-table__popover"
31
+ @hide="showTooltip = false"
32
+ @click-item="onRemoveServerFromList(item)"
33
+ />
34
+ </template>
35
+ </atoms-popover>
36
+ </div>
37
+ </template>
38
+ </atoms-table-data-grid>
39
+ </div>
40
+ </template>
41
+
42
+ <script lang="ts" setup>
43
+ import type {
44
+ UI_I_HeadItem,
45
+ UI_I_BodyItem,
46
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
47
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
48
+ import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
49
+ import type { UI_I_DataServersListItem } from '~/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/interfaces'
50
+ import * as serversTable from '~/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/config/serversListConfig'
51
+
52
+ const props = defineProps<{
53
+ dataTable: UI_I_DataServersListItem[] | []
54
+ loading?: boolean
55
+ }>()
56
+ const emits = defineEmits<{
57
+ (event: 'update:data-table', value: UI_I_DataServersListItem[]): void
58
+ }>()
59
+
60
+ const localization = computed<UI_I_Localization>(() => useLocal())
61
+
62
+ const selectedDisk = ref<number | null>(null)
63
+
64
+ const pagination = ref<UI_I_Pagination>({
65
+ page: 1,
66
+ pageSize: 34,
67
+ })
68
+
69
+ // const columnKeys = ref<UI_I_ColumnKey[]>(serversTable.columnKeys(localization.value))
70
+ const headItems = computed<UI_I_HeadItem[]>(() =>
71
+ serversTable.headItems(localization.value)
72
+ )
73
+
74
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
75
+ watch(
76
+ () => props.dataTable,
77
+ (newValue) => {
78
+ if (!newValue?.length) {
79
+ bodyItems.value = []
80
+ return
81
+ }
82
+
83
+ bodyItems.value = serversTable.bodyItems(newValue)
84
+ },
85
+ { deep: true, immediate: true }
86
+ )
87
+
88
+ const selectedServerForRemove = ref<number | null>(null)
89
+ const showTooltip = ref<boolean>(false)
90
+ const onShowTooltipForRemove = (server: UI_I_BodyItem[]): void => {
91
+ selectedServerForRemove.value = server[0].id
92
+ showTooltip.value = true
93
+ }
94
+ const onRemoveServerFromList = (removeItem: UI_I_BodyItem[]): void => {
95
+ const { text } = removeItem[0]
96
+
97
+ const serverList = props.dataTable.filter(
98
+ (server: UI_I_DataServersListItem) => server.server_name !== text
99
+ )
100
+ emits('update:data-table', serverList)
101
+ showTooltip.value = false
102
+ }
103
+ </script>
104
+
105
+ <style lang="scss" scoped>
106
+ .servers-list {
107
+ height: inherit;
108
+ .data-table {
109
+ &__action-icon {
110
+ width: 16px;
111
+ height: 16px;
112
+ cursor: pointer;
113
+ position: relative;
114
+ fill: var(--ellipsis-vertical-icon-color);
115
+ }
116
+
117
+ height: inherit;
118
+ :deep(.datagrid-outer-wrapper) {
119
+ height: inherit;
120
+ padding-top: 0;
121
+ }
122
+ }
123
+ }
124
+ </style>
@@ -0,0 +1,40 @@
1
+ import type {
2
+ UI_I_HeadItem,
3
+ UI_I_BodyItem,
4
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
+ import {
6
+ constructHeadItem,
7
+ } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
8
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
9
+ import { serversTableItemsKeys } from '~/components/common/backup/storage/actions/add/temp/nfs/configuration/serversList/lib/config/tableKeys'
10
+
11
+ const getItems = (
12
+ localization: UI_I_Localization
13
+ ): [string, boolean, string, string][] => {
14
+ return [
15
+ [localization.common.serversToBeAdded, true, '96px', serversTableItemsKeys[0]],
16
+ ]
17
+ }
18
+
19
+ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
20
+ const result: UI_I_HeadItem[] = []
21
+ getItems(localization).forEach((item) => {
22
+ const col = 'type'
23
+ result.push(constructHeadItem(col, item[0], item[3], false, item[2]))
24
+ })
25
+ return result
26
+ }
27
+
28
+ export const bodyItems = (data: any[]): UI_I_BodyItem[][] => {
29
+ const bodyItems: UI_I_BodyItem[][] = []
30
+ data.forEach((server, key) => {
31
+ bodyItems.push([
32
+ {
33
+ key: 'col0',
34
+ text: server[serversTableItemsKeys[0]],
35
+ id: key,
36
+ },
37
+ ])
38
+ })
39
+ return bodyItems
40
+ }
@@ -0,0 +1,3 @@
1
+ import type { T_ServersTableItemsTuple } from '~/components/common/backup/storage/actions/add/temp/samba/configuration/serversList/lib/models/types'
2
+
3
+ export const serversTableItemsKeys: T_ServersTableItemsTuple = ['server_name']
@@ -0,0 +1,13 @@
1
+ import type { UI_I_Validation } from '~/lib/models/plugins/validation/interfaces'
2
+
3
+ export interface UI_I_FormValidationConfiguration {
4
+ name: UI_I_Validation
5
+ folder: UI_I_Validation
6
+ server: UI_I_Validation
7
+ username: UI_I_Validation
8
+ password: UI_I_Validation
9
+ }
10
+
11
+ export interface UI_I_DataServersListItem {
12
+ server_name: string
13
+ }
@@ -0,0 +1 @@
1
+ export type T_ServersTableItemsTuple = ['server_name']
@@ -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 type { UI_I_Localization } from '~/lib/models/interfaces'
30
+ import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
31
+ import type { UI_T_KerberosAuthentication } from '~/components/common/backup/storage/actions/add/temp/lib/models/types'
32
+ import { kerberosOptionsFunc } from '~/components/common/backup/storage/actions/add/temp/samba/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,80 @@
1
+ <template>
2
+ <div class="shared-storm-step h-full">
3
+ <!-- TODO move to common-->
4
+ <common-backup-storage-actions-add-temp-local-create-name
5
+ v-show="props.stepPosition === 1"
6
+ :local-create-name-submit="props.createNameSubmit"
7
+ test-id="shared-storm"
8
+ @loading="(e) => emits('loading', e)"
9
+ @submit="onChangeName"
10
+ />
11
+
12
+ <common-backup-storage-actions-add-temp-shared-storm-storage
13
+ v-show="props.stepPosition === 2"
14
+ :storage="storage"
15
+ :datastore="datastore"
16
+ :get-datastore-table-func="getDatastoreTableFunc"
17
+ :storage-submit="storageSubmitLocal"
18
+ @change="onChangeStorage"
19
+ />
20
+ </div>
21
+ </template>
22
+
23
+ <script lang="ts" setup>
24
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
25
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
26
+ import type { I_SharedStormData } from '~/components/common/backup/storage/actions/add/temp/lib/models/interfaces'
27
+
28
+ const props = defineProps<{
29
+ stepPosition: number
30
+ createNameSubmit: number
31
+ storageSubmit: number
32
+ }>()
33
+ const emits = defineEmits<{
34
+ (event: 'loading', value: boolean): void
35
+ (event: 'submit', value: I_SharedStormData): void
36
+ }>()
37
+
38
+ const { $store } = useNuxtApp()
39
+
40
+ const storage = ref<UI_I_DatastoreTableItem | null>(null)
41
+ const onChangeStorage = (data: UI_I_DatastoreTableItem | null): void => {
42
+ storage.value = data
43
+ }
44
+ const datastore = computed<UI_I_DatastoreTableItem[]>(
45
+ () => $store.getters['storage/getDatastoreTable'] || []
46
+ )
47
+ const getDatastoreTableFunc = async (
48
+ payload: UI_I_TablePayload
49
+ ): Promise<void> => {
50
+ await $store.dispatch('storage/A_GET_DATASTORE_TABLE', payload)
51
+ }
52
+
53
+ const storageName = ref<string>('')
54
+ const onChangeName = (name: string): void => {
55
+ storageName.value = name
56
+ emits('submit', {
57
+ name: storageName.value,
58
+ storm_id: storage.value?.id,
59
+ storm_name: storage.value?.name,
60
+ })
61
+ }
62
+
63
+ const storageSubmitLocal = ref<Function | null>(null)
64
+ watch(
65
+ () => props.storageSubmit,
66
+ () => {
67
+ storageSubmitLocal.value = (isValid: boolean): void => {
68
+ if (isValid) {
69
+ emits('submit', {
70
+ name: storageName.value,
71
+ storm_id: storage.value?.id,
72
+ storm_name: storage.value?.name,
73
+ })
74
+ }
75
+ }
76
+ }
77
+ )
78
+ </script>
79
+
80
+ <style lang="scss" scoped></style>
@@ -0,0 +1,156 @@
1
+ <template>
2
+ <div class="create-datastore-name">
3
+ <atoms-alert
4
+ v-show="errors.length"
5
+ test-id="datastore-creat-name"
6
+ status="alert-danger"
7
+ :items="errors"
8
+ @remove="onRemoveValidationErrors"
9
+ />
10
+
11
+ <div class="clr-form-control clr-row flex flex-row">
12
+ <label for="datastore-name" class="clr-control-label clr-col-md-2">{{
13
+ localization.common.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="form.name.value"
21
+ data-id="shared-storm-backup-storage-name-input"
22
+ type="text"
23
+ class="clr-input"
24
+ @blur="onBlurInputName"
25
+ @input="onInputName"
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
+ // TODO refactoring
40
+ import type { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
41
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
42
+ import { defaultFormFunc } from '~/components/common/backup/storage/actions/add/temp/local/createName/lib/config/defaultForm'
43
+ import { checkValidityName } from '~/components/common/backup/storage/actions/add/temp/lib/utils'
44
+
45
+ const props = defineProps<{
46
+ localCreateNameSubmit: number
47
+ }>()
48
+ const emits = defineEmits<{
49
+ (event: 'loading', value: boolean): void
50
+ (event: 'submit', value: string): void
51
+ }>()
52
+
53
+ const localization = computed<UI_I_Localization>(() => useLocal())
54
+ const { $validation } = useNuxtApp()
55
+
56
+ const validation = $validation.call({})
57
+ const defaultForm: any = defaultFormFunc(localization.value)
58
+ const form = ref<any>(useDeepCopy(defaultForm))
59
+
60
+ const setForm = (): void => {
61
+ form.value = useDeepCopy(defaultForm)
62
+ validation.setForm(form)
63
+ }
64
+ setForm()
65
+
66
+ const validForm = ref<UI_I_ValidationTouchResult | null>(null)
67
+
68
+ /* Validation for Name input */
69
+ const isInitNameValidation = ref<boolean>(false)
70
+ const onBlurInputName = (): void => {
71
+ validForm.value = validation.touch()
72
+ isInitNameValidation.value = true
73
+ }
74
+ const onInputName = (): void => {
75
+ validForm.value = validation.touch()
76
+ }
77
+ const nameErrorText = computed<string>(() => {
78
+ if (!isInitNameValidation.value) return ''
79
+ return validForm.value?.errors?.name?.[0] || ''
80
+ })
81
+ /* Validation Name input end */
82
+
83
+ const errors = ref<string[]>([])
84
+ const showValidationErrors = (data: string[]): void => {
85
+ errors.value = data
86
+ }
87
+ const onRemoveValidationErrors = (): void => {
88
+ errors.value = []
89
+ }
90
+ const submit = async (): Promise<void> => {
91
+ const name = form.value.name.value
92
+
93
+ if (!name) {
94
+ validForm.value = validation.touch()
95
+ isInitNameValidation.value = true
96
+ if (nameErrorText.value) return
97
+ }
98
+
99
+ if (name) {
100
+ emits('loading', true)
101
+
102
+ const { valid, msg } = await checkValidityName(name)
103
+
104
+ emits('loading', false)
105
+
106
+ if (!valid) {
107
+ showValidationErrors([msg])
108
+ return
109
+ }
110
+ }
111
+
112
+ onRemoveValidationErrors()
113
+ emits('submit', name)
114
+ }
115
+ watch(
116
+ () => props.localCreateNameSubmit,
117
+ () => {
118
+ submit()
119
+ }
120
+ )
121
+ </script>
122
+
123
+ <style lang="scss" scoped>
124
+ .create-datastore-name {
125
+ &__alert-info {
126
+ :deep(.alert-text) {
127
+ font-size: 11px;
128
+ letter-spacing: normal;
129
+ }
130
+ }
131
+ .clr-form-control {
132
+
133
+ .clr-control-container {
134
+ min-height: 48px;
135
+ input {
136
+ width: 375px;
137
+ }
138
+ &.clr-error {
139
+ .clr-subtext,
140
+ .error-icon {
141
+ display: block;
142
+ }
143
+ }
144
+ .clr-subtext,
145
+ .error-icon {
146
+ display: none;
147
+ }
148
+ .error-icon {
149
+ fill: #db2100;
150
+ width: 24px;
151
+ height: 24px;
152
+ }
153
+ }
154
+ }
155
+ }
156
+ </style>
@@ -0,0 +1,15 @@
1
+ import type { 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.common.specifyDatastoreName,
11
+ },
12
+ ],
13
+ },
14
+ }
15
+ }
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <common-vm-actions-common-select-storage
3
+ :storage-submit="props.storageSubmit"
4
+ :datastore="props.datastore"
5
+ :get-datastore-table-func="props.getDatastoreTableFunc"
6
+ hide-compatibility
7
+ class="storage-datatable h-full"
8
+ @submit="onChangeStorage"
9
+ />
10
+ </template>
11
+
12
+ <script lang="ts" setup>
13
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
14
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
15
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
16
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
17
+
18
+ const props = defineProps<{
19
+ storageSubmit: Function | null
20
+ storage: UI_I_DatastoreTableItem | null
21
+ datastore: UI_I_DatastoreTableItem[]
22
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
23
+ }>()
24
+ const emits = defineEmits<{
25
+ (event: 'change', value: UI_I_DatastoreTableItem): void
26
+ }>()
27
+
28
+ const localization = computed<UI_I_Localization>(() => useLocal())
29
+
30
+ const storages = ref<UI_I_DatastoreTableItem[]>([])
31
+ const addStorage = (storage: UI_I_DatastoreTableItem): void => {
32
+ const hasStorage = storages.value.some((item) => item.id === storage.id)
33
+ if (hasStorage) {
34
+ return
35
+ }
36
+
37
+ storages.value.push(storage)
38
+ }
39
+
40
+ const selectedLocation = ref<string>(props.storage?.id || '')
41
+
42
+ const locationOptions = ref<UI_I_OptionItem[]>([])
43
+
44
+ watch(
45
+ () => props.storage,
46
+ (newValue) => {
47
+ if (locationOptions.value.length || !newValue) {
48
+ return
49
+ }
50
+
51
+ locationOptions.value = [
52
+ {
53
+ text: localization.value.common.storeWithVirtualMachine,
54
+ value: newValue.id,
55
+ },
56
+ { text: `${localization.value.common.browse}...`, value: -1 },
57
+ ]
58
+ selectedLocation.value = newValue.id
59
+ storages.value.push(newValue)
60
+ addStorage(newValue)
61
+ },
62
+ { immediate: true }
63
+ )
64
+
65
+ const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
66
+ if (!storage) return
67
+ emits('change', storage)
68
+ }
69
+ </script>
70
+
71
+ <style lang="scss" scoped></style>
@@ -0,0 +1,15 @@
1
+ import type { 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.common.specifyDatastoreName,
11
+ },
12
+ ],
13
+ },
14
+ }
15
+ }
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <section class="datastore-types">
3
+ <div class="header-row flex items-center">
4
+ <span class="datastore-types__subtitle">
5
+ {{ localization.common.specifyDatastoreType }}
6
+ </span>
7
+ <div id="type-select-help-icon" class="signpost-container relative flex cursor-pointer">
8
+ <atoms-the-icon
9
+ data-id="toggle-type-select-help-icon"
10
+ fill="#0072a3"
11
+ width="24px"
12
+ height="24px"
13
+ name="info-circle"
14
+ @click="isShowTypeHelp = !isShowTypeHelp"
15
+ />
16
+ <atoms-tooltip-signpost
17
+ v-if="isShowTypeHelp"
18
+ elem-id="type-select-help-icon"
19
+ @hide="isShowTypeHelp = false"
20
+ >
21
+ <p class="help-desc">{{ localization.common.datastoreTypeHelpDesc }}</p>
22
+ </atoms-tooltip-signpost>
23
+ </div>
24
+ </div>
25
+
26
+ <common-select-radio-group
27
+ v-model="selectedType"
28
+ :options="datastoreTypes"
29
+ />
30
+ </section>
31
+ </template>
32
+
33
+ <script lang="ts" setup>
34
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
35
+ import type { UI_T_Project } from '~/lib/models/types'
36
+ import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
37
+ import type {
38
+ UI_T_DatastoreType
39
+ } from '~/components/common/backup/storage/actions/add/temp/lib/models/types'
40
+ import { datastoreTypesFunc } from '~/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions'
41
+
42
+ const props = defineProps<{
43
+ project: UI_T_Project
44
+ type: UI_T_DatastoreType
45
+ }>()
46
+ const emits = defineEmits<{
47
+ (event: 'update:type', value: UI_T_DatastoreType): void
48
+ }>()
49
+ const localization = computed<UI_I_Localization>(() => useLocal())
50
+
51
+ const datastoreTypes = ref<UI_I_RadioOption[]>(
52
+ datastoreTypesFunc(localization.value, props.project)
53
+ )
54
+
55
+ const selectedType = computed<UI_T_DatastoreType>({
56
+ get() {
57
+ return props.type
58
+ },
59
+ set(newValue) {
60
+ emits('update:type', newValue)
61
+ },
62
+ })
63
+
64
+ const isShowTypeHelp = ref<boolean>(false)
65
+ </script>
66
+
67
+ <style lang="scss" scoped>
68
+ .datastore-types {
69
+ .signpost-container {
70
+ .help-desc-container {
71
+ max-width: 350px;
72
+ }
73
+ }
74
+ .header-row {
75
+ gap: 10px;
76
+ }
77
+ }
78
+ </style>