bfg-common 1.3.75 → 1.3.76
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 +4 -1
- package/assets/localization/local_en.json +4 -1
- package/assets/localization/local_hy.json +4 -1
- package/assets/localization/local_kk.json +4 -1
- package/assets/localization/local_ru.json +4 -1
- package/assets/localization/local_zh.json +4 -1
- package/assets/scss/common/icons/icons-2.scss +222 -222
- package/components/atoms/switch/Switch.vue +107 -107
- package/components/atoms/table/dataGrid/DataGrid.vue +1569 -1569
- package/components/common/browse/blocks/Title.vue +66 -66
- package/components/common/diagramMain/network/Contents.vue +43 -7
- package/components/common/diagramMain/port/Port.vue +47 -7
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +137 -137
- package/components/common/pages/Tasks.vue +120 -120
- package/components/common/recursionTree/RecursionTree.vue +203 -203
- package/components/common/vm/actions/clone/Clone.vue +518 -518
- package/composables/useAppVersion.ts +21 -21
- package/composables/useEnvLanguage.ts +20 -20
- package/composables/useLocal.ts +38 -38
- package/lib/models/store/tasks/interfaces.ts +108 -108
- package/lib/utils/sendTask.ts +72 -72
- package/minify.js +146 -146
- 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/store/main/lib/interfaces.ts +9 -9
- package/store/tasks/actions.ts +133 -133
- package/store/tasks/getters.ts +25 -25
- package/store/tasks/lib/models/interfaces.ts +18 -18
- package/store/tasks/mutations.ts +58 -58
- package/store/tasks/state.ts +16 -16
|
@@ -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>
|
|
@@ -12,21 +12,28 @@
|
|
|
12
12
|
|
|
13
13
|
<a
|
|
14
14
|
:id="`network-${testId}`"
|
|
15
|
+
style="text-decoration: none"
|
|
15
16
|
cursor="pointer"
|
|
16
17
|
data-title="network-name-link"
|
|
17
18
|
@click="onSelectNetwork(props.network.id)"
|
|
18
19
|
>
|
|
19
|
-
<
|
|
20
|
+
<foreignObject
|
|
20
21
|
data-title="network-name-text"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
font-weight="500"
|
|
22
|
+
height="22"
|
|
23
|
+
width="206"
|
|
24
24
|
x="50"
|
|
25
|
-
:
|
|
25
|
+
:title="props.network.title"
|
|
26
|
+
:y="networkTitlePosition"
|
|
26
27
|
class="diagram__heading"
|
|
27
28
|
>
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
<span
|
|
30
|
+
class="text-ellipsis"
|
|
31
|
+
:title="props.network.title"
|
|
32
|
+
:id="`network_${props.network.id}`"
|
|
33
|
+
>
|
|
34
|
+
{{ props.network.title }}
|
|
35
|
+
</span>
|
|
36
|
+
</foreignObject>
|
|
30
37
|
</a>
|
|
31
38
|
|
|
32
39
|
<foreignObject
|
|
@@ -183,6 +190,10 @@ const closedPortsLinePosition = computed<number>(
|
|
|
183
190
|
() => props.network.portsPosition + 7.5
|
|
184
191
|
)
|
|
185
192
|
|
|
193
|
+
const networkTitlePosition = computed<number>(
|
|
194
|
+
() => props.network.titlePosition - 5
|
|
195
|
+
)
|
|
196
|
+
|
|
186
197
|
const onSelectNetwork = (networkId: string): void => {
|
|
187
198
|
emits('select-network', networkId)
|
|
188
199
|
}
|
|
@@ -210,6 +221,15 @@ const onTogglePorts = (
|
|
|
210
221
|
.port-group-header {
|
|
211
222
|
fill: #c1cdd4;
|
|
212
223
|
}
|
|
224
|
+
|
|
225
|
+
.text-ellipsis {
|
|
226
|
+
color: #c1cdd4;
|
|
227
|
+
|
|
228
|
+
&:hover {
|
|
229
|
+
color: #c1cdd4;
|
|
230
|
+
text-decoration: solid underline #c1cdd4 2px;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
213
233
|
}
|
|
214
234
|
|
|
215
235
|
.diagram {
|
|
@@ -250,4 +270,20 @@ const onTogglePorts = (
|
|
|
250
270
|
transform: rotate(180deg);
|
|
251
271
|
}
|
|
252
272
|
}
|
|
273
|
+
|
|
274
|
+
.text-ellipsis {
|
|
275
|
+
display: block;
|
|
276
|
+
max-width: 206px;
|
|
277
|
+
text-overflow: ellipsis;
|
|
278
|
+
overflow: hidden;
|
|
279
|
+
white-space: nowrap;
|
|
280
|
+
font-weight: 500;
|
|
281
|
+
font-size: 14px;
|
|
282
|
+
color: #565656;
|
|
283
|
+
|
|
284
|
+
&:hover {
|
|
285
|
+
color: #565656;
|
|
286
|
+
text-decoration: solid underline #565656 2px;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
253
289
|
</style>
|
|
@@ -25,16 +25,22 @@
|
|
|
25
25
|
cursor="pointer"
|
|
26
26
|
@click="onSelectPort(props.network.id, props.port.id)"
|
|
27
27
|
>
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
<foreignObject
|
|
29
|
+
data-title="network-name-text"
|
|
30
|
+
height="20"
|
|
31
|
+
width="206"
|
|
32
32
|
x="42"
|
|
33
|
-
:y="
|
|
33
|
+
:y="portTitlePosition"
|
|
34
34
|
class="diagram__values"
|
|
35
35
|
>
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
<span
|
|
37
|
+
class="text-ellipsis"
|
|
38
|
+
:title="props.port.name"
|
|
39
|
+
:id="`port_${props.port.id}`"
|
|
40
|
+
>
|
|
41
|
+
{{ props.port.name }}
|
|
42
|
+
</span>
|
|
43
|
+
</foreignObject>
|
|
38
44
|
</a>
|
|
39
45
|
|
|
40
46
|
<text
|
|
@@ -144,6 +150,8 @@ const emits = defineEmits<{
|
|
|
144
150
|
): void
|
|
145
151
|
}>()
|
|
146
152
|
|
|
153
|
+
const portTitlePosition = computed<number>(() => props.port.portPosition - 5)
|
|
154
|
+
|
|
147
155
|
const isVmKernel = computed<boolean>(
|
|
148
156
|
() => props.network.networkType === UI_E_NetworkType.VMkernel
|
|
149
157
|
)
|
|
@@ -206,6 +214,13 @@ const showHighlightPortSelectedAdapter = computed(() =>
|
|
|
206
214
|
?.ports.includes(props.port.id)
|
|
207
215
|
)
|
|
208
216
|
|
|
217
|
+
const portTitle = computed<string>(() => {
|
|
218
|
+
if (props.port.name.length > 23) {
|
|
219
|
+
return `${props.port.name.slice(0, 23)}...`
|
|
220
|
+
}
|
|
221
|
+
return props.port.name
|
|
222
|
+
})
|
|
223
|
+
|
|
209
224
|
const onShowModal = (
|
|
210
225
|
value: string,
|
|
211
226
|
properties?: UI_I_ModalsInitialData
|
|
@@ -274,6 +289,15 @@ const onSelectPort = (networkId: string, portId: string): void => {
|
|
|
274
289
|
.diagram__values {
|
|
275
290
|
fill: #c1cdd4;
|
|
276
291
|
}
|
|
292
|
+
|
|
293
|
+
.text-ellipsis {
|
|
294
|
+
color: #c1cdd4;
|
|
295
|
+
|
|
296
|
+
&:hover {
|
|
297
|
+
color: #c1cdd4;
|
|
298
|
+
text-decoration: solid underline #c1cdd4 1px;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
277
301
|
}
|
|
278
302
|
|
|
279
303
|
.diagram {
|
|
@@ -317,4 +341,20 @@ const onSelectPort = (networkId: string, portId: string): void => {
|
|
|
317
341
|
.small {
|
|
318
342
|
font: normal 9px Metropolis;
|
|
319
343
|
}
|
|
344
|
+
|
|
345
|
+
.text-ellipsis {
|
|
346
|
+
display: block;
|
|
347
|
+
max-width: 206px;
|
|
348
|
+
text-overflow: ellipsis;
|
|
349
|
+
overflow: hidden;
|
|
350
|
+
white-space: nowrap;
|
|
351
|
+
font-weight: 400;
|
|
352
|
+
font-size: 12px;
|
|
353
|
+
color: #565656;
|
|
354
|
+
|
|
355
|
+
&:hover {
|
|
356
|
+
color: #565656;
|
|
357
|
+
text-decoration: solid underline #565656 1px;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
320
360
|
</style>
|
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="vertical-flex-container chart-option-counters-vertical-split">
|
|
3
|
-
<span class="chart-options-grid-title">{{
|
|
4
|
-
localization.selectCountersForThisChart
|
|
5
|
-
}}</span>
|
|
6
|
-
|
|
7
|
-
<atoms-table-data-grid
|
|
8
|
-
v-model:selected-row="selectedCounters"
|
|
9
|
-
v-model:column-keys="columnItems"
|
|
10
|
-
v-model:page-size="pagination.pageSize"
|
|
11
|
-
v-model:page="pagination.page"
|
|
12
|
-
type="checkbox"
|
|
13
|
-
class="data-table"
|
|
14
|
-
:head-items="headItems"
|
|
15
|
-
:body-items="bodyItems"
|
|
16
|
-
:total-items="totalItems"
|
|
17
|
-
:total-pages="totalPages"
|
|
18
|
-
hide-footer
|
|
19
|
-
server-off
|
|
20
|
-
@change="onChangeRow"
|
|
21
|
-
/>
|
|
22
|
-
</div>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script setup lang="ts">
|
|
26
|
-
import {
|
|
27
|
-
UI_I_HeadItem,
|
|
28
|
-
UI_I_BodyItem,
|
|
29
|
-
UI_I_ColumnKey,
|
|
30
|
-
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
31
|
-
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
32
|
-
import { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
33
|
-
import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig'
|
|
34
|
-
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
|
|
35
|
-
import {
|
|
36
|
-
UI_T_ChartHost,
|
|
37
|
-
UI_T_ChartVm,
|
|
38
|
-
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
|
|
39
|
-
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
|
|
40
|
-
import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils'
|
|
41
|
-
|
|
42
|
-
const props = defineProps<{
|
|
43
|
-
chart: UI_T_ChartHost | UI_T_ChartVm
|
|
44
|
-
type: UI_T_AdvancedType
|
|
45
|
-
selectedKeys: number[]
|
|
46
|
-
}>()
|
|
47
|
-
|
|
48
|
-
const emits = defineEmits<{
|
|
49
|
-
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
50
|
-
(event: 'total-items', value: number): void
|
|
51
|
-
}>()
|
|
52
|
-
|
|
53
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
-
|
|
55
|
-
const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
|
|
56
|
-
countersItemsFunc(props.type, props.chart, localization.value)
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
const totalItems = computed<number>(() => counters.value.length)
|
|
60
|
-
const totalPages = computed<number>(() => 1)
|
|
61
|
-
|
|
62
|
-
watch(
|
|
63
|
-
totalItems,
|
|
64
|
-
(newValue) => {
|
|
65
|
-
emits('total-items', newValue)
|
|
66
|
-
},
|
|
67
|
-
{ immediate: true }
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
const selectedCounters = ref<number[]>([])
|
|
71
|
-
watch(
|
|
72
|
-
() => props.selectedKeys,
|
|
73
|
-
(newValue) => {
|
|
74
|
-
selectedCounters.value = newValue
|
|
75
|
-
},
|
|
76
|
-
{ immediate: true, deep: true }
|
|
77
|
-
)
|
|
78
|
-
watch(
|
|
79
|
-
() => props.chart,
|
|
80
|
-
() => {
|
|
81
|
-
selectedCounters.value = []
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
const pagination = ref<UI_I_Pagination>({
|
|
85
|
-
page: 1,
|
|
86
|
-
pageSize: 35,
|
|
87
|
-
})
|
|
88
|
-
|
|
89
|
-
const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
90
|
-
table.columnKeys(localization.value)
|
|
91
|
-
)
|
|
92
|
-
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
93
|
-
table.headItems(localization.value)
|
|
94
|
-
)
|
|
95
|
-
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
96
|
-
|
|
97
|
-
watch(
|
|
98
|
-
counters,
|
|
99
|
-
(newValue) => {
|
|
100
|
-
if (!newValue.length) return
|
|
101
|
-
|
|
102
|
-
bodyItems.value = table.bodyItems(newValue)
|
|
103
|
-
},
|
|
104
|
-
{ deep: true, immediate: true }
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
const onChangeRow = (val: number[]): void => {
|
|
108
|
-
const result: UI_I_AdvancedCounterItem[] = []
|
|
109
|
-
|
|
110
|
-
counters.value.forEach((item) => {
|
|
111
|
-
if (val.includes(item.id)) result.push(item)
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
emits('select-row', result)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
watch(
|
|
118
|
-
selectedCounters,
|
|
119
|
-
(newValue) => {
|
|
120
|
-
onChangeRow(newValue)
|
|
121
|
-
},
|
|
122
|
-
{ immediate: true }
|
|
123
|
-
)
|
|
124
|
-
</script>
|
|
125
|
-
|
|
126
|
-
<style scoped lang="scss">
|
|
127
|
-
.chart-option-counters-vertical-split {
|
|
128
|
-
.chart-options-grid-title {
|
|
129
|
-
display: block;
|
|
130
|
-
margin-bottom: -20px;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
:deep(.datagrid-table-wrapper) {
|
|
134
|
-
max-height: 88px;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="vertical-flex-container chart-option-counters-vertical-split">
|
|
3
|
+
<span class="chart-options-grid-title">{{
|
|
4
|
+
localization.selectCountersForThisChart
|
|
5
|
+
}}</span>
|
|
6
|
+
|
|
7
|
+
<atoms-table-data-grid
|
|
8
|
+
v-model:selected-row="selectedCounters"
|
|
9
|
+
v-model:column-keys="columnItems"
|
|
10
|
+
v-model:page-size="pagination.pageSize"
|
|
11
|
+
v-model:page="pagination.page"
|
|
12
|
+
type="checkbox"
|
|
13
|
+
class="data-table"
|
|
14
|
+
:head-items="headItems"
|
|
15
|
+
:body-items="bodyItems"
|
|
16
|
+
:total-items="totalItems"
|
|
17
|
+
:total-pages="totalPages"
|
|
18
|
+
hide-footer
|
|
19
|
+
server-off
|
|
20
|
+
@change="onChangeRow"
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup lang="ts">
|
|
26
|
+
import {
|
|
27
|
+
UI_I_HeadItem,
|
|
28
|
+
UI_I_BodyItem,
|
|
29
|
+
UI_I_ColumnKey,
|
|
30
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
31
|
+
import { UI_I_Localization } from '~/lib/models/interfaces'
|
|
32
|
+
import { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
33
|
+
import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig'
|
|
34
|
+
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
|
|
35
|
+
import {
|
|
36
|
+
UI_T_ChartHost,
|
|
37
|
+
UI_T_ChartVm,
|
|
38
|
+
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
|
|
39
|
+
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
|
|
40
|
+
import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils'
|
|
41
|
+
|
|
42
|
+
const props = defineProps<{
|
|
43
|
+
chart: UI_T_ChartHost | UI_T_ChartVm
|
|
44
|
+
type: UI_T_AdvancedType
|
|
45
|
+
selectedKeys: number[]
|
|
46
|
+
}>()
|
|
47
|
+
|
|
48
|
+
const emits = defineEmits<{
|
|
49
|
+
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
50
|
+
(event: 'total-items', value: number): void
|
|
51
|
+
}>()
|
|
52
|
+
|
|
53
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
54
|
+
|
|
55
|
+
const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
|
|
56
|
+
countersItemsFunc(props.type, props.chart, localization.value)
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
const totalItems = computed<number>(() => counters.value.length)
|
|
60
|
+
const totalPages = computed<number>(() => 1)
|
|
61
|
+
|
|
62
|
+
watch(
|
|
63
|
+
totalItems,
|
|
64
|
+
(newValue) => {
|
|
65
|
+
emits('total-items', newValue)
|
|
66
|
+
},
|
|
67
|
+
{ immediate: true }
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
const selectedCounters = ref<number[]>([])
|
|
71
|
+
watch(
|
|
72
|
+
() => props.selectedKeys,
|
|
73
|
+
(newValue) => {
|
|
74
|
+
selectedCounters.value = newValue
|
|
75
|
+
},
|
|
76
|
+
{ immediate: true, deep: true }
|
|
77
|
+
)
|
|
78
|
+
watch(
|
|
79
|
+
() => props.chart,
|
|
80
|
+
() => {
|
|
81
|
+
selectedCounters.value = []
|
|
82
|
+
}
|
|
83
|
+
)
|
|
84
|
+
const pagination = ref<UI_I_Pagination>({
|
|
85
|
+
page: 1,
|
|
86
|
+
pageSize: 35,
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
90
|
+
table.columnKeys(localization.value)
|
|
91
|
+
)
|
|
92
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
93
|
+
table.headItems(localization.value)
|
|
94
|
+
)
|
|
95
|
+
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
96
|
+
|
|
97
|
+
watch(
|
|
98
|
+
counters,
|
|
99
|
+
(newValue) => {
|
|
100
|
+
if (!newValue.length) return
|
|
101
|
+
|
|
102
|
+
bodyItems.value = table.bodyItems(newValue)
|
|
103
|
+
},
|
|
104
|
+
{ deep: true, immediate: true }
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
const onChangeRow = (val: number[]): void => {
|
|
108
|
+
const result: UI_I_AdvancedCounterItem[] = []
|
|
109
|
+
|
|
110
|
+
counters.value.forEach((item) => {
|
|
111
|
+
if (val.includes(item.id)) result.push(item)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
emits('select-row', result)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
watch(
|
|
118
|
+
selectedCounters,
|
|
119
|
+
(newValue) => {
|
|
120
|
+
onChangeRow(newValue)
|
|
121
|
+
},
|
|
122
|
+
{ immediate: true }
|
|
123
|
+
)
|
|
124
|
+
</script>
|
|
125
|
+
|
|
126
|
+
<style scoped lang="scss">
|
|
127
|
+
.chart-option-counters-vertical-split {
|
|
128
|
+
.chart-options-grid-title {
|
|
129
|
+
display: block;
|
|
130
|
+
margin-bottom: -20px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
:deep(.datagrid-table-wrapper) {
|
|
134
|
+
max-height: 88px;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
</style>
|