bfg-common 1.5.478 → 1.5.479

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 (102) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1709 -1709
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/atoms/window/Window.vue +460 -460
  14. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  15. package/components/common/context/lib/models/interfaces.ts +33 -33
  16. package/components/common/diagramMain/modals/lib/config/networkModal.ts +398 -398
  17. package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
  18. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  19. package/components/common/diagramMain/port/Port.vue +580 -580
  20. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  21. package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +95 -95
  22. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  23. package/components/common/pages/backups/DetailView.vue +52 -52
  24. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  25. package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
  26. package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +26 -26
  27. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +66 -66
  28. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  29. package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +35 -35
  30. package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -95
  31. package/components/common/pages/backups/modals/createBackup/general/General.vue +141 -141
  32. package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +12 -12
  33. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  34. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  35. package/components/common/pages/backups/modals/restore/disks/Disks.vue +27 -27
  36. package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -117
  37. package/components/common/pages/backups/modals/restore/name/Name.vue +166 -166
  38. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  39. package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
  40. package/components/common/pages/backups/modals/restore/networks/table/Table.vue +214 -214
  41. package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
  42. package/components/common/pages/backups/tools/Tools.vue +75 -75
  43. package/components/common/pages/backups/tools/lib/config/tabs.ts +36 -36
  44. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  45. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  46. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  47. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  48. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  49. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  50. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  51. package/components/common/select/radio/RadioGroup.vue +137 -137
  52. package/components/common/spiceConsole/Drawer.vue +392 -392
  53. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  54. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  55. package/components/common/tools/Actions.vue +207 -207
  56. package/components/common/treeView/TreeView.vue +52 -52
  57. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  58. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +99 -99
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  68. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  69. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  70. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  71. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  72. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  73. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  74. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  75. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +143 -143
  76. package/components/common/vm/actions/common/select/computeResource/New.vue +184 -184
  77. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +131 -131
  78. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  79. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  80. package/components/common/vm/actions/common/select/name/Name.vue +197 -197
  81. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  82. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  83. package/components/common/vm/actions/common/select/storage/new/New.vue +320 -320
  84. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  85. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  86. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  87. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  88. package/components/common/vm/actions/register/Register.vue +267 -267
  89. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  90. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  91. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  92. package/composables/useAppVersion.ts +21 -21
  93. package/composables/useLocal.ts +6 -6
  94. package/composables/useLocalCommon.ts +39 -39
  95. package/package.json +2 -2
  96. package/plugins/date.ts +233 -233
  97. package/plugins/panelStates.ts +70 -70
  98. package/plugins/text.ts +59 -59
  99. package/public/spice-console/lib/images/bitmap.js +203 -203
  100. package/public/spice-console/network/spicechannel.js +440 -440
  101. package/store/main/mutations.ts +7 -7
  102. package/store/main/state.ts +7 -7
@@ -1,580 +1,580 @@
1
- <template>
2
- <g>
3
- <g>
4
- <common-diagram-main-highlights
5
- data-title="port-vm"
6
- type="main-blue"
7
- width="276"
8
- :height="portRectHeight"
9
- :x="positions.blockX"
10
- :y="portRectPosition"
11
- :hide="!showHighlightPortSelectedPort"
12
- />
13
- <common-diagram-main-highlights
14
- data-title="port-vm"
15
- type="main-orange"
16
- width="276"
17
- :height="portRectHeight"
18
- :x="positions.blockX"
19
- :y="portRectPosition"
20
- :hide="!showHighlightPortSelectedAdapter"
21
- />
22
- </g>
23
-
24
- <a
25
- :id="testId"
26
- data-title="port-vm-name"
27
- :data-id="`${props.network.testId}-${props.port.testId}-select`"
28
- cursor="pointer"
29
- @click="onSelectPort(props.network.id, props.port.id)"
30
- >
31
- <foreignObject
32
- data-title="network-name-text"
33
- height="20"
34
- :width="positions.portWidth"
35
- :x="positions.portX"
36
- :y="portTitlePosition"
37
- class="diagram__values"
38
- >
39
- <!-- v-if="props.port.state?.state === 2 || props.port.state?.state === 3"-->
40
- <span
41
- :class="[
42
- 'port-state-icon-container',
43
- isNewView && 'port-state-icon-container-new',
44
- ]"
45
- :title="!isNewView && portErrorText"
46
- >
47
- <template v-if="isNewView">
48
- <Teleport to="body">
49
- <ui-tooltip-info
50
- :id="`port-tooltip-${props.port.id}`"
51
- :test-id="`port-tooltip-${props.port.id}`"
52
- :info="warningType"
53
- :title="localization.common[warningType]"
54
- :text="portErrorText"
55
- />
56
- </Teleport>
57
-
58
- <div
59
- :id="`port-tooltip-${props.port.id}`"
60
- class="popped tooltip inline-block"
61
- >
62
- <ui-icon
63
- v-if="props.port.state?.state === 2"
64
- name="warning-outline"
65
- width="14"
66
- height="14"
67
- color="#fbce28"
68
- />
69
- <ui-icon
70
- v-if="props.port.state?.state === 3"
71
- name="error-outline"
72
- width="14"
73
- height="14"
74
- color="#ea3223"
75
- />
76
- </div>
77
- </template>
78
- <template v-else>
79
- <atoms-the-icon
80
- v-if="props.port.state?.state === 2"
81
- name="warning"
82
- width="15"
83
- height="15"
84
- />
85
- <atoms-the-icon
86
- v-if="props.port.state?.state === 3"
87
- name="error-outline"
88
- width="15"
89
- height="15"
90
- />
91
- </template>
92
- </span>
93
- <span
94
- class="port-text text-ellipsis"
95
- :title="props.port.name"
96
- :id="`port_${props.port.id}`"
97
- >
98
- {{ props.port.name }}
99
- </span>
100
- </foreignObject>
101
- </a>
102
-
103
- <text
104
- v-if="isVCenter"
105
- data-title="v-center-with-mac-address-text"
106
- dy="7px"
107
- font-size="1em"
108
- font-weight="400"
109
- :x="positions.portX"
110
- class="diagram__values small"
111
- :y="macAddressPosition"
112
- >
113
- {{ localization.common.macAddress }}: 00:0c:29:a8:0f:74
114
- </text>
115
-
116
- <common-diagram-main-highlights
117
- data-title="port-vm-line"
118
- type="line-orange"
119
- :x="positions.x1"
120
- :y="portLinePosition"
121
- :x2="positions.x2"
122
- :y2="portLinePosition"
123
- :hide="!showHighlightLine"
124
- />
125
-
126
- <foreignObject
127
- v-if="(isVCenter || isVMPortsGroup) && props.port.isActive"
128
- data-title="vm-play-icon"
129
- :width="positions.playIconSize"
130
- :height="positions.playIconSize"
131
- :x="positions.playIconX"
132
- :y="positions.playIconY"
133
- >
134
- <div style="margin: 0; display: block">
135
- <ui-icon v-if="isNewView" name="diagram-vm-play" />
136
- <atoms-diagram-icon v-else name="v-center-play" />
137
- </div>
138
- </foreignObject>
139
-
140
- <foreignObject
141
- data-title="port-vm-action-icon"
142
- width="18"
143
- height="18"
144
- :x="positions.actionX"
145
- :y="positions.actionY"
146
- cursor="pointer"
147
- >
148
- <div v-if="isNewView" class="dropdown-actions-container">
149
- <button
150
- :id="`dropdown-${props.network.id}-${props.port.id}`"
151
- :class="[
152
- 'action-button',
153
- { 'action-button-selected': isShowDropdown },
154
- ]"
155
- @click="isShowDropdown = !isShowDropdown"
156
- >
157
- <ui-icon name="horizontal-dotes" width="16" height="16" />
158
- </button>
159
- <Teleport to="body">
160
- <ui-dropdown
161
- :test-id="testId"
162
- :show="isShowDropdown"
163
- :items="navigationItemsNew"
164
- :elem-id="`dropdown-${props.network.id}-${props.port.id}`"
165
- width="max-content"
166
- show-from-left
167
- :margin-between-trigger="0"
168
- @select="onShowModalWithTypeCheck"
169
- @hide="onHide"
170
- ></ui-dropdown>
171
- </Teleport>
172
- </div>
173
- <div v-else class="diagram-actions">
174
- <atoms-collapse-nav
175
- class="diagram-actions__icon"
176
- popup-class="diagram-actions__popup"
177
- :close-after-click="true"
178
- :items="navigationItems"
179
- :test-id="testId"
180
- @change="onShowModalWithTypeCheck"
181
- />
182
- </div>
183
- </foreignObject>
184
-
185
- <foreignObject
186
- data-title="port-vm-icon"
187
- :width="positions.portSecondIconSize"
188
- :height="positions.portSecondIconSize"
189
- :x="positions.portSecondIconX"
190
- :y="positions.portSecondIconY"
191
- >
192
- <div v-if="isNewView">
193
- <ui-icon
194
- v-if="
195
- isVmKernel || ((isVCenter || isVMPortsGroup) && props.port.isActive)
196
- "
197
- name="diagram-fill-port"
198
- />
199
- <ui-icon
200
- v-if="isVCenter || (isVMPortsGroup && !props.port.isActive)"
201
- :name="inactivePortIconName"
202
- />
203
- </div>
204
- <div v-else>
205
- <atoms-diagram-icon
206
- v-if="
207
- isVmKernel || ((isVCenter || isVMPortsGroup) && props.port.isActive)
208
- "
209
- name="fill-port"
210
- />
211
- <atoms-diagram-icon
212
- v-if="isVCenter || (isVMPortsGroup && !props.port.isActive)"
213
- :name="inactivePortIconName"
214
- />
215
- </div>
216
- </foreignObject>
217
- </g>
218
- </template>
219
-
220
- <script setup lang="ts">
221
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
222
- import type {
223
- UI_I_Localization,
224
- UI_I_ArbitraryObject,
225
- } from '~/lib/models/interfaces'
226
- import type {
227
- UI_I_Network,
228
- UI_I_Port,
229
- UI_I_SelectedPort,
230
- UI_I_SelectedAdapter,
231
- UI_I_ModalsInitialData,
232
- } from '~/components/common/diagramMain/lib/models/interfaces'
233
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
234
- import { UI_E_NetworkType } from '~/components/common/diagramMain/lib/models/enums'
235
- import {
236
- portPopupFieldsFunc,
237
- portPopupFieldsNewFunc,
238
- vCenterPopupFieldsFunc,
239
- vCenterPopupFieldsNewFunc,
240
- } from '~/components/common/diagramMain/modals/lib/config'
241
- import { portPositionsFunc } from '~/components/common/diagramMain/lib/config'
242
-
243
- const props = defineProps<{
244
- network: UI_I_Network
245
- port: UI_I_Port & { portPosition: number }
246
- selectedPort: UI_I_SelectedPort
247
- selectedAdapter: UI_I_SelectedAdapter
248
- isDarkMode: boolean
249
- }>()
250
-
251
- const localization = computed<UI_I_Localization>(() => useLocal())
252
-
253
- const emits = defineEmits<{
254
- (event: 'select-port', networkId: string, portId: string): void
255
- (
256
- event: 'show-modal',
257
- value: string,
258
- properties?: UI_I_ModalsInitialData
259
- ): void
260
- }>()
261
-
262
- const { $store }: any = useNuxtApp()
263
-
264
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
265
-
266
- const positions = computed<UI_I_ArbitraryObject<number>>(() =>
267
- portPositionsFunc(
268
- isNewView.value,
269
- navCollapsePosition.value,
270
- portStatusIconPosition.value
271
- )
272
- )
273
-
274
- const isShowDropdown = ref<boolean>(false)
275
- const onHide = (): void => {
276
- isShowDropdown.value = false
277
- }
278
-
279
- const portErrorText = computed<string>(
280
- () => props.port.state?.errors?.join('. ') || ''
281
- )
282
-
283
- const warningType = computed<string>(
284
- () =>
285
- (props.port.state?.state === 2 && 'warning') ||
286
- (props.port.state?.state === 3 && 'error')
287
- )
288
-
289
- const inactivePortIconName = computed<string>(
290
- () =>
291
- `${isNewView.value ? 'diagram-' : ''}outline-port${
292
- props.isDarkMode ? '-dark-mode' : ''
293
- }`
294
- )
295
-
296
- const portTitlePosition = computed<number>(() => props.port.portPosition - 5)
297
-
298
- const isVmKernel = computed<boolean>(
299
- () => props.network.networkType === UI_E_NetworkType.VMkernel
300
- )
301
-
302
- const isVCenter = computed<boolean>(
303
- () => props.network.networkType === UI_E_NetworkType.VCenter
304
- )
305
-
306
- const isVMPortsGroup = computed<boolean>(
307
- () => props.network.networkType === UI_E_NetworkType.VMPortsGroup
308
- )
309
-
310
- const testId = computed<string>(() =>
311
- isVmKernel.value
312
- ? `port-${props.port.id}`
313
- : isVMPortsGroup.value
314
- ? `vm-${props.port.name}`
315
- : ''
316
- )
317
-
318
- const portRectHeight = computed<number>(() => (isVCenter.value ? 29 : 18))
319
- const portRectPosition = computed<number>(() => props.port.portPosition - 1.5)
320
- const portLinePosition = computed<number>(() =>
321
- isVCenter.value
322
- ? props.port.portPosition + 12.5
323
- : props.port.portPosition + 7.5
324
- )
325
- const portStatusIconPosition = computed<number>(
326
- () => props.port.portPosition - (isVCenter.value ? -4 : 2)
327
- )
328
- const navCollapsePosition = computed<number>(() => props.port.portPosition - 2)
329
- const macAddressPosition = computed<number>(() => props.port.portPosition + 16)
330
-
331
- const navigationItems = computed<UI_I_CollapseNavItem[]>(() =>
332
- !isNewView.value
333
- ? isVCenter.value || isVMPortsGroup.value
334
- ? vCenterPopupFieldsFunc(
335
- localization.value,
336
- `${props.network.testId}-${props.port.testId}`
337
- )
338
- : portPopupFieldsFunc(
339
- localization.value,
340
- `${props.network.testId}-${props.port.testId}`
341
- )
342
- : []
343
- )
344
-
345
- const navigationItemsNew = computed<UI_I_Dropdown[]>(() =>
346
- isNewView.value
347
- ? isVCenter.value || isVMPortsGroup.value
348
- ? vCenterPopupFieldsNewFunc(
349
- localization.value,
350
- `${props.network.testId}-${props.port.testId}`
351
- )
352
- : portPopupFieldsNewFunc(
353
- localization.value,
354
- `${props.network.testId}-${props.port.testId}`
355
- )
356
- : []
357
- )
358
-
359
- const showHighlightLine = computed<boolean>(
360
- () =>
361
- (props.selectedPort.portId === props.port.id &&
362
- props.selectedPort.networkId === props.network.id &&
363
- props.network.activeAdapters.length > 0) ||
364
- !!props.selectedAdapter.connectedPorts.find(
365
- (net) =>
366
- net.networkId === props.network.id && net.ports.includes(props.port.id)
367
- )
368
- )
369
-
370
- const showHighlightPortSelectedPort = computed<boolean>(
371
- () =>
372
- props.selectedPort.portId === props.port.id &&
373
- props.selectedPort.networkId === props.network.id
374
- )
375
-
376
- const showHighlightPortSelectedAdapter = computed<boolean>(() =>
377
- props.selectedAdapter.connectedPorts
378
- ?.find((net) => net.networkId === props.network.id)
379
- ?.ports.includes(props.port.id)
380
- )
381
-
382
- const portTitle = computed<string>(() => {
383
- if (props.port.name.length > 23) {
384
- return `${props.port.name.slice(0, 23)}...`
385
- }
386
- return props.port.name
387
- })
388
-
389
- const onShowModal = (
390
- value: string,
391
- properties?: UI_I_ModalsInitialData
392
- ): void => {
393
- emits('show-modal', value, properties)
394
- }
395
-
396
- const onShowModalWithTypeCheck = (value: string) => {
397
- if (isVCenter.value || isVMPortsGroup.value) {
398
- onShowModal(value, {
399
- macAddress: props.port.macAddress,
400
- adapter: props.port.adapter,
401
- vmTitle: props.port.name,
402
- })
403
- return
404
- }
405
-
406
- if (isVmKernel.value) {
407
- onShowModal(value, {
408
- portName: props.network.sysx?.id,
409
- networkLabel: props.network.title,
410
- vlanId: props.network.vlanId,
411
- tcpIp: props.network.sysx?.tcp_stack,
412
- mtu: props.network.sysx?.mtu,
413
- services: {
414
- vMotion: props.network.sysx?.services.VMotion,
415
- provisioning: props.network.sysx?.services.Provisioning,
416
- faultToleranceLogging:
417
- props.network.sysx?.services.FaultToleranceLogging,
418
- management: props.network.sysx?.services.Management,
419
- replication: props.network.sysx?.services.VSphereReplication,
420
- replicationNFC: props.network.sysx?.services.VSphereReplicationNFC,
421
- vSAN: props.network.sysx?.services.VSAN,
422
- backupNFC: props.network.sysx?.services.VSphereBackupNFC,
423
- nVMeOverTCP: props.network.sysx?.services.NVMeOverTCP,
424
- nVMeOverRDMA: props.network.sysx?.services.NVMeOverRDMA,
425
- },
426
- tcpConfig: {
427
- ipv4Settings: props.network.sysx?.ipv4_settings.auto ? '0' : '1',
428
- ipv4Address: props.network.sysx?.ipv4_settings.ipv4,
429
- subnetMask: props.network.sysx?.ipv4_settings.mask,
430
- defaultGateway: {
431
- checked: props.network.sysx?.ipv4_settings.gateway_override,
432
- value: props.network.sysx?.ipv4_settings.gateway,
433
- },
434
- },
435
- })
436
- return
437
- }
438
-
439
- onShowModal(value)
440
- }
441
-
442
- const onSelectPort = (networkId: string, portId: string): void => {
443
- emits('select-port', networkId, portId)
444
- }
445
- </script>
446
-
447
- <style scoped lang="scss">
448
- @import '../../../../assets/scss/common/mixins';
449
-
450
- :root.dark-theme {
451
- .selection-line {
452
- stroke: #fdd006;
453
- }
454
- .diagram__values {
455
- fill: #c1cdd4;
456
- }
457
-
458
- .text-ellipsis {
459
- color: #c1cdd4;
460
-
461
- &:hover {
462
- color: #c1cdd4;
463
- text-decoration: solid underline #c1cdd4 1px;
464
- }
465
- }
466
- }
467
-
468
- .diagram {
469
- &__values {
470
- @include text($fs: 12px, $fw: 400);
471
-
472
- fill: #565656;
473
- }
474
-
475
- &-actions {
476
- :deep(.diagram-actions__icon) {
477
- &.tabs-overflow {
478
- top: -12px;
479
- right: -13px;
480
- }
481
- .navbar-dropdown-menu {
482
- .navbar-dropdown-menu-item {
483
- background: red;
484
- }
485
- }
486
- }
487
- }
488
- }
489
- .selection-line {
490
- stroke: #f3bb00;
491
- }
492
- .highlight-stroke {
493
- stroke: #f3bb00;
494
- }
495
- .highlight {
496
- fill: #fffce8;
497
- }
498
- .selection-stroke {
499
- stroke: #0079b8;
500
- fill: #f3f6fa;
501
- }
502
- .hide-line-highlight {
503
- stroke-opacity: 0;
504
- fill: transparent;
505
- }
506
- .small {
507
- font: normal 9px Metropolis;
508
- }
509
-
510
- .text-ellipsis {
511
- display: block;
512
- text-overflow: ellipsis;
513
- overflow: hidden;
514
- white-space: nowrap;
515
- font-weight: 400;
516
- font-size: 12px;
517
-
518
- &.port-text {
519
- max-width: 206px;
520
- color: #565656;
521
-
522
- &:hover {
523
- color: #565656;
524
- text-decoration: solid underline #565656 1px;
525
- }
526
- }
527
- }
528
-
529
- .port-state-icon-container {
530
- position: absolute;
531
- top: 4px;
532
- left: 3px;
533
- }
534
-
535
- .port-text {
536
- padding-left: 20px;
537
- }
538
-
539
- :root.is-new-view {
540
- .port-text.text-ellipsis {
541
- user-select: none;
542
- -webkit-user-select: none;
543
- line-height: 25px;
544
- padding-left: 18px;
545
- color: var(--diagram-content-text);
546
- max-width: 200px;
547
-
548
- &:hover {
549
- color: var(--diagram-content-text-hover);
550
- text-decoration: unset;
551
- }
552
- }
553
-
554
- .action-button {
555
- border: none;
556
- margin: 0;
557
- padding: 0;
558
- background: transparent;
559
- cursor: pointer;
560
- color: var(--diagram-content-text);
561
-
562
- &:hover {
563
- color: var(--diagram-content-text-hover);
564
- }
565
-
566
- &.action-button-selected {
567
- color: var(--diagram-content-text-selected);
568
- }
569
- }
570
-
571
- .port-state-icon-container {
572
- position: absolute;
573
-
574
- &.port-state-icon-container-new {
575
- top: 5px;
576
- left: 0;
577
- }
578
- }
579
- }
580
- </style>
1
+ <template>
2
+ <g>
3
+ <g>
4
+ <common-diagram-main-highlights
5
+ data-title="port-vm"
6
+ type="main-blue"
7
+ width="276"
8
+ :height="portRectHeight"
9
+ :x="positions.blockX"
10
+ :y="portRectPosition"
11
+ :hide="!showHighlightPortSelectedPort"
12
+ />
13
+ <common-diagram-main-highlights
14
+ data-title="port-vm"
15
+ type="main-orange"
16
+ width="276"
17
+ :height="portRectHeight"
18
+ :x="positions.blockX"
19
+ :y="portRectPosition"
20
+ :hide="!showHighlightPortSelectedAdapter"
21
+ />
22
+ </g>
23
+
24
+ <a
25
+ :id="testId"
26
+ data-title="port-vm-name"
27
+ :data-id="`${props.network.testId}-${props.port.testId}-select`"
28
+ cursor="pointer"
29
+ @click="onSelectPort(props.network.id, props.port.id)"
30
+ >
31
+ <foreignObject
32
+ data-title="network-name-text"
33
+ height="20"
34
+ :width="positions.portWidth"
35
+ :x="positions.portX"
36
+ :y="portTitlePosition"
37
+ class="diagram__values"
38
+ >
39
+ <!-- v-if="props.port.state?.state === 2 || props.port.state?.state === 3"-->
40
+ <span
41
+ :class="[
42
+ 'port-state-icon-container',
43
+ isNewView && 'port-state-icon-container-new',
44
+ ]"
45
+ :title="!isNewView && portErrorText"
46
+ >
47
+ <template v-if="isNewView">
48
+ <Teleport to="body">
49
+ <ui-tooltip-info
50
+ :id="`port-tooltip-${props.port.id}`"
51
+ :test-id="`port-tooltip-${props.port.id}`"
52
+ :info="warningType"
53
+ :title="localization.common[warningType]"
54
+ :text="portErrorText"
55
+ />
56
+ </Teleport>
57
+
58
+ <div
59
+ :id="`port-tooltip-${props.port.id}`"
60
+ class="popped tooltip inline-block"
61
+ >
62
+ <ui-icon
63
+ v-if="props.port.state?.state === 2"
64
+ name="warning-outline"
65
+ width="14"
66
+ height="14"
67
+ color="#fbce28"
68
+ />
69
+ <ui-icon
70
+ v-if="props.port.state?.state === 3"
71
+ name="error-outline"
72
+ width="14"
73
+ height="14"
74
+ color="#ea3223"
75
+ />
76
+ </div>
77
+ </template>
78
+ <template v-else>
79
+ <atoms-the-icon
80
+ v-if="props.port.state?.state === 2"
81
+ name="warning"
82
+ width="15"
83
+ height="15"
84
+ />
85
+ <atoms-the-icon
86
+ v-if="props.port.state?.state === 3"
87
+ name="error-outline"
88
+ width="15"
89
+ height="15"
90
+ />
91
+ </template>
92
+ </span>
93
+ <span
94
+ class="port-text text-ellipsis"
95
+ :title="props.port.name"
96
+ :id="`port_${props.port.id}`"
97
+ >
98
+ {{ props.port.name }}
99
+ </span>
100
+ </foreignObject>
101
+ </a>
102
+
103
+ <text
104
+ v-if="isVCenter"
105
+ data-title="v-center-with-mac-address-text"
106
+ dy="7px"
107
+ font-size="1em"
108
+ font-weight="400"
109
+ :x="positions.portX"
110
+ class="diagram__values small"
111
+ :y="macAddressPosition"
112
+ >
113
+ {{ localization.common.macAddress }}: 00:0c:29:a8:0f:74
114
+ </text>
115
+
116
+ <common-diagram-main-highlights
117
+ data-title="port-vm-line"
118
+ type="line-orange"
119
+ :x="positions.x1"
120
+ :y="portLinePosition"
121
+ :x2="positions.x2"
122
+ :y2="portLinePosition"
123
+ :hide="!showHighlightLine"
124
+ />
125
+
126
+ <foreignObject
127
+ v-if="(isVCenter || isVMPortsGroup) && props.port.isActive"
128
+ data-title="vm-play-icon"
129
+ :width="positions.playIconSize"
130
+ :height="positions.playIconSize"
131
+ :x="positions.playIconX"
132
+ :y="positions.playIconY"
133
+ >
134
+ <div style="margin: 0; display: block">
135
+ <ui-icon v-if="isNewView" name="diagram-vm-play" />
136
+ <atoms-diagram-icon v-else name="v-center-play" />
137
+ </div>
138
+ </foreignObject>
139
+
140
+ <foreignObject
141
+ data-title="port-vm-action-icon"
142
+ width="18"
143
+ height="18"
144
+ :x="positions.actionX"
145
+ :y="positions.actionY"
146
+ cursor="pointer"
147
+ >
148
+ <div v-if="isNewView" class="dropdown-actions-container">
149
+ <button
150
+ :id="`dropdown-${props.network.id}-${props.port.id}`"
151
+ :class="[
152
+ 'action-button',
153
+ { 'action-button-selected': isShowDropdown },
154
+ ]"
155
+ @click="isShowDropdown = !isShowDropdown"
156
+ >
157
+ <ui-icon name="horizontal-dotes" width="16" height="16" />
158
+ </button>
159
+ <Teleport to="body">
160
+ <ui-dropdown
161
+ :test-id="testId"
162
+ :show="isShowDropdown"
163
+ :items="navigationItemsNew"
164
+ :elem-id="`dropdown-${props.network.id}-${props.port.id}`"
165
+ width="max-content"
166
+ show-from-left
167
+ :margin-between-trigger="0"
168
+ @select="onShowModalWithTypeCheck"
169
+ @hide="onHide"
170
+ ></ui-dropdown>
171
+ </Teleport>
172
+ </div>
173
+ <div v-else class="diagram-actions">
174
+ <atoms-collapse-nav
175
+ class="diagram-actions__icon"
176
+ popup-class="diagram-actions__popup"
177
+ :close-after-click="true"
178
+ :items="navigationItems"
179
+ :test-id="testId"
180
+ @change="onShowModalWithTypeCheck"
181
+ />
182
+ </div>
183
+ </foreignObject>
184
+
185
+ <foreignObject
186
+ data-title="port-vm-icon"
187
+ :width="positions.portSecondIconSize"
188
+ :height="positions.portSecondIconSize"
189
+ :x="positions.portSecondIconX"
190
+ :y="positions.portSecondIconY"
191
+ >
192
+ <div v-if="isNewView">
193
+ <ui-icon
194
+ v-if="
195
+ isVmKernel || ((isVCenter || isVMPortsGroup) && props.port.isActive)
196
+ "
197
+ name="diagram-fill-port"
198
+ />
199
+ <ui-icon
200
+ v-if="isVCenter || (isVMPortsGroup && !props.port.isActive)"
201
+ :name="inactivePortIconName"
202
+ />
203
+ </div>
204
+ <div v-else>
205
+ <atoms-diagram-icon
206
+ v-if="
207
+ isVmKernel || ((isVCenter || isVMPortsGroup) && props.port.isActive)
208
+ "
209
+ name="fill-port"
210
+ />
211
+ <atoms-diagram-icon
212
+ v-if="isVCenter || (isVMPortsGroup && !props.port.isActive)"
213
+ :name="inactivePortIconName"
214
+ />
215
+ </div>
216
+ </foreignObject>
217
+ </g>
218
+ </template>
219
+
220
+ <script setup lang="ts">
221
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
222
+ import type {
223
+ UI_I_Localization,
224
+ UI_I_ArbitraryObject,
225
+ } from '~/lib/models/interfaces'
226
+ import type {
227
+ UI_I_Network,
228
+ UI_I_Port,
229
+ UI_I_SelectedPort,
230
+ UI_I_SelectedAdapter,
231
+ UI_I_ModalsInitialData,
232
+ } from '~/components/common/diagramMain/lib/models/interfaces'
233
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
234
+ import { UI_E_NetworkType } from '~/components/common/diagramMain/lib/models/enums'
235
+ import {
236
+ portPopupFieldsFunc,
237
+ portPopupFieldsNewFunc,
238
+ vCenterPopupFieldsFunc,
239
+ vCenterPopupFieldsNewFunc,
240
+ } from '~/components/common/diagramMain/modals/lib/config'
241
+ import { portPositionsFunc } from '~/components/common/diagramMain/lib/config'
242
+
243
+ const props = defineProps<{
244
+ network: UI_I_Network
245
+ port: UI_I_Port & { portPosition: number }
246
+ selectedPort: UI_I_SelectedPort
247
+ selectedAdapter: UI_I_SelectedAdapter
248
+ isDarkMode: boolean
249
+ }>()
250
+
251
+ const localization = computed<UI_I_Localization>(() => useLocal())
252
+
253
+ const emits = defineEmits<{
254
+ (event: 'select-port', networkId: string, portId: string): void
255
+ (
256
+ event: 'show-modal',
257
+ value: string,
258
+ properties?: UI_I_ModalsInitialData
259
+ ): void
260
+ }>()
261
+
262
+ const { $store }: any = useNuxtApp()
263
+
264
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
265
+
266
+ const positions = computed<UI_I_ArbitraryObject<number>>(() =>
267
+ portPositionsFunc(
268
+ isNewView.value,
269
+ navCollapsePosition.value,
270
+ portStatusIconPosition.value
271
+ )
272
+ )
273
+
274
+ const isShowDropdown = ref<boolean>(false)
275
+ const onHide = (): void => {
276
+ isShowDropdown.value = false
277
+ }
278
+
279
+ const portErrorText = computed<string>(
280
+ () => props.port.state?.errors?.join('. ') || ''
281
+ )
282
+
283
+ const warningType = computed<string>(
284
+ () =>
285
+ (props.port.state?.state === 2 && 'warning') ||
286
+ (props.port.state?.state === 3 && 'error')
287
+ )
288
+
289
+ const inactivePortIconName = computed<string>(
290
+ () =>
291
+ `${isNewView.value ? 'diagram-' : ''}outline-port${
292
+ props.isDarkMode ? '-dark-mode' : ''
293
+ }`
294
+ )
295
+
296
+ const portTitlePosition = computed<number>(() => props.port.portPosition - 5)
297
+
298
+ const isVmKernel = computed<boolean>(
299
+ () => props.network.networkType === UI_E_NetworkType.VMkernel
300
+ )
301
+
302
+ const isVCenter = computed<boolean>(
303
+ () => props.network.networkType === UI_E_NetworkType.VCenter
304
+ )
305
+
306
+ const isVMPortsGroup = computed<boolean>(
307
+ () => props.network.networkType === UI_E_NetworkType.VMPortsGroup
308
+ )
309
+
310
+ const testId = computed<string>(() =>
311
+ isVmKernel.value
312
+ ? `port-${props.port.id}`
313
+ : isVMPortsGroup.value
314
+ ? `vm-${props.port.name}`
315
+ : ''
316
+ )
317
+
318
+ const portRectHeight = computed<number>(() => (isVCenter.value ? 29 : 18))
319
+ const portRectPosition = computed<number>(() => props.port.portPosition - 1.5)
320
+ const portLinePosition = computed<number>(() =>
321
+ isVCenter.value
322
+ ? props.port.portPosition + 12.5
323
+ : props.port.portPosition + 7.5
324
+ )
325
+ const portStatusIconPosition = computed<number>(
326
+ () => props.port.portPosition - (isVCenter.value ? -4 : 2)
327
+ )
328
+ const navCollapsePosition = computed<number>(() => props.port.portPosition - 2)
329
+ const macAddressPosition = computed<number>(() => props.port.portPosition + 16)
330
+
331
+ const navigationItems = computed<UI_I_CollapseNavItem[]>(() =>
332
+ !isNewView.value
333
+ ? isVCenter.value || isVMPortsGroup.value
334
+ ? vCenterPopupFieldsFunc(
335
+ localization.value,
336
+ `${props.network.testId}-${props.port.testId}`
337
+ )
338
+ : portPopupFieldsFunc(
339
+ localization.value,
340
+ `${props.network.testId}-${props.port.testId}`
341
+ )
342
+ : []
343
+ )
344
+
345
+ const navigationItemsNew = computed<UI_I_Dropdown[]>(() =>
346
+ isNewView.value
347
+ ? isVCenter.value || isVMPortsGroup.value
348
+ ? vCenterPopupFieldsNewFunc(
349
+ localization.value,
350
+ `${props.network.testId}-${props.port.testId}`
351
+ )
352
+ : portPopupFieldsNewFunc(
353
+ localization.value,
354
+ `${props.network.testId}-${props.port.testId}`
355
+ )
356
+ : []
357
+ )
358
+
359
+ const showHighlightLine = computed<boolean>(
360
+ () =>
361
+ (props.selectedPort.portId === props.port.id &&
362
+ props.selectedPort.networkId === props.network.id &&
363
+ props.network.activeAdapters.length > 0) ||
364
+ !!props.selectedAdapter.connectedPorts.find(
365
+ (net) =>
366
+ net.networkId === props.network.id && net.ports.includes(props.port.id)
367
+ )
368
+ )
369
+
370
+ const showHighlightPortSelectedPort = computed<boolean>(
371
+ () =>
372
+ props.selectedPort.portId === props.port.id &&
373
+ props.selectedPort.networkId === props.network.id
374
+ )
375
+
376
+ const showHighlightPortSelectedAdapter = computed<boolean>(() =>
377
+ props.selectedAdapter.connectedPorts
378
+ ?.find((net) => net.networkId === props.network.id)
379
+ ?.ports.includes(props.port.id)
380
+ )
381
+
382
+ const portTitle = computed<string>(() => {
383
+ if (props.port.name.length > 23) {
384
+ return `${props.port.name.slice(0, 23)}...`
385
+ }
386
+ return props.port.name
387
+ })
388
+
389
+ const onShowModal = (
390
+ value: string,
391
+ properties?: UI_I_ModalsInitialData
392
+ ): void => {
393
+ emits('show-modal', value, properties)
394
+ }
395
+
396
+ const onShowModalWithTypeCheck = (value: string) => {
397
+ if (isVCenter.value || isVMPortsGroup.value) {
398
+ onShowModal(value, {
399
+ macAddress: props.port.macAddress,
400
+ adapter: props.port.adapter,
401
+ vmTitle: props.port.name,
402
+ })
403
+ return
404
+ }
405
+
406
+ if (isVmKernel.value) {
407
+ onShowModal(value, {
408
+ portName: props.network.sysx?.id,
409
+ networkLabel: props.network.title,
410
+ vlanId: props.network.vlanId,
411
+ tcpIp: props.network.sysx?.tcp_stack,
412
+ mtu: props.network.sysx?.mtu,
413
+ services: {
414
+ vMotion: props.network.sysx?.services.VMotion,
415
+ provisioning: props.network.sysx?.services.Provisioning,
416
+ faultToleranceLogging:
417
+ props.network.sysx?.services.FaultToleranceLogging,
418
+ management: props.network.sysx?.services.Management,
419
+ replication: props.network.sysx?.services.VSphereReplication,
420
+ replicationNFC: props.network.sysx?.services.VSphereReplicationNFC,
421
+ vSAN: props.network.sysx?.services.VSAN,
422
+ backupNFC: props.network.sysx?.services.VSphereBackupNFC,
423
+ nVMeOverTCP: props.network.sysx?.services.NVMeOverTCP,
424
+ nVMeOverRDMA: props.network.sysx?.services.NVMeOverRDMA,
425
+ },
426
+ tcpConfig: {
427
+ ipv4Settings: props.network.sysx?.ipv4_settings.auto ? '0' : '1',
428
+ ipv4Address: props.network.sysx?.ipv4_settings.ipv4,
429
+ subnetMask: props.network.sysx?.ipv4_settings.mask,
430
+ defaultGateway: {
431
+ checked: props.network.sysx?.ipv4_settings.gateway_override,
432
+ value: props.network.sysx?.ipv4_settings.gateway,
433
+ },
434
+ },
435
+ })
436
+ return
437
+ }
438
+
439
+ onShowModal(value)
440
+ }
441
+
442
+ const onSelectPort = (networkId: string, portId: string): void => {
443
+ emits('select-port', networkId, portId)
444
+ }
445
+ </script>
446
+
447
+ <style scoped lang="scss">
448
+ @import '../../../../assets/scss/common/mixins';
449
+
450
+ :root.dark-theme {
451
+ .selection-line {
452
+ stroke: #fdd006;
453
+ }
454
+ .diagram__values {
455
+ fill: #c1cdd4;
456
+ }
457
+
458
+ .text-ellipsis {
459
+ color: #c1cdd4;
460
+
461
+ &:hover {
462
+ color: #c1cdd4;
463
+ text-decoration: solid underline #c1cdd4 1px;
464
+ }
465
+ }
466
+ }
467
+
468
+ .diagram {
469
+ &__values {
470
+ @include text($fs: 12px, $fw: 400);
471
+
472
+ fill: #565656;
473
+ }
474
+
475
+ &-actions {
476
+ :deep(.diagram-actions__icon) {
477
+ &.tabs-overflow {
478
+ top: -12px;
479
+ right: -13px;
480
+ }
481
+ .navbar-dropdown-menu {
482
+ .navbar-dropdown-menu-item {
483
+ background: red;
484
+ }
485
+ }
486
+ }
487
+ }
488
+ }
489
+ .selection-line {
490
+ stroke: #f3bb00;
491
+ }
492
+ .highlight-stroke {
493
+ stroke: #f3bb00;
494
+ }
495
+ .highlight {
496
+ fill: #fffce8;
497
+ }
498
+ .selection-stroke {
499
+ stroke: #0079b8;
500
+ fill: #f3f6fa;
501
+ }
502
+ .hide-line-highlight {
503
+ stroke-opacity: 0;
504
+ fill: transparent;
505
+ }
506
+ .small {
507
+ font: normal 9px Metropolis;
508
+ }
509
+
510
+ .text-ellipsis {
511
+ display: block;
512
+ text-overflow: ellipsis;
513
+ overflow: hidden;
514
+ white-space: nowrap;
515
+ font-weight: 400;
516
+ font-size: 12px;
517
+
518
+ &.port-text {
519
+ max-width: 206px;
520
+ color: #565656;
521
+
522
+ &:hover {
523
+ color: #565656;
524
+ text-decoration: solid underline #565656 1px;
525
+ }
526
+ }
527
+ }
528
+
529
+ .port-state-icon-container {
530
+ position: absolute;
531
+ top: 4px;
532
+ left: 3px;
533
+ }
534
+
535
+ .port-text {
536
+ padding-left: 20px;
537
+ }
538
+
539
+ :root.is-new-view {
540
+ .port-text.text-ellipsis {
541
+ user-select: none;
542
+ -webkit-user-select: none;
543
+ line-height: 25px;
544
+ padding-left: 18px;
545
+ color: var(--diagram-content-text);
546
+ max-width: 200px;
547
+
548
+ &:hover {
549
+ color: var(--diagram-content-text-hover);
550
+ text-decoration: unset;
551
+ }
552
+ }
553
+
554
+ .action-button {
555
+ border: none;
556
+ margin: 0;
557
+ padding: 0;
558
+ background: transparent;
559
+ cursor: pointer;
560
+ color: var(--diagram-content-text);
561
+
562
+ &:hover {
563
+ color: var(--diagram-content-text-hover);
564
+ }
565
+
566
+ &.action-button-selected {
567
+ color: var(--diagram-content-text-selected);
568
+ }
569
+ }
570
+
571
+ .port-state-icon-container {
572
+ position: absolute;
573
+
574
+ &.port-state-icon-container-new {
575
+ top: 5px;
576
+ left: 0;
577
+ }
578
+ }
579
+ }
580
+ </style>