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,20 @@
1
+ import { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
3
+ export const nfsVersionFunc = (
4
+ localization: UI_I_Localization
5
+ ): UI_I_RadioOption[] => {
6
+ return [
7
+ {
8
+ label: 'NFS 3',
9
+ value: 'nfs-3',
10
+ disabled: false,
11
+ description: localization.nfsVersionDesc1,
12
+ },
13
+ {
14
+ label: 'NFS 4.1',
15
+ value: 'nfs-4.1',
16
+ disabled: false,
17
+ description: localization.nfsVersionDesc2,
18
+ },
19
+ ]
20
+ }
@@ -0,0 +1,88 @@
1
+ <template>
2
+ <div class="ready-complete">
3
+ <common-details-list :items="properties" class="ready-complete__list list">
4
+ <template #default="{ item }">
5
+ <common-details-item :has-children="true" open-by-default>
6
+ <template #stackBlockKey>
7
+ <span class="list__labels">{{
8
+ localization.chosenDatastoreName
9
+ }}</span>
10
+ </template>
11
+
12
+ <template #stackChildren>
13
+ <template
14
+ v-for="(item2, key2) in item.items"
15
+ :key="`${item2}_${key2}`"
16
+ >
17
+ <common-details-item
18
+ :has-children="false"
19
+ class="list__default-style"
20
+ >
21
+ <template #stackBlockKey>
22
+ <div>
23
+ {{ item2.label }}
24
+ </div>
25
+ </template>
26
+ <template #stackBlockContent>
27
+ <div v-if="item2.data">
28
+ <div
29
+ v-for="item3 in item2.data"
30
+ :key="item3"
31
+ class="flex-align-center"
32
+ >
33
+ <div class="vsphere-icon-host"></div>
34
+ <span>{{ item3 }}</span>
35
+ </div>
36
+ </div>
37
+ <span v-else>
38
+ {{ item2.value }}
39
+ </span>
40
+ </template>
41
+ </common-details-item>
42
+ </template>
43
+ </template>
44
+ </common-details-item>
45
+ </template>
46
+ </common-details-list>
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts" setup>
51
+ import { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
52
+ import { UI_I_Localization } from '~/lib/models/interfaces'
53
+
54
+ const props = defineProps<{
55
+ dataReadyView: UI_I_DetailsItem[]
56
+ }>()
57
+ // console.log(props)
58
+
59
+ const localization = computed<UI_I_Localization>(() => useLocal())
60
+
61
+ const properties = computed<UI_I_DetailsItem[]>(() => props.dataReadyView)
62
+ </script>
63
+
64
+ <style lang="scss" scoped>
65
+ @import '~/assets/scss/common/mixins.scss';
66
+ .ready-complete {
67
+ &__list {
68
+ @include flex($dir: column);
69
+ padding: 12px 0;
70
+ row-gap: 15px;
71
+ }
72
+ }
73
+ .list {
74
+ &__labels {
75
+ @include text($fs: 13px, $fw: 700);
76
+ }
77
+ :deep(.list__default-style) {
78
+ .stack-block {
79
+ &__label {
80
+ align-items: flex-start;
81
+ }
82
+ &-content {
83
+ white-space: pre-line;
84
+ }
85
+ }
86
+ }
87
+ }
88
+ </style>
@@ -0,0 +1,183 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_DetailsItem } from '~/components/common/details/lib/models/interfaces'
3
+ import type { UI_T_Project } from '~/lib/models/types'
4
+ import type { UI_I_CreateStorageLunDiskItem } from '~/components/common/wizards/datastoreNew/add/sharedStorm/deviceSelection/lib/models/interfaces'
5
+ import type { UI_I_CreateDatastoreForm } from '~/components/common/wizards/datastoreNew/add/lib/models/interfaces'
6
+ const constructLunDiskItems = (
7
+ disks: UI_I_CreateStorageLunDiskItem[]
8
+ ): string => {
9
+ const { $binary } = useNuxtApp() as any
10
+
11
+ let result = ''
12
+ disks.forEach((disk: UI_I_CreateStorageLunDiskItem) => {
13
+ const capacity = $binary.round(disk.capacity_mb)
14
+ result += `${disk.name} - ${capacity} \n`
15
+ })
16
+ return result
17
+ }
18
+
19
+ const nfsDetailsFunc = (
20
+ localization: UI_I_Localization,
21
+ data: UI_I_CreateDatastoreForm,
22
+ project: UI_T_Project,
23
+ nfsHosts: any
24
+ ): UI_I_DetailsItem[] => {
25
+ const { name, server, folder, nfsVersion, hosts } = data
26
+ // const accessMode = readonly ? 'Read-only' : 'Read-write'
27
+
28
+ const details: UI_I_DetailsItem[] = [
29
+ {
30
+ label: localization.vmfsVersion,
31
+ value: '',
32
+ items: [
33
+ {
34
+ label: localization.version,
35
+ value: nfsVersion.toUpperCase(),
36
+ items: [],
37
+ },
38
+ ],
39
+ actions: [],
40
+ },
41
+ {
42
+ label: localization.nameAndConfiguration,
43
+ value: '',
44
+ items: [
45
+ {
46
+ label: localization.datastoreName,
47
+ value: name,
48
+ items: [],
49
+ },
50
+ {
51
+ label: localization.server,
52
+ value: server,
53
+ items: [],
54
+ },
55
+ {
56
+ label: localization.folder,
57
+ value: folder,
58
+ items: [],
59
+ },
60
+ // {
61
+ // label: localization.accessMode,
62
+ // value: accessMode,
63
+ // items: [],
64
+ // },
65
+ ],
66
+ actions: [],
67
+ },
68
+ ]
69
+
70
+ if (project === 'sphere') {
71
+ const hostsNames = nfsHosts
72
+ ? nfsHosts.items
73
+ .filter((host) => data.hosts.includes(host.id))
74
+ .map((host) => host.host)
75
+ : []
76
+ details.push({
77
+ label: localization.hostsAccessibility,
78
+ value: '',
79
+ items: [
80
+ {
81
+ label: localization.hosts,
82
+ value: '',
83
+ data: hostsNames,
84
+ items: [],
85
+ },
86
+ ],
87
+ actions: [],
88
+ })
89
+ }
90
+
91
+ return details
92
+ }
93
+
94
+ const localDetailsFunc = (
95
+ localization: UI_I_Localization,
96
+ data: UI_I_CreateDatastoreForm
97
+ ): UI_I_DetailsItem[] => {
98
+ const { name } = data
99
+
100
+ return [
101
+ {
102
+ label: localization.selectName,
103
+ value: '',
104
+ items: [
105
+ {
106
+ label: localization.datastoreName,
107
+ value: name,
108
+ items: [],
109
+ },
110
+ ],
111
+ actions: [],
112
+ },
113
+ ]
114
+ }
115
+
116
+ const sharedStormDetailsFunc = (
117
+ localization: UI_I_Localization,
118
+ data: UI_I_CreateDatastoreForm
119
+ ): UI_I_DetailsItem[] => {
120
+ const { name, lunDisk } = data
121
+
122
+ return [
123
+ {
124
+ label: localization.nameAndDeviceSelection,
125
+ value: '',
126
+ items: [
127
+ {
128
+ label: localization.datastoreName,
129
+ value: name,
130
+ items: [],
131
+ },
132
+ {
133
+ label: localization.diskLun,
134
+ value: constructLunDiskItems(lunDisk),
135
+ items: [],
136
+ },
137
+ ],
138
+ actions: [],
139
+ },
140
+ // {
141
+ // label: localization.partitionConfiguration,
142
+ // value: '',
143
+ // items: [
144
+ // {
145
+ // label: localization.method,
146
+ // value: 'None',
147
+ // items: [],
148
+ // },
149
+ // {
150
+ // label: localization.partitionFormat,
151
+ // value: 'None',
152
+ // items: [],
153
+ // },
154
+ // {
155
+ // label: localization.blockSize,
156
+ // value: 'None',
157
+ // items: [],
158
+ // },
159
+ // {
160
+ // label: localization.spaceReclamationGranularity,
161
+ // value: 'None',
162
+ // items: [],
163
+ // },
164
+ // ],
165
+ // actions: [],
166
+ // }, /* TODO данные с нее пока никуда не вставляем */
167
+ ]
168
+ }
169
+
170
+ export const constructDataReadyViewFunc = (
171
+ localization: UI_I_Localization,
172
+ data: UI_I_CreateDatastoreForm,
173
+ project: UI_T_Project,
174
+ nfsHosts: any
175
+ ): UI_I_DetailsItem[] => {
176
+ const details = {
177
+ 1: localDetailsFunc,
178
+ 2: sharedStormDetailsFunc,
179
+ 4: nfsDetailsFunc,
180
+ }
181
+
182
+ return details[data.type_code](localization, data, project, nfsHosts)
183
+ }
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div class="shared-storm-container">
3
+ <common-wizards-datastore-new-add-shared-storm-device-selection
4
+ v-show="props.stepId === 2"
5
+ v-model="model"
6
+ :step-id="props.stepId"
7
+ :alert-messages="props.alertMessages"
8
+ :messages-fields="props.messagesFields"
9
+ :datastore-type="props.datastoreType"
10
+ :project="props.project"
11
+ :datacenter-hosts="props.datacenterHosts"
12
+ :is-main-filter="props.isMainFilter"
13
+ :host-id="props.hostId"
14
+ @hide-alert="(e) => emits('hide-alert', e)"
15
+ @main-filter="emits('main-filter', $event)"
16
+ />
17
+
18
+ <!-- <templates-home-datastore-actions-add-vmfs-version-->
19
+ <!-- v-show="props.stepPosition === 2"-->
20
+ <!-- v-models:version="vmfsVersion"-->
21
+ <!-- />-->
22
+ <!-- TODO в shared-storm пока верси не будет -->
23
+
24
+ <common-wizards-datastore-add-shared-storm-partition-configuration
25
+ v-show="props.project === 'procurator' && props.stepId === 3"
26
+ :vmfs-version="vmfsVersion"
27
+ :selected-lun-disk-size="lunDiskTotalCapacity"
28
+ />
29
+ </div>
30
+ </template>
31
+
32
+ <script lang="ts" setup>
33
+ import {
34
+ UI_I_Localization,
35
+ UI_I_ArbitraryObject,
36
+ } from '~/lib/models/interfaces'
37
+ import { UI_T_Project } from '~/lib/models/types'
38
+ import type { UI_I_ErrorFields } from '~/components/atoms/wizard/lib/models/interfaces'
39
+ import {
40
+ UI_T_DatastoreType,
41
+ UI_T_VmfsType,
42
+ } from '~/components/common/wizards/datastore/add/lib/models/types'
43
+ import type {
44
+ UI_I_SelectHostOptions,
45
+ UI_I_CreateStorageLunDiskItem,
46
+ } from '~/components/common/wizards/datastore/add/sharedStorm/deviceSelection/lib/models/interfaces'
47
+
48
+ const props = defineProps<{
49
+ project: UI_T_Project
50
+ stepId: number
51
+ datastoreType: UI_T_DatastoreType
52
+ alertMessages: string[]
53
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
54
+ datacenterHosts?: UI_I_SelectHostOptions[]
55
+ isMainFilter?: boolean
56
+ hostId?: string
57
+ }>()
58
+ const model = defineModel<any>()
59
+ const emits = defineEmits<{
60
+ (event: 'hide-alert', value: boolean): void
61
+ (event: 'main-filter', value: string): void
62
+ }>()
63
+
64
+ const localization = computed<UI_I_Localization>(() => useLocal())
65
+
66
+ const vmfsVersion = ref<UI_T_VmfsType>('vmfs-6')
67
+
68
+ const lunDiskTotalCapacity = computed<number>(() => {
69
+ if (!model.value.lunDisk.length) return 0
70
+
71
+ return +model.value.lunDisk
72
+ .map((disk: UI_I_CreateStorageLunDiskItem) => disk.capacity_mb)
73
+ .reduce((acc, cur) => acc + cur)
74
+ })
75
+ </script>
76
+
77
+ <style lang="scss" scoped>
78
+ .shared-storm-container {
79
+ display: flex;
80
+ flex-direction: column;
81
+ overflow-y: auto;
82
+ overflow-x: hidden;
83
+ height: inherit;
84
+ }
85
+ </style>