bfg-common 1.2.19 → 1.2.21
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/components/atoms/alert/Notification.vue +167 -167
- package/components/atoms/autocomplete/Autocomplete.vue +236 -236
- package/components/atoms/datepicker/Datepicker.vue +612 -612
- package/components/atoms/list/SelectList.vue +62 -62
- package/components/atoms/nav/NavBar.vue +116 -116
- package/components/atoms/nav/VerticalNavBar.vue +89 -89
- package/components/atoms/notificationBar/NotificationBar.vue +175 -175
- package/components/atoms/perPage/PerPage.vue +52 -52
- package/components/atoms/popup/SimplePopup.vue +90 -90
- package/components/atoms/step/VerticalStep.vue +104 -104
- package/components/atoms/switch/Switch.vue +107 -107
- package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +206 -206
- package/components/atoms/table/dataGrid/DataGridPage.vue +189 -189
- package/components/atoms/tabs/Tabs.vue +189 -189
- package/components/atoms/tooltip/Signpost.vue +224 -224
- package/components/common/BadBrowser.vue +58 -0
- package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
- package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
- package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
- package/components/common/browse/Browse.vue +182 -182
- package/components/common/browse/blocks/Title.vue +66 -66
- package/components/common/diagramMain/Diagram.vue +186 -186
- package/components/common/diagramMain/DiagramMain.vue +986 -986
- package/components/common/diagramMain/adapter/AdapterItem.vue +227 -227
- package/components/common/diagramMain/adapter/AdapterItems.vue +57 -57
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
- package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
- package/components/common/diagramMain/network/Contents.vue +238 -238
- package/components/common/feedback/Buttons.vue +232 -232
- package/components/common/feedback/Message.vue +468 -468
- package/components/common/feedback/VisitPortal.vue +54 -54
- package/components/common/help/navbar/left/Left.vue +159 -159
- package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +359 -359
- package/components/common/modals/Rename.vue +165 -165
- package/components/common/perPage/PerPage.vue +51 -51
- package/components/common/recursionTree/RecursionTree.vue +201 -201
- package/components/common/vm/actions/add/config/capabilities.ts +338 -338
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/VirtualHardware.vue +657 -657
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +109 -109
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/Cpu.vue +383 -383
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +445 -445
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/videoCard/VideoCard.vue +177 -177
- package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/order/Order.vue +197 -197
- package/components/common/vm/actions/add/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +181 -181
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +51 -51
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +253 -253
- package/components/common/vm/actions/add/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +55 -55
- package/components/common/vm/actions/add/select/storage/config/config.ts +154 -154
- package/components/common/vm/actions/clone/Clone.vue +544 -544
- package/components/common/vm/actions/clone/select/options/Options.vue +65 -65
- package/components/common/vm/actions/clone/utils.ts +43 -43
- package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +373 -373
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +123 -123
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +131 -131
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +230 -230
- package/composables/useLocal.ts +38 -38
- package/minify.js +146 -146
- package/models/store/interfaces.ts +37 -37
- package/models/store/storage/interfaces.ts +32 -32
- package/models/store/types.ts +32 -32
- package/modules/fixContentBuild/utils/methods.ts +114 -114
- package/package.json +1 -1
- package/public/spice-console/application/codec.js +257 -257
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +369 -369
- package/utils/contentBuild.ts +34 -34
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="title-block" :style="blockWidth">
|
|
3
|
-
<div class="title-block__container" :style="blockWidth">
|
|
4
|
-
<div class="title-block__title" :style="blockTitleWidth">
|
|
5
|
-
<b>{{ props.title }}</b>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="title-block__body">
|
|
8
|
-
<slot name="content"></slot>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</div>
|
|
12
|
-
</template>
|
|
13
|
-
|
|
14
|
-
<script setup lang="ts">
|
|
15
|
-
const props = defineProps<{
|
|
16
|
-
title: string
|
|
17
|
-
width: number
|
|
18
|
-
}>()
|
|
19
|
-
|
|
20
|
-
const blockWidth = computed(() => ({ width: `${props.width}px` }))
|
|
21
|
-
const blockTitleWidth = computed(() => ({ width: `${props.width - 2}px` }))
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<style scoped lang="scss">
|
|
25
|
-
.title-block {
|
|
26
|
-
width: 100%;
|
|
27
|
-
min-height: 400px;
|
|
28
|
-
position: relative;
|
|
29
|
-
|
|
30
|
-
&__container {
|
|
31
|
-
position: absolute;
|
|
32
|
-
top: 0;
|
|
33
|
-
height: 400px;
|
|
34
|
-
left: 0;
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
border-width: 1px;
|
|
38
|
-
border-style: solid;
|
|
39
|
-
border-color: rgb(204, 204, 204);
|
|
40
|
-
border-image: initial;
|
|
41
|
-
background: rgb(255, 255, 255);
|
|
42
|
-
}
|
|
43
|
-
&__title {
|
|
44
|
-
background-color: rgb(231, 235, 239);
|
|
45
|
-
flex: 0 0 auto;
|
|
46
|
-
padding: 8px;
|
|
47
|
-
border-bottom: 1px solid rgb(204, 204, 204);
|
|
48
|
-
display: inline-block;
|
|
49
|
-
white-space: nowrap;
|
|
50
|
-
overflow: hidden !important;
|
|
51
|
-
text-overflow: ellipsis;
|
|
52
|
-
|
|
53
|
-
b {
|
|
54
|
-
font-weight: bolder;
|
|
55
|
-
font-size: 13px;
|
|
56
|
-
letter-spacing: normal;
|
|
57
|
-
font-family: Metropolis, Avenir Next, Helvetica Neue, Arial, sans-serif;
|
|
58
|
-
color: #666;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
&__body {
|
|
62
|
-
flex: 1 1 auto;
|
|
63
|
-
overflow-y: auto;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="title-block" :style="blockWidth">
|
|
3
|
+
<div class="title-block__container" :style="blockWidth">
|
|
4
|
+
<div class="title-block__title" :style="blockTitleWidth">
|
|
5
|
+
<b>{{ props.title }}</b>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="title-block__body">
|
|
8
|
+
<slot name="content"></slot>
|
|
9
|
+
</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
const props = defineProps<{
|
|
16
|
+
title: string
|
|
17
|
+
width: number
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const blockWidth = computed(() => ({ width: `${props.width}px` }))
|
|
21
|
+
const blockTitleWidth = computed(() => ({ width: `${props.width - 2}px` }))
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<style scoped lang="scss">
|
|
25
|
+
.title-block {
|
|
26
|
+
width: 100%;
|
|
27
|
+
min-height: 400px;
|
|
28
|
+
position: relative;
|
|
29
|
+
|
|
30
|
+
&__container {
|
|
31
|
+
position: absolute;
|
|
32
|
+
top: 0;
|
|
33
|
+
height: 400px;
|
|
34
|
+
left: 0;
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
border-width: 1px;
|
|
38
|
+
border-style: solid;
|
|
39
|
+
border-color: rgb(204, 204, 204);
|
|
40
|
+
border-image: initial;
|
|
41
|
+
background: rgb(255, 255, 255);
|
|
42
|
+
}
|
|
43
|
+
&__title {
|
|
44
|
+
background-color: rgb(231, 235, 239);
|
|
45
|
+
flex: 0 0 auto;
|
|
46
|
+
padding: 8px;
|
|
47
|
+
border-bottom: 1px solid rgb(204, 204, 204);
|
|
48
|
+
display: inline-block;
|
|
49
|
+
white-space: nowrap;
|
|
50
|
+
overflow: hidden !important;
|
|
51
|
+
text-overflow: ellipsis;
|
|
52
|
+
|
|
53
|
+
b {
|
|
54
|
+
font-weight: bolder;
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
letter-spacing: normal;
|
|
57
|
+
font-family: Metropolis, Avenir Next, Helvetica Neue, Arial, sans-serif;
|
|
58
|
+
color: #666;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
&__body {
|
|
62
|
+
flex: 1 1 auto;
|
|
63
|
+
overflow-y: auto;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="diagram-container">
|
|
3
|
-
<svg
|
|
4
|
-
v-if="props.diagramData && props.isShowDiagram"
|
|
5
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
-
:height="diagramHeight"
|
|
7
|
-
:width="diagramWidth"
|
|
8
|
-
:viewBox="viewBox"
|
|
9
|
-
:preserveAspectRatio="preserveAspectRatio"
|
|
10
|
-
:class="svgClasses"
|
|
11
|
-
@click.capture="onClickDiagram"
|
|
12
|
-
>
|
|
13
|
-
<common-diagram-main-switch
|
|
14
|
-
:networks-count="props.networksWithPositions.length"
|
|
15
|
-
:main-rect-height="props.mainRectHeight"
|
|
16
|
-
:main-switch-line="props.mainSwitchLine"
|
|
17
|
-
:selected-main-line="props.selectedMainLine"
|
|
18
|
-
:is-visible-line="hasActiveAdapter"
|
|
19
|
-
/>
|
|
20
|
-
<common-diagram-main-adapter
|
|
21
|
-
:networks-count="props.networksWithPositions.length"
|
|
22
|
-
:adapters-with-positions="props.adaptersWithPositions"
|
|
23
|
-
:selected-main-line="props.selectedMainLine"
|
|
24
|
-
:selected-port="props.selectedPort"
|
|
25
|
-
:selected-adapter="props.selectedAdapter"
|
|
26
|
-
:selected-network="props.selectedNetwork"
|
|
27
|
-
:is-visible-line="hasActiveAdapter"
|
|
28
|
-
@toggle-adapters="onToggleAdapters"
|
|
29
|
-
@select-adapter="onSelectAdapter"
|
|
30
|
-
@show-modal="onShowModal"
|
|
31
|
-
/>
|
|
32
|
-
<template v-if="!!props.networksWithPositions.length">
|
|
33
|
-
<template
|
|
34
|
-
v-for="network in props.networksWithPositions"
|
|
35
|
-
:key="network.id"
|
|
36
|
-
>
|
|
37
|
-
<common-diagram-main-network
|
|
38
|
-
:network="network"
|
|
39
|
-
:selected-port="props.selectedPort"
|
|
40
|
-
:selected-adapter="props.selectedAdapter"
|
|
41
|
-
:selected-network="props.selectedNetwork"
|
|
42
|
-
:selected-main-line="props.selectedMainLine"
|
|
43
|
-
:diagram-id="props.diagramData.id"
|
|
44
|
-
:in-portlet="props.inPortlet"
|
|
45
|
-
:is-visible-line="hasActiveAdapter"
|
|
46
|
-
@toggle-ports="onTogglePorts"
|
|
47
|
-
@select-port="onSelectPort"
|
|
48
|
-
@select-network="onSelectNetwork"
|
|
49
|
-
@show-modal="onShowModal"
|
|
50
|
-
/>
|
|
51
|
-
</template>
|
|
52
|
-
</template>
|
|
53
|
-
<common-diagram-main-network-no-network v-else />
|
|
54
|
-
<common-diagram-main-switch-selected
|
|
55
|
-
:selected-switch-line-y="props.selectedSwitchLineY"
|
|
56
|
-
:is-visible-line="hasActiveAdapter"
|
|
57
|
-
/>
|
|
58
|
-
</svg>
|
|
59
|
-
</div>
|
|
60
|
-
</template>
|
|
61
|
-
|
|
62
|
-
<script setup lang="ts">
|
|
63
|
-
import {
|
|
64
|
-
UI_I_Adapter,
|
|
65
|
-
UI_I_AdaptersWithPositions,
|
|
66
|
-
UI_I_DiagramDataFull,
|
|
67
|
-
UI_I_ModalsInitialData,
|
|
68
|
-
UI_I_NetworksWithPositions,
|
|
69
|
-
UI_I_SelectedAdapter,
|
|
70
|
-
UI_I_SelectedPort,
|
|
71
|
-
UI_I_SwitchLine,
|
|
72
|
-
} from '~/components/common/diagramMain/models/interfaces'
|
|
73
|
-
import { UI_E_PositionsY } from '~/components/common/diagramMain/models/enums'
|
|
74
|
-
|
|
75
|
-
const props = defineProps<{
|
|
76
|
-
diagramData: UI_I_DiagramDataFull | null
|
|
77
|
-
isShowDiagram: boolean
|
|
78
|
-
inPortlet: boolean
|
|
79
|
-
networksWithPositions: UI_I_NetworksWithPositions[]
|
|
80
|
-
mainRectHeight: number
|
|
81
|
-
mainSwitchLine: UI_I_SwitchLine
|
|
82
|
-
selectedMainLine: boolean
|
|
83
|
-
adaptersWithPositions: UI_I_AdaptersWithPositions
|
|
84
|
-
selectedPort: UI_I_SelectedPort
|
|
85
|
-
selectedAdapter: UI_I_SelectedAdapter
|
|
86
|
-
selectedNetwork: string
|
|
87
|
-
selectedSwitchLineY: UI_I_SwitchLine
|
|
88
|
-
}>()
|
|
89
|
-
|
|
90
|
-
const emits = defineEmits<{
|
|
91
|
-
(event: 'click-diagram', ev: MouseEvent): void
|
|
92
|
-
(event: 'toggle-adapters'): void
|
|
93
|
-
(event: 'select-adapter', adapterId: string): void
|
|
94
|
-
(event: 'show-modal', value: string, properties?: UI_I_ModalsInitialData): void
|
|
95
|
-
(
|
|
96
|
-
event: 'toggle-ports',
|
|
97
|
-
id: string,
|
|
98
|
-
newState: boolean,
|
|
99
|
-
diagramId: string
|
|
100
|
-
): void
|
|
101
|
-
(event: 'select-port', networkId: string, portId: string): void
|
|
102
|
-
(event: 'select-network', networkId: string): void
|
|
103
|
-
}>()
|
|
104
|
-
|
|
105
|
-
const svgClasses = computed(() => ({
|
|
106
|
-
'diagram-margin-top': !props.inPortlet,
|
|
107
|
-
}))
|
|
108
|
-
|
|
109
|
-
const preserveAspectRatio = computed<string | undefined>(() =>
|
|
110
|
-
props.inPortlet ? 'xMinYMin' : undefined
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
const svgHeight = computed<number>(
|
|
114
|
-
() =>
|
|
115
|
-
UI_E_PositionsY.DIAGRAM_TOP +
|
|
116
|
-
props.mainRectHeight +
|
|
117
|
-
UI_E_PositionsY.DIAGRAM_BOTTOM
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
const viewBox = computed<string>(() =>
|
|
121
|
-
props.inPortlet ? '0 0 750 1' : `0 0 740 ${svgHeight.value}`
|
|
122
|
-
)
|
|
123
|
-
|
|
124
|
-
const diagramHeight = computed<number>(() =>
|
|
125
|
-
props.inPortlet ? svgHeight.value / 1.35 : svgHeight.value
|
|
126
|
-
)
|
|
127
|
-
|
|
128
|
-
const diagramWidth = computed<number>(() => (props.inPortlet ? 560 : 740))
|
|
129
|
-
|
|
130
|
-
const hasActiveAdapter = computed<boolean>(() => {
|
|
131
|
-
return !!props.diagramData?.physicalAdapters?.adapters.filter(
|
|
132
|
-
(adapter: UI_I_Adapter) => {
|
|
133
|
-
return adapter.status === 'active'
|
|
134
|
-
}
|
|
135
|
-
).length
|
|
136
|
-
})
|
|
137
|
-
|
|
138
|
-
const onClickDiagram = (ev: MouseEvent) => emits('click-diagram', ev)
|
|
139
|
-
const onToggleAdapters = () => emits('toggle-adapters')
|
|
140
|
-
const onSelectAdapter = (adapterId: string) =>
|
|
141
|
-
emits('select-adapter', adapterId)
|
|
142
|
-
const onShowModal = (value: string, properties?: UI_I_ModalsInitialData) =>
|
|
143
|
-
emits('show-modal', value, properties)
|
|
144
|
-
const onTogglePorts = (
|
|
145
|
-
id: string,
|
|
146
|
-
isToggle: boolean,
|
|
147
|
-
diagramId: string
|
|
148
|
-
): void => {
|
|
149
|
-
emits('toggle-ports', id, isToggle, diagramId)
|
|
150
|
-
}
|
|
151
|
-
const onSelectPort = (networkId: string, portId: string): void => {
|
|
152
|
-
emits('select-port', networkId, portId)
|
|
153
|
-
}
|
|
154
|
-
const onSelectNetwork = (networkId: string): void => {
|
|
155
|
-
emits('select-network', networkId)
|
|
156
|
-
}
|
|
157
|
-
</script>
|
|
158
|
-
|
|
159
|
-
<style scoped lang="scss">
|
|
160
|
-
.diagram {
|
|
161
|
-
&-container {
|
|
162
|
-
display: flex;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
}
|
|
165
|
-
&-margin-top {
|
|
166
|
-
margin-top: 10px;
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
</style>
|
|
170
|
-
<style lang="scss">
|
|
171
|
-
.diagram-actions__popup.navbar-dropdown-menu {
|
|
172
|
-
transform: translate(-30px, -20px);
|
|
173
|
-
|
|
174
|
-
.btn {
|
|
175
|
-
border-radius: 0;
|
|
176
|
-
border-bottom: 1px solid transparent;
|
|
177
|
-
|
|
178
|
-
span {
|
|
179
|
-
font-size: 14px;
|
|
180
|
-
}
|
|
181
|
-
&:active {
|
|
182
|
-
box-shadow: none;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="diagram-container">
|
|
3
|
+
<svg
|
|
4
|
+
v-if="props.diagramData && props.isShowDiagram"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
:height="diagramHeight"
|
|
7
|
+
:width="diagramWidth"
|
|
8
|
+
:viewBox="viewBox"
|
|
9
|
+
:preserveAspectRatio="preserveAspectRatio"
|
|
10
|
+
:class="svgClasses"
|
|
11
|
+
@click.capture="onClickDiagram"
|
|
12
|
+
>
|
|
13
|
+
<common-diagram-main-switch
|
|
14
|
+
:networks-count="props.networksWithPositions.length"
|
|
15
|
+
:main-rect-height="props.mainRectHeight"
|
|
16
|
+
:main-switch-line="props.mainSwitchLine"
|
|
17
|
+
:selected-main-line="props.selectedMainLine"
|
|
18
|
+
:is-visible-line="hasActiveAdapter"
|
|
19
|
+
/>
|
|
20
|
+
<common-diagram-main-adapter
|
|
21
|
+
:networks-count="props.networksWithPositions.length"
|
|
22
|
+
:adapters-with-positions="props.adaptersWithPositions"
|
|
23
|
+
:selected-main-line="props.selectedMainLine"
|
|
24
|
+
:selected-port="props.selectedPort"
|
|
25
|
+
:selected-adapter="props.selectedAdapter"
|
|
26
|
+
:selected-network="props.selectedNetwork"
|
|
27
|
+
:is-visible-line="hasActiveAdapter"
|
|
28
|
+
@toggle-adapters="onToggleAdapters"
|
|
29
|
+
@select-adapter="onSelectAdapter"
|
|
30
|
+
@show-modal="onShowModal"
|
|
31
|
+
/>
|
|
32
|
+
<template v-if="!!props.networksWithPositions.length">
|
|
33
|
+
<template
|
|
34
|
+
v-for="network in props.networksWithPositions"
|
|
35
|
+
:key="network.id"
|
|
36
|
+
>
|
|
37
|
+
<common-diagram-main-network
|
|
38
|
+
:network="network"
|
|
39
|
+
:selected-port="props.selectedPort"
|
|
40
|
+
:selected-adapter="props.selectedAdapter"
|
|
41
|
+
:selected-network="props.selectedNetwork"
|
|
42
|
+
:selected-main-line="props.selectedMainLine"
|
|
43
|
+
:diagram-id="props.diagramData.id"
|
|
44
|
+
:in-portlet="props.inPortlet"
|
|
45
|
+
:is-visible-line="hasActiveAdapter"
|
|
46
|
+
@toggle-ports="onTogglePorts"
|
|
47
|
+
@select-port="onSelectPort"
|
|
48
|
+
@select-network="onSelectNetwork"
|
|
49
|
+
@show-modal="onShowModal"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
</template>
|
|
53
|
+
<common-diagram-main-network-no-network v-else />
|
|
54
|
+
<common-diagram-main-switch-selected
|
|
55
|
+
:selected-switch-line-y="props.selectedSwitchLineY"
|
|
56
|
+
:is-visible-line="hasActiveAdapter"
|
|
57
|
+
/>
|
|
58
|
+
</svg>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<script setup lang="ts">
|
|
63
|
+
import {
|
|
64
|
+
UI_I_Adapter,
|
|
65
|
+
UI_I_AdaptersWithPositions,
|
|
66
|
+
UI_I_DiagramDataFull,
|
|
67
|
+
UI_I_ModalsInitialData,
|
|
68
|
+
UI_I_NetworksWithPositions,
|
|
69
|
+
UI_I_SelectedAdapter,
|
|
70
|
+
UI_I_SelectedPort,
|
|
71
|
+
UI_I_SwitchLine,
|
|
72
|
+
} from '~/components/common/diagramMain/models/interfaces'
|
|
73
|
+
import { UI_E_PositionsY } from '~/components/common/diagramMain/models/enums'
|
|
74
|
+
|
|
75
|
+
const props = defineProps<{
|
|
76
|
+
diagramData: UI_I_DiagramDataFull | null
|
|
77
|
+
isShowDiagram: boolean
|
|
78
|
+
inPortlet: boolean
|
|
79
|
+
networksWithPositions: UI_I_NetworksWithPositions[]
|
|
80
|
+
mainRectHeight: number
|
|
81
|
+
mainSwitchLine: UI_I_SwitchLine
|
|
82
|
+
selectedMainLine: boolean
|
|
83
|
+
adaptersWithPositions: UI_I_AdaptersWithPositions
|
|
84
|
+
selectedPort: UI_I_SelectedPort
|
|
85
|
+
selectedAdapter: UI_I_SelectedAdapter
|
|
86
|
+
selectedNetwork: string
|
|
87
|
+
selectedSwitchLineY: UI_I_SwitchLine
|
|
88
|
+
}>()
|
|
89
|
+
|
|
90
|
+
const emits = defineEmits<{
|
|
91
|
+
(event: 'click-diagram', ev: MouseEvent): void
|
|
92
|
+
(event: 'toggle-adapters'): void
|
|
93
|
+
(event: 'select-adapter', adapterId: string): void
|
|
94
|
+
(event: 'show-modal', value: string, properties?: UI_I_ModalsInitialData): void
|
|
95
|
+
(
|
|
96
|
+
event: 'toggle-ports',
|
|
97
|
+
id: string,
|
|
98
|
+
newState: boolean,
|
|
99
|
+
diagramId: string
|
|
100
|
+
): void
|
|
101
|
+
(event: 'select-port', networkId: string, portId: string): void
|
|
102
|
+
(event: 'select-network', networkId: string): void
|
|
103
|
+
}>()
|
|
104
|
+
|
|
105
|
+
const svgClasses = computed(() => ({
|
|
106
|
+
'diagram-margin-top': !props.inPortlet,
|
|
107
|
+
}))
|
|
108
|
+
|
|
109
|
+
const preserveAspectRatio = computed<string | undefined>(() =>
|
|
110
|
+
props.inPortlet ? 'xMinYMin' : undefined
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
const svgHeight = computed<number>(
|
|
114
|
+
() =>
|
|
115
|
+
UI_E_PositionsY.DIAGRAM_TOP +
|
|
116
|
+
props.mainRectHeight +
|
|
117
|
+
UI_E_PositionsY.DIAGRAM_BOTTOM
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
const viewBox = computed<string>(() =>
|
|
121
|
+
props.inPortlet ? '0 0 750 1' : `0 0 740 ${svgHeight.value}`
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const diagramHeight = computed<number>(() =>
|
|
125
|
+
props.inPortlet ? svgHeight.value / 1.35 : svgHeight.value
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
const diagramWidth = computed<number>(() => (props.inPortlet ? 560 : 740))
|
|
129
|
+
|
|
130
|
+
const hasActiveAdapter = computed<boolean>(() => {
|
|
131
|
+
return !!props.diagramData?.physicalAdapters?.adapters.filter(
|
|
132
|
+
(adapter: UI_I_Adapter) => {
|
|
133
|
+
return adapter.status === 'active'
|
|
134
|
+
}
|
|
135
|
+
).length
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const onClickDiagram = (ev: MouseEvent) => emits('click-diagram', ev)
|
|
139
|
+
const onToggleAdapters = () => emits('toggle-adapters')
|
|
140
|
+
const onSelectAdapter = (adapterId: string) =>
|
|
141
|
+
emits('select-adapter', adapterId)
|
|
142
|
+
const onShowModal = (value: string, properties?: UI_I_ModalsInitialData) =>
|
|
143
|
+
emits('show-modal', value, properties)
|
|
144
|
+
const onTogglePorts = (
|
|
145
|
+
id: string,
|
|
146
|
+
isToggle: boolean,
|
|
147
|
+
diagramId: string
|
|
148
|
+
): void => {
|
|
149
|
+
emits('toggle-ports', id, isToggle, diagramId)
|
|
150
|
+
}
|
|
151
|
+
const onSelectPort = (networkId: string, portId: string): void => {
|
|
152
|
+
emits('select-port', networkId, portId)
|
|
153
|
+
}
|
|
154
|
+
const onSelectNetwork = (networkId: string): void => {
|
|
155
|
+
emits('select-network', networkId)
|
|
156
|
+
}
|
|
157
|
+
</script>
|
|
158
|
+
|
|
159
|
+
<style scoped lang="scss">
|
|
160
|
+
.diagram {
|
|
161
|
+
&-container {
|
|
162
|
+
display: flex;
|
|
163
|
+
justify-content: center;
|
|
164
|
+
}
|
|
165
|
+
&-margin-top {
|
|
166
|
+
margin-top: 10px;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
</style>
|
|
170
|
+
<style lang="scss">
|
|
171
|
+
.diagram-actions__popup.navbar-dropdown-menu {
|
|
172
|
+
transform: translate(-30px, -20px);
|
|
173
|
+
|
|
174
|
+
.btn {
|
|
175
|
+
border-radius: 0;
|
|
176
|
+
border-bottom: 1px solid transparent;
|
|
177
|
+
|
|
178
|
+
span {
|
|
179
|
+
font-size: 14px;
|
|
180
|
+
}
|
|
181
|
+
&:active {
|
|
182
|
+
box-shadow: none;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
</style>
|