bfg-common 1.4.141 → 1.4.143

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.
@@ -63,12 +63,43 @@ const migrateOnlyStorageDataView = (
63
63
  )
64
64
  }
65
65
 
66
+ const setSelectNetworkDataView = (
67
+ localization: UI_I_Localization,
68
+ from: UI_I_MigrateFormLocal
69
+ ): string => {
70
+ const {
71
+ noNetworkReassignments,
72
+ networkAdapterReassignedNewDestination,
73
+ networkAdapterWillBeReassignedTo,
74
+ } = localization.common
75
+
76
+ const { isBasicNetworkMode, data } = from.network
77
+ const { sourceNetwork, value } = data
78
+
79
+ if (sourceNetwork === value) {
80
+ return noNetworkReassignments
81
+ }
82
+
83
+ if (isBasicNetworkMode) {
84
+ const replacements = {
85
+ lan: sourceNetwork,
86
+ network: value,
87
+ }
88
+ return networkAdapterWillBeReassignedTo.replace(
89
+ /{(\w+)}/g,
90
+ (_, key) => replacements[key]
91
+ )
92
+ }
93
+
94
+ return networkAdapterReassignedNewDestination.replace('{number}', '1')
95
+ }
96
+
66
97
  const storageDetailsFunc = (
67
98
  localization: UI_I_Localization,
68
99
  name: string,
69
100
  form: UI_I_MigrateFormLocal
70
101
  ): UI_I_MigrateReadyBlockData[] => {
71
- const { migrate_type } = form
102
+ const { migrate_type, vMotion_priority } = form
72
103
 
73
104
  const migrationType = localization.common[UI_E_VmMigrationType[migrate_type]]
74
105
 
@@ -85,6 +116,31 @@ const storageDetailsFunc = (
85
116
  },
86
117
  ]
87
118
 
119
+ if (migrate_type === 'resource') {
120
+ const resourceResult = [
121
+ {
122
+ label: localization.common.vMotionPriority,
123
+ value: localization.common[vMotion_priority],
124
+ permissions: [],
125
+ },
126
+ {
127
+ label: localization.common.networks,
128
+ value: setSelectNetworkDataView(localization, form),
129
+ permissions: [],
130
+ },
131
+ ]
132
+ // Object.entries(selectedComputeResource).forEach(([key, value]) => {
133
+ // if (value !== null) {
134
+ // storageResult.unshift({
135
+ // label: localization.common[key],
136
+ // value: value.name,
137
+ // permissions: [],
138
+ // })
139
+ // }
140
+ // })
141
+ result = [...result, ...resourceResult]
142
+ }
143
+
88
144
  if (migrate_type === 'storage') {
89
145
  const storageData = migrateOnlyStorageDataView(localization, form, name)
90
146
  result = [...result, ...storageData]
@@ -112,7 +112,10 @@ const onSelectNetwork = (data: any): void => {
112
112
  </script>
113
113
 
114
114
  <style lang="scss" scoped>
115
+ @import 'assets/scss/common/mixins';
115
116
  .select-network {
117
+ @include flex($dir: column);
118
+ height: inherit;
116
119
  margin-top: 10px;
117
120
  &__text {
118
121
  font-size: 12px;
@@ -1,8 +1,7 @@
1
1
  <template>
2
- <div class="table-wrap">
2
+ <div class="table-view-container">
3
3
  <atoms-table-data-grid
4
4
  v-model:selected-row="selectedNetworkLocal"
5
- v-model:column-keys="columnKeys"
6
5
  v-model:page-size="pagination.pageSize"
7
6
  v-model:page="pagination.page"
8
7
  :head-items="headItems"
@@ -43,13 +42,12 @@
43
42
  import type { UI_I_Localization } from '~/lib/models/interfaces'
44
43
  import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
45
44
  import type {
46
- UI_I_ColumnKey,
47
45
  UI_I_HeadItem,
48
46
  UI_I_BodyItem,
49
47
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
50
- import type { UI_T_MigrateSelectNetwork } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
51
- import * as basicTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/basicTable'
52
- import * as advancedTable from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable'
48
+ import type { UI_T_MigrateSelectNetwork } from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/types'
49
+ import * as basicTable from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/basicTable'
50
+ import * as advancedTable from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/advancedTable'
53
51
 
54
52
  const props = defineProps<{
55
53
  networks: UI_T_MigrateSelectNetwork[]
@@ -75,13 +73,6 @@ const table: any = {
75
73
  const headItems = computed<UI_I_HeadItem[]>(() =>
76
74
  table[props.type].headItems(localization.value)
77
75
  )
78
- const columnKeys = ref<UI_I_ColumnKey[]>(() =>
79
- table[props.type].columnKeys(localization.value)
80
- )
81
- watch(localization, () => {
82
- columnKeys.value = table[props.type].columnKeys(localization.value)
83
- })
84
-
85
76
  const bodyItems = computed<UI_I_BodyItem[][]>(() => {
86
77
  return table[props.type].bodyItems(props.networks)
87
78
  })
@@ -102,14 +93,21 @@ watch(
102
93
  </script>
103
94
 
104
95
  <style lang="scss" scoped>
105
- .select-network {
106
- &__select {
107
- width: 100%;
108
- height: 24px;
109
- min-width: 107px;
110
- & > select {
111
- height: 100%;
96
+ @import 'assets/scss/common/mixins';
97
+ .table-view-container {
98
+ @include flex($dir: column);
99
+ height: inherit;
100
+ .select-network {
101
+ height: inherit;
102
+ &__select {
103
+ width: 100%;
104
+ height: 24px;
105
+ min-width: 107px;
106
+ & > select {
107
+ height: 100%;
108
+ }
112
109
  }
113
110
  }
114
111
  }
112
+
115
113
  </style>
@@ -4,8 +4,8 @@ import type {
4
4
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
5
5
  import type { UI_I_Localization } from '~/lib/models/interfaces'
6
6
  import { constructHeadItem } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
7
- import type { UI_I_MigrateSelectNetworkAdvancedItem } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
8
- import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/config/tableKeys'
7
+ import type { UI_I_MigrateSelectNetworkAdvancedItem } from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/interfaces'
8
+ import { networkAdvancedTableItemKeys } from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/config/tableKeys'
9
9
 
10
10
  const getItems = (
11
11
  localization: UI_I_Localization
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  UI_T_NetworkBasicsTableKeysTuple,
3
3
  UI_T_NetworkAdvancedTableKeysTuple,
4
- } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/types'
4
+ } from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/types'
5
5
 
6
6
  export const networkBasicsTableItemKeys: UI_T_NetworkBasicsTableKeysTuple = [
7
7
  'source_network',
@@ -1,7 +1,7 @@
1
1
  import type {
2
2
  UI_I_MigrateSelectNetworkBasicItem,
3
3
  UI_I_MigrateSelectNetworkAdvancedItem,
4
- } from '~/components/common/wizards/vm/migrate/select/network/table/network/lib/models/interfaces'
4
+ } from '~/components/common/wizards/vmNew/migrate/select/network/table/network/lib/models/interfaces'
5
5
 
6
6
  export type UI_T_NetworkAdvancedTableKeysTuple = [
7
7
  'vm_name',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.141",
4
+ "version": "1.4.143",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",