bfg-common 1.5.701 → 1.5.702
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/localization/local_be.json +2 -1
- package/assets/localization/local_en.json +2 -1
- package/assets/localization/local_hy.json +2 -1
- package/assets/localization/local_kk.json +2 -1
- package/assets/localization/local_ru.json +3 -2
- package/assets/localization/local_zh.json +2 -1
- package/components/common/layout/theHeader/modals/reconnect/ReconnectOld.vue +2 -0
- package/components/common/monitor/advanced/graphView/GraphView.vue +151 -151
- package/components/common/monitor/advanced/tools/Tools.vue +313 -313
- package/components/common/pages/files/lib/models/enums.ts +10 -0
- package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +394 -394
- package/components/common/pages/hardwareHealth/tableView/TableView.vue +202 -202
- package/components/common/pages/hardwareHealth/tableView/lib/config/sensorTable.ts +165 -165
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/New.vue +0 -9
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/Old.vue +6 -13
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +0 -26
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces.ts +3 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/New.vue +7 -4
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +9 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/Old.vue +5 -8
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +1 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/New.vue +2 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/Old.vue +2 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/New.vue +1 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/Old.vue +1 -2
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/New.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +1 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/Old.vue +1 -1
- package/package.json +1 -1
- package/store/main/getters.ts +7 -7
|
@@ -1,313 +1,313 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<common-monitor-advanced-tools-new
|
|
3
|
-
v-if="isNewView"
|
|
4
|
-
v-model:selected-view="selectedView"
|
|
5
|
-
v-model:is-show-modal-local="isShowModal"
|
|
6
|
-
v-model:selected-period="selectedPeriod"
|
|
7
|
-
:selected-timespan-type="localSelectedTimespanType"
|
|
8
|
-
:type="props.type"
|
|
9
|
-
:chart-title-date="chartTitleDate"
|
|
10
|
-
:language="props.language"
|
|
11
|
-
:selected-counters-keys="props.selectedCountersKeys"
|
|
12
|
-
:selected-metric="props.selectedMetric"
|
|
13
|
-
:disabled-period="props.disabledPeriod"
|
|
14
|
-
:disabled-view="props.disabledView"
|
|
15
|
-
:selected-chart-type="props.selectedChartType"
|
|
16
|
-
:units-count="props.unitsCount"
|
|
17
|
-
:period-type="props.periodType"
|
|
18
|
-
:selected-custom-time="props.selectedCustomTime"
|
|
19
|
-
:selected-chart-option-name="props.selectedChartOptionName"
|
|
20
|
-
:custom-date-from="props.customDateFrom"
|
|
21
|
-
:custom-date-to="props.customDateTo"
|
|
22
|
-
:custom-time-from="props.customTimeFrom"
|
|
23
|
-
:custom-time-to="props.customTimeTo"
|
|
24
|
-
:total-cores="totalCores"
|
|
25
|
-
:host-id="props.hostId"
|
|
26
|
-
:selected-objects="props.selectedObjects"
|
|
27
|
-
:project="props.project"
|
|
28
|
-
:objects-loading="props.objectsLoading"
|
|
29
|
-
:objects-data="props.objectsData"
|
|
30
|
-
:valid-date-end="props.validDateEnd"
|
|
31
|
-
:format-date="props.formatDate"
|
|
32
|
-
:view-options="viewOptions"
|
|
33
|
-
:period-options="periodOptions"
|
|
34
|
-
:selected-node-name="props.selectedNodeName"
|
|
35
|
-
@save-option-name="onSaveOptionName"
|
|
36
|
-
@change-period="updateTools"
|
|
37
|
-
@change-view="updateTools"
|
|
38
|
-
@select-row="emits('select-row', $event)"
|
|
39
|
-
@select-metric-local="emits('select-metric-local', $event)"
|
|
40
|
-
@update-chart-type="emits('update-chart-type', $event)"
|
|
41
|
-
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
42
|
-
@update-unit-count="emits('update-unit-count', $event)"
|
|
43
|
-
@update-period-type="emits('update-period-type', $event)"
|
|
44
|
-
@update-custom-time="emits('update-custom-time', $event)"
|
|
45
|
-
@delete-option="onDeleteOption"
|
|
46
|
-
@submit-options="emits('submit-options', $event)"
|
|
47
|
-
/>
|
|
48
|
-
<common-monitor-advanced-tools-old
|
|
49
|
-
v-else
|
|
50
|
-
v-model:selected-view="selectedView"
|
|
51
|
-
v-model:is-show-modal-local="isShowModal"
|
|
52
|
-
v-model:selected-period="selectedPeriod"
|
|
53
|
-
:selected-timespan-type="localSelectedTimespanType"
|
|
54
|
-
:type="props.type"
|
|
55
|
-
:chart-title="props.chartTitle"
|
|
56
|
-
:chart-title-date="chartTitleDate"
|
|
57
|
-
:language="props.language"
|
|
58
|
-
:selected-counters-keys="props.selectedCountersKeys"
|
|
59
|
-
:selected-metric="props.selectedMetric"
|
|
60
|
-
:disabled-period="props.disabledPeriod"
|
|
61
|
-
:disabled-view="props.disabledView"
|
|
62
|
-
:selected-chart-type="props.selectedChartType"
|
|
63
|
-
:units-count="props.unitsCount"
|
|
64
|
-
:period-type="props.periodType"
|
|
65
|
-
:selected-custom-time="props.selectedCustomTime"
|
|
66
|
-
:selected-chart-option-name="props.selectedChartOptionName"
|
|
67
|
-
:custom-date-from="props.customDateFrom"
|
|
68
|
-
:custom-date-to="props.customDateTo"
|
|
69
|
-
:custom-time-from="props.customTimeFrom"
|
|
70
|
-
:custom-time-to="props.customTimeTo"
|
|
71
|
-
:total-cores="totalCores"
|
|
72
|
-
:host-id="props.hostId"
|
|
73
|
-
:selected-objects="props.selectedObjects"
|
|
74
|
-
:project="props.project"
|
|
75
|
-
:objects-loading="props.objectsLoading"
|
|
76
|
-
:objects-data="props.objectsData"
|
|
77
|
-
:valid-date-end="props.validDateEnd"
|
|
78
|
-
:format-date="props.formatDate"
|
|
79
|
-
:view-options="viewOptions"
|
|
80
|
-
:period-options="periodOptions"
|
|
81
|
-
@save-option-name="onSaveOptionName"
|
|
82
|
-
@change-period="updateTools"
|
|
83
|
-
@change-view="updateTools"
|
|
84
|
-
@exporting="emits('exporting', $event)"
|
|
85
|
-
@open-advanced-page="emits('open-advanced-page')"
|
|
86
|
-
@select-row="emits('select-row', $event)"
|
|
87
|
-
@select-metric-local="emits('select-metric-local', $event)"
|
|
88
|
-
@update-chart-type="emits('update-chart-type', $event)"
|
|
89
|
-
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
90
|
-
@update-unit-count="emits('update-unit-count', $event)"
|
|
91
|
-
@update-period-type="emits('update-period-type', $event)"
|
|
92
|
-
@update-custom-time="emits('update-custom-time', $event)"
|
|
93
|
-
@delete-option="onDeleteOption"
|
|
94
|
-
@submit-options="emits('submit-options', $event)"
|
|
95
|
-
/>
|
|
96
|
-
</template>
|
|
97
|
-
|
|
98
|
-
<script setup lang="ts">
|
|
99
|
-
import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
|
|
100
|
-
import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
|
|
101
|
-
import type {
|
|
102
|
-
UI_T_ChartHost,
|
|
103
|
-
UI_T_ChartVm,
|
|
104
|
-
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
|
|
105
|
-
import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
|
|
106
|
-
import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
|
|
107
|
-
import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
|
|
108
|
-
import type { UI_T_Project } from '~/lib/models/types'
|
|
109
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
111
|
-
import {
|
|
112
|
-
getCurrentOptionsStorageFunc,
|
|
113
|
-
periodFunc,
|
|
114
|
-
viewFunc,
|
|
115
|
-
} from '~/components/common/monitor/advanced/tools/lib/config/advancedToolbar'
|
|
116
|
-
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
117
|
-
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
118
|
-
|
|
119
|
-
const props = withDefaults(
|
|
120
|
-
defineProps<{
|
|
121
|
-
type: UI_T_AdvancedType
|
|
122
|
-
startDate: number
|
|
123
|
-
endDate: number
|
|
124
|
-
chartTitle: string
|
|
125
|
-
language: string
|
|
126
|
-
selectedCountersKeys: number[]
|
|
127
|
-
selectedMetric: UI_T_ChartHost | UI_T_ChartVm
|
|
128
|
-
selectedChartType: string
|
|
129
|
-
selectedTimespanType: string
|
|
130
|
-
unitsCount: number
|
|
131
|
-
periodType: string
|
|
132
|
-
selectedCustomTime: string
|
|
133
|
-
selectedChartOptionName: string
|
|
134
|
-
customDateFrom: string
|
|
135
|
-
customDateTo: string
|
|
136
|
-
customTimeFrom: string
|
|
137
|
-
customTimeTo: string
|
|
138
|
-
totalCores: number
|
|
139
|
-
hostId: string
|
|
140
|
-
selectedObjects: string
|
|
141
|
-
project: UI_T_Project
|
|
142
|
-
objectsLoading: boolean
|
|
143
|
-
objectsData: UI_I_ObjectItem[]
|
|
144
|
-
validDateEnd: number
|
|
145
|
-
formatDate: string
|
|
146
|
-
disabledPeriod?: boolean
|
|
147
|
-
disabledView?: boolean
|
|
148
|
-
selectedNodeName?: string
|
|
149
|
-
}>(),
|
|
150
|
-
{
|
|
151
|
-
disabledPeriod: undefined,
|
|
152
|
-
disabledView: undefined,
|
|
153
|
-
selectedNodeName: undefined,
|
|
154
|
-
}
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
const emits = defineEmits<{
|
|
158
|
-
(event: 'update-tools', value: UI_I_MonitorGraphPayload): void
|
|
159
|
-
(event: 'exporting', value: string): void
|
|
160
|
-
(event: 'open-advanced-page'): void
|
|
161
|
-
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
162
|
-
(event: 'select-metric-local', value: string): void
|
|
163
|
-
(event: 'update-chart-type', value: string): void
|
|
164
|
-
(event: 'update-timespan-type', value: string): void
|
|
165
|
-
(event: 'update-unit-count', value: number): void
|
|
166
|
-
(event: 'update-period-type', value: string): void
|
|
167
|
-
(event: 'update-custom-time', value: string): void
|
|
168
|
-
(event: 'delete-option'): void
|
|
169
|
-
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
170
|
-
(event: 'update:selected-timespan-type', value: string): void
|
|
171
|
-
}>()
|
|
172
|
-
|
|
173
|
-
const { $store, $formattedDatetime }: any = useNuxtApp()
|
|
174
|
-
|
|
175
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
176
|
-
|
|
177
|
-
const routeType = '' + useRoute().params.type
|
|
178
|
-
|
|
179
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
180
|
-
|
|
181
|
-
const updateTimeFormatAndInterfaceLang = computed<number>(
|
|
182
|
-
() => $store.getters['main/getUpdateTimeFormatAndInterfaceLang']
|
|
183
|
-
)
|
|
184
|
-
|
|
185
|
-
const localSelectedTimespanType = computed<string>({
|
|
186
|
-
get() {
|
|
187
|
-
return props.selectedTimespanType
|
|
188
|
-
},
|
|
189
|
-
set(newValue) {
|
|
190
|
-
emits('update:selected-timespan-type', newValue)
|
|
191
|
-
},
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
const optionsNames = ref<string[]>([])
|
|
195
|
-
const viewOptions = computed<UI_I_OptionItem[]>(() =>
|
|
196
|
-
viewFunc(localization.value, props.type, optionsNames.value)
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
const selectedView = ref<string>('')
|
|
200
|
-
|
|
201
|
-
watch(
|
|
202
|
-
() => props.selectedChartOptionName,
|
|
203
|
-
(newValue) => {
|
|
204
|
-
let currentValue = ''
|
|
205
|
-
|
|
206
|
-
if (newValue) currentValue = newValue
|
|
207
|
-
else if (
|
|
208
|
-
selectedView.value &&
|
|
209
|
-
optionsNames.value.includes(selectedView.value)
|
|
210
|
-
)
|
|
211
|
-
currentValue = selectedView.value
|
|
212
|
-
else currentValue = selectedView.value || viewOptions.value[0]?.value
|
|
213
|
-
|
|
214
|
-
selectedView.value = currentValue
|
|
215
|
-
},
|
|
216
|
-
{ immediate: true }
|
|
217
|
-
)
|
|
218
|
-
|
|
219
|
-
const periodOptions = computed<UI_I_OptionItem[]>(() =>
|
|
220
|
-
periodFunc(localization.value, props.selectedTimespanType)
|
|
221
|
-
)
|
|
222
|
-
const selectedPeriod = computed<string>({
|
|
223
|
-
get() {
|
|
224
|
-
return props.selectedTimespanType || periodOptions.value[0].value
|
|
225
|
-
},
|
|
226
|
-
set(newValue) {
|
|
227
|
-
emits('update:selected-timespan-type', newValue)
|
|
228
|
-
},
|
|
229
|
-
})
|
|
230
|
-
|
|
231
|
-
const updateTools = (): void => {
|
|
232
|
-
const periodValue = localSelectedTimespanType.value
|
|
233
|
-
const viewValue = selectedView.value
|
|
234
|
-
const prefix = props.project === 'sphere'
|
|
235
|
-
const selectedValue = useLocalStorage(
|
|
236
|
-
viewValue + 'ChartOptions',
|
|
237
|
-
undefined,
|
|
238
|
-
prefix
|
|
239
|
-
)
|
|
240
|
-
|
|
241
|
-
const fields = selectedValue
|
|
242
|
-
? selectedValue.counters.map((item) => item.name).join(', ')
|
|
243
|
-
: ''
|
|
244
|
-
const validPeriodData = getValidDateByOptionFunc(
|
|
245
|
-
periodValue,
|
|
246
|
-
selectedValue,
|
|
247
|
-
props.unitsCount,
|
|
248
|
-
props.selectedCustomTime
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
const period = [
|
|
252
|
-
Math.round(validPeriodData[0] / 1000),
|
|
253
|
-
Math.round(validPeriodData[1] / 1000),
|
|
254
|
-
]
|
|
255
|
-
|
|
256
|
-
if (periodValue === 'custom_interval' && props.periodType === 'period') {
|
|
257
|
-
const checkDateResult = checkDateFunc(
|
|
258
|
-
localization.value,
|
|
259
|
-
props.customDateFrom,
|
|
260
|
-
props.customDateTo,
|
|
261
|
-
props.customTimeFrom,
|
|
262
|
-
props.customTimeTo,
|
|
263
|
-
props.validDateEnd,
|
|
264
|
-
props.formatDate
|
|
265
|
-
)
|
|
266
|
-
if (Array.isArray(checkDateResult)) {
|
|
267
|
-
period[0] = Math.round(checkDateResult[0] / 1000)
|
|
268
|
-
period[1] = Math.round(checkDateResult[1] / 1000)
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
const tools: UI_I_MonitorGraphPayload = {
|
|
273
|
-
fields,
|
|
274
|
-
period,
|
|
275
|
-
periodType: periodValue,
|
|
276
|
-
view: viewValue,
|
|
277
|
-
}
|
|
278
|
-
if (selectedValue.metric) tools.metricType = selectedValue.metric
|
|
279
|
-
|
|
280
|
-
emits('update-timespan-type', localSelectedTimespanType.value)
|
|
281
|
-
emits('update-tools', tools)
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const chartTitleDate = computed<string>(() => {
|
|
285
|
-
if (!props.startDate || !updateTimeFormatAndInterfaceLang.value) return ''
|
|
286
|
-
|
|
287
|
-
const start = $formattedDatetime(props.startDate, { hasSeconds: true })
|
|
288
|
-
const end = $formattedDatetime(props.endDate, { hasSeconds: true })
|
|
289
|
-
return `${start} - ${end}`
|
|
290
|
-
})
|
|
291
|
-
|
|
292
|
-
const onDeleteOption = (): void => {
|
|
293
|
-
emits('delete-option')
|
|
294
|
-
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
const onSaveOptionName = (): void => {
|
|
298
|
-
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const isShowModal = ref<boolean>()
|
|
302
|
-
watch(isShowModal, (newValue) => {
|
|
303
|
-
if (!newValue && !selectedView.value)
|
|
304
|
-
selectedView.value = viewOptions.value[0].value
|
|
305
|
-
})
|
|
306
|
-
|
|
307
|
-
onMounted(() => {
|
|
308
|
-
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
309
|
-
updateTools()
|
|
310
|
-
})
|
|
311
|
-
</script>
|
|
312
|
-
|
|
313
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<common-monitor-advanced-tools-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model:selected-view="selectedView"
|
|
5
|
+
v-model:is-show-modal-local="isShowModal"
|
|
6
|
+
v-model:selected-period="selectedPeriod"
|
|
7
|
+
:selected-timespan-type="localSelectedTimespanType"
|
|
8
|
+
:type="props.type"
|
|
9
|
+
:chart-title-date="chartTitleDate"
|
|
10
|
+
:language="props.language"
|
|
11
|
+
:selected-counters-keys="props.selectedCountersKeys"
|
|
12
|
+
:selected-metric="props.selectedMetric"
|
|
13
|
+
:disabled-period="props.disabledPeriod"
|
|
14
|
+
:disabled-view="props.disabledView"
|
|
15
|
+
:selected-chart-type="props.selectedChartType"
|
|
16
|
+
:units-count="props.unitsCount"
|
|
17
|
+
:period-type="props.periodType"
|
|
18
|
+
:selected-custom-time="props.selectedCustomTime"
|
|
19
|
+
:selected-chart-option-name="props.selectedChartOptionName"
|
|
20
|
+
:custom-date-from="props.customDateFrom"
|
|
21
|
+
:custom-date-to="props.customDateTo"
|
|
22
|
+
:custom-time-from="props.customTimeFrom"
|
|
23
|
+
:custom-time-to="props.customTimeTo"
|
|
24
|
+
:total-cores="totalCores"
|
|
25
|
+
:host-id="props.hostId"
|
|
26
|
+
:selected-objects="props.selectedObjects"
|
|
27
|
+
:project="props.project"
|
|
28
|
+
:objects-loading="props.objectsLoading"
|
|
29
|
+
:objects-data="props.objectsData"
|
|
30
|
+
:valid-date-end="props.validDateEnd"
|
|
31
|
+
:format-date="props.formatDate"
|
|
32
|
+
:view-options="viewOptions"
|
|
33
|
+
:period-options="periodOptions"
|
|
34
|
+
:selected-node-name="props.selectedNodeName"
|
|
35
|
+
@save-option-name="onSaveOptionName"
|
|
36
|
+
@change-period="updateTools"
|
|
37
|
+
@change-view="updateTools"
|
|
38
|
+
@select-row="emits('select-row', $event)"
|
|
39
|
+
@select-metric-local="emits('select-metric-local', $event)"
|
|
40
|
+
@update-chart-type="emits('update-chart-type', $event)"
|
|
41
|
+
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
42
|
+
@update-unit-count="emits('update-unit-count', $event)"
|
|
43
|
+
@update-period-type="emits('update-period-type', $event)"
|
|
44
|
+
@update-custom-time="emits('update-custom-time', $event)"
|
|
45
|
+
@delete-option="onDeleteOption"
|
|
46
|
+
@submit-options="emits('submit-options', $event)"
|
|
47
|
+
/>
|
|
48
|
+
<common-monitor-advanced-tools-old
|
|
49
|
+
v-else
|
|
50
|
+
v-model:selected-view="selectedView"
|
|
51
|
+
v-model:is-show-modal-local="isShowModal"
|
|
52
|
+
v-model:selected-period="selectedPeriod"
|
|
53
|
+
:selected-timespan-type="localSelectedTimespanType"
|
|
54
|
+
:type="props.type"
|
|
55
|
+
:chart-title="props.chartTitle"
|
|
56
|
+
:chart-title-date="chartTitleDate"
|
|
57
|
+
:language="props.language"
|
|
58
|
+
:selected-counters-keys="props.selectedCountersKeys"
|
|
59
|
+
:selected-metric="props.selectedMetric"
|
|
60
|
+
:disabled-period="props.disabledPeriod"
|
|
61
|
+
:disabled-view="props.disabledView"
|
|
62
|
+
:selected-chart-type="props.selectedChartType"
|
|
63
|
+
:units-count="props.unitsCount"
|
|
64
|
+
:period-type="props.periodType"
|
|
65
|
+
:selected-custom-time="props.selectedCustomTime"
|
|
66
|
+
:selected-chart-option-name="props.selectedChartOptionName"
|
|
67
|
+
:custom-date-from="props.customDateFrom"
|
|
68
|
+
:custom-date-to="props.customDateTo"
|
|
69
|
+
:custom-time-from="props.customTimeFrom"
|
|
70
|
+
:custom-time-to="props.customTimeTo"
|
|
71
|
+
:total-cores="totalCores"
|
|
72
|
+
:host-id="props.hostId"
|
|
73
|
+
:selected-objects="props.selectedObjects"
|
|
74
|
+
:project="props.project"
|
|
75
|
+
:objects-loading="props.objectsLoading"
|
|
76
|
+
:objects-data="props.objectsData"
|
|
77
|
+
:valid-date-end="props.validDateEnd"
|
|
78
|
+
:format-date="props.formatDate"
|
|
79
|
+
:view-options="viewOptions"
|
|
80
|
+
:period-options="periodOptions"
|
|
81
|
+
@save-option-name="onSaveOptionName"
|
|
82
|
+
@change-period="updateTools"
|
|
83
|
+
@change-view="updateTools"
|
|
84
|
+
@exporting="emits('exporting', $event)"
|
|
85
|
+
@open-advanced-page="emits('open-advanced-page')"
|
|
86
|
+
@select-row="emits('select-row', $event)"
|
|
87
|
+
@select-metric-local="emits('select-metric-local', $event)"
|
|
88
|
+
@update-chart-type="emits('update-chart-type', $event)"
|
|
89
|
+
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
90
|
+
@update-unit-count="emits('update-unit-count', $event)"
|
|
91
|
+
@update-period-type="emits('update-period-type', $event)"
|
|
92
|
+
@update-custom-time="emits('update-custom-time', $event)"
|
|
93
|
+
@delete-option="onDeleteOption"
|
|
94
|
+
@submit-options="emits('submit-options', $event)"
|
|
95
|
+
/>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script setup lang="ts">
|
|
99
|
+
import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
|
|
100
|
+
import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
|
|
101
|
+
import type {
|
|
102
|
+
UI_T_ChartHost,
|
|
103
|
+
UI_T_ChartVm,
|
|
104
|
+
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
|
|
105
|
+
import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
|
|
106
|
+
import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
|
|
107
|
+
import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
|
|
108
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
109
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
111
|
+
import {
|
|
112
|
+
getCurrentOptionsStorageFunc,
|
|
113
|
+
periodFunc,
|
|
114
|
+
viewFunc,
|
|
115
|
+
} from '~/components/common/monitor/advanced/tools/lib/config/advancedToolbar'
|
|
116
|
+
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
117
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
118
|
+
|
|
119
|
+
const props = withDefaults(
|
|
120
|
+
defineProps<{
|
|
121
|
+
type: UI_T_AdvancedType
|
|
122
|
+
startDate: number
|
|
123
|
+
endDate: number
|
|
124
|
+
chartTitle: string
|
|
125
|
+
language: string
|
|
126
|
+
selectedCountersKeys: number[]
|
|
127
|
+
selectedMetric: UI_T_ChartHost | UI_T_ChartVm
|
|
128
|
+
selectedChartType: string
|
|
129
|
+
selectedTimespanType: string
|
|
130
|
+
unitsCount: number
|
|
131
|
+
periodType: string
|
|
132
|
+
selectedCustomTime: string
|
|
133
|
+
selectedChartOptionName: string
|
|
134
|
+
customDateFrom: string
|
|
135
|
+
customDateTo: string
|
|
136
|
+
customTimeFrom: string
|
|
137
|
+
customTimeTo: string
|
|
138
|
+
totalCores: number
|
|
139
|
+
hostId: string
|
|
140
|
+
selectedObjects: string
|
|
141
|
+
project: UI_T_Project
|
|
142
|
+
objectsLoading: boolean
|
|
143
|
+
objectsData: UI_I_ObjectItem[]
|
|
144
|
+
validDateEnd: number
|
|
145
|
+
formatDate: string
|
|
146
|
+
disabledPeriod?: boolean
|
|
147
|
+
disabledView?: boolean
|
|
148
|
+
selectedNodeName?: string
|
|
149
|
+
}>(),
|
|
150
|
+
{
|
|
151
|
+
disabledPeriod: undefined,
|
|
152
|
+
disabledView: undefined,
|
|
153
|
+
selectedNodeName: undefined,
|
|
154
|
+
}
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
const emits = defineEmits<{
|
|
158
|
+
(event: 'update-tools', value: UI_I_MonitorGraphPayload): void
|
|
159
|
+
(event: 'exporting', value: string): void
|
|
160
|
+
(event: 'open-advanced-page'): void
|
|
161
|
+
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
162
|
+
(event: 'select-metric-local', value: string): void
|
|
163
|
+
(event: 'update-chart-type', value: string): void
|
|
164
|
+
(event: 'update-timespan-type', value: string): void
|
|
165
|
+
(event: 'update-unit-count', value: number): void
|
|
166
|
+
(event: 'update-period-type', value: string): void
|
|
167
|
+
(event: 'update-custom-time', value: string): void
|
|
168
|
+
(event: 'delete-option'): void
|
|
169
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
170
|
+
(event: 'update:selected-timespan-type', value: string): void
|
|
171
|
+
}>()
|
|
172
|
+
|
|
173
|
+
const { $store, $formattedDatetime }: any = useNuxtApp()
|
|
174
|
+
|
|
175
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
176
|
+
|
|
177
|
+
const routeType = '' + useRoute().params.type
|
|
178
|
+
|
|
179
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
180
|
+
|
|
181
|
+
const updateTimeFormatAndInterfaceLang = computed<number>(
|
|
182
|
+
() => $store.getters['main/getUpdateTimeFormatAndInterfaceLang']
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
const localSelectedTimespanType = computed<string>({
|
|
186
|
+
get() {
|
|
187
|
+
return props.selectedTimespanType
|
|
188
|
+
},
|
|
189
|
+
set(newValue) {
|
|
190
|
+
emits('update:selected-timespan-type', newValue)
|
|
191
|
+
},
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
const optionsNames = ref<string[]>([])
|
|
195
|
+
const viewOptions = computed<UI_I_OptionItem[]>(() =>
|
|
196
|
+
viewFunc(localization.value, props.type, optionsNames.value)
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
const selectedView = ref<string>('')
|
|
200
|
+
|
|
201
|
+
watch(
|
|
202
|
+
() => props.selectedChartOptionName,
|
|
203
|
+
(newValue) => {
|
|
204
|
+
let currentValue = ''
|
|
205
|
+
|
|
206
|
+
if (newValue) currentValue = newValue
|
|
207
|
+
else if (
|
|
208
|
+
selectedView.value &&
|
|
209
|
+
optionsNames.value.includes(selectedView.value)
|
|
210
|
+
)
|
|
211
|
+
currentValue = selectedView.value
|
|
212
|
+
else currentValue = selectedView.value || viewOptions.value[0]?.value
|
|
213
|
+
|
|
214
|
+
selectedView.value = currentValue
|
|
215
|
+
},
|
|
216
|
+
{ immediate: true }
|
|
217
|
+
)
|
|
218
|
+
|
|
219
|
+
const periodOptions = computed<UI_I_OptionItem[]>(() =>
|
|
220
|
+
periodFunc(localization.value, props.selectedTimespanType)
|
|
221
|
+
)
|
|
222
|
+
const selectedPeriod = computed<string>({
|
|
223
|
+
get() {
|
|
224
|
+
return props.selectedTimespanType || periodOptions.value[0].value
|
|
225
|
+
},
|
|
226
|
+
set(newValue) {
|
|
227
|
+
emits('update:selected-timespan-type', newValue)
|
|
228
|
+
},
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
const updateTools = (): void => {
|
|
232
|
+
const periodValue = localSelectedTimespanType.value
|
|
233
|
+
const viewValue = selectedView.value
|
|
234
|
+
const prefix = props.project === 'sphere'
|
|
235
|
+
const selectedValue = useLocalStorage(
|
|
236
|
+
viewValue + 'ChartOptions',
|
|
237
|
+
undefined,
|
|
238
|
+
prefix
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
const fields = selectedValue
|
|
242
|
+
? selectedValue.counters.map((item) => item.name).join(', ')
|
|
243
|
+
: ''
|
|
244
|
+
const validPeriodData = getValidDateByOptionFunc(
|
|
245
|
+
periodValue,
|
|
246
|
+
selectedValue,
|
|
247
|
+
props.unitsCount,
|
|
248
|
+
props.selectedCustomTime
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
const period = [
|
|
252
|
+
Math.round(validPeriodData[0] / 1000),
|
|
253
|
+
Math.round(validPeriodData[1] / 1000),
|
|
254
|
+
]
|
|
255
|
+
|
|
256
|
+
if (periodValue === 'custom_interval' && props.periodType === 'period') {
|
|
257
|
+
const checkDateResult = checkDateFunc(
|
|
258
|
+
localization.value,
|
|
259
|
+
props.customDateFrom,
|
|
260
|
+
props.customDateTo,
|
|
261
|
+
props.customTimeFrom,
|
|
262
|
+
props.customTimeTo,
|
|
263
|
+
props.validDateEnd,
|
|
264
|
+
props.formatDate
|
|
265
|
+
)
|
|
266
|
+
if (Array.isArray(checkDateResult)) {
|
|
267
|
+
period[0] = Math.round(checkDateResult[0] / 1000)
|
|
268
|
+
period[1] = Math.round(checkDateResult[1] / 1000)
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
const tools: UI_I_MonitorGraphPayload = {
|
|
273
|
+
fields,
|
|
274
|
+
period,
|
|
275
|
+
periodType: periodValue,
|
|
276
|
+
view: viewValue,
|
|
277
|
+
}
|
|
278
|
+
if (selectedValue.metric) tools.metricType = selectedValue.metric
|
|
279
|
+
|
|
280
|
+
emits('update-timespan-type', localSelectedTimespanType.value)
|
|
281
|
+
emits('update-tools', tools)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const chartTitleDate = computed<string>(() => {
|
|
285
|
+
if (!props.startDate || !updateTimeFormatAndInterfaceLang.value) return ''
|
|
286
|
+
|
|
287
|
+
const start = $formattedDatetime(props.startDate, { hasSeconds: true })
|
|
288
|
+
const end = $formattedDatetime(props.endDate, { hasSeconds: true })
|
|
289
|
+
return `${start} - ${end}`
|
|
290
|
+
})
|
|
291
|
+
|
|
292
|
+
const onDeleteOption = (): void => {
|
|
293
|
+
emits('delete-option')
|
|
294
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const onSaveOptionName = (): void => {
|
|
298
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const isShowModal = ref<boolean>()
|
|
302
|
+
watch(isShowModal, (newValue) => {
|
|
303
|
+
if (!newValue && !selectedView.value)
|
|
304
|
+
selectedView.value = viewOptions.value[0].value
|
|
305
|
+
})
|
|
306
|
+
|
|
307
|
+
onMounted(() => {
|
|
308
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
309
|
+
updateTools()
|
|
310
|
+
})
|
|
311
|
+
</script>
|
|
312
|
+
|
|
313
|
+
<style scoped lang="scss"></style>
|