bfg-common 1.1.62 → 1.1.63
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 +1 -1
- package/assets/localization/local_hy.json +1 -1
- package/assets/localization/local_kk.json +1 -1
- package/assets/localization/local_ru.json +1 -1
- package/components/atoms/alert/Notification.vue +167 -167
- package/components/atoms/autocomplete/Autocomplete.vue +236 -236
- package/components/atoms/datepicker/Datepicker.vue +612 -612
- package/components/atoms/list/SelectList.vue +62 -62
- package/components/atoms/nav/NavBar.vue +116 -116
- package/components/atoms/nav/VerticalNavBar.vue +89 -89
- package/components/atoms/notificationBar/NotificationBar.vue +175 -175
- package/components/atoms/perPage/PerPage.vue +52 -52
- package/components/atoms/popup/SimplePopup.vue +90 -90
- package/components/atoms/step/VerticalStep.vue +104 -104
- package/components/atoms/switch/Switch.vue +107 -107
- package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +206 -206
- package/components/atoms/table/dataGrid/DataGridPage.vue +189 -189
- package/components/atoms/tabs/Tabs.vue +189 -189
- package/components/atoms/tooltip/Signpost.vue +224 -224
- package/components/common/adapterManager/AddAdapterWarningModal.vue +82 -82
- package/components/common/adapterManager/NoActiveAdaptersModal.vue +62 -62
- package/components/common/adapterManager/NoConnectedActiveAdaptersModal.vue +62 -62
- package/components/common/browse/Browse.vue +182 -182
- package/components/common/browse/blocks/Title.vue +66 -66
- package/components/common/diagramMain/Diagram.vue +186 -186
- package/components/common/diagramMain/DiagramMain.vue +986 -986
- package/components/common/diagramMain/adapter/AdapterItem.vue +227 -227
- package/components/common/diagramMain/adapter/AdapterItems.vue +57 -57
- package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +339 -339
- package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +202 -202
- package/components/common/diagramMain/modals/remove/RemoveModal.vue +226 -226
- package/components/common/diagramMain/network/Contents.vue +238 -238
- package/components/common/feedback/Buttons.vue +232 -232
- package/components/common/feedback/Message.vue +468 -468
- package/components/common/feedback/VisitPortal.vue +54 -54
- package/components/common/graph/Graph.vue +20 -18
- package/components/common/help/navbar/left/Left.vue +159 -159
- package/components/common/help/navbar/left/utils/constructAccordion.ts +27 -27
- package/components/common/mainNavigationPanel/MainNavigationPanel.vue +359 -359
- package/components/common/modals/Rename.vue +165 -165
- package/components/common/monitor/advanced/Advanced.vue +33 -3
- package/components/common/monitor/advanced/GraphView.vue +4 -4
- package/components/common/monitor/advanced/table/Table.vue +5 -5
- package/components/common/monitor/advanced/tools/Tools.vue +91 -27
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +101 -17
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +25 -7
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts +55 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces.ts +1 -1
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +32 -3
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +25 -8
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +41 -19
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/models/interfaces.ts +1 -1
- package/components/common/monitor/advanced/tools/config/advancedToolbar.ts +50 -38
- package/components/common/monitor/advanced/tools/utils/countCores.ts +7 -0
- package/components/common/monitor/config/getValidDateByOption.ts +105 -6
- package/components/common/monitor/overview/filters/Filters.vue +6 -6
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +8 -8
- package/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker.ts +1 -1
- package/components/common/perPage/PerPage.vue +51 -51
- package/components/common/recursionTree/RecursionTree.vue +201 -201
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/VirtualHardware.vue +642 -641
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +274 -245
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/cpu/Cpu.vue +375 -375
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/Limit.vue +234 -234
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/limit/config/options.ts +28 -28
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/Memory.vue +316 -316
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/memory/config/memoryOptions.ts +35 -35
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +447 -447
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/reservation/Reservation.vue +235 -235
- package/components/common/vm/actions/add/select/storage/config/config.ts +154 -154
- package/components/common/wizards/datastore/add/nfs/configuration/Configuration.vue +373 -373
- package/components/common/wizards/datastore/add/nfs/configuration/serversList/ServersList.vue +123 -123
- package/components/common/wizards/datastore/add/nfs/kerberosAuthentication/KerberosAuthentication.vue +54 -54
- package/components/common/wizards/datastore/add/sharedStorm/deviceSelection/hostTable/HostTable.vue +131 -131
- package/components/common/wizards/datastore/add/sharedStorm/partitionConfiguration/PartitionConfiguration.vue +230 -230
- package/models/store/interfaces.ts +37 -37
- package/models/store/storage/interfaces.ts +32 -32
- package/models/store/types.ts +32 -32
- package/modules/fixContentBuild/utils/methods.ts +114 -114
- package/package.json +1 -1
- package/public/spice-console/application/codec.js +257 -257
- package/public/spice-console/lib/rasterEngine.js +907 -907
- package/public/spice-console/network/spicechannel.js +369 -369
- package/public/spice-console-minify/lib/decoder/dixie.min.js +4 -4
- package/public/spice-console-minify/lib/jgestures.min.js +24 -24
- package/public/spice-console-minify/lib/jquery-2.0.3.min.js +24 -24
- package/public/spice-console-minify/lib/jquery-mousewheel.min.js +11 -11
- package/public/spice-console-minify/lib/jquery-visibility.min.js +1 -1
- package/public/spice-console-minify/lib/lodash.4.0.0.min.js +5 -5
- package/utils/contentBuild.ts +34 -34
|
@@ -39,12 +39,22 @@
|
|
|
39
39
|
:units-count="localUnitsCount"
|
|
40
40
|
:period-type="localPeriodType"
|
|
41
41
|
:selected-custom-time="localCustomTime"
|
|
42
|
+
:custom-date-from="props.customDateFrom"
|
|
43
|
+
:custom-date-to="props.customDateTo"
|
|
44
|
+
:custom-time-from="props.customTimeFrom"
|
|
45
|
+
:custom-time-to="props.customTimeTo"
|
|
46
|
+
:total-cores="props.totalCores"
|
|
47
|
+
:host-id="props.hostId"
|
|
42
48
|
@select-row="selectedRows = $event"
|
|
43
49
|
@update-chart-type="selectedChartTypeLocal = $event"
|
|
44
50
|
@update-custom-time="localCustomTime = $event"
|
|
45
51
|
@update-timespan-type="timespanType = $event"
|
|
46
52
|
@update-unit-count="unitCount = $event"
|
|
47
53
|
@update-period-type="localPeriodType = $event"
|
|
54
|
+
@update-custom-date-from="onUpdateCustomDateFrom"
|
|
55
|
+
@update-custom-date-to="onUpdateCustomDateTo"
|
|
56
|
+
@update-custom-time-from="onUpdateCustomTimeFrom"
|
|
57
|
+
@update-custom-time-to="onUpdateCustomTimeTo"
|
|
48
58
|
/>
|
|
49
59
|
</div>
|
|
50
60
|
</div>
|
|
@@ -64,6 +74,7 @@ import {
|
|
|
64
74
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
65
75
|
import { metricsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/metrics/config/optionsMetrics'
|
|
66
76
|
import { getCurrentOptionsStorageFunc } from '~/components/common/monitor/advanced/tools/config/advancedToolbar'
|
|
77
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker'
|
|
67
78
|
|
|
68
79
|
const props = defineProps<{
|
|
69
80
|
type: UI_T_AdvancedType
|
|
@@ -76,6 +87,12 @@ const props = defineProps<{
|
|
|
76
87
|
periodType: string
|
|
77
88
|
selectedCustomTime: string
|
|
78
89
|
selectedChartOptionName: string
|
|
90
|
+
customDateFrom: string
|
|
91
|
+
customDateTo: string
|
|
92
|
+
customTimeFrom: string
|
|
93
|
+
customTimeTo: string
|
|
94
|
+
totalCores: number
|
|
95
|
+
hostId: string
|
|
79
96
|
}>()
|
|
80
97
|
|
|
81
98
|
const emits = defineEmits<{
|
|
@@ -90,12 +107,35 @@ const emits = defineEmits<{
|
|
|
90
107
|
(event: 'select-chart-name', value: string): void
|
|
91
108
|
(event: 'delete-option'): void
|
|
92
109
|
(event: 'save-option-name'): void
|
|
110
|
+
(event: 'update-custom-date-from', value: string): void
|
|
111
|
+
(event: 'update-custom-date-to', value: string): void
|
|
112
|
+
(event: 'update-custom-time-from', value: string): void
|
|
113
|
+
(event: 'update-custom-time-to', value: string): void
|
|
114
|
+
(event: 'submit-options', value: string): void
|
|
115
|
+
(event: 'select-objects', value: string): void
|
|
93
116
|
}>()
|
|
94
117
|
|
|
95
118
|
const routeType = '' + useRoute().params.type
|
|
96
119
|
|
|
97
120
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
98
121
|
|
|
122
|
+
const localCustomDateFrom = ref<string>('')
|
|
123
|
+
const onUpdateCustomDateFrom = (value: string): void => {
|
|
124
|
+
localCustomDateFrom.value = value
|
|
125
|
+
}
|
|
126
|
+
const localCustomDateTo = ref<string>('')
|
|
127
|
+
const onUpdateCustomDateTo = (value: string): void => {
|
|
128
|
+
localCustomDateTo.value = value
|
|
129
|
+
}
|
|
130
|
+
const localCustomTimeFrom = ref<string>('')
|
|
131
|
+
const onUpdateCustomTimeFrom = (value: string): void => {
|
|
132
|
+
localCustomTimeFrom.value = value
|
|
133
|
+
}
|
|
134
|
+
const localCustomTimeTo = ref<string>('')
|
|
135
|
+
const onUpdateCustomTimeTo = (value: string): void => {
|
|
136
|
+
localCustomTimeTo.value = value
|
|
137
|
+
}
|
|
138
|
+
|
|
99
139
|
const metricsItems = computed<UI_I_VerticalTabs[]>(() =>
|
|
100
140
|
metricsFunc(localization.value, props.type)
|
|
101
141
|
)
|
|
@@ -173,17 +213,30 @@ const selectedRows = ref<UI_I_AdvancedCounterItem[]>([])
|
|
|
173
213
|
const selectedChartTypeLocal = ref<string>('')
|
|
174
214
|
|
|
175
215
|
const checkValidations = (): boolean => {
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
216
|
+
const checkDateResult = checkDateFunc(
|
|
217
|
+
localization.value,
|
|
218
|
+
localCustomDateFrom.value,
|
|
219
|
+
localCustomDateTo.value,
|
|
220
|
+
localCustomTimeFrom.value,
|
|
221
|
+
localCustomTimeTo.value
|
|
222
|
+
)
|
|
179
223
|
|
|
180
|
-
|
|
224
|
+
if (!selectedRows.value.length) {
|
|
225
|
+
alerts.value = [localization.value.noCountersSelected]
|
|
226
|
+
isShowAlerts.value = true
|
|
227
|
+
return false
|
|
228
|
+
} else if (
|
|
229
|
+
timespanType.value === 'custom_interval' &&
|
|
230
|
+
localPeriodType.value === 'period' &&
|
|
231
|
+
checkDateResult !== '' &&
|
|
232
|
+
typeof checkDateResult === 'string'
|
|
233
|
+
) {
|
|
234
|
+
alerts.value = [checkDateResult]
|
|
235
|
+
isShowAlerts.value = true
|
|
236
|
+
return false
|
|
181
237
|
}
|
|
182
238
|
|
|
183
|
-
|
|
184
|
-
isShowAlerts.value = true
|
|
185
|
-
|
|
186
|
-
return false
|
|
239
|
+
return true
|
|
187
240
|
}
|
|
188
241
|
|
|
189
242
|
const localSelectedChartOptionName = ref<string>('')
|
|
@@ -197,6 +250,8 @@ watch(
|
|
|
197
250
|
|
|
198
251
|
const selectedLocalOptionName = ref<string>('')
|
|
199
252
|
|
|
253
|
+
const selectedObjects = ref<string>('')
|
|
254
|
+
|
|
200
255
|
const onSubmit = (): void => {
|
|
201
256
|
if (!checkValidations()) return
|
|
202
257
|
|
|
@@ -205,14 +260,37 @@ const onSubmit = (): void => {
|
|
|
205
260
|
|
|
206
261
|
onSaveOptions(selectedLocalOptionName.value)
|
|
207
262
|
|
|
208
|
-
emits('select-
|
|
209
|
-
emits('select-
|
|
210
|
-
emits('
|
|
211
|
-
emits('update-timespan-type', timespanType.value)
|
|
212
|
-
emits('update-
|
|
213
|
-
emits('update-
|
|
214
|
-
emits('update-custom-time', localCustomTime.value)
|
|
215
|
-
emits('
|
|
263
|
+
// emits('select-chart-name', selectedLocalOptionName.value) +
|
|
264
|
+
// emits('select-metric', selectedMetric.value) +
|
|
265
|
+
// emits('select-row', selectedRows.value) +
|
|
266
|
+
// emits('update-timespan-type', timespanType.value) +
|
|
267
|
+
// emits('update-period-type', localPeriodType.value) +
|
|
268
|
+
// emits('update-unit-count', unitCount.value) +
|
|
269
|
+
// emits('update-custom-time', localCustomTime.value) +
|
|
270
|
+
// emits('update-custom-date-from', localCustomDateFrom.value) +
|
|
271
|
+
// emits('update-custom-date-to', localCustomDateTo.value) +
|
|
272
|
+
// emits('update-custom-time-from', localCustomTimeFrom.value) +
|
|
273
|
+
// emits('update-custom-time-to', localCustomTimeTo.value) +
|
|
274
|
+
// emits('update-chart-type', selectedChartTypeLocal.value) +
|
|
275
|
+
// emits('submit-options')
|
|
276
|
+
|
|
277
|
+
const savedObject = {
|
|
278
|
+
optionName: selectedLocalOptionName.value,
|
|
279
|
+
metric: selectedMetric.value,
|
|
280
|
+
counters: selectedRows.value,
|
|
281
|
+
timespanType: timespanType.value,
|
|
282
|
+
periodType: localPeriodType.value,
|
|
283
|
+
unitCount: unitCount.value,
|
|
284
|
+
localTimespanType: localCustomTime.value,
|
|
285
|
+
dateFrom: localCustomDateFrom.value,
|
|
286
|
+
timeFrom: localCustomTimeFrom.value,
|
|
287
|
+
dateTo: localCustomDateTo.value,
|
|
288
|
+
timeTo: localCustomTimeTo.value,
|
|
289
|
+
chartType: selectedChartTypeLocal.value,
|
|
290
|
+
objects: selectedObjects.value,
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
emits('submit-options', savedObject)
|
|
216
294
|
onHide()
|
|
217
295
|
}
|
|
218
296
|
|
|
@@ -251,7 +329,13 @@ const onSaveOptions = (name: string): void => {
|
|
|
251
329
|
}
|
|
252
330
|
|
|
253
331
|
const setSelectOptions = (): void => {
|
|
254
|
-
|
|
332
|
+
selectedMetric.value = props.selectedMetric || metricsItems.value[0]?.value
|
|
333
|
+
localSelectedCountersKeys.value = props.selectedCountersKeys
|
|
334
|
+
localSelectedChartType.value = props.selectedChartType
|
|
335
|
+
localSelectedTimespanType.value = props.selectedTimespanType
|
|
336
|
+
localUnitsCount.value = props.unitsCount
|
|
337
|
+
localPeriodType.value = props.periodType
|
|
338
|
+
localCustomTime.value = props.selectedCustomTime
|
|
255
339
|
}
|
|
256
340
|
|
|
257
341
|
const setDefaultOptions = (): void => {
|
|
@@ -7,18 +7,30 @@
|
|
|
7
7
|
@select-row="emits('select-row', $event)"
|
|
8
8
|
/>
|
|
9
9
|
<common-monitor-advanced-tools-chart-options-modal-counters-timespan
|
|
10
|
+
:type="props.type"
|
|
11
|
+
:chart="props.chart"
|
|
10
12
|
:language="props.language"
|
|
11
|
-
:selected="selectedOptions"
|
|
12
13
|
:selected-chart-type="props.selectedChartType"
|
|
13
14
|
:selected-timespan-type="props.selectedTimespanType"
|
|
14
15
|
:units-count="props.unitsCount"
|
|
15
16
|
:period-type="props.periodType"
|
|
16
17
|
:selected-custom-time="props.selectedCustomTime"
|
|
18
|
+
:custom-date-from="props.customDateFrom"
|
|
19
|
+
:custom-date-to="props.customDateTo"
|
|
20
|
+
:custom-time-from="props.customTimeFrom"
|
|
21
|
+
:custom-time-to="props.customTimeTo"
|
|
22
|
+
:total-cores="props.totalCores"
|
|
23
|
+
:host-id="props.hostId"
|
|
17
24
|
@update-chart-type="emits('update-chart-type', $event)"
|
|
18
25
|
@update-custom-time="emits('update-custom-time', $event)"
|
|
19
26
|
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
20
27
|
@update-unit-count="emits('update-unit-count', $event)"
|
|
21
28
|
@update-period-type="emits('update-period-type', $event)"
|
|
29
|
+
@update-custom-date-from="emits('update-custom-date-from', $event)"
|
|
30
|
+
@update-custom-date-to="emits('update-custom-date-to', $event)"
|
|
31
|
+
@update-custom-time-from="emits('update-custom-time-from', $event)"
|
|
32
|
+
@update-custom-time-to="emits('update-custom-time-to', $event)"
|
|
33
|
+
@select-objects="emits('select-objects', $event)"
|
|
22
34
|
/>
|
|
23
35
|
</div>
|
|
24
36
|
</template>
|
|
@@ -29,10 +41,7 @@ import {
|
|
|
29
41
|
T_ChartVm,
|
|
30
42
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
31
43
|
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
|
|
32
|
-
import {
|
|
33
|
-
UI_I_AdvancedCounterItem,
|
|
34
|
-
UI_I_AdvancedTargetObject,
|
|
35
|
-
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
44
|
+
import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
36
45
|
|
|
37
46
|
const props = defineProps<{
|
|
38
47
|
language: string
|
|
@@ -44,6 +53,12 @@ const props = defineProps<{
|
|
|
44
53
|
unitsCount: number
|
|
45
54
|
periodType: string
|
|
46
55
|
selectedCustomTime: string
|
|
56
|
+
customDateFrom: string
|
|
57
|
+
customDateTo: string
|
|
58
|
+
customTimeFrom: string
|
|
59
|
+
customTimeTo: string
|
|
60
|
+
totalCores: number
|
|
61
|
+
hostId: string
|
|
47
62
|
}>()
|
|
48
63
|
|
|
49
64
|
const emits = defineEmits<{
|
|
@@ -53,9 +68,12 @@ const emits = defineEmits<{
|
|
|
53
68
|
(event: 'update-timespan-type', value: string): void
|
|
54
69
|
(event: 'update-unit-count', value: number): void
|
|
55
70
|
(event: 'update-period-type', value: string): void
|
|
71
|
+
(event: 'update-custom-date-from', value: string): void
|
|
72
|
+
(event: 'update-custom-date-to', value: string): void
|
|
73
|
+
(event: 'update-custom-time-from', value: string): void
|
|
74
|
+
(event: 'update-custom-time-to', value: string): void
|
|
75
|
+
(event: 'select-objects', value: string): void
|
|
56
76
|
}>()
|
|
57
|
-
|
|
58
|
-
const selectedOptions = ref<UI_I_AdvancedTargetObject[][]>([])
|
|
59
77
|
</script>
|
|
60
78
|
|
|
61
79
|
<style scoped lang="scss">
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts
CHANGED
|
@@ -631,3 +631,58 @@ export const countersItemsFunc = (
|
|
|
631
631
|
|
|
632
632
|
return result
|
|
633
633
|
}
|
|
634
|
+
|
|
635
|
+
export const getDefaultMetricName = (type: string, view: string): string => {
|
|
636
|
+
if (type === 'datacenter') return 'cpu'
|
|
637
|
+
else if (type === 'host') {
|
|
638
|
+
if (view === 'cpuUsageInPercent') return 'cpu'
|
|
639
|
+
return view
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
return ''
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
export const getDefaultCounters = (
|
|
646
|
+
type: string,
|
|
647
|
+
view: string
|
|
648
|
+
): UI_I_AdvancedCounterItem[] => {
|
|
649
|
+
switch (type) {
|
|
650
|
+
case 'datacenter':
|
|
651
|
+
return [hostItemsFunc('cpu', {})[0]]
|
|
652
|
+
case 'host':
|
|
653
|
+
switch (view) {
|
|
654
|
+
case 'cpuUsageInPercent':
|
|
655
|
+
return hostItemsFunc('cpu', {}).splice(0, 2)
|
|
656
|
+
case 'disk':
|
|
657
|
+
const allItems = hostItemsFunc('disk', {})
|
|
658
|
+
return allItems.filter((_, key) => [0, 14].includes(key))
|
|
659
|
+
case 'memory':
|
|
660
|
+
return hostItemsFunc('memory', {})
|
|
661
|
+
case 'network':
|
|
662
|
+
return hostItemsFunc('network', {}).splice(1, 3)
|
|
663
|
+
}
|
|
664
|
+
break
|
|
665
|
+
case 'vm':
|
|
666
|
+
switch (view) {
|
|
667
|
+
case 'cpuUsageInPercent':
|
|
668
|
+
return []
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// if (type === 'datacenter') {
|
|
673
|
+
// return [hostItemsFunc('cpu', {})[0]]
|
|
674
|
+
// } else if (type === 'host') {
|
|
675
|
+
// if (view === 'cpuUsageInPercent')
|
|
676
|
+
// return hostItemsFunc('cpu', {}).splice(0, 2)
|
|
677
|
+
// else if (view === 'disk') {
|
|
678
|
+
// const allItems = hostItemsFunc('disk', {})
|
|
679
|
+
// return allItems.filter((_, key) => [0, 14].includes(key))
|
|
680
|
+
// } else if (view === 'memory') return hostItemsFunc('memory', {})
|
|
681
|
+
// else if (view === 'network')
|
|
682
|
+
// return hostItemsFunc('network', {}).splice(1, 3)
|
|
683
|
+
// } else if (type === 'vm') {
|
|
684
|
+
// if (view === 'cpuUsageInPercent') return []
|
|
685
|
+
// }
|
|
686
|
+
|
|
687
|
+
return []
|
|
688
|
+
}
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue
CHANGED
|
@@ -7,29 +7,52 @@
|
|
|
7
7
|
:units-count="props.unitsCount"
|
|
8
8
|
:period-type="props.periodType"
|
|
9
9
|
:selected-custom-time="props.selectedCustomTime"
|
|
10
|
+
:custom-date-from="props.customDateFrom"
|
|
11
|
+
:custom-date-to="props.customDateTo"
|
|
12
|
+
:custom-time-from="props.customTimeFrom"
|
|
13
|
+
:custom-time-to="props.customTimeTo"
|
|
10
14
|
@update-chart-type="emits('update-chart-type', $event)"
|
|
11
15
|
@update-custom-time="emits('update-custom-time', $event)"
|
|
12
16
|
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
13
17
|
@update-unit-count="emits('update-unit-count', $event)"
|
|
14
18
|
@update-period-type="emits('update-period-type', $event)"
|
|
19
|
+
@update-custom-date-from="emits('update-custom-date-from', $event)"
|
|
20
|
+
@update-custom-date-to="emits('update-custom-date-to', $event)"
|
|
21
|
+
@update-custom-time-from="emits('update-custom-time-from', $event)"
|
|
22
|
+
@update-custom-time-to="emits('update-custom-time-to', $event)"
|
|
15
23
|
/>
|
|
16
24
|
<common-monitor-advanced-tools-chart-options-modal-counters-timespan-object
|
|
17
|
-
:
|
|
25
|
+
:type="props.type"
|
|
26
|
+
:chart="props.chart"
|
|
27
|
+
:total-cores="props.totalCores"
|
|
28
|
+
:host-id="props.hostId"
|
|
29
|
+
@select-objects="emits('select-objects', $event)"
|
|
18
30
|
/>
|
|
19
31
|
</div>
|
|
20
32
|
</template>
|
|
21
33
|
|
|
22
34
|
<script setup lang="ts">
|
|
23
|
-
import {
|
|
35
|
+
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
|
|
36
|
+
import {
|
|
37
|
+
T_ChartHost,
|
|
38
|
+
T_ChartVm,
|
|
39
|
+
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
24
40
|
|
|
25
41
|
const props = defineProps<{
|
|
26
|
-
|
|
42
|
+
type: UI_T_AdvancedType
|
|
43
|
+
chart: T_ChartHost | T_ChartVm
|
|
27
44
|
language: string
|
|
28
45
|
selectedChartType: string
|
|
29
46
|
selectedTimespanType: string
|
|
30
47
|
unitsCount: number
|
|
31
48
|
periodType: string
|
|
32
49
|
selectedCustomTime: string
|
|
50
|
+
customDateFrom: string
|
|
51
|
+
customDateTo: string
|
|
52
|
+
customTimeFrom: string
|
|
53
|
+
customTimeTo: string
|
|
54
|
+
totalCores: number
|
|
55
|
+
hostId: string
|
|
33
56
|
}>()
|
|
34
57
|
|
|
35
58
|
const emits = defineEmits<{
|
|
@@ -38,6 +61,12 @@ const emits = defineEmits<{
|
|
|
38
61
|
(event: 'update-timespan-type', value: string): void
|
|
39
62
|
(event: 'update-unit-count', value: number): void
|
|
40
63
|
(event: 'update-period-type', value: string): void
|
|
64
|
+
(event: 'update-period-type', value: string): void
|
|
65
|
+
(event: 'update-custom-date-from', value: string): void
|
|
66
|
+
(event: 'update-custom-date-to', value: string): void
|
|
67
|
+
(event: 'update-custom-time-from', value: string): void
|
|
68
|
+
(event: 'update-custom-time-to', value: string): void
|
|
69
|
+
(event: 'select-objects', value: string): void
|
|
41
70
|
}>()
|
|
42
71
|
</script>
|
|
43
72
|
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue
CHANGED
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
>
|
|
112
112
|
<input
|
|
113
113
|
id="current-date-from"
|
|
114
|
-
v-model.lazy="
|
|
114
|
+
v-model.lazy="localCurrentDateFrom"
|
|
115
115
|
type="text"
|
|
116
116
|
class="chart-option-setting-row custom-time-input first-from"
|
|
117
117
|
/>
|
|
@@ -221,6 +221,10 @@ const props = defineProps<{
|
|
|
221
221
|
unitsCount: number
|
|
222
222
|
periodType: string
|
|
223
223
|
selectedCustomTime: string
|
|
224
|
+
customDateFrom: string
|
|
225
|
+
customDateTo: string
|
|
226
|
+
customTimeFrom: string
|
|
227
|
+
customTimeTo: string
|
|
224
228
|
}>()
|
|
225
229
|
|
|
226
230
|
const emits = defineEmits<{
|
|
@@ -229,6 +233,10 @@ const emits = defineEmits<{
|
|
|
229
233
|
(event: 'update-timespan-type', value: string): void
|
|
230
234
|
(event: 'update-unit-count', value: number): void
|
|
231
235
|
(event: 'update-period-type', value: string): void
|
|
236
|
+
(event: 'update-custom-date-from', value: string): void
|
|
237
|
+
(event: 'update-custom-date-to', value: string): void
|
|
238
|
+
(event: 'update-custom-time-from', value: string): void
|
|
239
|
+
(event: 'update-custom-time-to', value: string): void
|
|
232
240
|
}>()
|
|
233
241
|
|
|
234
242
|
const { $formattedDate, $isDate, $getTimeFormat, $getUnixByDate } = useNuxtApp()
|
|
@@ -348,26 +356,28 @@ const yesterday = new Date().setDate(new Date().getDate() - 1)
|
|
|
348
356
|
const dateFrom = ref<number>(yesterday)
|
|
349
357
|
const dateTo = ref<number>(new Date().getTime())
|
|
350
358
|
|
|
351
|
-
const
|
|
359
|
+
const localCurrentDateFrom = ref<string>('')
|
|
352
360
|
const currentDateTo = ref<string>('')
|
|
353
361
|
const currentTimeFrom = ref<string>('')
|
|
354
362
|
const currentTimeTo = ref<string>('')
|
|
355
363
|
|
|
356
364
|
const getCurrentTime = (): void => {
|
|
357
|
-
|
|
358
|
-
|
|
365
|
+
localCurrentDateFrom.value =
|
|
366
|
+
props.customDateFrom || $formattedDate(yesterday, '')
|
|
367
|
+
currentDateTo.value = props.customDateTo || $formattedDate(new Date(), '')
|
|
359
368
|
|
|
360
369
|
const currentTime = format(new Date(), $getTimeFormat(true))
|
|
361
|
-
currentTimeFrom.value = currentTime
|
|
362
|
-
currentTimeTo.value = currentTime
|
|
370
|
+
currentTimeFrom.value = props.customTimeFrom || currentTime
|
|
371
|
+
currentTimeTo.value = props.customTimeTo || currentTime
|
|
363
372
|
}
|
|
364
373
|
|
|
365
374
|
const onUpdateDateFrom = (val: number): void => {
|
|
366
375
|
if (!val) return
|
|
367
376
|
|
|
368
|
-
|
|
377
|
+
localCurrentDateFrom.value = $formattedDate(new Date(val), '')
|
|
369
378
|
}
|
|
370
|
-
watch(
|
|
379
|
+
watch(localCurrentDateFrom, (newValue) => {
|
|
380
|
+
emits('update-custom-date-from', newValue)
|
|
371
381
|
if (!newValue) return
|
|
372
382
|
|
|
373
383
|
if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
|
|
@@ -379,10 +389,17 @@ const onUpdateDateTo = (val: number): void => {
|
|
|
379
389
|
currentDateTo.value = $formattedDate(new Date(val), '')
|
|
380
390
|
}
|
|
381
391
|
watch(currentDateTo, (newValue) => {
|
|
392
|
+
emits('update-custom-date-to', newValue)
|
|
382
393
|
if (!newValue) return
|
|
383
394
|
|
|
384
395
|
if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
|
|
385
396
|
})
|
|
397
|
+
watch(currentTimeFrom, (newValue) => {
|
|
398
|
+
emits('update-custom-time-from', newValue)
|
|
399
|
+
})
|
|
400
|
+
watch(currentTimeTo, (newValue) => {
|
|
401
|
+
emits('update-custom-time-to', newValue)
|
|
402
|
+
})
|
|
386
403
|
|
|
387
404
|
onMounted(() => {
|
|
388
405
|
getCurrentTime()
|
|
@@ -34,10 +34,21 @@ import {
|
|
|
34
34
|
import { UI_I_Localization } from '~/models/interfaces'
|
|
35
35
|
import { UI_I_AdvancedTargetObject } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
|
|
36
36
|
import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/config/objectTable'
|
|
37
|
-
import {
|
|
37
|
+
import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
|
|
38
|
+
import {
|
|
39
|
+
T_ChartHost,
|
|
40
|
+
T_ChartVm,
|
|
41
|
+
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
38
42
|
|
|
39
43
|
const props = defineProps<{
|
|
40
|
-
|
|
44
|
+
type: UI_T_AdvancedType
|
|
45
|
+
chart: T_ChartHost | T_ChartVm
|
|
46
|
+
totalCores: number
|
|
47
|
+
hostId: string
|
|
48
|
+
}>()
|
|
49
|
+
|
|
50
|
+
const emits = defineEmits<{
|
|
51
|
+
(event: 'select-objects', value: string): void
|
|
41
52
|
}>()
|
|
42
53
|
|
|
43
54
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
@@ -57,28 +68,38 @@ const columnItems = computed<UI_I_ColumnKey[]>(() =>
|
|
|
57
68
|
|
|
58
69
|
const bodyItems = ref<UI_I_BodyItem[][]>([])
|
|
59
70
|
|
|
71
|
+
const items: UI_I_AdvancedTargetObject[] = []
|
|
60
72
|
watch(
|
|
61
|
-
() => props.
|
|
62
|
-
(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
val.forEach((itemArr) => {
|
|
70
|
-
itemArr.forEach((item) =>
|
|
73
|
+
() => [props.type, props.chart, props.totalCores, props.hostId],
|
|
74
|
+
(newValue) => {
|
|
75
|
+
if (newValue[0] === 'host' && newValue[1] === 'cpu') {
|
|
76
|
+
items.push({
|
|
77
|
+
id: 'total',
|
|
78
|
+
target_object: newValue[3],
|
|
79
|
+
})
|
|
80
|
+
for (let i = 0; i < newValue[2]; i++) {
|
|
71
81
|
items.push({
|
|
72
|
-
id:
|
|
73
|
-
target_object:
|
|
82
|
+
id: 'core' + i,
|
|
83
|
+
target_object: '' + i,
|
|
74
84
|
})
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
bodyItems.value = table.bodyItems(items)
|
|
85
|
+
}
|
|
86
|
+
bodyItems.value = table.bodyItems(items)
|
|
87
|
+
}
|
|
79
88
|
},
|
|
80
|
-
{
|
|
89
|
+
{ immediate: true }
|
|
81
90
|
)
|
|
91
|
+
|
|
92
|
+
watch(selectedRow, (newValue) => {
|
|
93
|
+
const selectedItems: number[] = []
|
|
94
|
+
|
|
95
|
+
newValue.forEach((key) => {
|
|
96
|
+
selectedItems.push(+items[key].id)
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
const selectedNames =
|
|
100
|
+
items.length === newValue.length ? '*' : selectedItems.join(', ')
|
|
101
|
+
emits('select-objects', selectedNames)
|
|
102
|
+
})
|
|
82
103
|
</script>
|
|
83
104
|
|
|
84
105
|
<style scoped lang="scss">
|
|
@@ -91,6 +112,7 @@ watch(
|
|
|
91
112
|
}
|
|
92
113
|
.flex-to-absolute-positioning-container {
|
|
93
114
|
height: 100%;
|
|
115
|
+
max-height: 204px;
|
|
94
116
|
.flex-to-absolute-positioning-container-inner {
|
|
95
117
|
height: inherit;
|
|
96
118
|
|