bfg-common 1.4.720 → 1.4.722
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 -2
- package/assets/localization/local_en.json +2 -2
- package/assets/localization/local_hy.json +2 -2
- package/assets/localization/local_kk.json +2 -2
- package/assets/localization/local_ru.json +2 -2
- package/assets/localization/local_zh.json +2 -2
- package/assets/scss/common/normalize.scss +355 -361
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/modal/bySteps/BySteps.vue +253 -253
- package/components/atoms/stack/StackBlock.vue +185 -185
- package/components/atoms/table/dataGrid/DataGrid.vue +1696 -1696
- package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +222 -222
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +91 -91
- package/components/common/browse/BrowseNew.vue +237 -237
- package/components/common/browse/BrowseOld.vue +217 -217
- package/components/common/browse/blocks/contents/Files.vue +37 -37
- package/components/common/browse/blocks/contents/FilesOld.vue +72 -72
- package/components/common/browse/blocks/contents/filesNew/FilesNew.vue +96 -96
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/context/lib/models/interfaces.ts +30 -30
- package/components/common/context/recursion/Recursion.vue +86 -86
- package/components/common/context/recursion/RecursionOld.vue +213 -213
- package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
- package/components/common/layout/theHeader/helpMenu/aboutNew/AboutNew.vue +103 -103
- package/components/common/layout/theHeader/lib/models/enums.ts +0 -1
- package/components/common/layout/theHeader/userMenu/modals/preferences/changeLanguage/ChangeLanguage.vue +2 -5
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +150 -150
- package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +284 -300
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +206 -206
- package/components/common/modals/unsavedChanges/UnsavedChanges.vue +56 -56
- package/components/common/monitor/advanced/Advanced.vue +244 -239
- package/components/common/monitor/advanced/tools/Tools.vue +447 -440
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +511 -504
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +108 -106
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +95 -93
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +544 -539
- package/components/common/monitor/overview/filters/Filters.vue +235 -232
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +250 -240
- package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +62 -52
- package/components/common/pages/home/StatusContent.vue +49 -49
- package/components/common/pages/home/headline/Headline.vue +44 -44
- package/components/common/pages/home/headline/HeadlineNew.vue +71 -71
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/Widgets.vue +49 -49
- package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
- package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/HostsNew.vue +100 -100
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/services/lib/config/config.ts +108 -108
- package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
- package/components/common/pages/home/widgets/vms/VmsNew.vue +101 -101
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/recursionTree/RecursionTree.vue +212 -223
- package/components/common/select/button/ButtonDropdown.vue +108 -108
- package/components/common/selectLanguage/lib/config/config.ts +0 -5
- package/components/common/spiceConsole/Drawer.vue +370 -370
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/split/vertical/Vertical.vue +160 -160
- package/components/common/vm/actions/add/Add.vue +616 -616
- package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +267 -267
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +269 -269
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/BusNew.vue +117 -117
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveNew.vue +161 -161
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +165 -165
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +55 -70
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +42 -50
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +338 -338
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +147 -147
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/mode/ModeOld.vue +56 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/SharingNew.vue +44 -44
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +281 -281
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetworkNew.vue +124 -124
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/LocationOld.vue +134 -134
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/New.vue +63 -63
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +95 -95
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressNew.vue +69 -69
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddressOld.vue +83 -83
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +85 -85
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +91 -91
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +35 -35
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +48 -48
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +46 -46
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +56 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +104 -104
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +112 -112
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/totalVideoMemory/TotalVideoMemoryNew.vue +54 -54
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +102 -102
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +75 -75
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +26 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +57 -57
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/FirmwareNew.vue +42 -42
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/menu/MenuNew.vue +25 -25
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +171 -171
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +50 -50
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +141 -141
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/folderSharing/FolderSharingNew.vue +30 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/KeymapNew.vue +39 -39
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +102 -102
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordOld.vue +94 -94
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +38 -38
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
- package/components/common/vm/actions/common/select/storage/Storage.vue +130 -130
- package/components/common/vm/actions/common/select/storage/StorageOld.vue +129 -129
- package/components/common/vm/actions/editSettings/EditSettings.vue +232 -232
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +183 -183
- package/components/common/vm/actions/editSettings/new/New.vue +177 -177
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/composables/productNameLocal.ts +30 -30
- package/composables/useAppVersion.ts +21 -21
- package/composables/useLocal.ts +0 -5
- package/layouts/auth.vue +0 -1
- package/package.json +1 -1
- package/plugins/date.ts +233 -233
- package/plugins/recursion.ts +311 -311
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +383 -383
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +64 -64
- package/assets/scss/clarity/local_ar.json +0 -2914
|
@@ -1,504 +1,511 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="chart-options-modal">
|
|
3
|
-
<atoms-modal
|
|
4
|
-
width="1150px"
|
|
5
|
-
:show="true"
|
|
6
|
-
:title="localization.inventoryMonitor.chartOptions"
|
|
7
|
-
:disabled-submit="isDisabledSubmit"
|
|
8
|
-
@hide="onHide"
|
|
9
|
-
@submit="onSubmit"
|
|
10
|
-
>
|
|
11
|
-
<template #modalBody>
|
|
12
|
-
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
13
|
-
v-show="isShowAlerts"
|
|
14
|
-
:alerts="alerts"
|
|
15
|
-
@remove="onRemoveAlerts"
|
|
16
|
-
/>
|
|
17
|
-
<div>
|
|
18
|
-
<common-monitor-advanced-tools-chart-options-modal-actions
|
|
19
|
-
:is-disabled-save="!selectedRows.length"
|
|
20
|
-
:options-names="optionsNames"
|
|
21
|
-
:selected-chart-option-name="localSelectedChartOptionName"
|
|
22
|
-
@save="onSaveOptions"
|
|
23
|
-
@check-validation="checkValidations"
|
|
24
|
-
@select-local-option-name="onSelectLocalOptionName"
|
|
25
|
-
@delete-chart-name="onDeleteChartName"
|
|
26
|
-
/>
|
|
27
|
-
|
|
28
|
-
<div class="horizontal-flex-container chart-options-content">
|
|
29
|
-
<common-monitor-advanced-tools-chart-options-modal-metrics
|
|
30
|
-
v-model:selected-metric="selectedMetric"
|
|
31
|
-
:metrics-items="metricsItems"
|
|
32
|
-
/>
|
|
33
|
-
<common-monitor-advanced-tools-chart-options-modal-counters
|
|
34
|
-
:chart="selectedMetric"
|
|
35
|
-
:language="props.language"
|
|
36
|
-
:type="props.type"
|
|
37
|
-
:selected-keys="localSelectedCountersKeys"
|
|
38
|
-
:selected-chart-type="localSelectedChartType"
|
|
39
|
-
:selected-timespan-type="localSelectedTimespanType"
|
|
40
|
-
:units-count="localUnitsCount"
|
|
41
|
-
:period-type="localPeriodType"
|
|
42
|
-
:selected-custom-time="localCustomTime"
|
|
43
|
-
:custom-date-from="props.customDateFrom"
|
|
44
|
-
:custom-date-to="props.customDateTo"
|
|
45
|
-
:custom-time-from="props.customTimeFrom"
|
|
46
|
-
:custom-time-to="props.customTimeTo"
|
|
47
|
-
:total-cores="props.totalCores"
|
|
48
|
-
:host-id="props.hostId"
|
|
49
|
-
:selected-metrics-keys="selectedMetricsKeys"
|
|
50
|
-
:selected-objects="props.selectedObjects"
|
|
51
|
-
:objects-loading="props.objectsLoading"
|
|
52
|
-
:objects-data="props.objectsData"
|
|
53
|
-
|
|
54
|
-
@
|
|
55
|
-
@update-
|
|
56
|
-
@update-
|
|
57
|
-
@update-
|
|
58
|
-
@update-
|
|
59
|
-
@update-
|
|
60
|
-
@update-custom-date-
|
|
61
|
-
@update-custom-
|
|
62
|
-
@update-custom-time-
|
|
63
|
-
@
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
import type {
|
|
75
|
-
import type {
|
|
76
|
-
import type {
|
|
77
|
-
import type {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
import type {
|
|
83
|
-
import type {
|
|
84
|
-
import {
|
|
85
|
-
import {
|
|
86
|
-
import {
|
|
87
|
-
import {
|
|
88
|
-
import {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
(event: '
|
|
119
|
-
(event: '
|
|
120
|
-
(event: '
|
|
121
|
-
(event: 'update-
|
|
122
|
-
(event: 'update-
|
|
123
|
-
(event: '
|
|
124
|
-
(event: '
|
|
125
|
-
(event: '
|
|
126
|
-
(event: '
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
)
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
)
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
)
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
)
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
(
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
)
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
flex-direction:
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="chart-options-modal">
|
|
3
|
+
<atoms-modal
|
|
4
|
+
width="1150px"
|
|
5
|
+
:show="true"
|
|
6
|
+
:title="localization.inventoryMonitor.chartOptions"
|
|
7
|
+
:disabled-submit="isDisabledSubmit"
|
|
8
|
+
@hide="onHide"
|
|
9
|
+
@submit="onSubmit"
|
|
10
|
+
>
|
|
11
|
+
<template #modalBody>
|
|
12
|
+
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
13
|
+
v-show="isShowAlerts"
|
|
14
|
+
:alerts="alerts"
|
|
15
|
+
@remove="onRemoveAlerts"
|
|
16
|
+
/>
|
|
17
|
+
<div>
|
|
18
|
+
<common-monitor-advanced-tools-chart-options-modal-actions
|
|
19
|
+
:is-disabled-save="!selectedRows.length"
|
|
20
|
+
:options-names="optionsNames"
|
|
21
|
+
:selected-chart-option-name="localSelectedChartOptionName"
|
|
22
|
+
@save="onSaveOptions"
|
|
23
|
+
@check-validation="checkValidations"
|
|
24
|
+
@select-local-option-name="onSelectLocalOptionName"
|
|
25
|
+
@delete-chart-name="onDeleteChartName"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<div class="horizontal-flex-container chart-options-content">
|
|
29
|
+
<common-monitor-advanced-tools-chart-options-modal-metrics
|
|
30
|
+
v-model:selected-metric="selectedMetric"
|
|
31
|
+
:metrics-items="metricsItems"
|
|
32
|
+
/>
|
|
33
|
+
<common-monitor-advanced-tools-chart-options-modal-counters
|
|
34
|
+
:chart="selectedMetric"
|
|
35
|
+
:language="props.language"
|
|
36
|
+
:type="props.type"
|
|
37
|
+
:selected-keys="localSelectedCountersKeys"
|
|
38
|
+
:selected-chart-type="localSelectedChartType"
|
|
39
|
+
:selected-timespan-type="localSelectedTimespanType"
|
|
40
|
+
:units-count="localUnitsCount"
|
|
41
|
+
:period-type="localPeriodType"
|
|
42
|
+
:selected-custom-time="localCustomTime"
|
|
43
|
+
:custom-date-from="props.customDateFrom"
|
|
44
|
+
:custom-date-to="props.customDateTo"
|
|
45
|
+
:custom-time-from="props.customTimeFrom"
|
|
46
|
+
:custom-time-to="props.customTimeTo"
|
|
47
|
+
:total-cores="props.totalCores"
|
|
48
|
+
:host-id="props.hostId"
|
|
49
|
+
:selected-metrics-keys="selectedMetricsKeys"
|
|
50
|
+
:selected-objects="props.selectedObjects"
|
|
51
|
+
:objects-loading="props.objectsLoading"
|
|
52
|
+
:objects-data="props.objectsData"
|
|
53
|
+
:valid-date-end="props.validDateEnd"
|
|
54
|
+
@select-row="selectedRows = $event"
|
|
55
|
+
@update-chart-type="selectedChartTypeLocal = $event"
|
|
56
|
+
@update-custom-time="localCustomTime = $event"
|
|
57
|
+
@update-timespan-type="timespanType = $event"
|
|
58
|
+
@update-unit-count="unitCount = $event"
|
|
59
|
+
@update-period-type="localPeriodType = $event"
|
|
60
|
+
@update-custom-date-from="onUpdateCustomDateFrom"
|
|
61
|
+
@update-custom-date-to="onUpdateCustomDateTo"
|
|
62
|
+
@update-custom-time-from="onUpdateCustomTimeFrom"
|
|
63
|
+
@update-custom-time-to="onUpdateCustomTimeTo"
|
|
64
|
+
@select-objects="localSelectedObjects = $event"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
</atoms-modal>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
72
|
+
|
|
73
|
+
<script setup lang="ts">
|
|
74
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
75
|
+
import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
|
|
76
|
+
import type { UI_I_VerticalTabs } from '~/components/atoms/tabs/lib/models/interfaces'
|
|
77
|
+
import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
|
|
78
|
+
import type {
|
|
79
|
+
UI_T_ChartHost,
|
|
80
|
+
UI_T_ChartVm,
|
|
81
|
+
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
|
|
82
|
+
import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
|
|
83
|
+
import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
|
|
84
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
85
|
+
import { metricsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/metrics/lib/config/optionsMetrics'
|
|
86
|
+
import { getCurrentOptionsStorageFunc } from '~/components/common/monitor/advanced/tools/lib/config/advancedToolbar'
|
|
87
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
88
|
+
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
89
|
+
import { checkIsDisabledSubmit } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/utils/checkSubmit'
|
|
90
|
+
|
|
91
|
+
const props = defineProps<{
|
|
92
|
+
type: UI_T_AdvancedType
|
|
93
|
+
language: string
|
|
94
|
+
selectedCountersKeys: number[]
|
|
95
|
+
selectedMetric: UI_T_ChartHost | UI_T_ChartVm
|
|
96
|
+
selectedMetricLocal: UI_T_ChartHost | UI_T_ChartVm
|
|
97
|
+
selectedChartType: string
|
|
98
|
+
selectedTimespanType: string
|
|
99
|
+
unitsCount: number
|
|
100
|
+
periodType: string
|
|
101
|
+
selectedCustomTime: string
|
|
102
|
+
selectedChartOptionName: string
|
|
103
|
+
customDateFrom: string
|
|
104
|
+
customDateTo: string
|
|
105
|
+
customTimeFrom: string
|
|
106
|
+
customTimeTo: string
|
|
107
|
+
totalCores: number
|
|
108
|
+
hostId: string
|
|
109
|
+
selectedObjects: string
|
|
110
|
+
project: UI_T_Project
|
|
111
|
+
objectsLoading: boolean
|
|
112
|
+
objectsData: UI_I_ObjectItem[]
|
|
113
|
+
validDateEnd: number
|
|
114
|
+
formatDate: string
|
|
115
|
+
}>()
|
|
116
|
+
|
|
117
|
+
const emits = defineEmits<{
|
|
118
|
+
(event: 'hide'): void
|
|
119
|
+
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
120
|
+
(event: 'select-metric-local', value: string): void
|
|
121
|
+
(event: 'update-chart-type', value: string): void
|
|
122
|
+
(event: 'update-timespan-type', value: string): void
|
|
123
|
+
(event: 'update-unit-count', value: number): void
|
|
124
|
+
(event: 'update-period-type', value: string): void
|
|
125
|
+
(event: 'update-custom-time', value: string): void
|
|
126
|
+
(event: 'delete-option'): void
|
|
127
|
+
(event: 'save-option-name'): void
|
|
128
|
+
(event: 'submit-options', value: UI_I_OptionsForm): void
|
|
129
|
+
(event: 'select-objects', value: string): void
|
|
130
|
+
}>()
|
|
131
|
+
|
|
132
|
+
const routeType = '' + useRoute().params.type
|
|
133
|
+
|
|
134
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
135
|
+
|
|
136
|
+
const localCustomDateFrom = ref<string>('')
|
|
137
|
+
const onUpdateCustomDateFrom = (value: string): void => {
|
|
138
|
+
localCustomDateFrom.value = value
|
|
139
|
+
}
|
|
140
|
+
const localCustomDateTo = ref<string>('')
|
|
141
|
+
const onUpdateCustomDateTo = (value: string): void => {
|
|
142
|
+
localCustomDateTo.value = value
|
|
143
|
+
}
|
|
144
|
+
const localCustomTimeFrom = ref<string>('')
|
|
145
|
+
const onUpdateCustomTimeFrom = (value: string): void => {
|
|
146
|
+
localCustomTimeFrom.value = value
|
|
147
|
+
}
|
|
148
|
+
const localCustomTimeTo = ref<string>('')
|
|
149
|
+
const onUpdateCustomTimeTo = (value: string): void => {
|
|
150
|
+
localCustomTimeTo.value = value
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const metricsItems = computed<UI_I_VerticalTabs[]>(() =>
|
|
154
|
+
metricsFunc(localization.value, props.type)
|
|
155
|
+
)
|
|
156
|
+
const selectedMetric = ref<UI_T_ChartHost | UI_T_ChartVm>(
|
|
157
|
+
props.selectedMetric || '' + metricsItems.value[0]?.value
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
const localSelectedCountersKeys = ref<number[]>([])
|
|
161
|
+
watch(
|
|
162
|
+
() => props.selectedCountersKeys,
|
|
163
|
+
(newValue) => {
|
|
164
|
+
localSelectedCountersKeys.value = newValue
|
|
165
|
+
},
|
|
166
|
+
{ immediate: true, deep: true }
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
const localSelectedChartType = ref<string>('')
|
|
170
|
+
watch(
|
|
171
|
+
() => props.selectedChartType,
|
|
172
|
+
(newValue) => {
|
|
173
|
+
localSelectedChartType.value = newValue
|
|
174
|
+
},
|
|
175
|
+
{ immediate: true }
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
const localSelectedTimespanType = ref<string>('')
|
|
179
|
+
watch(
|
|
180
|
+
() => props.selectedTimespanType,
|
|
181
|
+
(newValue) => {
|
|
182
|
+
localSelectedTimespanType.value = newValue
|
|
183
|
+
},
|
|
184
|
+
{ immediate: true }
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
const localUnitsCount = ref<number>(0)
|
|
188
|
+
watch(
|
|
189
|
+
() => props.unitsCount,
|
|
190
|
+
(newValue) => {
|
|
191
|
+
localUnitsCount.value = newValue
|
|
192
|
+
},
|
|
193
|
+
{ immediate: true }
|
|
194
|
+
)
|
|
195
|
+
|
|
196
|
+
const localPeriodType = ref<string>('')
|
|
197
|
+
watch(
|
|
198
|
+
() => props.periodType,
|
|
199
|
+
(newValue) => {
|
|
200
|
+
localPeriodType.value = newValue
|
|
201
|
+
},
|
|
202
|
+
{ immediate: true }
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
const localCustomTime = ref<string>('')
|
|
206
|
+
watch(
|
|
207
|
+
() => props.selectedCustomTime,
|
|
208
|
+
(newValue) => {
|
|
209
|
+
localCustomTime.value = newValue
|
|
210
|
+
},
|
|
211
|
+
{ immediate: true }
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
const isShowAlerts = ref<boolean>(false)
|
|
215
|
+
const alerts = ref<string[]>([])
|
|
216
|
+
|
|
217
|
+
const onRemoveAlerts = (): void => {
|
|
218
|
+
isShowAlerts.value = false
|
|
219
|
+
alerts.value = []
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const onHide = (): void => {
|
|
223
|
+
emits('hide')
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
const selectedRows = ref<UI_I_AdvancedCounterItem[]>([])
|
|
227
|
+
const selectedMetricsKeys = computed<number[]>(() =>
|
|
228
|
+
selectedRows.value.map((item) => item.id)
|
|
229
|
+
)
|
|
230
|
+
const selectedChartTypeLocal = ref<string>('')
|
|
231
|
+
|
|
232
|
+
const checkValidations = (): boolean => {
|
|
233
|
+
const checkDateResult = checkDateFunc(
|
|
234
|
+
localization.value,
|
|
235
|
+
localCustomDateFrom.value,
|
|
236
|
+
localCustomDateTo.value,
|
|
237
|
+
localCustomTimeFrom.value,
|
|
238
|
+
localCustomTimeTo.value,
|
|
239
|
+
props.validDateEnd,
|
|
240
|
+
props.formatDate
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
if (isDisabledSubmit.value) {
|
|
244
|
+
alerts.value = [localization.value.inventoryMonitor.noCountersSelected]
|
|
245
|
+
isShowAlerts.value = true
|
|
246
|
+
return false
|
|
247
|
+
} else if (
|
|
248
|
+
timespanType.value === 'custom_interval' &&
|
|
249
|
+
localPeriodType.value === 'period' &&
|
|
250
|
+
checkDateResult !== '' &&
|
|
251
|
+
typeof checkDateResult === 'string'
|
|
252
|
+
) {
|
|
253
|
+
alerts.value = [checkDateResult]
|
|
254
|
+
isShowAlerts.value = true
|
|
255
|
+
return false
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
return true
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
const localSelectedChartOptionName = ref<string>('')
|
|
262
|
+
watch(
|
|
263
|
+
() => props.selectedChartOptionName,
|
|
264
|
+
(newValue) => {
|
|
265
|
+
localSelectedChartOptionName.value = newValue
|
|
266
|
+
},
|
|
267
|
+
{ immediate: true }
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
const selectedLocalOptionName = ref<string>('')
|
|
271
|
+
|
|
272
|
+
const localSelectedObjects = ref<string>('')
|
|
273
|
+
|
|
274
|
+
const currentFieldsByArray = (data: UI_I_AdvancedCounterItem[]): string => {
|
|
275
|
+
const result: string[] = []
|
|
276
|
+
|
|
277
|
+
data.forEach((item) => {
|
|
278
|
+
if (props.type === 'vm' && selectedMetric.value === 'network') {
|
|
279
|
+
const currentFields = []
|
|
280
|
+
const objectArray = localSelectedObjects.value.split(', ')
|
|
281
|
+
if (objectArray.length) {
|
|
282
|
+
objectArray.forEach((item2) => {
|
|
283
|
+
currentFields.push(`${item.nameEn} ${item2}`)
|
|
284
|
+
})
|
|
285
|
+
} else currentFields.push(item.nameEn)
|
|
286
|
+
|
|
287
|
+
result.push(currentFields.join(', '))
|
|
288
|
+
} else result.push(item.nameEn)
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
return result.join(',')
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
const onSubmit = (): void => {
|
|
295
|
+
if (!checkValidations()) return
|
|
296
|
+
|
|
297
|
+
if (['select_options', 'default'].includes(selectedLocalOptionName.value))
|
|
298
|
+
selectedLocalOptionName.value = 'custom'
|
|
299
|
+
|
|
300
|
+
onSaveOptions(selectedLocalOptionName.value)
|
|
301
|
+
|
|
302
|
+
// const currentFields =
|
|
303
|
+
// localSelectedObjects.value || currentFieldsByArray(selectedRows.value)
|
|
304
|
+
|
|
305
|
+
const currentFields = currentFieldsByArray(selectedRows.value)
|
|
306
|
+
|
|
307
|
+
const validPeriod = getValidDateByOptionFunc(
|
|
308
|
+
timespanType.value,
|
|
309
|
+
null,
|
|
310
|
+
unitCount.value,
|
|
311
|
+
localCustomTime.value
|
|
312
|
+
).map((item) => Math.round(item / 1000))
|
|
313
|
+
|
|
314
|
+
if (
|
|
315
|
+
timespanType.value === 'custom_interval' &&
|
|
316
|
+
localPeriodType.value === 'period'
|
|
317
|
+
) {
|
|
318
|
+
const checkDateResult = checkDateFunc(
|
|
319
|
+
localization.value,
|
|
320
|
+
localCustomDateFrom.value,
|
|
321
|
+
localCustomDateTo.value,
|
|
322
|
+
localCustomTimeFrom.value,
|
|
323
|
+
localCustomTimeTo.value,
|
|
324
|
+
props.validDateEnd,
|
|
325
|
+
props.formatDate
|
|
326
|
+
)
|
|
327
|
+
if (Array.isArray(checkDateResult)) {
|
|
328
|
+
validPeriod[0] = Math.round(checkDateResult[0] / 1000)
|
|
329
|
+
validPeriod[1] = Math.round(checkDateResult[1] / 1000)
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const savedObject = {
|
|
334
|
+
fields: currentFields,
|
|
335
|
+
optionName: selectedLocalOptionName.value,
|
|
336
|
+
metric: selectedMetric.value,
|
|
337
|
+
counters: selectedRows.value,
|
|
338
|
+
timespanType: timespanType.value,
|
|
339
|
+
periodType: localPeriodType.value,
|
|
340
|
+
unitCount: unitCount.value,
|
|
341
|
+
localTimespanType: localCustomTime.value,
|
|
342
|
+
dateFrom: localCustomDateFrom.value,
|
|
343
|
+
timeFrom: localCustomTimeFrom.value,
|
|
344
|
+
dateTo: localCustomDateTo.value,
|
|
345
|
+
timeTo: localCustomTimeTo.value,
|
|
346
|
+
chartType: selectedChartTypeLocal.value,
|
|
347
|
+
objects: localSelectedObjects.value,
|
|
348
|
+
periodValue: validPeriod,
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
emits('submit-options', savedObject)
|
|
352
|
+
onHide()
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const timespanType = ref<string>('')
|
|
356
|
+
const unitCount = ref<number>(1)
|
|
357
|
+
|
|
358
|
+
const optionsNames = ref<string[]>([])
|
|
359
|
+
|
|
360
|
+
const onSaveOptions = (name: string): void => {
|
|
361
|
+
const counters = selectedRows.value.map((item) => {
|
|
362
|
+
return {
|
|
363
|
+
id: item.id,
|
|
364
|
+
name: item.nameEn,
|
|
365
|
+
}
|
|
366
|
+
})
|
|
367
|
+
let chartType = 'line_graph'
|
|
368
|
+
if (selectedChartTypeLocal.value === 'spline') chartType = 'line_graph'
|
|
369
|
+
else if (selectedChartTypeLocal.value === 'area') chartType = 'stacked_graph'
|
|
370
|
+
|
|
371
|
+
const saveOptionsData = {
|
|
372
|
+
routeType,
|
|
373
|
+
chartType,
|
|
374
|
+
counters,
|
|
375
|
+
metric: selectedMetric.value,
|
|
376
|
+
timespan: {
|
|
377
|
+
periodType: localPeriodType.value,
|
|
378
|
+
units: localCustomTime.value,
|
|
379
|
+
unitsCount: unitCount.value,
|
|
380
|
+
type: timespanType.value,
|
|
381
|
+
},
|
|
382
|
+
}
|
|
383
|
+
const prefix = props.project === 'sphere'
|
|
384
|
+
useLocalStorage(`${name}ChartOptions`, saveOptionsData, prefix)
|
|
385
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
386
|
+
localSelectedChartOptionName.value = name
|
|
387
|
+
emits('save-option-name')
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
const setSelectOptions = (): void => {
|
|
391
|
+
selectedMetric.value = props.selectedMetric || metricsItems.value[0]?.value
|
|
392
|
+
localSelectedCountersKeys.value = props.selectedCountersKeys
|
|
393
|
+
localSelectedChartType.value = props.selectedChartType
|
|
394
|
+
localSelectedTimespanType.value = props.selectedTimespanType
|
|
395
|
+
localUnitsCount.value = props.unitsCount
|
|
396
|
+
localPeriodType.value = props.periodType
|
|
397
|
+
localCustomTime.value = props.selectedCustomTime
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const setDefaultOptions = (): void => {
|
|
401
|
+
selectedMetric.value = metricsItems.value[0]?.value
|
|
402
|
+
localSelectedCountersKeys.value = []
|
|
403
|
+
localSelectedChartType.value = 'spline'
|
|
404
|
+
localSelectedTimespanType.value = ''
|
|
405
|
+
localUnitsCount.value = 0
|
|
406
|
+
localPeriodType.value = ''
|
|
407
|
+
localCustomTime.value = ''
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const setCustomOptions = (name: string): void => {
|
|
411
|
+
const prefix = props.project === 'sphere'
|
|
412
|
+
const selectedValue = useLocalStorage(
|
|
413
|
+
name + 'ChartOptions',
|
|
414
|
+
undefined,
|
|
415
|
+
prefix
|
|
416
|
+
)
|
|
417
|
+
|
|
418
|
+
if (selectedValue.routeType !== routeType) return
|
|
419
|
+
|
|
420
|
+
let currentChartType = ''
|
|
421
|
+
if (selectedValue.chartType === 'line_graph') currentChartType = 'spline'
|
|
422
|
+
else if (selectedValue.chartType === 'stacked_graph')
|
|
423
|
+
currentChartType = 'area'
|
|
424
|
+
|
|
425
|
+
selectedMetric.value = selectedValue.metric
|
|
426
|
+
localSelectedCountersKeys.value = selectedValue.counters.map(
|
|
427
|
+
(item) => item.id
|
|
428
|
+
)
|
|
429
|
+
localSelectedChartType.value = currentChartType
|
|
430
|
+
localSelectedTimespanType.value = selectedValue.timespan.type
|
|
431
|
+
localUnitsCount.value = selectedValue.timespan.unitsCount
|
|
432
|
+
localPeriodType.value = selectedValue.timespan.periodType
|
|
433
|
+
localCustomTime.value = selectedValue.timespan.units
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const onSelectLocalOptionName = (name: string): void => {
|
|
437
|
+
selectedLocalOptionName.value = name
|
|
438
|
+
|
|
439
|
+
if (optionsNames.value.includes(name)) setCustomOptions(name)
|
|
440
|
+
else if (name === 'default') setDefaultOptions()
|
|
441
|
+
else if (name === 'select_options') setSelectOptions()
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
watch(
|
|
445
|
+
localSelectedChartOptionName,
|
|
446
|
+
(newValue) => {
|
|
447
|
+
if (!newValue) return
|
|
448
|
+
|
|
449
|
+
setCustomOptions(newValue)
|
|
450
|
+
},
|
|
451
|
+
{ immediate: true }
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
const onDeleteChartName = (name: string): void => {
|
|
455
|
+
window.localStorage.removeItem(name + 'ChartOptions')
|
|
456
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
457
|
+
setSelectOptions()
|
|
458
|
+
emits('delete-option')
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
const isDisabledSubmit = computed<boolean>(() =>
|
|
462
|
+
checkIsDisabledSubmit(
|
|
463
|
+
props.type,
|
|
464
|
+
selectedMetric.value,
|
|
465
|
+
selectedRows.value.length,
|
|
466
|
+
localSelectedObjects.value
|
|
467
|
+
)
|
|
468
|
+
)
|
|
469
|
+
|
|
470
|
+
watch(
|
|
471
|
+
selectedMetric,
|
|
472
|
+
(newValue) => {
|
|
473
|
+
emits('select-metric-local', newValue)
|
|
474
|
+
},
|
|
475
|
+
{ immediate: true }
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
onMounted(() => {
|
|
479
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
|
|
480
|
+
})
|
|
481
|
+
</script>
|
|
482
|
+
|
|
483
|
+
<style scoped lang="scss">
|
|
484
|
+
.chart-options-modal {
|
|
485
|
+
.loader-on :deep(.modal-body) {
|
|
486
|
+
display: flex;
|
|
487
|
+
align-items: center;
|
|
488
|
+
justify-content: center;
|
|
489
|
+
}
|
|
490
|
+
:deep(.modal-title) {
|
|
491
|
+
text-transform: capitalize;
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
#loader {
|
|
495
|
+
min-height: 90px;
|
|
496
|
+
text-align: center;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.chart-options-content {
|
|
500
|
+
display: flex;
|
|
501
|
+
flex-direction: row;
|
|
502
|
+
flex-basis: 90%;
|
|
503
|
+
overflow-y: hidden;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
@media (max-width: 1024px) {
|
|
507
|
+
.chart-options-content {
|
|
508
|
+
flex-direction: column !important;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
</style>
|