bfg-common 1.3.287 → 1.3.288
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.
- package/assets/localization/local_be.json +2 -1
- package/assets/localization/local_en.json +2 -1
- package/assets/localization/local_hy.json +2 -1
- package/assets/localization/local_kk.json +2 -1
- package/assets/localization/local_ru.json +2 -1
- package/assets/localization/local_zh.json +2 -1
- package/components/common/vm/actions/add/Add.vue +609 -577
- package/components/common/vm/actions/add/lib/config/steps.ts +6 -1
- package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +164 -170
- package/components/common/vm/actions/common/select/computeResource/lib/ComputeResource.spec.ts +473 -473
- package/components/common/vm/actions/common/select/name/Name.vue +6 -0
- package/package.json +1 -1
package/components/common/vm/actions/common/select/computeResource/lib/ComputeResource.spec.ts
CHANGED
|
@@ -1,479 +1,479 @@
|
|
|
1
|
-
import { describe, test, expect, vi } from 'vitest'
|
|
2
|
-
import { mount } from '@vue/test-utils'
|
|
3
|
-
import AtomsAlert from '../../../../../atoms/alert/Alert.vue'
|
|
4
|
-
import SelectComputeResource from './SelectComputeResource.vue'
|
|
5
|
-
import { I_TreeNode } from '~/components/templates/inventory/treeView/lib/models/interfaces'
|
|
6
|
-
|
|
7
|
-
vi.stubGlobal('useLocal', () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
vi.stubGlobal('useNuxtApp', () => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
},
|
|
377
|
-
}
|
|
378
|
-
})
|
|
379
|
-
|
|
380
|
-
// const selectedNode1 = {
|
|
381
|
-
// id: 299,
|
|
382
|
-
// text: 'cluster02',
|
|
383
|
-
// iconClassName: 'vsphere-icon-cluster',
|
|
384
|
-
// type: 'cluster',
|
|
385
|
-
// isActive: true,
|
|
386
|
-
// hasChild: true,
|
|
387
|
-
// childrenShow: true,
|
|
388
|
-
// children: [
|
|
389
|
-
// {
|
|
390
|
-
// id: 24,
|
|
391
|
-
// text: 'hdev4.иридиум',
|
|
392
|
-
// iconClassName: 'icon-host-connect',
|
|
393
|
-
// type: 'host',
|
|
394
|
-
// isActive: false,
|
|
395
|
-
// hasChild: false,
|
|
396
|
-
// childrenShow: false,
|
|
397
|
-
// children: [],
|
|
398
|
-
// isShow: true,
|
|
1
|
+
// import { describe, test, expect, vi } from 'vitest'
|
|
2
|
+
// import { mount } from '@vue/test-utils'
|
|
3
|
+
// import AtomsAlert from '../../../../../atoms/alert/Alert.vue'
|
|
4
|
+
// import SelectComputeResource from './SelectComputeResource.vue'
|
|
5
|
+
// import { I_TreeNode } from '~/components/templates/inventory/treeView/lib/models/interfaces'
|
|
6
|
+
//
|
|
7
|
+
// vi.stubGlobal('useLocal', () => {
|
|
8
|
+
// return {
|
|
9
|
+
// specifyValidClusterOrHostDestination: 'error test',
|
|
10
|
+
// compatibilityChecksSucceeded: 'test',
|
|
11
|
+
// selectValidClusterOrHostDestination: 'test',
|
|
12
|
+
// clusterNotContainAnyHosts: 'test',
|
|
13
|
+
// selectedHostDisconnectedMaintenanceMode: 'test',
|
|
14
|
+
// }
|
|
15
|
+
// })
|
|
16
|
+
//
|
|
17
|
+
// vi.stubGlobal('useNuxtApp', () => {
|
|
18
|
+
// return {
|
|
19
|
+
// $store: {
|
|
20
|
+
// getters: {
|
|
21
|
+
// 'inventory/getPoolOfHosts': {
|
|
22
|
+
// value: [
|
|
23
|
+
// {
|
|
24
|
+
// id: 0,
|
|
25
|
+
// state: 2,
|
|
26
|
+
// type: 'host',
|
|
27
|
+
// text: 'hdev1.иридиум',
|
|
28
|
+
// CLUSTER: 'cluster01',
|
|
29
|
+
// shCpuUsage: 49,
|
|
30
|
+
// shdFreeMem: '',
|
|
31
|
+
// shdId: '',
|
|
32
|
+
// shdTotalMb: '',
|
|
33
|
+
// shdUsedMb: '',
|
|
34
|
+
// shDiskUsage: 0,
|
|
35
|
+
// shFreeCpu: 448,
|
|
36
|
+
// shFreeDisk: 27620,
|
|
37
|
+
// shFreeMem: 12347160,
|
|
38
|
+
// shMaxCpu: 800,
|
|
39
|
+
// shMaxDisk: 44831,
|
|
40
|
+
// shMaxMem: 16335812,
|
|
41
|
+
// shMemUsage: 1310720,
|
|
42
|
+
// shbName: 'hvssw0',
|
|
43
|
+
// shbStp: false,
|
|
44
|
+
// shbType: 'ovs',
|
|
45
|
+
// shPciDevices: [null],
|
|
46
|
+
// shRunningVms: 5,
|
|
47
|
+
// shTotalCpu: 800,
|
|
48
|
+
// shTotalMem: 16335812,
|
|
49
|
+
// shUsedCpu: 352,
|
|
50
|
+
// shUsedDisk: 17211,
|
|
51
|
+
// shUsedMem: 3988652,
|
|
52
|
+
// IM_MAD: 'kvm',
|
|
53
|
+
// LAST_MON_TIME: 1667999807,
|
|
54
|
+
// STATE: 2,
|
|
55
|
+
// tplArch: 'x86_64',
|
|
56
|
+
// tplCpuspeed: 'x86_64',
|
|
57
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
58
|
+
// tplHostname: 'hcs-dev1',
|
|
59
|
+
// tplHvsVersion: '21.04-r16',
|
|
60
|
+
// tplHypervisor: 'kvm',
|
|
61
|
+
// tplImMad: 'kvm',
|
|
62
|
+
// tplLabels: '',
|
|
63
|
+
// tplLogicalProcessors: 8,
|
|
64
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
65
|
+
// tplModelname: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
66
|
+
// tplNetrx: 15619909053,
|
|
67
|
+
// tplNettx: 1042941236,
|
|
68
|
+
// tplUptime: 'up 1 week, 4 days, 6 hours, 54 minutes',
|
|
69
|
+
// tplVersion: '1.1.29',
|
|
70
|
+
// tplVmMad: 'kvm',
|
|
71
|
+
// VMS: [55, 56, 57, 58, 59],
|
|
72
|
+
// VM_MAD: 'kvm',
|
|
73
|
+
// iconClassName: 'icon-host-connect',
|
|
74
|
+
// isActive: false,
|
|
75
|
+
// hasChild: false,
|
|
76
|
+
// childrenShow: false,
|
|
77
|
+
// children: [],
|
|
78
|
+
// clusterId: 186,
|
|
79
|
+
// isShow: true,
|
|
80
|
+
// },
|
|
81
|
+
// {
|
|
82
|
+
// id: 2,
|
|
83
|
+
// state: 2,
|
|
84
|
+
// type: 'host',
|
|
85
|
+
// text: 'hdev3.иридиум',
|
|
86
|
+
// CLUSTER: 'cluster01',
|
|
87
|
+
// shCpuUsage: 0,
|
|
88
|
+
// shdFreeMem: '',
|
|
89
|
+
// shdId: '',
|
|
90
|
+
// shdTotalMb: '',
|
|
91
|
+
// shdUsedMb: '',
|
|
92
|
+
// shDiskUsage: 0,
|
|
93
|
+
// shFreeCpu: 800,
|
|
94
|
+
// shFreeDisk: 44481,
|
|
95
|
+
// shFreeMem: 16025608,
|
|
96
|
+
// shMaxCpu: 800,
|
|
97
|
+
// shMaxDisk: 44831,
|
|
98
|
+
// shMaxMem: 16335812,
|
|
99
|
+
// shMemUsage: 0,
|
|
100
|
+
// shbName: 'hvssw0',
|
|
101
|
+
// shbStp: false,
|
|
102
|
+
// shbType: 'ovs',
|
|
103
|
+
// shPciDevices: [null],
|
|
104
|
+
// shRunningVms: 0,
|
|
105
|
+
// shTotalCpu: 800,
|
|
106
|
+
// shTotalMem: 16335812,
|
|
107
|
+
// shUsedCpu: 0,
|
|
108
|
+
// shUsedDisk: 350,
|
|
109
|
+
// shUsedMem: 310204,
|
|
110
|
+
// IM_MAD: 'kvm',
|
|
111
|
+
// LAST_MON_TIME: 1667999802,
|
|
112
|
+
// STATE: 2,
|
|
113
|
+
// tplArch: 'x86_64',
|
|
114
|
+
// tplCpuspeed: 'x86_64',
|
|
115
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
116
|
+
// tplHostname: 'hcs-dev3',
|
|
117
|
+
// tplHvsVersion: '21.04-r16',
|
|
118
|
+
// tplHypervisor: 'kvm',
|
|
119
|
+
// tplImMad: 'kvm',
|
|
120
|
+
// tplLabels: '',
|
|
121
|
+
// tplLogicalProcessors: 8,
|
|
122
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
123
|
+
// tplModelname: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
124
|
+
// tplNetrx: 241141142,
|
|
125
|
+
// tplNettx: 165303817,
|
|
126
|
+
// tplUptime: 'up 1 week, 4 days, 6 hours, 55 minutes',
|
|
127
|
+
// tplVersion: '1.1.29',
|
|
128
|
+
// tplVmMad: 'kvm',
|
|
129
|
+
// VMS: [],
|
|
130
|
+
// VM_MAD: 'kvm',
|
|
131
|
+
// iconClassName: 'icon-host-connect',
|
|
132
|
+
// isActive: false,
|
|
133
|
+
// hasChild: false,
|
|
134
|
+
// childrenShow: false,
|
|
135
|
+
// children: [],
|
|
136
|
+
// clusterId: 186,
|
|
137
|
+
// isShow: true,
|
|
138
|
+
// },
|
|
139
|
+
// {
|
|
140
|
+
// id: 24,
|
|
141
|
+
// state: 2,
|
|
142
|
+
// type: 'host',
|
|
143
|
+
// text: 'hdev4.иридиум',
|
|
144
|
+
// CLUSTER: 'cluster02',
|
|
145
|
+
// shCpuUsage: 0,
|
|
146
|
+
// shdFreeMem: '',
|
|
147
|
+
// shdId: '',
|
|
148
|
+
// shdTotalMb: '',
|
|
149
|
+
// shdUsedMb: '',
|
|
150
|
+
// shDiskUsage: 0,
|
|
151
|
+
// shFreeCpu: 800,
|
|
152
|
+
// shFreeDisk: 44481,
|
|
153
|
+
// shFreeMem: 16035828,
|
|
154
|
+
// shMaxCpu: 800,
|
|
155
|
+
// shMaxDisk: 44831,
|
|
156
|
+
// shMaxMem: 16335812,
|
|
157
|
+
// shMemUsage: 0,
|
|
158
|
+
// shbName: 'hvssw0',
|
|
159
|
+
// shbStp: false,
|
|
160
|
+
// shbType: 'ovs',
|
|
161
|
+
// shPciDevices: [null],
|
|
162
|
+
// shRunningVms: 0,
|
|
163
|
+
// shTotalCpu: 800,
|
|
164
|
+
// shTotalMem: 16335812,
|
|
165
|
+
// shUsedCpu: 0,
|
|
166
|
+
// shUsedDisk: 350,
|
|
167
|
+
// shUsedMem: 299984,
|
|
168
|
+
// IM_MAD: 'kvm',
|
|
169
|
+
// LAST_MON_TIME: 1667999797,
|
|
170
|
+
// STATE: 2,
|
|
171
|
+
// tplArch: 'x86_64',
|
|
172
|
+
// tplCpuspeed: 'x86_64',
|
|
173
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
174
|
+
// tplHostname: 'hcs-dev4',
|
|
175
|
+
// tplHvsVersion: '21.04-r16',
|
|
176
|
+
// tplHypervisor: 'kvm',
|
|
177
|
+
// tplImMad: 'kvm',
|
|
178
|
+
// tplLabels: '',
|
|
179
|
+
// tplLogicalProcessors: 8,
|
|
180
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
181
|
+
// tplModelname: '',
|
|
182
|
+
// tplNetrx: 211570793,
|
|
183
|
+
// tplNettx: 136135205,
|
|
184
|
+
// tplUptime: 'up 1 week, 4 days, 6 hours, 55 minutes',
|
|
185
|
+
// tplVersion: '1.1.29',
|
|
186
|
+
// tplVmMad: 'kvm',
|
|
187
|
+
// VMS: [],
|
|
188
|
+
// VM_MAD: 'kvm',
|
|
189
|
+
// iconClassName: 'icon-host-connect',
|
|
190
|
+
// isActive: false,
|
|
191
|
+
// hasChild: false,
|
|
192
|
+
// childrenShow: false,
|
|
193
|
+
// children: [],
|
|
194
|
+
// clusterId: 299,
|
|
195
|
+
// isShow: true,
|
|
196
|
+
// },
|
|
197
|
+
// {
|
|
198
|
+
// id: 25,
|
|
199
|
+
// state: 2,
|
|
200
|
+
// type: 'host',
|
|
201
|
+
// text: 'hdev5.иридиум',
|
|
202
|
+
// CLUSTER: 'cluster02',
|
|
203
|
+
// shCpuUsage: 0,
|
|
204
|
+
// shdFreeMem: '',
|
|
205
|
+
// shdId: '',
|
|
206
|
+
// shdTotalMb: '',
|
|
207
|
+
// shdUsedMb: '',
|
|
208
|
+
// shDiskUsage: 0,
|
|
209
|
+
// shFreeCpu: 800,
|
|
210
|
+
// shFreeDisk: 44481,
|
|
211
|
+
// shFreeMem: 16035316,
|
|
212
|
+
// shMaxCpu: 800,
|
|
213
|
+
// shMaxDisk: 44831,
|
|
214
|
+
// shMaxMem: 16335812,
|
|
215
|
+
// shMemUsage: 0,
|
|
216
|
+
// shbName: 'hvssw0',
|
|
217
|
+
// shbStp: false,
|
|
218
|
+
// shbType: 'ovs',
|
|
219
|
+
// shPciDevices: [null],
|
|
220
|
+
// shRunningVms: 0,
|
|
221
|
+
// shTotalCpu: 800,
|
|
222
|
+
// shTotalMem: 16335812,
|
|
223
|
+
// shUsedCpu: 0,
|
|
224
|
+
// shUsedDisk: 350,
|
|
225
|
+
// shUsedMem: 300496,
|
|
226
|
+
// IM_MAD: 'kvm',
|
|
227
|
+
// LAST_MON_TIME: 1667999802,
|
|
228
|
+
// STATE: 2,
|
|
229
|
+
// tplArch: 'x86_64',
|
|
230
|
+
// tplCpuspeed: 'x86_64',
|
|
231
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
232
|
+
// tplHostname: 'hcs-dev5',
|
|
233
|
+
// tplHvsVersion: '21.04-r16',
|
|
234
|
+
// tplHypervisor: 'kvm',
|
|
235
|
+
// tplImMad: 'kvm',
|
|
236
|
+
// tplLabels: '',
|
|
237
|
+
// tplLogicalProcessors: 8,
|
|
238
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
239
|
+
// tplModelname: '',
|
|
240
|
+
// tplNetrx: 214135211,
|
|
241
|
+
// tplNettx: 136727383,
|
|
242
|
+
// tplUptime: 'up 1 week, 4 days, 6 hours, 54 minutes',
|
|
243
|
+
// tplVersion: '1.1.29',
|
|
244
|
+
// tplVmMad: 'kvm',
|
|
245
|
+
// VMS: [],
|
|
246
|
+
// VM_MAD: 'kvm',
|
|
247
|
+
// iconClassName: 'icon-host-connect',
|
|
248
|
+
// isActive: false,
|
|
249
|
+
// hasChild: false,
|
|
250
|
+
// childrenShow: false,
|
|
251
|
+
// children: [],
|
|
252
|
+
// clusterId: 299,
|
|
253
|
+
// isShow: true,
|
|
254
|
+
// },
|
|
255
|
+
// {
|
|
256
|
+
// id: 26,
|
|
257
|
+
// state: 2,
|
|
258
|
+
// type: 'host',
|
|
259
|
+
// text: 'hdev2.иридиум',
|
|
260
|
+
// CLUSTER: 'cluster02',
|
|
261
|
+
// shCpuUsage: 100,
|
|
262
|
+
// shdFreeMem: '',
|
|
263
|
+
// shdId: '',
|
|
264
|
+
// shdTotalMb: '',
|
|
265
|
+
// shdUsedMb: '',
|
|
266
|
+
// shDiskUsage: 0,
|
|
267
|
+
// shFreeCpu: 760,
|
|
268
|
+
// shFreeDisk: 44481,
|
|
269
|
+
// shFreeMem: 15543228,
|
|
270
|
+
// shMaxCpu: 800,
|
|
271
|
+
// shMaxDisk: 44831,
|
|
272
|
+
// shMaxMem: 16335812,
|
|
273
|
+
// shMemUsage: 2621440,
|
|
274
|
+
// shbName: 'hvssw0',
|
|
275
|
+
// shbStp: false,
|
|
276
|
+
// shbType: 'ovs',
|
|
277
|
+
// shPciDevices: [null],
|
|
278
|
+
// shRunningVms: 10,
|
|
279
|
+
// shTotalCpu: 800,
|
|
280
|
+
// shTotalMem: 16335812,
|
|
281
|
+
// shUsedCpu: 40,
|
|
282
|
+
// shUsedDisk: 351,
|
|
283
|
+
// shUsedMem: 792584,
|
|
284
|
+
// IM_MAD: 'kvm',
|
|
285
|
+
// LAST_MON_TIME: 1667999797,
|
|
286
|
+
// STATE: 2,
|
|
287
|
+
// tplArch: 'x86_64',
|
|
288
|
+
// tplCpuspeed: 'x86_64',
|
|
289
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
290
|
+
// tplHostname: 'hcs-dev2',
|
|
291
|
+
// tplHvsVersion: '21.04-r16',
|
|
292
|
+
// tplHypervisor: 'kvm',
|
|
293
|
+
// tplImMad: 'kvm',
|
|
294
|
+
// tplLabels: '',
|
|
295
|
+
// tplLogicalProcessors: 8,
|
|
296
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
297
|
+
// tplModelname: '',
|
|
298
|
+
// tplNetrx: 243255597,
|
|
299
|
+
// tplNettx: 177126118,
|
|
300
|
+
// tplUptime: 'up 1 week, 4 days, 6 hours, 54 minutes',
|
|
301
|
+
// tplVersion: '1.1.29',
|
|
302
|
+
// tplVmMad: 'kvm',
|
|
303
|
+
// VMS: [60, 61, 62, 63, 64, 65, 66, 67, 68, 69],
|
|
304
|
+
// VM_MAD: 'kvm',
|
|
305
|
+
// iconClassName: 'icon-host-connect',
|
|
306
|
+
// isActive: false,
|
|
307
|
+
// hasChild: false,
|
|
308
|
+
// childrenShow: false,
|
|
309
|
+
// children: [],
|
|
310
|
+
// clusterId: 299,
|
|
311
|
+
// isShow: true,
|
|
312
|
+
// },
|
|
313
|
+
// ],
|
|
314
|
+
// },
|
|
315
|
+
// 'inventory/getHostOfPoolInfoById': {
|
|
316
|
+
// value: {
|
|
317
|
+
// id: 24,
|
|
318
|
+
// state: 2,
|
|
319
|
+
// type: 'host',
|
|
320
|
+
// text: 'hdev4.иридиум',
|
|
321
|
+
// CLUSTER: 'cluster02',
|
|
322
|
+
// shCpuUsage: 0,
|
|
323
|
+
// shdFreeMem: '',
|
|
324
|
+
// shdId: '',
|
|
325
|
+
// shdTotalMb: '',
|
|
326
|
+
// shdUsedMb: '',
|
|
327
|
+
// shDiskUsage: 0,
|
|
328
|
+
// shFreeCpu: 800,
|
|
329
|
+
// shFreeDisk: 44481,
|
|
330
|
+
// shFreeMem: 16036516,
|
|
331
|
+
// shMaxCpu: 800,
|
|
332
|
+
// shMaxDisk: 44831,
|
|
333
|
+
// shMaxMem: 16335812,
|
|
334
|
+
// shMemUsage: 0,
|
|
335
|
+
// shbName: 'hvssw0',
|
|
336
|
+
// shbStp: false,
|
|
337
|
+
// shbType: 'ovs',
|
|
338
|
+
// shPciDevices: [null],
|
|
339
|
+
// shRunningVms: 0,
|
|
340
|
+
// shTotalCpu: 800,
|
|
341
|
+
// shTotalMem: 16335812,
|
|
342
|
+
// shUsedCpu: 0,
|
|
343
|
+
// shUsedDisk: 350,
|
|
344
|
+
// shUsedMem: 299296,
|
|
345
|
+
// IM_MAD: 'kvm',
|
|
346
|
+
// LAST_MON_TIME: 1668001572,
|
|
347
|
+
// STATE: 2,
|
|
348
|
+
// tplArch: 'x86_64',
|
|
349
|
+
// tplCpuspeed: 'x86_64',
|
|
350
|
+
// tplCpuType: 'Intel(R) Xeon(R) CPU E5-2620 v4 @ 2.10GHz',
|
|
351
|
+
// tplHostname: 'hcs-dev4',
|
|
352
|
+
// tplHvsVersion: '21.04-r16',
|
|
353
|
+
// tplHypervisor: 'kvm',
|
|
354
|
+
// tplImMad: 'kvm',
|
|
355
|
+
// tplLabels: '',
|
|
356
|
+
// tplLogicalProcessors: 8,
|
|
357
|
+
// tplModel: 'Standard PC (Q35 + ICH9, 2009)',
|
|
358
|
+
// tplModelname: '',
|
|
359
|
+
// tplNetrx: 211793678,
|
|
360
|
+
// tplNettx: 136399461,
|
|
361
|
+
// tplUptime: 'up 1 week, 4 days, 7 hours, 25 minutes',
|
|
362
|
+
// tplVersion: '1.1.29',
|
|
363
|
+
// tplVmMad: 'kvm',
|
|
364
|
+
// VMS: [],
|
|
365
|
+
// VM_MAD: 'kvm',
|
|
366
|
+
// iconClassName: 'icon-host-connect',
|
|
367
|
+
// isActive: false,
|
|
368
|
+
// hasChild: false,
|
|
369
|
+
// childrenShow: false,
|
|
370
|
+
// children: [],
|
|
371
|
+
// clusterId: 299,
|
|
372
|
+
// isShow: true,
|
|
373
|
+
// },
|
|
374
|
+
// },
|
|
375
|
+
// },
|
|
399
376
|
// },
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
//
|
|
407
|
-
//
|
|
408
|
-
//
|
|
409
|
-
//
|
|
377
|
+
// }
|
|
378
|
+
// })
|
|
379
|
+
//
|
|
380
|
+
// // const selectedNode1 = {
|
|
381
|
+
// // id: 299,
|
|
382
|
+
// // text: 'cluster02',
|
|
383
|
+
// // iconClassName: 'vsphere-icon-cluster',
|
|
384
|
+
// // type: 'cluster',
|
|
385
|
+
// // isActive: true,
|
|
386
|
+
// // hasChild: true,
|
|
387
|
+
// // childrenShow: true,
|
|
388
|
+
// // children: [
|
|
389
|
+
// // {
|
|
390
|
+
// // id: 24,
|
|
391
|
+
// // text: 'hdev4.иридиум',
|
|
392
|
+
// // iconClassName: 'icon-host-connect',
|
|
393
|
+
// // type: 'host',
|
|
394
|
+
// // isActive: false,
|
|
395
|
+
// // hasChild: false,
|
|
396
|
+
// // childrenShow: false,
|
|
397
|
+
// // children: [],
|
|
398
|
+
// // isShow: true,
|
|
399
|
+
// // },
|
|
400
|
+
// // {
|
|
401
|
+
// // id: 25,
|
|
402
|
+
// // text: 'hdev5.иридиум',
|
|
403
|
+
// // iconClassName: 'icon-host-connect',
|
|
404
|
+
// // type: 'host',
|
|
405
|
+
// // isActive: false,
|
|
406
|
+
// // hasChild: false,
|
|
407
|
+
// // childrenShow: false,
|
|
408
|
+
// // children: [],
|
|
409
|
+
// // isShow: true,
|
|
410
|
+
// // },
|
|
411
|
+
// // {
|
|
412
|
+
// // id: 26,
|
|
413
|
+
// // text: 'hdev2.иридиум',
|
|
414
|
+
// // iconClassName: 'icon-host-connect',
|
|
415
|
+
// // type: 'host',
|
|
416
|
+
// // isActive: false,
|
|
417
|
+
// // hasChild: false,
|
|
418
|
+
// // childrenShow: false,
|
|
419
|
+
// // children: [],
|
|
420
|
+
// // isShow: true,
|
|
421
|
+
// // },
|
|
422
|
+
// // ],
|
|
423
|
+
// // isShow: true,
|
|
424
|
+
// // }
|
|
425
|
+
// //
|
|
426
|
+
// // const selectedNode2 = {
|
|
427
|
+
// // id: 24,
|
|
428
|
+
// // text: 'hdev4.иридиум',
|
|
429
|
+
// // iconClassName: 'icon-host-connect',
|
|
430
|
+
// // type: 'host',
|
|
431
|
+
// // isActive: true,
|
|
432
|
+
// // hasChild: false,
|
|
433
|
+
// // childrenShow: false,
|
|
434
|
+
// // children: [],
|
|
435
|
+
// // isShow: true,
|
|
436
|
+
// // }
|
|
437
|
+
// //
|
|
438
|
+
// // const selectedNode3 = {
|
|
439
|
+
// // id: 311,
|
|
440
|
+
// // text: 'cluster07',
|
|
441
|
+
// // iconClassName: 'vsphere-icon-cluster',
|
|
442
|
+
// // type: 'cluster',
|
|
443
|
+
// // isActive: true,
|
|
444
|
+
// // hasChild: false,
|
|
445
|
+
// // childrenShow: true,
|
|
446
|
+
// // children: [],
|
|
447
|
+
// // isShow: true,
|
|
448
|
+
// // }
|
|
449
|
+
//
|
|
450
|
+
// const factory = () => {
|
|
451
|
+
// return mount(SelectComputeResource, {
|
|
452
|
+
// props: {
|
|
453
|
+
// computeResourceSubmit: 0,
|
|
454
|
+
// dataCenter: {} as I_TreeNode,
|
|
410
455
|
// },
|
|
411
|
-
// {
|
|
412
|
-
//
|
|
413
|
-
// text: 'hdev2.иридиум',
|
|
414
|
-
// iconClassName: 'icon-host-connect',
|
|
415
|
-
// type: 'host',
|
|
416
|
-
// isActive: false,
|
|
417
|
-
// hasChild: false,
|
|
418
|
-
// childrenShow: false,
|
|
419
|
-
// children: [],
|
|
420
|
-
// isShow: true,
|
|
456
|
+
// components: {
|
|
457
|
+
// AtomsAlert,
|
|
421
458
|
// },
|
|
422
|
-
//
|
|
423
|
-
// isShow: true,
|
|
459
|
+
// })
|
|
424
460
|
// }
|
|
425
461
|
//
|
|
426
|
-
//
|
|
427
|
-
//
|
|
428
|
-
//
|
|
429
|
-
// iconClassName: 'icon-host-connect',
|
|
430
|
-
// type: 'host',
|
|
431
|
-
// isActive: true,
|
|
432
|
-
// hasChild: false,
|
|
433
|
-
// childrenShow: false,
|
|
434
|
-
// children: [],
|
|
435
|
-
// isShow: true,
|
|
436
|
-
// }
|
|
462
|
+
// describe('SelectComputeResource.vue', () => {
|
|
463
|
+
// test('test render', async () => {
|
|
464
|
+
// const wrapper = await factory()
|
|
437
465
|
//
|
|
438
|
-
//
|
|
439
|
-
//
|
|
440
|
-
//
|
|
441
|
-
//
|
|
442
|
-
//
|
|
443
|
-
//
|
|
444
|
-
//
|
|
445
|
-
//
|
|
446
|
-
//
|
|
447
|
-
//
|
|
448
|
-
//
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
props: {
|
|
453
|
-
computeResourceSubmit: 0,
|
|
454
|
-
dataCenter: {} as I_TreeNode,
|
|
455
|
-
},
|
|
456
|
-
components: {
|
|
457
|
-
AtomsAlert,
|
|
458
|
-
},
|
|
459
|
-
})
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
describe('SelectComputeResource.vue', () => {
|
|
463
|
-
test('test render', async () => {
|
|
464
|
-
const wrapper = await factory()
|
|
465
|
-
|
|
466
|
-
expect(wrapper.find('.alert-text').exists()).toBe(false)
|
|
467
|
-
await wrapper.setProps({ computeResourceSubmit: 1 })
|
|
468
|
-
expect(wrapper.find('.alert-text').text()).toBe('error test')
|
|
469
|
-
})
|
|
470
|
-
|
|
471
|
-
// test('test change', async () => {
|
|
472
|
-
// const wrapper = await factory()
|
|
473
|
-
//
|
|
474
|
-
// await wrapper.vm.selectNode(ref(selectedNode1))
|
|
475
|
-
// await wrapper.setProps({ compatibilityText: 1 })
|
|
476
|
-
//
|
|
477
|
-
// expect(wrapper.find('.alert-text').text()).toBe('error test')
|
|
478
|
-
// })
|
|
479
|
-
})
|
|
466
|
+
// expect(wrapper.find('.alert-text').exists()).toBe(false)
|
|
467
|
+
// await wrapper.setProps({ computeResourceSubmit: 1 })
|
|
468
|
+
// expect(wrapper.find('.alert-text').text()).toBe('error test')
|
|
469
|
+
// })
|
|
470
|
+
//
|
|
471
|
+
// // test('test change', async () => {
|
|
472
|
+
// // const wrapper = await factory()
|
|
473
|
+
// //
|
|
474
|
+
// // await wrapper.vm.selectNode(ref(selectedNode1))
|
|
475
|
+
// // await wrapper.setProps({ compatibilityText: 1 })
|
|
476
|
+
// //
|
|
477
|
+
// // expect(wrapper.find('.alert-text').text()).toBe('error test')
|
|
478
|
+
// // })
|
|
479
|
+
// })
|