bfg-common 1.1.44 → 1.1.46

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.
@@ -120,6 +120,40 @@ export const createSecondSchemeReadyCompleteFunc = (
120
120
  },
121
121
  ]
122
122
 
123
+ export const createThirdSchemeReadyCompleteFunc = (
124
+ connectionSettingsValues: UI_I_ConnectionSettings,
125
+ targetDeviceValues: UI_I_TargetDevice,
126
+ addedAdapters: string[],
127
+ localization: UI_I_Localization
128
+ ): UI_I_ReadyCompleteData[] => [
129
+ {
130
+ id: 0,
131
+ type: 0,
132
+ rows: [
133
+ {
134
+ name: localization.newStandardSwitch,
135
+ value: '--',
136
+ },
137
+ {
138
+ name: localization.virtualMachinePortGroup,
139
+ value: connectionSettingsValues.networkLabel,
140
+ },
141
+ {
142
+ name: localization.assignedAdapters,
143
+ value: addedAdapters.join(', '),
144
+ },
145
+ {
146
+ name: localization.switchMTU,
147
+ value: targetDeviceValues.mtu?.toString(),
148
+ },
149
+ {
150
+ name: localization.vlanId,
151
+ value: connectionSettingsValues.vlanId,
152
+ },
153
+ ],
154
+ },
155
+ ]
156
+
123
157
  const makeFirstColumnOfZeroAndFirstScheme = (
124
158
  targetDevice: UI_I_TargetDevice,
125
159
  portProperties: UI_I_PortProperties,
@@ -13,6 +13,7 @@ export const {
13
13
  createSecondSchemeReadyCompleteFunc,
14
14
  createZeroSchemeReadyCompleteFunc,
15
15
  createFirstSchemeReadyCompleteFunc,
16
+ createThirdSchemeReadyCompleteFunc,
16
17
  } = addNetworkingStepsConfig
17
18
  export const {
18
19
  servicesInitial,
@@ -41,6 +42,6 @@ export const {
41
42
  } = selectSwitches
42
43
 
43
44
  export const {
44
- addNetworkingSecondSchemeDataFunc,
45
45
  addNetworkingZeroOrFirstSchemeDataFunc,
46
+ addNetworkingSecondOrThirdSchemeDataFunc,
46
47
  } = sendData
@@ -3,22 +3,37 @@ import {
3
3
  UI_I_ConnectionSettings,
4
4
  UI_I_IpFourSettings,
5
5
  UI_I_PortProperties,
6
- UI_I_SecondSchemeData,
7
6
  UI_I_TargetDevice,
7
+ UI_I_AddNetworkingSecondOrThirdSchemeDataSend,
8
8
  } from '~/components/common/addNetworking/models/interfaces'
9
9
  import { UI_I_AdapterStatus } from '~/components/common/diagramMain/models/interfaces'
10
10
 
11
- export const addNetworkingSecondSchemeDataFunc = (
11
+ export const addNetworkingSecondOrThirdSchemeDataFunc = (
12
12
  connectionSettings: UI_I_ConnectionSettings,
13
13
  targetDevice: UI_I_TargetDevice,
14
- vlan: number
15
- ): UI_I_SecondSchemeData => {
16
- return {
17
- vlan,
18
- name: connectionSettings.networkLabel,
19
- switch: targetDevice.standardSwitch,
20
- }
21
- }
14
+ vlan: number,
15
+ isSecondScheme: boolean = false,
16
+ adapterStatus?: UI_I_AdapterStatus
17
+ ): UI_I_AddNetworkingSecondOrThirdSchemeDataSend =>
18
+ isSecondScheme
19
+ ? {
20
+ vlan,
21
+ name: connectionSettings.networkLabel,
22
+ switch: targetDevice.standardSwitch,
23
+ }
24
+ : {
25
+ vlan,
26
+ name: connectionSettings.networkLabel,
27
+ new_switch: {
28
+ mtu: targetDevice.selected === '3' ? targetDevice.mtu : undefined,
29
+ nics: {
30
+ active: adapterStatus?.active || [],
31
+ standby: adapterStatus?.standby || [],
32
+ unused: adapterStatus?.unused || [],
33
+ },
34
+ },
35
+ }
36
+
22
37
  export const addNetworkingZeroOrFirstSchemeDataFunc = (
23
38
  targetDevice: UI_I_TargetDevice,
24
39
  vlan: number,
@@ -1,7 +1,5 @@
1
1
  import { UI_E_StepStatus } from '~/components/common/addNetworking/models/enums'
2
2
  import { UI_T_TCP } from '~/components/common/addNetworking/models/types'
3
- import { addNetworkingSecondSchemeDataFunc } from '~/components/common/addNetworking/config/sendData'
4
- import { createSecondSchemeReadyCompleteFunc } from '~/components/common/addNetworking/config/addNetworkingSteps'
5
3
 
6
4
  export interface UI_I_Services {
7
5
  vMotion: boolean
@@ -121,11 +119,6 @@ export interface UI_I_PortPropertiesEnabledService {
121
119
  modelValue: string
122
120
  }
123
121
 
124
- export interface UI_I_AddNetworkingSecondSchemeDataSend {
125
- name: string
126
- vlan: number
127
- switch?: string
128
- }
129
122
  export interface UI_I_AddNetworkingZeroOrFirstSchemeDataSend {
130
123
  switch?: string
131
124
  new_switch?: {
@@ -178,10 +171,18 @@ export interface UI_I_BodyItems {
178
171
  id?: string
179
172
  }
180
173
 
181
- export interface UI_I_SecondSchemeData {
174
+ export interface UI_I_AddNetworkingSecondOrThirdSchemeDataSend {
182
175
  vlan: number
183
176
  name: string
184
- switch: string | undefined
177
+ switch?: string | undefined
178
+ new_switch?: {
179
+ mtu: number | undefined
180
+ nics: {
181
+ active: string[]
182
+ standby: string[]
183
+ unused: string[]
184
+ }
185
+ }
185
186
  }
186
187
 
187
188
  export interface UI_I_VlanIdData {
@@ -137,12 +137,7 @@
137
137
  </div>
138
138
 
139
139
  <div>
140
- <div
141
- :class="[
142
- 'radio',
143
- { 'disabled-on-time': props.connectionType === '1' },
144
- ]"
145
- >
140
+ <div class="radio">
146
141
  <input
147
142
  id="standard-switch"
148
143
  v-model="fields.selected"
@@ -214,7 +214,7 @@
214
214
  view-name="migrate-vmkernel-adapter"
215
215
  width="956px"
216
216
  height="636px"
217
- :title="`esxi1.aobfg.ru - ${localization.migrateVmKernelNetworkAdapterTo} vSwitch0`"
217
+ :title="`esxi1.иридиум - ${localization.migrateVmKernelNetworkAdapterTo} vSwitch0`"
218
218
  :switch-name="diagramData.id"
219
219
  :networks-list="props.networksList"
220
220
  :switch-networks="diagramData.networks"
@@ -24,7 +24,7 @@ vi.stubGlobal('useNuxtApp', () => {
24
24
  id: 0,
25
25
  state: 2,
26
26
  type: 'host',
27
- text: 'hdev1.aobfg.ru',
27
+ text: 'hdev1.иридиум',
28
28
  CLUSTER: 'cluster01',
29
29
  shCpuUsage: 49,
30
30
  shdFreeMem: '',
@@ -82,7 +82,7 @@ vi.stubGlobal('useNuxtApp', () => {
82
82
  id: 2,
83
83
  state: 2,
84
84
  type: 'host',
85
- text: 'hdev3.aobfg.ru',
85
+ text: 'hdev3.иридиум',
86
86
  CLUSTER: 'cluster01',
87
87
  shCpuUsage: 0,
88
88
  shdFreeMem: '',
@@ -140,7 +140,7 @@ vi.stubGlobal('useNuxtApp', () => {
140
140
  id: 24,
141
141
  state: 2,
142
142
  type: 'host',
143
- text: 'hdev4.aobfg.ru',
143
+ text: 'hdev4.иридиум',
144
144
  CLUSTER: 'cluster02',
145
145
  shCpuUsage: 0,
146
146
  shdFreeMem: '',
@@ -198,7 +198,7 @@ vi.stubGlobal('useNuxtApp', () => {
198
198
  id: 25,
199
199
  state: 2,
200
200
  type: 'host',
201
- text: 'hdev5.aobfg.ru',
201
+ text: 'hdev5.иридиум',
202
202
  CLUSTER: 'cluster02',
203
203
  shCpuUsage: 0,
204
204
  shdFreeMem: '',
@@ -256,7 +256,7 @@ vi.stubGlobal('useNuxtApp', () => {
256
256
  id: 26,
257
257
  state: 2,
258
258
  type: 'host',
259
- text: 'hdev2.aobfg.ru',
259
+ text: 'hdev2.иридиум',
260
260
  CLUSTER: 'cluster02',
261
261
  shCpuUsage: 100,
262
262
  shdFreeMem: '',
@@ -317,7 +317,7 @@ vi.stubGlobal('useNuxtApp', () => {
317
317
  id: 24,
318
318
  state: 2,
319
319
  type: 'host',
320
- text: 'hdev4.aobfg.ru',
320
+ text: 'hdev4.иридиум',
321
321
  CLUSTER: 'cluster02',
322
322
  shCpuUsage: 0,
323
323
  shdFreeMem: '',
@@ -388,7 +388,7 @@ vi.stubGlobal('useNuxtApp', () => {
388
388
  // children: [
389
389
  // {
390
390
  // id: 24,
391
- // text: 'hdev4.aobfg.ru',
391
+ // text: 'hdev4.иридиум',
392
392
  // iconClassName: 'icon-host-connect',
393
393
  // type: 'host',
394
394
  // isActive: false,
@@ -399,7 +399,7 @@ vi.stubGlobal('useNuxtApp', () => {
399
399
  // },
400
400
  // {
401
401
  // id: 25,
402
- // text: 'hdev5.aobfg.ru',
402
+ // text: 'hdev5.иридиум',
403
403
  // iconClassName: 'icon-host-connect',
404
404
  // type: 'host',
405
405
  // isActive: false,
@@ -410,7 +410,7 @@ vi.stubGlobal('useNuxtApp', () => {
410
410
  // },
411
411
  // {
412
412
  // id: 26,
413
- // text: 'hdev2.aobfg.ru',
413
+ // text: 'hdev2.иридиум',
414
414
  // iconClassName: 'icon-host-connect',
415
415
  // type: 'host',
416
416
  // isActive: false,
@@ -425,7 +425,7 @@ vi.stubGlobal('useNuxtApp', () => {
425
425
  //
426
426
  // const selectedNode2 = {
427
427
  // id: 24,
428
- // text: 'hdev4.aobfg.ru',
428
+ // text: 'hdev4.иридиум',
429
429
  // iconClassName: 'icon-host-connect',
430
430
  // type: 'host',
431
431
  // isActive: true,
@@ -9,27 +9,27 @@ const compatibleHostsTable: API_UI_I_DataTable<I_CompatibleHostsTable[]> = {
9
9
  items: [
10
10
  {
11
11
  id: 1,
12
- host: 'esxi0.aobfg.ru',
12
+ host: 'esxi0.иридиум',
13
13
  cluster: 'Cluster00',
14
14
  },
15
15
  {
16
16
  id: 2,
17
- host: ' esxi0.aobfg.ru',
17
+ host: ' esxi0.иридиум',
18
18
  cluster: 'Cluster00',
19
19
  },
20
20
  {
21
21
  id: 3,
22
- host: 'esxi3.aobfg.ru',
22
+ host: 'esxi3.иридиум',
23
23
  cluster: 'Cluster00',
24
24
  },
25
25
  {
26
26
  id: 4,
27
- host: 'esxi4.aobfg.ru',
27
+ host: 'esxi4.иридиум',
28
28
  cluster: 'Cluster00',
29
29
  },
30
30
  {
31
31
  id: 5,
32
- host: 'esxi1.aobfg.ru',
32
+ host: 'esxi1.иридиум',
33
33
  cluster: 'Cluster01',
34
34
  },
35
35
  ],
@@ -40,21 +40,21 @@ const incompatibleHostsTable: API_UI_I_DataTable<I_IncompatibleHostsTable[]> = {
40
40
  items: [
41
41
  {
42
42
  id: 1,
43
- host: 'esxi0.aobfg.ru',
43
+ host: 'esxi0.иридиум',
44
44
  host_incompatibility_reason:
45
45
  'Kerberos is not supported as host is not in AD domain',
46
46
  cluster: 'Cluster00',
47
47
  },
48
48
  {
49
49
  id: 2,
50
- host: 'esxi0.aobfg.ru',
50
+ host: 'esxi0.иридиум',
51
51
  host_incompatibility_reason:
52
52
  'Kerberos is not supported as host is not in AD domain',
53
53
  cluster: 'Cluster00',
54
54
  },
55
55
  {
56
56
  id: 3,
57
- host: 'esxi0.aobfg.ru',
57
+ host: 'esxi0.иридиум',
58
58
  host_incompatibility_reason:
59
59
  'Kerberos is not supported as host is not in AD domain',
60
60
  cluster: 'Cluster00',
@@ -1,92 +1,92 @@
1
- import { defineNuxtModule } from '@nuxt/kit'
2
- const fs = require('fs')
3
- const path = require('path')
4
- import {
5
- replaceFileContent,
6
- removeNonImageFiles,
7
- removeImagesFromContent,
8
- updateImagesPathAndCustomComponents,
9
- } from './utils/methods'
10
-
11
- // const npmDev = (): void => {
12
- // const contentPath = path.join(
13
- // __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
14
- // 'content',
15
- // 'help'
16
- // )
17
- // // Заменяем кастомные тэги
18
- // updateCustomComponents(contentPath)
19
- // }
20
-
21
- const npmGenerate = (): void => {
22
- // Правим путь к файлу
23
- const filePath = path.join(
24
- __dirname.replace('/bfg-common/modules/fixContentBuild', ''),
25
- '@nuxt',
26
- 'content',
27
- 'dist',
28
- 'runtime',
29
- 'legacy',
30
- 'composables',
31
- 'query.js'
32
- )
33
- const searchString = '/query/${hash(params)}'
34
- const replacementString = 'cache'
35
- replaceFileContent(filePath, searchString, replacementString)
36
- // End block
37
-
38
- // Переносим весь контент и удаляем все файлы кроме картинок
39
- const contentPath = path.join(
40
- __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
41
- 'content',
42
- 'help'
43
- )
44
- if (!fs.existsSync(contentPath)) return
45
-
46
- const publicPath = path.join(
47
- __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
48
- 'public',
49
- 'help',
50
- 'images'
51
- )
52
- fs.cp(contentPath, publicPath, { recursive: true }, () => {
53
- // Удаляем все файлы кроме картинок
54
- removeNonImageFiles(publicPath)
55
-
56
- // Удаляем картинки из папки content
57
- removeImagesFromContent(contentPath)
58
-
59
- // Правим путь к картинкам и заменяем кастомные тэги
60
- updateImagesPathAndCustomComponents(contentPath)
61
- })
62
- // End block
63
- }
64
-
65
- // @ts-ignore
66
- export default defineNuxtModule(() => {
67
- switch (process.env.npm_command) {
68
- case 'run-script':
69
- // npmDev()
70
- break
71
- case 'exec':
72
- npmGenerate()
73
- break
74
- }
75
- })
76
-
77
- // export default defineNuxtModule({
78
- // meta: {
79
- // name: 'fix-content-build',
80
- // configKey: 'fixContentBuild',
81
- // },
82
- // setup() {
83
- // switch (process.env.npm_command) {
84
- // case 'run-script':
85
- // // npmDev()
86
- // break
87
- // case 'exec':
88
- // npmGenerate()
89
- // break
90
- // }
91
- // },
92
- // })
1
+ import { defineNuxtModule } from '@nuxt/kit'
2
+ const fs = require('fs')
3
+ const path = require('path')
4
+ import {
5
+ replaceFileContent,
6
+ removeNonImageFiles,
7
+ removeImagesFromContent,
8
+ updateImagesPathAndCustomComponents,
9
+ } from './utils/methods'
10
+
11
+ // const npmDev = (): void => {
12
+ // const contentPath = path.join(
13
+ // __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
14
+ // 'content',
15
+ // 'help'
16
+ // )
17
+ // // Заменяем кастомные тэги
18
+ // updateCustomComponents(contentPath)
19
+ // }
20
+
21
+ const npmGenerate = (): void => {
22
+ // Правим путь к файлу
23
+ const filePath = path.join(
24
+ __dirname.replace('/bfg-common/modules/fixContentBuild', ''),
25
+ '@nuxt',
26
+ 'content',
27
+ 'dist',
28
+ 'runtime',
29
+ 'legacy',
30
+ 'composables',
31
+ 'query.js'
32
+ )
33
+ const searchString = '/query/${hash(params)}'
34
+ const replacementString = 'cache'
35
+ replaceFileContent(filePath, searchString, replacementString)
36
+ // End block
37
+
38
+ // Переносим весь контент и удаляем все файлы кроме картинок
39
+ const contentPath = path.join(
40
+ __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
41
+ 'content',
42
+ 'help'
43
+ )
44
+ if (!fs.existsSync(contentPath)) return
45
+
46
+ const publicPath = path.join(
47
+ __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
48
+ 'public',
49
+ 'help',
50
+ 'images'
51
+ )
52
+ fs.cp(contentPath, publicPath, { recursive: true }, () => {
53
+ // Удаляем все файлы кроме картинок
54
+ removeNonImageFiles(publicPath)
55
+
56
+ // Удаляем картинки из папки content
57
+ removeImagesFromContent(contentPath)
58
+
59
+ // Правим путь к картинкам и заменяем кастомные тэги
60
+ updateImagesPathAndCustomComponents(contentPath)
61
+ })
62
+ // End block
63
+ }
64
+
65
+ // @ts-ignore
66
+ export default defineNuxtModule(() => {
67
+ switch (process.env.npm_command) {
68
+ case 'run-script':
69
+ // npmDev()
70
+ break
71
+ case 'exec':
72
+ npmGenerate()
73
+ break
74
+ }
75
+ })
76
+
77
+ // export default defineNuxtModule({
78
+ // meta: {
79
+ // name: 'fix-content-build',
80
+ // configKey: 'fixContentBuild',
81
+ // },
82
+ // setup() {
83
+ // switch (process.env.npm_command) {
84
+ // case 'run-script':
85
+ // // npmDev()
86
+ // break
87
+ // case 'exec':
88
+ // npmGenerate()
89
+ // break
90
+ // }
91
+ // },
92
+ // })
@@ -0,0 +1,47 @@
1
+ import { defineNuxtModule } from '@nuxt/kit'
2
+ const fs = require('fs')
3
+ const path = require('path')
4
+
5
+ const npmGenerate = (): void => {
6
+ // Переносим весь контент и удаляем все файлы кроме картинок
7
+ const filePath = path.join(
8
+ __dirname.replace('/node_modules/bfg-common/modules/fixContentBuild', ''),
9
+ 'assets',
10
+ 'scss',
11
+ 'common',
12
+ 'normalize.css'
13
+ )
14
+ if (!fs.existsSync(filePath)) return
15
+
16
+ const searchString = 'FONT'
17
+ const replacementString = process.env.FONT || ''
18
+ fs.readFile(filePath, 'utf8', (err: any, data: string) => {
19
+ if (err) {
20
+ return console.log(err)
21
+ }
22
+
23
+ if (data.match(replacementString)) {
24
+ return
25
+ }
26
+
27
+ const updatedContent = data.replace(searchString, replacementString)
28
+
29
+ fs.writeFile(filePath, updatedContent, 'utf8', (err: any) => {
30
+ if (err) {
31
+ return console.log(err)
32
+ }
33
+ })
34
+ })
35
+ }
36
+
37
+ // @ts-ignore
38
+ export default defineNuxtModule(() => {
39
+ switch (process.env.npm_command) {
40
+ case 'run-script':
41
+ // npmDev()
42
+ break
43
+ case 'exec':
44
+ npmGenerate()
45
+ break
46
+ }
47
+ })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.1.44",
4
+ "version": "1.1.46",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",