bfg-common 1.4.884 → 1.4.886
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 +3025 -3018
- package/assets/localization/local_en.json +3029 -3022
- package/assets/localization/local_hy.json +3029 -3022
- package/assets/localization/local_kk.json +8 -1
- package/assets/localization/local_ru.json +8 -1
- package/assets/localization/local_zh.json +8 -2
- package/components/common/graph/GraphNew.vue +179 -178
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +106 -106
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsNew.vue +1 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +28 -25
- package/components/common/monitor/overview/Overview.vue +132 -224
- package/components/common/monitor/overview/OverviewNew.vue +120 -142
- package/components/common/monitor/overview/filters/Filters.vue +169 -166
- package/components/common/monitor/overview/filters/FiltersNew.vue +183 -172
- package/components/common/monitor/overview/filters/FiltersOld.vue +2 -0
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +173 -175
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalNew.vue +209 -186
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalOld.vue +2 -2
- package/package.json +2 -2
package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue
CHANGED
|
@@ -1,175 +1,173 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<common-monitor-overview-filters-custom-interval-modal-new
|
|
4
|
-
v-if="isNewView"
|
|
5
|
-
v-model:alert-show="alertShow"
|
|
6
|
-
v-model:current-date-from="currentDateFrom"
|
|
7
|
-
v-model:date-from="dateFrom"
|
|
8
|
-
v-model:current-time-from="currentTimeFrom"
|
|
9
|
-
v-model:current-date-to="currentDateTo"
|
|
10
|
-
v-model:date-to="dateTo"
|
|
11
|
-
v-model:current-time-to="currentTimeTo"
|
|
12
|
-
:title-interval-modal="titleIntervalModal"
|
|
13
|
-
:selected-
|
|
14
|
-
:current-lang="currentLang"
|
|
15
|
-
:alert-items="alertItems"
|
|
16
|
-
:format-date="props.formatDate"
|
|
17
|
-
@update-date-from="onUpdateDateFrom"
|
|
18
|
-
@update-date-to="onUpdateDateTo"
|
|
19
|
-
@submit="onSubmit"
|
|
20
|
-
@hide="onHide"
|
|
21
|
-
/>
|
|
22
|
-
<common-monitor-overview-filters-custom-interval-modal-old
|
|
23
|
-
v-else
|
|
24
|
-
v-model:alert-show="alertShow"
|
|
25
|
-
v-model:current-date-from="currentDateFrom"
|
|
26
|
-
v-model:date-from="dateFrom"
|
|
27
|
-
v-model:current-time-from="currentTimeFrom"
|
|
28
|
-
v-model:current-date-to="currentDateTo"
|
|
29
|
-
v-model:date-to="dateTo"
|
|
30
|
-
v-model:current-time-to="currentTimeTo"
|
|
31
|
-
:title-interval-modal="titleIntervalModal"
|
|
32
|
-
:selected-
|
|
33
|
-
:current-lang="currentLang"
|
|
34
|
-
:alert-items="alertItems"
|
|
35
|
-
@update-date-from="onUpdateDateFrom"
|
|
36
|
-
@update-date-to="onUpdateDateTo"
|
|
37
|
-
@submit="onSubmit"
|
|
38
|
-
@hide="onHide"
|
|
39
|
-
/>
|
|
40
|
-
</div>
|
|
41
|
-
</template>
|
|
42
|
-
|
|
43
|
-
<script setup lang="ts">
|
|
44
|
-
import { format } from 'date-fns'
|
|
45
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
46
|
-
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
47
|
-
|
|
48
|
-
const props = defineProps<{
|
|
49
|
-
formatDate: string
|
|
50
|
-
selectedPeriods: number[]
|
|
51
|
-
currentLang: string
|
|
52
|
-
validDateEnd: number
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
(event: '
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
props.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
props.
|
|
103
|
-
|
|
104
|
-
)
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
props.
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
() =>
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
<style scoped lang="scss"></style>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<common-monitor-overview-filters-custom-interval-modal-new
|
|
4
|
+
v-if="isNewView"
|
|
5
|
+
v-model:alert-show="alertShow"
|
|
6
|
+
v-model:current-date-from="currentDateFrom"
|
|
7
|
+
v-model:date-from="dateFrom"
|
|
8
|
+
v-model:current-time-from="currentTimeFrom"
|
|
9
|
+
v-model:current-date-to="currentDateTo"
|
|
10
|
+
v-model:date-to="dateTo"
|
|
11
|
+
v-model:current-time-to="currentTimeTo"
|
|
12
|
+
:title-interval-modal="titleIntervalModal"
|
|
13
|
+
:selected-node-name="props.selectedNodeName"
|
|
14
|
+
:current-lang="currentLang"
|
|
15
|
+
:alert-items="alertItems"
|
|
16
|
+
:format-date="props.formatDate"
|
|
17
|
+
@update-date-from="onUpdateDateFrom"
|
|
18
|
+
@update-date-to="onUpdateDateTo"
|
|
19
|
+
@submit="onSubmit"
|
|
20
|
+
@hide="onHide"
|
|
21
|
+
/>
|
|
22
|
+
<common-monitor-overview-filters-custom-interval-modal-old
|
|
23
|
+
v-else
|
|
24
|
+
v-model:alert-show="alertShow"
|
|
25
|
+
v-model:current-date-from="currentDateFrom"
|
|
26
|
+
v-model:date-from="dateFrom"
|
|
27
|
+
v-model:current-time-from="currentTimeFrom"
|
|
28
|
+
v-model:current-date-to="currentDateTo"
|
|
29
|
+
v-model:date-to="dateTo"
|
|
30
|
+
v-model:current-time-to="currentTimeTo"
|
|
31
|
+
:title-interval-modal="titleIntervalModal"
|
|
32
|
+
:selected-node-name="props.selectedNodeName"
|
|
33
|
+
:current-lang="currentLang"
|
|
34
|
+
:alert-items="alertItems"
|
|
35
|
+
@update-date-from="onUpdateDateFrom"
|
|
36
|
+
@update-date-to="onUpdateDateTo"
|
|
37
|
+
@submit="onSubmit"
|
|
38
|
+
@hide="onHide"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup lang="ts">
|
|
44
|
+
import { format } from 'date-fns'
|
|
45
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
46
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
47
|
+
|
|
48
|
+
const props = defineProps<{
|
|
49
|
+
formatDate: string
|
|
50
|
+
selectedPeriods: number[]
|
|
51
|
+
currentLang: string
|
|
52
|
+
validDateEnd: number
|
|
53
|
+
selectedNodeName: string
|
|
54
|
+
}>()
|
|
55
|
+
|
|
56
|
+
const emits = defineEmits<{
|
|
57
|
+
(event: 'hide'): void
|
|
58
|
+
(event: 'submit', value: number[]): void
|
|
59
|
+
}>()
|
|
60
|
+
|
|
61
|
+
const { $store, $formattedDate, $formattedTime, $isDate, $getUnixByDate } =
|
|
62
|
+
useNuxtApp()
|
|
63
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
64
|
+
|
|
65
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
66
|
+
|
|
67
|
+
const titleIntervalModal = ref<string>(
|
|
68
|
+
`${localization.value.common.timeRange}:`
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
const onHide = (): void => {
|
|
72
|
+
getCurrentTime()
|
|
73
|
+
emits('hide')
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const yesterday = new Date().setDate(new Date().getDate() - 1)
|
|
77
|
+
const dateFrom = ref<number>(yesterday)
|
|
78
|
+
const dateTo = ref<number>(new Date().getTime())
|
|
79
|
+
|
|
80
|
+
const currentDateFrom = ref<string>('')
|
|
81
|
+
const currentDateTo = ref<string>('')
|
|
82
|
+
const currentTimeFrom = ref<string>('')
|
|
83
|
+
const currentTimeTo = ref<string>('')
|
|
84
|
+
|
|
85
|
+
const getCurrentTime = (): void => {
|
|
86
|
+
if (!props.selectedPeriods.length) {
|
|
87
|
+
currentDateFrom.value = $formattedDate(yesterday, props.formatDate)
|
|
88
|
+
currentDateTo.value = $formattedDate(props.validDateEnd, props.formatDate)
|
|
89
|
+
|
|
90
|
+
currentTimeFrom.value = format(new Date(), 'H:mm:ss')
|
|
91
|
+
currentTimeTo.value = format(props.validDateEnd, 'H:mm:ss')
|
|
92
|
+
|
|
93
|
+
return
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
currentDateFrom.value = $formattedDate(
|
|
97
|
+
props.selectedPeriods[0],
|
|
98
|
+
props.formatDate
|
|
99
|
+
)
|
|
100
|
+
currentDateTo.value = $formattedDate(
|
|
101
|
+
props.selectedPeriods[1],
|
|
102
|
+
props.formatDate
|
|
103
|
+
)
|
|
104
|
+
currentTimeFrom.value = $formattedTime(props.selectedPeriods[0], '', true)
|
|
105
|
+
currentTimeTo.value = $formattedTime(props.selectedPeriods[1], '', true)
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const onUpdateDateFrom = (val: number): void => {
|
|
109
|
+
if (!val) return
|
|
110
|
+
|
|
111
|
+
currentDateFrom.value = $formattedDate(new Date(val), props.formatDate)
|
|
112
|
+
}
|
|
113
|
+
watch(currentDateFrom, (newValue) => {
|
|
114
|
+
if (!newValue) return
|
|
115
|
+
|
|
116
|
+
if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
|
|
117
|
+
})
|
|
118
|
+
|
|
119
|
+
const onUpdateDateTo = (val: number): void => {
|
|
120
|
+
if (!val) return
|
|
121
|
+
|
|
122
|
+
currentDateTo.value = $formattedDate(new Date(val), props.formatDate)
|
|
123
|
+
}
|
|
124
|
+
watch(currentDateTo, (newValue) => {
|
|
125
|
+
if (!newValue) return
|
|
126
|
+
|
|
127
|
+
if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
const alertShow = ref<boolean>(false)
|
|
131
|
+
const alertItems = ref<string[]>([])
|
|
132
|
+
|
|
133
|
+
const onSubmit = (): void => {
|
|
134
|
+
alertItems.value = []
|
|
135
|
+
alertShow.value = false
|
|
136
|
+
|
|
137
|
+
if (!dateFrom.value || !dateTo.value) return
|
|
138
|
+
|
|
139
|
+
const result = checkDateFunc(
|
|
140
|
+
localization.value,
|
|
141
|
+
currentDateFrom.value,
|
|
142
|
+
currentDateTo.value,
|
|
143
|
+
currentTimeFrom.value,
|
|
144
|
+
currentTimeTo.value,
|
|
145
|
+
props.validDateEnd,
|
|
146
|
+
props.formatDate
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
if (typeof result === 'string') {
|
|
150
|
+
alertShow.value = true
|
|
151
|
+
alertItems.value.push(result)
|
|
152
|
+
return
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
emits('submit', [result[0], result[1]])
|
|
156
|
+
onHide()
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
watch(
|
|
160
|
+
() => [props.selectedPeriods, props.currentLang],
|
|
161
|
+
(): void => {
|
|
162
|
+
getCurrentTime()
|
|
163
|
+
},
|
|
164
|
+
{ deep: true }
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
onMounted(() => {
|
|
168
|
+
getCurrentTime()
|
|
169
|
+
onSubmit()
|
|
170
|
+
})
|
|
171
|
+
</script>
|
|
172
|
+
|
|
173
|
+
<style scoped lang="scss"></style>
|