bfg-common 1.5.154 → 1.5.155

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 (30) hide show
  1. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  2. package/components/common/browse/lib/models/interfaces.ts +5 -5
  3. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  4. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  5. package/components/common/diagramMain/lib/models/types.ts +21 -21
  6. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  7. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  8. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  9. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  10. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  11. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  12. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  13. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  14. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  15. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  16. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  17. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  18. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  19. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  20. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  21. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  22. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  23. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  24. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  25. package/components/common/diagramMain/port/Ports.vue +47 -47
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +1 -2
  27. package/components/common/wizards/vm/migrate/Migrate.vue +344 -343
  28. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +190 -188
  29. package/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel.ts +39 -29
  30. package/package.json +1 -1
@@ -1,188 +1,190 @@
1
- <template>
2
- <div class="compute-resource">
3
- <atoms-alert
4
- v-show="props.alertMessages?.length"
5
- :items="props.alertMessages"
6
- test-id="compute-resource-alert"
7
- status="alert-danger"
8
- @remove="onHideAlert"
9
- />
10
-
11
- <div
12
- v-if="model.migrate_type === 'resource-storage'"
13
- class="tree-view-wrap mt-1"
14
- >
15
- <common-wizards-vm-common-compute-resource-tree-view
16
- v-model="model.resource.selectedNode"
17
- :compute-resource-tree="nodes"
18
- @show-compute-resource-tree="onShowComputeResourceTree"
19
- @select-compute-resource-tree="onSelectComputeResourceTree"
20
- />
21
- </div>
22
-
23
- <template v-else>
24
- <atoms-tabs
25
- v-model="activeTab"
26
- test-id="migrate-select-storage-tabs"
27
- :items="selectStorageTabs"
28
- size="small"
29
- class="compute-resource__tabs"
30
- />
31
-
32
- <common-wizards-vm-migrate-select-compute-resource-table-view
33
- v-model="selectedTableDataKeys[activeTab]"
34
- :type="activeTab"
35
- :data-table="props.computeResourceData?.items || []"
36
- :total-items="props.computeResourceData?.total_items || 0"
37
- :total-pages="props.computeResourceData?.total_pages || 1"
38
- :get-compute-resource-data="props.getComputeResourceData"
39
- />
40
- </template>
41
-
42
- <common-wizards-vm-common-validation-compatibility
43
- :loading="!model.resource.selectedNode"
44
- :status="compatibilityText[0]"
45
- :text="compatibilityText[1]"
46
- />
47
- </div>
48
- </template>
49
-
50
- <script lang="ts" setup>
51
- import type { UI_I_Localization } from '~/lib/models/interfaces'
52
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
53
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
54
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
55
- import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
56
- import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
57
- import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
58
- import { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/enums'
59
- import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel'
60
-
61
- const props = defineProps<{
62
- alertMessages: string[]
63
- getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
64
- computeResourceData: any
65
- computeResourceTree: UI_I_TreeNode | null
66
- }>()
67
- const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
68
- const emits = defineEmits<{
69
- (event: 'hide-alert', value: number): void
70
- (event: 'next-step', value: any): void
71
- }>()
72
-
73
- const localization = computed<UI_I_Localization>(() => useLocal())
74
- const { $recursion }: any = useNuxtApp()
75
-
76
- const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
77
- const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
78
- vmMigrateComputeResourceTabsFunc(localization.value)
79
- )
80
-
81
- const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
82
- host: null,
83
- cluster: null,
84
- 'resource-pool': null,
85
- 'v-apps': null,
86
- })
87
- watch(
88
- selectedTableDataKeys,
89
- (newValue) => {
90
- if (!props.computeResourceData?.items.length) return
91
-
92
- const data = props.computeResourceData.items.find(
93
- (_: never, key: number) => newValue[activeTab.value] === key
94
- )
95
- if (data) {
96
- const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
97
- model.value.resource[dataKeys] = data
98
- }
99
- },
100
- { immediate: true, deep: true }
101
- )
102
-
103
- const nodes = ref<UI_I_TreeNode[]>([])
104
- watch(
105
- props.computeResourceTree,
106
- (newValue) => {
107
- if (nodes.value.length) return
108
-
109
- nodes.value = useDeepCopy([newValue])
110
- },
111
- { immediate: true, deep: true }
112
- )
113
-
114
- const onShowComputeResourceTree = ({
115
- node,
116
- cb,
117
- }: {
118
- node: UI_I_TreeNode
119
- cb: () => void
120
- }): void => {
121
- $recursion.findAndShow(
122
- nodes.value,
123
- [node.id, node.type],
124
- ['id', 'type'],
125
- 'nodes'
126
- )
127
- cb()
128
- }
129
- const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
130
- $recursion.findAndActivate(
131
- nodes.value,
132
- [node.type, node.id],
133
- ['type', 'id'],
134
- 'nodes'
135
- )
136
- }
137
- const compatibilityText = computed<[string, string]>(() => {
138
- const { selectedNode } = model.value.resource
139
-
140
- if (!selectedNode) return ['Success', '']
141
-
142
- let res: [string, string] = ['Success', 'compatibilityChecksSucceeded']
143
-
144
- if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
145
- res = ['Error', 'selectValidClusterOrHostDestination']
146
- }
147
- if (selectedNode.type === 'cluster') {
148
- const hasHost = !!selectedNode.nodes.length
149
- if (!hasHost) {
150
- res = ['Error', 'clusterNotContainAnyHosts']
151
- }
152
- }
153
-
154
- if (selectedNode.type === 'host') {
155
- if (selectedNode.state === 'Error') {
156
- // TODO check Maintenance Mode
157
- res = ['Error', 'selectedHostDisconnectedMaintenanceMode']
158
- }
159
- }
160
-
161
- return res
162
- })
163
- const onHideAlert = (): void => {
164
- emits('hide-alert', 3)
165
- }
166
- </script>
167
-
168
- <style lang="scss" scoped>
169
- @import 'assets/scss/common/mixins';
170
- .compute-resource {
171
- @include flex($dir: column);
172
- height: inherit;
173
- .tree-view-wrap {
174
- max-height: 250px;
175
- min-height: 200px;
176
- position: relative;
177
- border: 1px solid #000;
178
- padding: 5px 0 0 5px;
179
- overflow: auto;
180
- }
181
- &__tabs {
182
- width: 100%;
183
- :deep(.nav) {
184
- margin-top: 0;
185
- }
186
- }
187
- }
188
- </style>
1
+ <template>
2
+ <div class="compute-resource">
3
+ <atoms-alert
4
+ v-show="props.alertMessages?.length"
5
+ :items="props.alertMessages"
6
+ test-id="compute-resource-alert"
7
+ status="alert-danger"
8
+ @remove="onHideAlert"
9
+ />
10
+
11
+ <div
12
+ v-if="model.migrate_type === 'resource-storage'"
13
+ class="tree-view-wrap mt-1"
14
+ >
15
+ <common-wizards-vm-common-compute-resource-tree-view
16
+ v-model="model.resource.selectedNode"
17
+ :compute-resource-tree="nodes"
18
+ @show-compute-resource-tree="onShowComputeResourceTree"
19
+ @select-compute-resource-tree="onSelectComputeResourceTree"
20
+ />
21
+ </div>
22
+
23
+ <template v-else>
24
+ <atoms-tabs
25
+ v-model="activeTab"
26
+ test-id="migrate-select-storage-tabs"
27
+ :items="selectStorageTabs"
28
+ size="small"
29
+ class="compute-resource__tabs"
30
+ />
31
+
32
+ <common-wizards-vm-migrate-select-compute-resource-table-view
33
+ v-model="selectedTableDataKeys[activeTab]"
34
+ :type="activeTab"
35
+ :data-table="props.computeResourceData?.items || []"
36
+ :total-items="props.computeResourceData?.total_items || 0"
37
+ :total-pages="props.computeResourceData?.total_pages || 1"
38
+ :get-compute-resource-data="props.getComputeResourceData"
39
+ />
40
+ </template>
41
+
42
+ <common-wizards-vm-common-validation-compatibility
43
+ :loading="!model.resource.selectedNode"
44
+ :status="compatibilityText[0]"
45
+ :text="compatibilityText[1]"
46
+ />
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts" setup>
51
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
52
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
53
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
54
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
55
+ import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
56
+ import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
57
+ import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
58
+ import { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/enums'
59
+ import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel'
60
+
61
+ const props = defineProps<{
62
+ alertMessages: string[]
63
+ getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
64
+ computeResourceData: any
65
+ computeResourceTree: UI_I_TreeNode | null
66
+ vmState?: number
67
+ }>()
68
+ const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
69
+ const emits = defineEmits<{
70
+ (event: 'hide-alert', value: number): void
71
+ (event: 'next-step', value: any): void
72
+ }>()
73
+
74
+ const localization = computed<UI_I_Localization>(() => useLocal())
75
+ const { $recursion }: any = useNuxtApp()
76
+
77
+ const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
78
+ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
79
+ vmMigrateComputeResourceTabsFunc(localization.value, props.vmState || 0)
80
+ )
81
+
82
+ const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
83
+ host: null,
84
+ cluster: null,
85
+ 'resource-pool': null,
86
+ 'v-apps': null,
87
+ })
88
+ watch(
89
+ selectedTableDataKeys,
90
+ (newValue) => {
91
+ if (!props.computeResourceData?.items.length) return
92
+
93
+ const data = props.computeResourceData.items.find(
94
+ (_: never, key: number) => newValue[activeTab.value] === key
95
+ )
96
+ if (data) {
97
+ const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
98
+ model.value.resource[dataKeys] = data
99
+ model.value.resource.selectedNode = data
100
+ }
101
+ },
102
+ { immediate: true, deep: true }
103
+ )
104
+
105
+ const nodes = ref<UI_I_TreeNode[]>([])
106
+ watch(
107
+ props.computeResourceTree,
108
+ (newValue) => {
109
+ if (nodes.value.length) return
110
+
111
+ nodes.value = useDeepCopy([newValue])
112
+ },
113
+ { immediate: true, deep: true }
114
+ )
115
+
116
+ const onShowComputeResourceTree = ({
117
+ node,
118
+ cb,
119
+ }: {
120
+ node: UI_I_TreeNode
121
+ cb: () => void
122
+ }): void => {
123
+ $recursion.findAndShow(
124
+ nodes.value,
125
+ [node.id, node.type],
126
+ ['id', 'type'],
127
+ 'nodes'
128
+ )
129
+ cb()
130
+ }
131
+ const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
132
+ $recursion.findAndActivate(
133
+ nodes.value,
134
+ [node.type, node.id],
135
+ ['type', 'id'],
136
+ 'nodes'
137
+ )
138
+ }
139
+ const compatibilityText = computed<[string, string]>(() => {
140
+ const { selectedNode } = model.value.resource
141
+
142
+ if (!selectedNode) return ['Success', '']
143
+
144
+ let res: [string, string] = ['Success', 'compatibilityChecksSucceeded']
145
+
146
+ if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
147
+ res = ['Error', 'selectValidClusterOrHostDestination']
148
+ }
149
+ if (selectedNode.type === 'cluster') {
150
+ const hasHost = !!selectedNode.nodes.length
151
+ if (!hasHost) {
152
+ res = ['Error', 'clusterNotContainAnyHosts']
153
+ }
154
+ }
155
+
156
+ if (selectedNode.type === 'host') {
157
+ if (selectedNode.state === 'Error') {
158
+ // TODO check Maintenance Mode
159
+ res = ['Error', 'selectedHostDisconnectedMaintenanceMode']
160
+ }
161
+ }
162
+
163
+ return res
164
+ })
165
+ const onHideAlert = (): void => {
166
+ emits('hide-alert', 3)
167
+ }
168
+ </script>
169
+
170
+ <style lang="scss" scoped>
171
+ @import 'assets/scss/common/mixins';
172
+ .compute-resource {
173
+ @include flex($dir: column);
174
+ height: inherit;
175
+ .tree-view-wrap {
176
+ max-height: 250px;
177
+ min-height: 200px;
178
+ position: relative;
179
+ border: 1px solid #000;
180
+ padding: 5px 0 0 5px;
181
+ overflow: auto;
182
+ }
183
+ &__tabs {
184
+ width: 100%;
185
+ :deep(.nav) {
186
+ margin-top: 0;
187
+ }
188
+ }
189
+ }
190
+ </style>
@@ -1,29 +1,39 @@
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 vmMigrateComputeResourceTabsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_CollapseNavItem[] => {
7
- return [
8
- {
9
- text: localization.common.hosts,
10
- value: 'host',
11
- disabled: false,
12
- },
13
- {
14
- text: localization.common.clusters,
15
- value: 'cluster',
16
- disabled: true,
17
- },
18
- {
19
- text: localization.inventoryTabs.resourcePools,
20
- value: 'resource-pool',
21
- disabled: true,
22
- },
23
- {
24
- text: localization.common.vApps,
25
- value: 'v-apps',
26
- disabled: true,
27
- },
28
- ]
29
- }
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 vmMigrateComputeResourceTabsFunc = (
5
+ localization: UI_I_Localization,
6
+ vmState: number
7
+ ): UI_I_CollapseNavItem[] => {
8
+ const tabs: UI_I_CollapseNavItem[] = [
9
+ {
10
+ text: localization.common.hosts,
11
+ value: 'host',
12
+ disabled: false,
13
+ testId: 'host-tab',
14
+ },
15
+ {
16
+ text: localization.common.clusters,
17
+ value: 'cluster',
18
+ disabled: true,
19
+ testId: 'cluster-tab',
20
+ },
21
+ {
22
+ text: localization.inventoryTabs.resourcePools,
23
+ value: 'resource-pool',
24
+ disabled: true,
25
+ testId: 'resource-pool-tab',
26
+ },
27
+ ]
28
+
29
+ if (vmState !== 2) {
30
+ tabs.push({
31
+ text: localization.common.vApps,
32
+ value: 'v-apps',
33
+ disabled: true,
34
+ testId: 'v-apps-tab',
35
+ })
36
+ }
37
+
38
+ return tabs
39
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.154",
4
+ "version": "1.5.155",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",