bfg-common 1.1.83 → 1.1.84
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_ru.json +1 -1
- package/components/common/monitor/advanced/Advanced.vue +19 -6
- package/components/common/monitor/advanced/tools/Tools.vue +15 -28
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +65 -5
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +8 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +9 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts +3 -2
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +6 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +66 -19
- package/components/common/monitor/advanced/tools/chartOptionsModal/models/models.ts +19 -0
- package/components/common/monitor/models/interfaces.ts +1 -0
- package/package.json +1 -1
|
@@ -320,7 +320,7 @@
|
|
|
320
320
|
"createHardDisk": "Создать жесткий диск",
|
|
321
321
|
"createNewFolder": "Создать новую папку",
|
|
322
322
|
"createNewVirtualMachine": "Создать новую виртуальную машину",
|
|
323
|
-
"createStandardSwitch": "Создание стандартного
|
|
323
|
+
"createStandardSwitch": "Создание стандартного коммутатора",
|
|
324
324
|
"createTag": "Создание Тега",
|
|
325
325
|
"creationDate": "Дата создания",
|
|
326
326
|
"currentDisplayLimited": "Текущий дисплей ограничен 200 записями.",
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
<div class="fill-parent flex-column">
|
|
13
13
|
<div class="vertical-flex-container fill-parent">
|
|
14
14
|
<common-monitor-advanced-tools
|
|
15
|
+
v-model:selected-timespan-type="localSelectedTimespanType"
|
|
15
16
|
:type="props.type"
|
|
16
17
|
:start-date="props.data?.pointStart || 0"
|
|
17
18
|
:chart-title="props.data?.groupName || ''"
|
|
@@ -21,7 +22,6 @@
|
|
|
21
22
|
:disabled-period="props.disabledPeriod"
|
|
22
23
|
:disabled-view="props.disabledView"
|
|
23
24
|
:selected-chart-type="props.selectedChartType"
|
|
24
|
-
:selected-timespan-type="props.selectedTimespanType"
|
|
25
25
|
:units-count="props.unitsCount"
|
|
26
26
|
:period-type="props.periodType"
|
|
27
27
|
:selected-custom-time="props.selectedCustomTime"
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
:custom-time-to="props.customTimeTo"
|
|
33
33
|
:total-cores="totalCores"
|
|
34
34
|
:host-id="props.hostId"
|
|
35
|
+
:selected-objects="props.selectedObjects"
|
|
35
36
|
@update-tools="emits('update-tools', $event)"
|
|
36
37
|
@exporting="onExporting"
|
|
37
38
|
@open-advanced-page="onGetEmptyPage"
|
|
@@ -42,7 +43,6 @@
|
|
|
42
43
|
@update-unit-count="emits('update-unit-count', $event)"
|
|
43
44
|
@update-period-type="emits('update-period-type', $event)"
|
|
44
45
|
@update-custom-time="emits('update-custom-time', $event)"
|
|
45
|
-
@select-chart-name="emits('select-chart-name', $event)"
|
|
46
46
|
@delete-option="emits('delete-option')"
|
|
47
47
|
@update-custom-date-from="emits('update-custom-date-from', $event)"
|
|
48
48
|
@update-custom-date-to="emits('update-custom-date-to', $event)"
|
|
@@ -91,11 +91,12 @@ import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/t
|
|
|
91
91
|
import { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/models/interfaces'
|
|
92
92
|
import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
|
|
93
93
|
import { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/models/interfaces'
|
|
94
|
-
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
95
94
|
import {
|
|
96
95
|
T_ChartHost,
|
|
97
96
|
T_ChartVm,
|
|
98
97
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
98
|
+
import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/models'
|
|
99
|
+
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
99
100
|
import { getCountCores } from '~/components/common/monitor/advanced/tools/utils/countCores'
|
|
100
101
|
|
|
101
102
|
const props = defineProps<{
|
|
@@ -120,6 +121,7 @@ const props = defineProps<{
|
|
|
120
121
|
customTimeFrom: string
|
|
121
122
|
customTimeTo: string
|
|
122
123
|
hostId: string
|
|
124
|
+
selectedObjects: string
|
|
123
125
|
disabledPeriod?: boolean
|
|
124
126
|
disabledView?: boolean
|
|
125
127
|
}>()
|
|
@@ -135,24 +137,35 @@ const emits = defineEmits<{
|
|
|
135
137
|
(event: 'update-unit-count', value: number): void
|
|
136
138
|
(event: 'update-period-type', value: string): void
|
|
137
139
|
(event: 'update-custom-time', value: string): void
|
|
138
|
-
(event: 'select-chart-name', value: string): void
|
|
139
140
|
(event: 'delete-option'): void
|
|
140
141
|
(event: 'update-custom-date-from', value: string): void
|
|
141
142
|
(event: 'update-custom-date-to', value: string): void
|
|
142
143
|
(event: 'update-custom-time-from', value: string): void
|
|
143
144
|
(event: 'update-custom-time-to', value: string): void
|
|
144
|
-
(event: 'submit-options', value:
|
|
145
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
146
|
+
(event: 'update:selected-timespan-type', value: string): void
|
|
145
147
|
}>()
|
|
146
148
|
|
|
147
149
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
148
150
|
|
|
151
|
+
const localSelectedTimespanType = computed<string>({
|
|
152
|
+
get() {
|
|
153
|
+
return props.selectedTimespanType
|
|
154
|
+
},
|
|
155
|
+
set(newValue) {
|
|
156
|
+
emits('update:selected-timespan-type', newValue)
|
|
157
|
+
},
|
|
158
|
+
})
|
|
159
|
+
|
|
149
160
|
const totalCores = ref<number>(0)
|
|
161
|
+
let isFirstUpdate = true
|
|
150
162
|
watch(
|
|
151
163
|
() => props.data,
|
|
152
164
|
(newValue) => {
|
|
153
|
-
if (!newValue) return
|
|
165
|
+
if (!newValue || !isFirstUpdate) return
|
|
154
166
|
|
|
155
167
|
totalCores.value = getCountCores(newValue)
|
|
168
|
+
isFirstUpdate = false
|
|
156
169
|
},
|
|
157
170
|
{ immediate: true }
|
|
158
171
|
)
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
:custom-time-to="props.customTimeTo"
|
|
102
102
|
:total-cores="props.totalCores"
|
|
103
103
|
:host-id="props.hostId"
|
|
104
|
+
:selected-objects="props.selectedObjects"
|
|
104
105
|
@hide="isShowModal = false"
|
|
105
106
|
@select-row="emits('select-row', $event)"
|
|
106
107
|
@select-metric="emits('select-metric', $event)"
|
|
@@ -109,7 +110,6 @@
|
|
|
109
110
|
@update-unit-count="emits('update-unit-count', $event)"
|
|
110
111
|
@update-period-type="emits('update-period-type', $event)"
|
|
111
112
|
@update-custom-time="emits('update-custom-time', $event)"
|
|
112
|
-
@select-chart-name="onSelectChartName"
|
|
113
113
|
@delete-option="onDeleteOption"
|
|
114
114
|
@save-option-name="onSaveOptionName"
|
|
115
115
|
@update-custom-date-from="emits('update-custom-date-from', $event)"
|
|
@@ -126,11 +126,12 @@ import { UI_I_Localization } from '~/models/interfaces'
|
|
|
126
126
|
import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
|
|
127
127
|
import { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/models/interfaces'
|
|
128
128
|
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
|
|
129
|
-
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
130
129
|
import {
|
|
131
130
|
T_ChartHost,
|
|
132
131
|
T_ChartVm,
|
|
133
132
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
133
|
+
import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/models'
|
|
134
|
+
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
134
135
|
import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
|
|
135
136
|
import {
|
|
136
137
|
periodFunc,
|
|
@@ -159,6 +160,7 @@ const props = defineProps<{
|
|
|
159
160
|
customTimeTo: string
|
|
160
161
|
totalCores: number
|
|
161
162
|
hostId: string
|
|
163
|
+
selectedObjects: string
|
|
162
164
|
disabledPeriod?: boolean
|
|
163
165
|
disabledView?: boolean
|
|
164
166
|
}>()
|
|
@@ -174,13 +176,13 @@ const emits = defineEmits<{
|
|
|
174
176
|
(event: 'update-unit-count', value: number): void
|
|
175
177
|
(event: 'update-period-type', value: string): void
|
|
176
178
|
(event: 'update-custom-time', value: string): void
|
|
177
|
-
(event: 'select-chart-name', value: string): void
|
|
178
179
|
(event: 'delete-option'): void
|
|
179
180
|
(event: 'update-custom-date-from', value: string): void
|
|
180
181
|
(event: 'update-custom-date-to', value: string): void
|
|
181
182
|
(event: 'update-custom-time-from', value: string): void
|
|
182
183
|
(event: 'update-custom-time-to', value: string): void
|
|
183
|
-
(event: 'submit-options', value:
|
|
184
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
185
|
+
(event: 'update:selected-timespan-type', value: string): void
|
|
184
186
|
}>()
|
|
185
187
|
|
|
186
188
|
const routeType = '' + useRoute().params.type
|
|
@@ -212,36 +214,22 @@ watch(
|
|
|
212
214
|
{ immediate: true }
|
|
213
215
|
)
|
|
214
216
|
|
|
215
|
-
const onSelectChartName = (name: string): void => {
|
|
216
|
-
emits('select-chart-name', name)
|
|
217
|
-
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
217
|
const onDeleteOption = (): void => {
|
|
221
218
|
emits('delete-option')
|
|
222
219
|
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
223
220
|
}
|
|
224
221
|
|
|
225
|
-
const selectedPeriod = ref<string>('')
|
|
226
222
|
const periodOptions = computed<UI_I_OptionItem[]>(() =>
|
|
227
223
|
periodFunc(localization.value, props.selectedTimespanType)
|
|
228
224
|
)
|
|
229
|
-
|
|
230
|
-
()
|
|
231
|
-
|
|
232
|
-
if (newValue) selectedPeriod.value = newValue[0].value
|
|
225
|
+
const selectedPeriod = computed<string>({
|
|
226
|
+
get() {
|
|
227
|
+
return props.selectedTimespanType || periodOptions.value[0].value
|
|
233
228
|
},
|
|
234
|
-
{
|
|
235
|
-
)
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
(newValue) => {
|
|
239
|
-
if (!newValue) return
|
|
240
|
-
|
|
241
|
-
selectedPeriod.value = newValue
|
|
242
|
-
updateTools()
|
|
243
|
-
}
|
|
244
|
-
)
|
|
229
|
+
set(newValue) {
|
|
230
|
+
emits('update:selected-timespan-type', newValue)
|
|
231
|
+
},
|
|
232
|
+
})
|
|
245
233
|
|
|
246
234
|
const isShowModal = ref<boolean>(false)
|
|
247
235
|
watch(isShowModal, (newValue) => {
|
|
@@ -249,8 +237,6 @@ watch(isShowModal, (newValue) => {
|
|
|
249
237
|
selectedView.value = viewOptions.value[0].value
|
|
250
238
|
})
|
|
251
239
|
|
|
252
|
-
const selectedObjects = ref<string>('')
|
|
253
|
-
|
|
254
240
|
const updateTools = (): void => {
|
|
255
241
|
const periodValue = selectedPeriod.value
|
|
256
242
|
const viewValue = selectedView.value
|
|
@@ -295,6 +281,8 @@ const updateTools = (): void => {
|
|
|
295
281
|
periodType: periodValue,
|
|
296
282
|
view: viewValue,
|
|
297
283
|
}
|
|
284
|
+
if (selectedValue.metric) tools.metricType = selectedValue.metric
|
|
285
|
+
|
|
298
286
|
emits('update-timespan-type', selectedPeriod.value)
|
|
299
287
|
emits('update-tools', tools)
|
|
300
288
|
}
|
|
@@ -421,7 +409,6 @@ onMounted(() => {
|
|
|
421
409
|
min-width: 16px;
|
|
422
410
|
min-height: 16px;
|
|
423
411
|
background-size: 100% auto;
|
|
424
|
-
display: block;
|
|
425
412
|
}
|
|
426
413
|
}
|
|
427
414
|
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
width="1150px"
|
|
5
5
|
:show="true"
|
|
6
6
|
:title="localization.chartOptions"
|
|
7
|
+
:disabled-submit="isDisabledSubmit"
|
|
7
8
|
@hide="onHide"
|
|
8
9
|
@submit="onSubmit"
|
|
9
10
|
>
|
|
@@ -45,6 +46,8 @@
|
|
|
45
46
|
:custom-time-to="props.customTimeTo"
|
|
46
47
|
:total-cores="props.totalCores"
|
|
47
48
|
:host-id="props.hostId"
|
|
49
|
+
:selected-metrics-keys="selectedMetricsKeys"
|
|
50
|
+
:selected-objects="props.selectedObjects"
|
|
48
51
|
@select-row="selectedRows = $event"
|
|
49
52
|
@update-chart-type="selectedChartTypeLocal = $event"
|
|
50
53
|
@update-custom-time="localCustomTime = $event"
|
|
@@ -55,6 +58,7 @@
|
|
|
55
58
|
@update-custom-date-to="onUpdateCustomDateTo"
|
|
56
59
|
@update-custom-time-from="onUpdateCustomTimeFrom"
|
|
57
60
|
@update-custom-time-to="onUpdateCustomTimeTo"
|
|
61
|
+
@select-objects="localSelectedObjects = $event"
|
|
58
62
|
/>
|
|
59
63
|
</div>
|
|
60
64
|
</div>
|
|
@@ -72,9 +76,11 @@ import {
|
|
|
72
76
|
T_ChartHost,
|
|
73
77
|
T_ChartVm,
|
|
74
78
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
79
|
+
import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/models'
|
|
75
80
|
import { metricsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/metrics/config/optionsMetrics'
|
|
76
81
|
import { getCurrentOptionsStorageFunc } from '~/components/common/monitor/advanced/tools/config/advancedToolbar'
|
|
77
82
|
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker'
|
|
83
|
+
import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
|
|
78
84
|
|
|
79
85
|
const props = defineProps<{
|
|
80
86
|
type: UI_T_AdvancedType
|
|
@@ -93,6 +99,7 @@ const props = defineProps<{
|
|
|
93
99
|
customTimeTo: string
|
|
94
100
|
totalCores: number
|
|
95
101
|
hostId: string
|
|
102
|
+
selectedObjects: string
|
|
96
103
|
}>()
|
|
97
104
|
|
|
98
105
|
const emits = defineEmits<{
|
|
@@ -104,14 +111,13 @@ const emits = defineEmits<{
|
|
|
104
111
|
(event: 'update-unit-count', value: number): void
|
|
105
112
|
(event: 'update-period-type', value: string): void
|
|
106
113
|
(event: 'update-custom-time', value: string): void
|
|
107
|
-
(event: 'select-chart-name', value: string): void
|
|
108
114
|
(event: 'delete-option'): void
|
|
109
115
|
(event: 'save-option-name'): void
|
|
110
116
|
(event: 'update-custom-date-from', value: string): void
|
|
111
117
|
(event: 'update-custom-date-to', value: string): void
|
|
112
118
|
(event: 'update-custom-time-from', value: string): void
|
|
113
119
|
(event: 'update-custom-time-to', value: string): void
|
|
114
|
-
(event: 'submit-options', value:
|
|
120
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
115
121
|
(event: 'select-objects', value: string): void
|
|
116
122
|
}>()
|
|
117
123
|
|
|
@@ -210,6 +216,9 @@ const onHide = (): void => {
|
|
|
210
216
|
}
|
|
211
217
|
|
|
212
218
|
const selectedRows = ref<UI_I_AdvancedCounterItem[]>([])
|
|
219
|
+
const selectedMetricsKeys = computed<number[]>(() =>
|
|
220
|
+
selectedRows.value.map((item) => item.id)
|
|
221
|
+
)
|
|
213
222
|
const selectedChartTypeLocal = ref<string>('')
|
|
214
223
|
|
|
215
224
|
const checkValidations = (): boolean => {
|
|
@@ -250,7 +259,15 @@ watch(
|
|
|
250
259
|
|
|
251
260
|
const selectedLocalOptionName = ref<string>('')
|
|
252
261
|
|
|
253
|
-
const
|
|
262
|
+
const localSelectedObjects = ref<string>('')
|
|
263
|
+
|
|
264
|
+
const currentFieldsByArray = (data: UI_I_AdvancedCounterItem[]): string => {
|
|
265
|
+
const result: string[] = []
|
|
266
|
+
data.forEach((item) => {
|
|
267
|
+
result.push(item.nameEn)
|
|
268
|
+
})
|
|
269
|
+
return result.join(',')
|
|
270
|
+
}
|
|
254
271
|
|
|
255
272
|
const onSubmit = (): void => {
|
|
256
273
|
if (!checkValidations()) return
|
|
@@ -260,7 +277,6 @@ const onSubmit = (): void => {
|
|
|
260
277
|
|
|
261
278
|
onSaveOptions(selectedLocalOptionName.value)
|
|
262
279
|
|
|
263
|
-
// emits('select-chart-name', selectedLocalOptionName.value) +
|
|
264
280
|
// emits('select-metric', selectedMetric.value) +
|
|
265
281
|
// emits('select-row', selectedRows.value) +
|
|
266
282
|
// emits('update-timespan-type', timespanType.value) +
|
|
@@ -274,7 +290,43 @@ const onSubmit = (): void => {
|
|
|
274
290
|
// emits('update-chart-type', selectedChartTypeLocal.value) +
|
|
275
291
|
// emits('submit-options')
|
|
276
292
|
|
|
293
|
+
// const periodValue = getValidDateByOptionFunc(
|
|
294
|
+
// periodValue,
|
|
295
|
+
// selectedValue,
|
|
296
|
+
// props.unitsCount,
|
|
297
|
+
// props.selectedCustomTime
|
|
298
|
+
// )
|
|
299
|
+
//
|
|
300
|
+
|
|
301
|
+
const currentFields =
|
|
302
|
+
localSelectedObjects.value || currentFieldsByArray(selectedRows.value)
|
|
303
|
+
|
|
304
|
+
const validPeriod = getValidDateByOptionFunc(
|
|
305
|
+
timespanType.value,
|
|
306
|
+
null,
|
|
307
|
+
unitCount.value,
|
|
308
|
+
localCustomTime.value
|
|
309
|
+
).map((item) => Math.round(item / 1000))
|
|
310
|
+
|
|
311
|
+
if (
|
|
312
|
+
timespanType.value === 'custom_interval' &&
|
|
313
|
+
localPeriodType.value === 'period'
|
|
314
|
+
) {
|
|
315
|
+
const checkDateResult = checkDateFunc(
|
|
316
|
+
localization.value,
|
|
317
|
+
localCustomDateFrom.value,
|
|
318
|
+
localCustomDateTo.value,
|
|
319
|
+
localCustomTimeFrom.value,
|
|
320
|
+
localCustomTimeTo.value
|
|
321
|
+
)
|
|
322
|
+
if (Array.isArray(checkDateResult)) {
|
|
323
|
+
validPeriod[0] = Math.round(checkDateResult[0] / 1000)
|
|
324
|
+
validPeriod[1] = Math.round(checkDateResult[1] / 1000)
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
277
328
|
const savedObject = {
|
|
329
|
+
fields: currentFields,
|
|
278
330
|
optionName: selectedLocalOptionName.value,
|
|
279
331
|
metric: selectedMetric.value,
|
|
280
332
|
counters: selectedRows.value,
|
|
@@ -287,7 +339,8 @@ const onSubmit = (): void => {
|
|
|
287
339
|
dateTo: localCustomDateTo.value,
|
|
288
340
|
timeTo: localCustomTimeTo.value,
|
|
289
341
|
chartType: selectedChartTypeLocal.value,
|
|
290
|
-
objects:
|
|
342
|
+
objects: localSelectedObjects.value,
|
|
343
|
+
periodValue: validPeriod,
|
|
291
344
|
}
|
|
292
345
|
|
|
293
346
|
emits('submit-options', savedObject)
|
|
@@ -394,6 +447,13 @@ const onDeleteChartName = (name: string): void => {
|
|
|
394
447
|
emits('delete-option')
|
|
395
448
|
}
|
|
396
449
|
|
|
450
|
+
const isDisabledSubmit = computed<boolean>(
|
|
451
|
+
() =>
|
|
452
|
+
props.type === 'host' &&
|
|
453
|
+
selectedMetric.value === 'cpu' &&
|
|
454
|
+
!localSelectedObjects.value
|
|
455
|
+
)
|
|
456
|
+
|
|
397
457
|
onMounted(() => {
|
|
398
458
|
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
399
459
|
})
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
:type="props.type"
|
|
6
6
|
:selected-keys="props.selectedKeys"
|
|
7
7
|
@select-row="emits('select-row', $event)"
|
|
8
|
+
@total-items="totalMetricItems = $event"
|
|
8
9
|
/>
|
|
9
10
|
<common-monitor-advanced-tools-chart-options-modal-counters-timespan
|
|
10
11
|
:type="props.type"
|
|
@@ -21,6 +22,9 @@
|
|
|
21
22
|
:custom-time-to="props.customTimeTo"
|
|
22
23
|
:total-cores="props.totalCores"
|
|
23
24
|
:host-id="props.hostId"
|
|
25
|
+
:selected-metrics-keys="props.selectedMetricsKeys"
|
|
26
|
+
:total-metric-items="totalMetricItems"
|
|
27
|
+
:selected-objects="props.selectedObjects"
|
|
24
28
|
@update-chart-type="emits('update-chart-type', $event)"
|
|
25
29
|
@update-custom-time="emits('update-custom-time', $event)"
|
|
26
30
|
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
@@ -59,6 +63,8 @@ const props = defineProps<{
|
|
|
59
63
|
customTimeTo: string
|
|
60
64
|
totalCores: number
|
|
61
65
|
hostId: string
|
|
66
|
+
selectedMetricsKeys: number[]
|
|
67
|
+
selectedObjects: string
|
|
62
68
|
}>()
|
|
63
69
|
|
|
64
70
|
const emits = defineEmits<{
|
|
@@ -74,6 +80,8 @@ const emits = defineEmits<{
|
|
|
74
80
|
(event: 'update-custom-time-to', value: string): void
|
|
75
81
|
(event: 'select-objects', value: string): void
|
|
76
82
|
}>()
|
|
83
|
+
|
|
84
|
+
const totalMetricItems = ref<number>(0)
|
|
77
85
|
</script>
|
|
78
86
|
|
|
79
87
|
<style scoped lang="scss">
|
|
@@ -46,6 +46,7 @@ const props = defineProps<{
|
|
|
46
46
|
|
|
47
47
|
const emits = defineEmits<{
|
|
48
48
|
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
49
|
+
(event: 'total-items', value: number): void
|
|
49
50
|
}>()
|
|
50
51
|
|
|
51
52
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
@@ -57,6 +58,14 @@ const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
|
|
|
57
58
|
const totalItems = computed<number>(() => counters.value.length)
|
|
58
59
|
const totalPages = computed<number>(() => 1)
|
|
59
60
|
|
|
61
|
+
watch(
|
|
62
|
+
totalItems,
|
|
63
|
+
(newValue) => {
|
|
64
|
+
emits('total-items', newValue)
|
|
65
|
+
},
|
|
66
|
+
{ immediate: true }
|
|
67
|
+
)
|
|
68
|
+
|
|
60
69
|
const selectedCounters = ref<number[]>([])
|
|
61
70
|
watch(
|
|
62
71
|
() => props.selectedKeys,
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts
CHANGED
|
@@ -654,8 +654,9 @@ export const getDefaultCounters = (
|
|
|
654
654
|
case 'cpuUsageInPercent':
|
|
655
655
|
return hostItemsFunc('cpu', {}).splice(0, 2)
|
|
656
656
|
case 'disk':
|
|
657
|
-
|
|
658
|
-
|
|
657
|
+
return hostItemsFunc('disk', {}).filter((_, key) =>
|
|
658
|
+
[0, 14].includes(key)
|
|
659
|
+
)
|
|
659
660
|
case 'memory':
|
|
660
661
|
return hostItemsFunc('memory', {})
|
|
661
662
|
case 'network':
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue
CHANGED
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
:chart="props.chart"
|
|
27
27
|
:total-cores="props.totalCores"
|
|
28
28
|
:host-id="props.hostId"
|
|
29
|
+
:selected-metrics-keys="props.selectedMetricsKeys"
|
|
30
|
+
:total-metric-items="props.totalMetricItems"
|
|
31
|
+
:selected-objects="props.selectedObjects"
|
|
29
32
|
@select-objects="emits('select-objects', $event)"
|
|
30
33
|
/>
|
|
31
34
|
</div>
|
|
@@ -53,6 +56,9 @@ const props = defineProps<{
|
|
|
53
56
|
customTimeTo: string
|
|
54
57
|
totalCores: number
|
|
55
58
|
hostId: string
|
|
59
|
+
selectedMetricsKeys: number[]
|
|
60
|
+
totalMetricItems: number
|
|
61
|
+
selectedObjects: string
|
|
56
62
|
}>()
|
|
57
63
|
|
|
58
64
|
const emits = defineEmits<{
|
|
@@ -45,6 +45,9 @@ const props = defineProps<{
|
|
|
45
45
|
chart: T_ChartHost | T_ChartVm
|
|
46
46
|
totalCores: number
|
|
47
47
|
hostId: string
|
|
48
|
+
selectedMetricsKeys: number[]
|
|
49
|
+
totalMetricItems: number
|
|
50
|
+
selectedObjects: string
|
|
48
51
|
}>()
|
|
49
52
|
|
|
50
53
|
const emits = defineEmits<{
|
|
@@ -68,38 +71,82 @@ const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
|
68
71
|
|
|
69
72
|
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
70
73
|
|
|
71
|
-
|
|
74
|
+
let items: UI_I_AdvancedTargetObject[] = []
|
|
72
75
|
watch(
|
|
73
|
-
() => [
|
|
76
|
+
() => [
|
|
77
|
+
props.type,
|
|
78
|
+
props.chart,
|
|
79
|
+
props.totalCores,
|
|
80
|
+
props.hostId,
|
|
81
|
+
props.selectedMetricsKeys,
|
|
82
|
+
],
|
|
74
83
|
(newValue) => {
|
|
84
|
+
items = []
|
|
85
|
+
selectedRow.value = []
|
|
86
|
+
|
|
75
87
|
if (newValue[0] === 'host' && newValue[1] === 'cpu') {
|
|
76
|
-
|
|
77
|
-
id: 'total',
|
|
78
|
-
target_object: newValue[3],
|
|
79
|
-
})
|
|
80
|
-
for (let i = 0; i < newValue[2]; i++) {
|
|
88
|
+
if (newValue[4].includes(0)) {
|
|
81
89
|
items.push({
|
|
82
|
-
id: '
|
|
83
|
-
target_object:
|
|
90
|
+
id: 'total',
|
|
91
|
+
target_object: newValue[3],
|
|
84
92
|
})
|
|
85
93
|
}
|
|
94
|
+
if (newValue[4].includes(1)) {
|
|
95
|
+
for (let i = 0; i < newValue[2]; i++) {
|
|
96
|
+
items.push({
|
|
97
|
+
id: 'core' + i,
|
|
98
|
+
target_object: '' + i,
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
}
|
|
86
102
|
bodyItems.value = table.bodyItems(items)
|
|
87
|
-
}
|
|
103
|
+
} else bodyItems.value = []
|
|
88
104
|
},
|
|
89
105
|
{ immediate: true }
|
|
90
106
|
)
|
|
91
107
|
|
|
92
|
-
watch(
|
|
93
|
-
|
|
108
|
+
watch(
|
|
109
|
+
selectedRow,
|
|
110
|
+
(newValue) => {
|
|
111
|
+
const selectedItems: string[] = []
|
|
112
|
+
|
|
113
|
+
newValue.forEach((key) => {
|
|
114
|
+
selectedItems.push(items[key].id)
|
|
115
|
+
})
|
|
94
116
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
117
|
+
const selectedNames =
|
|
118
|
+
items.length === newValue.length &&
|
|
119
|
+
props.selectedMetricsKeys.length === props.totalMetricItems
|
|
120
|
+
? '*'
|
|
121
|
+
: selectedItems.join(', ')
|
|
98
122
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
123
|
+
emits('select-objects', selectedNames)
|
|
124
|
+
},
|
|
125
|
+
{ deep: true }
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
watch(
|
|
129
|
+
() => [props.selectedObjects, bodyItems.value],
|
|
130
|
+
([selected, all]) => {
|
|
131
|
+
if (!all.length) return
|
|
132
|
+
|
|
133
|
+
if (props.type === 'host' && props.chart === 'cpu') {
|
|
134
|
+
if (selected === '*') {
|
|
135
|
+
selectedRow.value = all.map((item) => item[0].id)
|
|
136
|
+
} else {
|
|
137
|
+
const selectedNames = selected.split(', ')
|
|
138
|
+
const selectedKeys: number[] = []
|
|
139
|
+
all.forEach((item) => {
|
|
140
|
+
if (selectedNames.includes('total')) selectedKeys.push(0)
|
|
141
|
+
if (selectedNames.includes(`core${item[0].text}`))
|
|
142
|
+
selectedKeys.push(item[0].id)
|
|
143
|
+
})
|
|
144
|
+
selectedRow.value = selectedKeys
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
{ immediate: true }
|
|
149
|
+
)
|
|
103
150
|
</script>
|
|
104
151
|
|
|
105
152
|
<style scoped lang="scss">
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
2
|
+
|
|
3
|
+
export interface UI_I_OptionsForm {
|
|
4
|
+
fields: string
|
|
5
|
+
optionName: string
|
|
6
|
+
metric: string
|
|
7
|
+
counters: UI_I_AdvancedCounterItem[]
|
|
8
|
+
timespanType: string
|
|
9
|
+
periodType: string
|
|
10
|
+
unitCount: number
|
|
11
|
+
localTimespanType: string
|
|
12
|
+
dateFrom: string
|
|
13
|
+
timeFrom: string
|
|
14
|
+
dateTo: string
|
|
15
|
+
timeTo: string
|
|
16
|
+
chartType: string
|
|
17
|
+
objects: string
|
|
18
|
+
periodValue: number[]
|
|
19
|
+
}
|