bfg-common 1.4.718 → 1.4.719
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 +3 -1
- package/assets/localization/local_en.json +3 -1
- package/assets/localization/local_hy.json +3 -1
- package/assets/localization/local_kk.json +3 -1
- package/assets/localization/local_ru.json +3 -1
- package/assets/localization/local_zh.json +3 -1
- package/assets/scss/common/icons/icons-1.scss +6 -0
- package/components/common/monitor/overview/filters/Filters.vue +235 -232
- package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +242 -240
- package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +62 -52
- package/components/common/pages/tasks/table/lib/config/config.ts +1 -0
- package/package.json +2 -2
|
@@ -2463,7 +2463,8 @@
|
|
|
2463
2463
|
"fieldNotContainSpecialCharacters": "Поле не павінна ўтрымліваць спецыяльныя сімвалы"
|
|
2464
2464
|
},
|
|
2465
2465
|
"contextMenu": {
|
|
2466
|
-
"actionsMenuPower": "Магутнасць"
|
|
2466
|
+
"actionsMenuPower": "Магутнасць",
|
|
2467
|
+
"browseFiles": "Агляд файлаў"
|
|
2467
2468
|
},
|
|
2468
2469
|
"networks": {
|
|
2469
2470
|
"active_ports": "Актыўныя Парты",
|
|
@@ -2701,6 +2702,7 @@
|
|
|
2701
2702
|
"timeToShouldBeLaterTimeFrom": "Ўказаны дыяпазон часу недапушчальны. Дата \" да \"павінна быць пазней даты\"ад\".",
|
|
2702
2703
|
"timeRangeShouldNotBeSmallerThanHour": "Ўказаны дыяпазон часу недапушчальны. Ён не павінен быць менш 1 гадзіны.",
|
|
2703
2704
|
"timeRangeShouldNotBeMoreThanMonth": "Указаны дыяпазон часу несапраўдны. Яно не павінна быць больш за 1 месяца.",
|
|
2705
|
+
"timeRangeShouldNotBeMoreThanValidTo": "Указаны дыяпазон часу несапраўдны. Яно не павінна перавышаць {0}.",
|
|
2704
2706
|
"overview": "Агляд",
|
|
2705
2707
|
"spaceUtilization": "Выкарыстанне прасторы",
|
|
2706
2708
|
"changeCustomInterval": "Зменіце карыстацкі інтэрвал",
|
|
@@ -2467,7 +2467,8 @@
|
|
|
2467
2467
|
"fieldNotContainSpecialCharacters": "The field must not contain special characters"
|
|
2468
2468
|
},
|
|
2469
2469
|
"contextMenu": {
|
|
2470
|
-
"actionsMenuPower": "Power"
|
|
2470
|
+
"actionsMenuPower": "Power",
|
|
2471
|
+
"browseFiles": "Browse Files"
|
|
2471
2472
|
},
|
|
2472
2473
|
"networks": {
|
|
2473
2474
|
"active_ports": "Active ports",
|
|
@@ -2705,6 +2706,7 @@
|
|
|
2705
2706
|
"timeToShouldBeLaterTimeFrom": "The specified time range is not valid. The \"to\" date should be later than the \"from\" date.",
|
|
2706
2707
|
"timeRangeShouldNotBeSmallerThanHour": "The specified time range is not valid. It should not be smaller than 1 hour.",
|
|
2707
2708
|
"timeRangeShouldNotBeMoreThanMonth": "The specified time range is not valid. It should not be more than 1 month.",
|
|
2709
|
+
"timeRangeShouldNotBeMoreThanValidTo": "The specified time range is not valid. It should not be more than {0}.",
|
|
2708
2710
|
"overview": "Overview",
|
|
2709
2711
|
"spaceUtilization": "Space Utilization",
|
|
2710
2712
|
"changeCustomInterval": "Change custom interval",
|
|
@@ -2467,7 +2467,8 @@
|
|
|
2467
2467
|
"fieldNotContainSpecialCharacters": "Դաշտը չպետք է պարունակի հատուկ նիշեր"
|
|
2468
2468
|
},
|
|
2469
2469
|
"contextMenu": {
|
|
2470
|
-
"actionsMenuPower": "Հզորությունը"
|
|
2470
|
+
"actionsMenuPower": "Հզորությունը",
|
|
2471
|
+
"browseFiles": "Թերթել ֆայլերը"
|
|
2471
2472
|
},
|
|
2472
2473
|
"networks": {
|
|
2473
2474
|
"active_ports": "Ակտիվ պորտեր",
|
|
@@ -2705,6 +2706,7 @@
|
|
|
2705
2706
|
"timeToShouldBeLaterTimeFrom": "Նշված ժամանակային միջակայքն անընդունելի է: \"Նախքան\" ամսաթիվը պետք է լինի ավելի ուշ, քան \"from\"ամսաթիվը:",
|
|
2706
2707
|
"timeRangeShouldNotBeSmallerThanHour": "The specified time range is not valid. It should not be smaller than 1 hour.",
|
|
2707
2708
|
"timeRangeShouldNotBeMoreThanMonth": "Նշված ժամանակային միջակայքը վավեր չէ: Այն չպետք է լինի 1 ամսից ավելի։",
|
|
2709
|
+
"timeRangeShouldNotBeMoreThanValidTo": "Նշված ժամանակային միջակայքը վավեր չէ: Այն չպետք է լինի {0}-ից ավելի:",
|
|
2708
2710
|
"overview": "Ակնարկ",
|
|
2709
2711
|
"spaceUtilization": "Օգտագործելով տարածություն",
|
|
2710
2712
|
"changeCustomInterval": "Փոխեք օգտագործողի միջակայքը",
|
|
@@ -2466,7 +2466,8 @@
|
|
|
2466
2466
|
"fieldNotContainSpecialCharacters": "Өрісте арнайы таңбалар болмауы керек"
|
|
2467
2467
|
},
|
|
2468
2468
|
"contextMenu": {
|
|
2469
|
-
"actionsMenuPower": "Магутнасттар"
|
|
2469
|
+
"actionsMenuPower": "Магутнасттар",
|
|
2470
|
+
"browseFiles": "Файлдарды шолыңыз"
|
|
2470
2471
|
},
|
|
2471
2472
|
"networks": {
|
|
2472
2473
|
"active_ports": "Белсенді порттар",
|
|
@@ -2704,6 +2705,7 @@
|
|
|
2704
2705
|
"timeToShouldBeLaterTimeFrom": "The specified time range is not valid. The \"to\" date should be later than the \"from\" date.",
|
|
2705
2706
|
"timeRangeShouldNotBeSmallerThanHour": "The specified time range is not valid. It should not be smaller than 1 hour.",
|
|
2706
2707
|
"timeRangeShouldNotBeMoreThanMonth": "Көрсетілген уақыт аралығы жарамсыз. 1 айдан аспауы керек.",
|
|
2708
|
+
"timeRangeShouldNotBeMoreThanValidTo": "Көрсетілген уақыт аралығы жарамсыз. Ол {0} аспауы керек.",
|
|
2707
2709
|
"overview": "Шолу",
|
|
2708
2710
|
"spaceUtilization": "Кеңістікті пайдалану",
|
|
2709
2711
|
"changeCustomInterval": "Пайдаланушы аралығын өзгертіңіз",
|
|
@@ -2468,7 +2468,8 @@
|
|
|
2468
2468
|
"fieldNotContainSpecialCharacters": "Поле не должно содержать специальных символов"
|
|
2469
2469
|
},
|
|
2470
2470
|
"contextMenu": {
|
|
2471
|
-
"actionsMenuPower": "Питание"
|
|
2471
|
+
"actionsMenuPower": "Питание",
|
|
2472
|
+
"browseFiles": "Просмотреть файлы"
|
|
2472
2473
|
},
|
|
2473
2474
|
"networks": {
|
|
2474
2475
|
"active_ports": "Активные порты",
|
|
@@ -2706,6 +2707,7 @@
|
|
|
2706
2707
|
"timeToShouldBeLaterTimeFrom": "Указанный диапазон времени недопустим. Дата \"до\" должна быть позже даты \"от\".",
|
|
2707
2708
|
"timeRangeShouldNotBeSmallerThanHour": "Указанный диапазон времени недопустим. Он не должен быть меньше 1 часа.",
|
|
2708
2709
|
"timeRangeShouldNotBeMoreThanMonth": "Указанный диапазон времени недействителен. Он не должен быть больше 1 месяца.",
|
|
2710
|
+
"timeRangeShouldNotBeMoreThanValidTo": "Указанный временной диапазон недействителен. Он не должен быть больше {0}.",
|
|
2709
2711
|
"overview": "Обзор",
|
|
2710
2712
|
"spaceUtilization": "Использование пространства",
|
|
2711
2713
|
"changeCustomInterval": "Измените пользовательский интервал",
|
|
@@ -2465,7 +2465,8 @@
|
|
|
2465
2465
|
"fieldNotContainSpecialCharacters": "该字段不能包含特殊字符"
|
|
2466
2466
|
},
|
|
2467
2467
|
"contextMenu": {
|
|
2468
|
-
"actionsMenuPower": "力量"
|
|
2468
|
+
"actionsMenuPower": "力量",
|
|
2469
|
+
"browseFiles": "浏览文件"
|
|
2469
2470
|
},
|
|
2470
2471
|
"networks": {
|
|
2471
2472
|
"active_ports": "活动端口",
|
|
@@ -2703,6 +2704,7 @@
|
|
|
2703
2704
|
"timeToShouldBeLaterTimeFrom": "指定的时间范围无效。 “结束”日期应晚于“开始”日期。",
|
|
2704
2705
|
"timeRangeShouldNotBeSmallerThanHour": "指定的时间范围无效。 不应小于1小时。",
|
|
2705
2706
|
"timeRangeShouldNotBeMoreThanMonth": "指定的时间范围无效。它不应超过 1 个月。",
|
|
2707
|
+
"timeRangeShouldNotBeMoreThanValidTo": "指定的时间范围无效。它不应超过 {0}。",
|
|
2706
2708
|
"overview": "概述",
|
|
2707
2709
|
"spaceUtilization": "空间利用",
|
|
2708
2710
|
"changeCustomInterval": "更改自定义间隔",
|
|
@@ -113,6 +113,9 @@
|
|
|
113
113
|
.vsphere-icon-clock-line {
|
|
114
114
|
background-position: 0 43.0379746835%;
|
|
115
115
|
}
|
|
116
|
+
.storage-ui-icon-browse-file {
|
|
117
|
+
background-position: 0 30.3797468354%;
|
|
118
|
+
}
|
|
116
119
|
|
|
117
120
|
/* _____BACKGROUND IMAGE_____ */
|
|
118
121
|
.host-ui-icon-certificate,
|
|
@@ -152,6 +155,7 @@
|
|
|
152
155
|
.icon-content-libraries,
|
|
153
156
|
.network-lib-ui-icon-statusGreen,
|
|
154
157
|
.vsphere-icon-clock-line,
|
|
158
|
+
.storage-ui-icon-browse-file,
|
|
155
159
|
.network-lib-ui-icon-statusRed {
|
|
156
160
|
background-image: url('@/assets/img/icons/icons-sprite-light-1.svg');
|
|
157
161
|
|
|
@@ -194,6 +198,7 @@
|
|
|
194
198
|
.active .icon-content-libraries,
|
|
195
199
|
.active .network-lib-ui-icon-statusGreen,
|
|
196
200
|
.active .vsphere-icon-clock-line,
|
|
201
|
+
.active .storage-ui-icon-browse-file,
|
|
197
202
|
.active .network-lib-ui-icon-statusRed {
|
|
198
203
|
background-image: url('@/assets/img/icons/icons-sprite-dark-1.svg');
|
|
199
204
|
html.dark-theme & {
|
|
@@ -245,6 +250,7 @@
|
|
|
245
250
|
.icon-content-libraries,
|
|
246
251
|
.network-lib-ui-icon-statusGreen,
|
|
247
252
|
.vsphere-icon-clock-line,
|
|
253
|
+
.storage-ui-icon-browse-file,
|
|
248
254
|
.network-lib-ui-icon-statusRed,
|
|
249
255
|
.icon-Host_Policy-32x {
|
|
250
256
|
display: inline-block;
|
|
@@ -1,232 +1,235 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="horizontal-flex-container overview-chart-title-bar">
|
|
3
|
-
<div class="horizontal-flex-container">
|
|
4
|
-
<label for="periodSelect" class="label-select"
|
|
5
|
-
>{{ localization.inventoryMonitor.period }}:</label
|
|
6
|
-
>
|
|
7
|
-
<div v-if="!disabledPeriodOptions" class="select">
|
|
8
|
-
<select
|
|
9
|
-
id="periodSelect"
|
|
10
|
-
v-model="selectedPeriod"
|
|
11
|
-
data-id="period-select"
|
|
12
|
-
>
|
|
13
|
-
<option
|
|
14
|
-
v-for="(item, index) in periodOptions"
|
|
15
|
-
:key="index"
|
|
16
|
-
:value="item.value"
|
|
17
|
-
>
|
|
18
|
-
{{ item.text }}
|
|
19
|
-
</option>
|
|
20
|
-
</select>
|
|
21
|
-
</div>
|
|
22
|
-
<span v-else class="single-option">{{ periodOptions[0].text }}</span>
|
|
23
|
-
</div>
|
|
24
|
-
<div v-show="isShowCustomIntervalButton">
|
|
25
|
-
<a
|
|
26
|
-
id="show-interval-modal-button"
|
|
27
|
-
data-id="show-interval-modal-button"
|
|
28
|
-
@click="onShowIntervalModal"
|
|
29
|
-
>{{ localization.inventoryMonitor.changeCustomInterval }}</a
|
|
30
|
-
>
|
|
31
|
-
</div>
|
|
32
|
-
<div v-if="!disabledPeriodOptions" class="chart-title">
|
|
33
|
-
{{ chartTitleDate }}
|
|
34
|
-
</div>
|
|
35
|
-
<div class="view-select-label horizontal-flex-container">
|
|
36
|
-
<label for="viewSelect" class="label-select"
|
|
37
|
-
>{{ localization.common.view }}:</label
|
|
38
|
-
>
|
|
39
|
-
<div class="select">
|
|
40
|
-
<select id="viewSelect" v-model="selectedView" data-id="view-select">
|
|
41
|
-
<option
|
|
42
|
-
v-for="(item, index) in viewOptions"
|
|
43
|
-
:key="index"
|
|
44
|
-
:value="item.value"
|
|
45
|
-
>
|
|
46
|
-
{{ item.text }}
|
|
47
|
-
</option>
|
|
48
|
-
</select>
|
|
49
|
-
</div>
|
|
50
|
-
</div>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<common-monitor-overview-filters-custom-interval-modal
|
|
54
|
-
v-
|
|
55
|
-
|
|
56
|
-
:
|
|
57
|
-
:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
import type {
|
|
67
|
-
import type {
|
|
68
|
-
import {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
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
|
-
const
|
|
114
|
-
isShowIntervalModal.value =
|
|
115
|
-
}
|
|
116
|
-
const
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
props.
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
props.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const
|
|
153
|
-
|
|
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
|
-
flex-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="horizontal-flex-container overview-chart-title-bar">
|
|
3
|
+
<div class="horizontal-flex-container">
|
|
4
|
+
<label for="periodSelect" class="label-select"
|
|
5
|
+
>{{ localization.inventoryMonitor.period }}:</label
|
|
6
|
+
>
|
|
7
|
+
<div v-if="!disabledPeriodOptions" class="select">
|
|
8
|
+
<select
|
|
9
|
+
id="periodSelect"
|
|
10
|
+
v-model="selectedPeriod"
|
|
11
|
+
data-id="period-select"
|
|
12
|
+
>
|
|
13
|
+
<option
|
|
14
|
+
v-for="(item, index) in periodOptions"
|
|
15
|
+
:key="index"
|
|
16
|
+
:value="item.value"
|
|
17
|
+
>
|
|
18
|
+
{{ item.text }}
|
|
19
|
+
</option>
|
|
20
|
+
</select>
|
|
21
|
+
</div>
|
|
22
|
+
<span v-else class="single-option">{{ periodOptions[0].text }}</span>
|
|
23
|
+
</div>
|
|
24
|
+
<div v-show="isShowCustomIntervalButton">
|
|
25
|
+
<a
|
|
26
|
+
id="show-interval-modal-button"
|
|
27
|
+
data-id="show-interval-modal-button"
|
|
28
|
+
@click="onShowIntervalModal"
|
|
29
|
+
>{{ localization.inventoryMonitor.changeCustomInterval }}</a
|
|
30
|
+
>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="!disabledPeriodOptions" class="chart-title">
|
|
33
|
+
{{ chartTitleDate }}
|
|
34
|
+
</div>
|
|
35
|
+
<div class="view-select-label horizontal-flex-container">
|
|
36
|
+
<label for="viewSelect" class="label-select"
|
|
37
|
+
>{{ localization.common.view }}:</label
|
|
38
|
+
>
|
|
39
|
+
<div class="select">
|
|
40
|
+
<select id="viewSelect" v-model="selectedView" data-id="view-select">
|
|
41
|
+
<option
|
|
42
|
+
v-for="(item, index) in viewOptions"
|
|
43
|
+
:key="index"
|
|
44
|
+
:value="item.value"
|
|
45
|
+
>
|
|
46
|
+
{{ item.text }}
|
|
47
|
+
</option>
|
|
48
|
+
</select>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<common-monitor-overview-filters-custom-interval-modal
|
|
54
|
+
v-if="props.validDateEnd"
|
|
55
|
+
v-show="isShowIntervalModal"
|
|
56
|
+
:selected-periods="props.selectedPeriods"
|
|
57
|
+
:format-date="props.formatDate"
|
|
58
|
+
:current-lang="props.currentLang"
|
|
59
|
+
:valid-date-end="props.validDateEnd"
|
|
60
|
+
@hide="onHideIntervalModal"
|
|
61
|
+
@submit="onSubmitIntervalModal"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
|
|
65
|
+
<script setup lang="ts">
|
|
66
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
67
|
+
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
68
|
+
import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
|
|
69
|
+
import type { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
|
|
70
|
+
import {
|
|
71
|
+
periodFunc,
|
|
72
|
+
viewFunc,
|
|
73
|
+
} from '~/components/common/monitor/overview/filters/lib/config/filterOptions'
|
|
74
|
+
import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
|
|
75
|
+
|
|
76
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
77
|
+
const { $formattedDatetime } = useNuxtApp()
|
|
78
|
+
|
|
79
|
+
const props = defineProps<{
|
|
80
|
+
startDate: number
|
|
81
|
+
endDate: number
|
|
82
|
+
chartType: 'spline' | 'pie'
|
|
83
|
+
view: UI_T_OverviewViewType
|
|
84
|
+
selectedPeriods: number[]
|
|
85
|
+
formatDate: string
|
|
86
|
+
currentLang: string
|
|
87
|
+
validDateEnd: number
|
|
88
|
+
formatTime?: string
|
|
89
|
+
}>()
|
|
90
|
+
|
|
91
|
+
const emits = defineEmits<{
|
|
92
|
+
(event: 'update-filters', value: UI_I_MonitorGraphPayload): void
|
|
93
|
+
(event: 'update-custom-date', value: number[]): void
|
|
94
|
+
}>()
|
|
95
|
+
|
|
96
|
+
const selectedPeriod = ref<string>('')
|
|
97
|
+
const periodOptions = computed<UI_I_OptionItem[]>(() =>
|
|
98
|
+
periodFunc(localization.value)
|
|
99
|
+
)
|
|
100
|
+
watch(
|
|
101
|
+
() => periodOptions.value,
|
|
102
|
+
(newValue: UI_I_OptionItem[]) => {
|
|
103
|
+
if (newValue) selectedPeriod.value = newValue[0].value
|
|
104
|
+
},
|
|
105
|
+
{ immediate: true }
|
|
106
|
+
)
|
|
107
|
+
|
|
108
|
+
const isShowCustomIntervalButton = computed<boolean>(
|
|
109
|
+
() => selectedPeriod.value === 'custom_interval'
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
const isShowIntervalModal = ref<boolean>(false)
|
|
113
|
+
const onShowIntervalModal = (): void => {
|
|
114
|
+
isShowIntervalModal.value = true
|
|
115
|
+
}
|
|
116
|
+
const onHideIntervalModal = (): void => {
|
|
117
|
+
isShowIntervalModal.value = false
|
|
118
|
+
}
|
|
119
|
+
const onSubmitIntervalModal = (customDates: number[]): void => {
|
|
120
|
+
customDatesData.value = customDates
|
|
121
|
+
sendUpdatedFilters()
|
|
122
|
+
onHideIntervalModal()
|
|
123
|
+
emits('update-custom-date', customDates)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const chartTitleDate = computed<string>(() => {
|
|
127
|
+
const startValue = props.startDate
|
|
128
|
+
const endValue = props.endDate
|
|
129
|
+
if (!startValue && !endValue) return ''
|
|
130
|
+
|
|
131
|
+
const start = $formattedDatetime(
|
|
132
|
+
startValue,
|
|
133
|
+
props.formatDate,
|
|
134
|
+
true,
|
|
135
|
+
'',
|
|
136
|
+
props.formatTime
|
|
137
|
+
)
|
|
138
|
+
const end = $formattedDatetime(
|
|
139
|
+
endValue,
|
|
140
|
+
props.formatDate,
|
|
141
|
+
true,
|
|
142
|
+
'',
|
|
143
|
+
props.formatTime
|
|
144
|
+
)
|
|
145
|
+
return `${start} - ${end}`
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
// const disabledPeriodOptions = computed<boolean>(
|
|
149
|
+
// () => props.chartType === 'pie' || !chartTitleDate.value
|
|
150
|
+
// )
|
|
151
|
+
|
|
152
|
+
const disabledPeriodOptions = computed<boolean>(() => props.chartType === 'pie')
|
|
153
|
+
|
|
154
|
+
const selectedView = ref<string>('')
|
|
155
|
+
const viewOptions = computed<UI_I_OptionItem[]>(() =>
|
|
156
|
+
viewFunc(localization.value, props.view)
|
|
157
|
+
)
|
|
158
|
+
watch(
|
|
159
|
+
() => viewOptions.value,
|
|
160
|
+
(newValue: UI_I_OptionItem[]) => {
|
|
161
|
+
if (newValue) selectedView.value = newValue[0].value
|
|
162
|
+
},
|
|
163
|
+
{ immediate: true }
|
|
164
|
+
)
|
|
165
|
+
|
|
166
|
+
const customDatesData = ref<number[]>([])
|
|
167
|
+
const sendUpdatedFilters = (): void => {
|
|
168
|
+
const currentPeriod =
|
|
169
|
+
selectedPeriod.value === 'custom_interval'
|
|
170
|
+
? customDatesData.value
|
|
171
|
+
: getValidDateByOptionFunc(selectedPeriod.value)
|
|
172
|
+
const filters: UI_I_MonitorGraphPayload = {
|
|
173
|
+
period: currentPeriod,
|
|
174
|
+
view: selectedView.value,
|
|
175
|
+
periodName: selectedPeriod.value,
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
emits('update-filters', filters)
|
|
179
|
+
}
|
|
180
|
+
watch(
|
|
181
|
+
() => [selectedPeriod.value, selectedView.value],
|
|
182
|
+
() => {
|
|
183
|
+
sendUpdatedFilters()
|
|
184
|
+
},
|
|
185
|
+
{ immediate: true }
|
|
186
|
+
)
|
|
187
|
+
</script>
|
|
188
|
+
|
|
189
|
+
<style scoped lang="scss">
|
|
190
|
+
.horizontal-flex-container {
|
|
191
|
+
display: flex;
|
|
192
|
+
flex-direction: row;
|
|
193
|
+
align-items: center;
|
|
194
|
+
line-height: 20px;
|
|
195
|
+
flex-shrink: 0;
|
|
196
|
+
padding-top: 5px;
|
|
197
|
+
|
|
198
|
+
.select {
|
|
199
|
+
position: relative;
|
|
200
|
+
|
|
201
|
+
select {
|
|
202
|
+
height: 20px;
|
|
203
|
+
margin: 5px;
|
|
204
|
+
color: var(--global-font-color);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
.single-option {
|
|
208
|
+
margin-left: 5px;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.chart-title {
|
|
212
|
+
color: var(--global-font-color);
|
|
213
|
+
text-overflow: ellipsis;
|
|
214
|
+
white-space: nowrap;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
margin: 6px;
|
|
217
|
+
font-weight: 700;
|
|
218
|
+
text-transform: uppercase;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
#show-interval-modal-button {
|
|
222
|
+
cursor: pointer;
|
|
223
|
+
color: var(--dropdown-item-color);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.view-select-label {
|
|
227
|
+
margin-left: auto;
|
|
228
|
+
padding-right: 7px;
|
|
229
|
+
padding-left: 7px;
|
|
230
|
+
text-overflow: ellipsis;
|
|
231
|
+
white-space: nowrap;
|
|
232
|
+
align-items: center;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
</style>
|
package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue
CHANGED
|
@@ -1,240 +1,242 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<atoms-modal
|
|
3
|
-
width="580px"
|
|
4
|
-
class="add-permission"
|
|
5
|
-
:show="true"
|
|
6
|
-
:title="titleIntervalModal"
|
|
7
|
-
:second-title="selectedItem"
|
|
8
|
-
test-id="overview-custom-interval-modal"
|
|
9
|
-
@hide="onHide"
|
|
10
|
-
@submit="onSubmit"
|
|
11
|
-
>
|
|
12
|
-
<template #modalBody>
|
|
13
|
-
<atoms-alert
|
|
14
|
-
v-show="alertShow"
|
|
15
|
-
status="alert-danger"
|
|
16
|
-
:items="alertItems"
|
|
17
|
-
test-id="overview-alert"
|
|
18
|
-
@remove="alertShow = false"
|
|
19
|
-
/>
|
|
20
|
-
|
|
21
|
-
<table>
|
|
22
|
-
<tbody>
|
|
23
|
-
<tr>
|
|
24
|
-
<td class="text-right">
|
|
25
|
-
<label class="custom-time-label">
|
|
26
|
-
<span class="custom-time-label-text text-capitalize">
|
|
27
|
-
{{ localization.common.from }}:
|
|
28
|
-
</span>
|
|
29
|
-
</label>
|
|
30
|
-
</td>
|
|
31
|
-
<td>
|
|
32
|
-
<div class="flex-align-center input-row-container">
|
|
33
|
-
<input
|
|
34
|
-
id="current-date-from"
|
|
35
|
-
v-model.lazy="currentDateFrom"
|
|
36
|
-
data-id="current-date-from-input"
|
|
37
|
-
type="text"
|
|
38
|
-
class="chart-option-setting-row custom-time-input first-from"
|
|
39
|
-
/>
|
|
40
|
-
<div class="section-datepicker">
|
|
41
|
-
<atoms-datepicker
|
|
42
|
-
v-model="dateFrom"
|
|
43
|
-
:lang="props.currentLang"
|
|
44
|
-
class="chart-option-setting-row custom-time-input"
|
|
45
|
-
test-id="overview-first-date-datepicker"
|
|
46
|
-
@update="onUpdateDateFrom"
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
49
|
-
<input
|
|
50
|
-
id="current-time-from"
|
|
51
|
-
v-model="currentTimeFrom"
|
|
52
|
-
data-id="current-time-from-input"
|
|
53
|
-
type="text"
|
|
54
|
-
class="chart-option-setting-row custom-time-input"
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
</td>
|
|
58
|
-
</tr>
|
|
59
|
-
<tr>
|
|
60
|
-
<td class="text-right">
|
|
61
|
-
<label class="custom-time-label">
|
|
62
|
-
<span class="custom-time-label-text text-capitalize">
|
|
63
|
-
{{ localization.common.to }}:
|
|
64
|
-
</span>
|
|
65
|
-
</label>
|
|
66
|
-
</td>
|
|
67
|
-
<td>
|
|
68
|
-
<div class="flex-align-center input-row-container">
|
|
69
|
-
<input
|
|
70
|
-
id="current-date-to"
|
|
71
|
-
v-model.lazy="currentDateTo"
|
|
72
|
-
data-id="current-date-to-input"
|
|
73
|
-
type="text"
|
|
74
|
-
class="chart-option-setting-row custom-time-input first-from"
|
|
75
|
-
/>
|
|
76
|
-
<div class="section-datepicker">
|
|
77
|
-
<atoms-datepicker
|
|
78
|
-
v-model="dateTo"
|
|
79
|
-
:lang="props.currentLang"
|
|
80
|
-
class="chart-option-setting-row custom-time-input"
|
|
81
|
-
test-id="overview-first-date-to-datepicker"
|
|
82
|
-
@update="onUpdateDateTo"
|
|
83
|
-
/>
|
|
84
|
-
</div>
|
|
85
|
-
<input
|
|
86
|
-
id="current-time-to"
|
|
87
|
-
v-model="currentTimeTo"
|
|
88
|
-
data-id="current-time-to-input"
|
|
89
|
-
type="text"
|
|
90
|
-
class="chart-option-setting-row custom-time-input"
|
|
91
|
-
/>
|
|
92
|
-
</div>
|
|
93
|
-
</td>
|
|
94
|
-
</tr>
|
|
95
|
-
<tr>
|
|
96
|
-
<td></td>
|
|
97
|
-
<td class="text-format-date">
|
|
98
|
-
(date and time are in ISO 8601 format)
|
|
99
|
-
</td>
|
|
100
|
-
</tr>
|
|
101
|
-
</tbody>
|
|
102
|
-
</table>
|
|
103
|
-
</template>
|
|
104
|
-
</atoms-modal>
|
|
105
|
-
</template>
|
|
106
|
-
|
|
107
|
-
<script setup lang="ts">
|
|
108
|
-
import { format } from 'date-fns'
|
|
109
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
|
-
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
111
|
-
|
|
112
|
-
const props = defineProps<{
|
|
113
|
-
formatDate: string
|
|
114
|
-
selectedPeriods: number[]
|
|
115
|
-
currentLang: string
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
(event: '
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
currentTimeFrom.value =
|
|
154
|
-
currentTimeTo.value =
|
|
155
|
-
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
currentDateFrom.value = $formattedDate(
|
|
160
|
-
props.selectedPeriods[0],
|
|
161
|
-
props.formatDate
|
|
162
|
-
)
|
|
163
|
-
currentDateTo.value = $formattedDate(
|
|
164
|
-
props.selectedPeriods[1],
|
|
165
|
-
props.formatDate
|
|
166
|
-
)
|
|
167
|
-
currentTimeFrom.value = $formattedTime(props.selectedPeriods[0], '', true)
|
|
168
|
-
currentTimeTo.value = $formattedTime(props.selectedPeriods[1], '', true)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const onUpdateDateFrom = (val: number): void => {
|
|
172
|
-
if (!val) return
|
|
173
|
-
|
|
174
|
-
currentDateFrom.value = $formattedDate(new Date(val), props.formatDate)
|
|
175
|
-
}
|
|
176
|
-
watch(currentDateFrom, (newValue) => {
|
|
177
|
-
if (!newValue) return
|
|
178
|
-
|
|
179
|
-
if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
|
|
180
|
-
})
|
|
181
|
-
|
|
182
|
-
const onUpdateDateTo = (val: number): void => {
|
|
183
|
-
if (!val) return
|
|
184
|
-
|
|
185
|
-
currentDateTo.value = $formattedDate(new Date(val), props.formatDate)
|
|
186
|
-
}
|
|
187
|
-
watch(currentDateTo, (newValue) => {
|
|
188
|
-
if (!newValue) return
|
|
189
|
-
|
|
190
|
-
if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
const alertShow = ref<boolean>(false)
|
|
194
|
-
const alertItems = ref<string[]>([])
|
|
195
|
-
|
|
196
|
-
const onSubmit = (): void => {
|
|
197
|
-
alertItems.value = []
|
|
198
|
-
alertShow.value = false
|
|
199
|
-
|
|
200
|
-
if (!dateFrom.value || !dateTo.value) return
|
|
201
|
-
|
|
202
|
-
const result = checkDateFunc(
|
|
203
|
-
localization.value,
|
|
204
|
-
currentDateFrom.value,
|
|
205
|
-
currentDateTo.value,
|
|
206
|
-
currentTimeFrom.value,
|
|
207
|
-
currentTimeTo.value
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<atoms-modal
|
|
3
|
+
width="580px"
|
|
4
|
+
class="add-permission"
|
|
5
|
+
:show="true"
|
|
6
|
+
:title="titleIntervalModal"
|
|
7
|
+
:second-title="selectedItem"
|
|
8
|
+
test-id="overview-custom-interval-modal"
|
|
9
|
+
@hide="onHide"
|
|
10
|
+
@submit="onSubmit"
|
|
11
|
+
>
|
|
12
|
+
<template #modalBody>
|
|
13
|
+
<atoms-alert
|
|
14
|
+
v-show="alertShow"
|
|
15
|
+
status="alert-danger"
|
|
16
|
+
:items="alertItems"
|
|
17
|
+
test-id="overview-alert"
|
|
18
|
+
@remove="alertShow = false"
|
|
19
|
+
/>
|
|
20
|
+
|
|
21
|
+
<table>
|
|
22
|
+
<tbody>
|
|
23
|
+
<tr>
|
|
24
|
+
<td class="text-right">
|
|
25
|
+
<label class="custom-time-label">
|
|
26
|
+
<span class="custom-time-label-text text-capitalize">
|
|
27
|
+
{{ localization.common.from }}:
|
|
28
|
+
</span>
|
|
29
|
+
</label>
|
|
30
|
+
</td>
|
|
31
|
+
<td>
|
|
32
|
+
<div class="flex-align-center input-row-container">
|
|
33
|
+
<input
|
|
34
|
+
id="current-date-from"
|
|
35
|
+
v-model.lazy="currentDateFrom"
|
|
36
|
+
data-id="current-date-from-input"
|
|
37
|
+
type="text"
|
|
38
|
+
class="chart-option-setting-row custom-time-input first-from"
|
|
39
|
+
/>
|
|
40
|
+
<div class="section-datepicker">
|
|
41
|
+
<atoms-datepicker
|
|
42
|
+
v-model="dateFrom"
|
|
43
|
+
:lang="props.currentLang"
|
|
44
|
+
class="chart-option-setting-row custom-time-input"
|
|
45
|
+
test-id="overview-first-date-datepicker"
|
|
46
|
+
@update="onUpdateDateFrom"
|
|
47
|
+
/>
|
|
48
|
+
</div>
|
|
49
|
+
<input
|
|
50
|
+
id="current-time-from"
|
|
51
|
+
v-model="currentTimeFrom"
|
|
52
|
+
data-id="current-time-from-input"
|
|
53
|
+
type="text"
|
|
54
|
+
class="chart-option-setting-row custom-time-input"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
<tr>
|
|
60
|
+
<td class="text-right">
|
|
61
|
+
<label class="custom-time-label">
|
|
62
|
+
<span class="custom-time-label-text text-capitalize">
|
|
63
|
+
{{ localization.common.to }}:
|
|
64
|
+
</span>
|
|
65
|
+
</label>
|
|
66
|
+
</td>
|
|
67
|
+
<td>
|
|
68
|
+
<div class="flex-align-center input-row-container">
|
|
69
|
+
<input
|
|
70
|
+
id="current-date-to"
|
|
71
|
+
v-model.lazy="currentDateTo"
|
|
72
|
+
data-id="current-date-to-input"
|
|
73
|
+
type="text"
|
|
74
|
+
class="chart-option-setting-row custom-time-input first-from"
|
|
75
|
+
/>
|
|
76
|
+
<div class="section-datepicker">
|
|
77
|
+
<atoms-datepicker
|
|
78
|
+
v-model="dateTo"
|
|
79
|
+
:lang="props.currentLang"
|
|
80
|
+
class="chart-option-setting-row custom-time-input"
|
|
81
|
+
test-id="overview-first-date-to-datepicker"
|
|
82
|
+
@update="onUpdateDateTo"
|
|
83
|
+
/>
|
|
84
|
+
</div>
|
|
85
|
+
<input
|
|
86
|
+
id="current-time-to"
|
|
87
|
+
v-model="currentTimeTo"
|
|
88
|
+
data-id="current-time-to-input"
|
|
89
|
+
type="text"
|
|
90
|
+
class="chart-option-setting-row custom-time-input"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</td>
|
|
94
|
+
</tr>
|
|
95
|
+
<tr>
|
|
96
|
+
<td></td>
|
|
97
|
+
<td class="text-format-date">
|
|
98
|
+
(date and time are in ISO 8601 format)
|
|
99
|
+
</td>
|
|
100
|
+
</tr>
|
|
101
|
+
</tbody>
|
|
102
|
+
</table>
|
|
103
|
+
</template>
|
|
104
|
+
</atoms-modal>
|
|
105
|
+
</template>
|
|
106
|
+
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import { format } from 'date-fns'
|
|
109
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
110
|
+
import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
|
|
111
|
+
|
|
112
|
+
const props = defineProps<{
|
|
113
|
+
formatDate: string
|
|
114
|
+
selectedPeriods: number[]
|
|
115
|
+
currentLang: string
|
|
116
|
+
validDateEnd: number
|
|
117
|
+
}>()
|
|
118
|
+
|
|
119
|
+
const emits = defineEmits<{
|
|
120
|
+
(event: 'hide'): void
|
|
121
|
+
(event: 'submit', value: number[]): void
|
|
122
|
+
}>()
|
|
123
|
+
|
|
124
|
+
const { $formattedDate, $formattedTime, $isDate, $getUnixByDate } = useNuxtApp()
|
|
125
|
+
|
|
126
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
127
|
+
|
|
128
|
+
const titleIntervalModal = ref<string>(
|
|
129
|
+
`${localization.value.common.timeRange}:`
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
const selectedItem = ref<string>('')
|
|
133
|
+
|
|
134
|
+
const onHide = (): void => {
|
|
135
|
+
getCurrentTime()
|
|
136
|
+
emits('hide')
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const yesterday = new Date().setDate(new Date().getDate() - 1)
|
|
140
|
+
const dateFrom = ref<number>(yesterday)
|
|
141
|
+
const dateTo = ref<number>(new Date().getTime())
|
|
142
|
+
|
|
143
|
+
const currentDateFrom = ref<string>('')
|
|
144
|
+
const currentDateTo = ref<string>('')
|
|
145
|
+
const currentTimeFrom = ref<string>('')
|
|
146
|
+
const currentTimeTo = ref<string>('')
|
|
147
|
+
|
|
148
|
+
const getCurrentTime = (): void => {
|
|
149
|
+
if (!props.selectedPeriods.length) {
|
|
150
|
+
currentDateFrom.value = $formattedDate(yesterday, props.formatDate)
|
|
151
|
+
currentDateTo.value = $formattedDate(props.validDateEnd, props.formatDate)
|
|
152
|
+
|
|
153
|
+
currentTimeFrom.value = format(new Date(), 'H:mm:ss')
|
|
154
|
+
currentTimeTo.value = format(props.validDateEnd, 'H:mm:ss')
|
|
155
|
+
|
|
156
|
+
return
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
currentDateFrom.value = $formattedDate(
|
|
160
|
+
props.selectedPeriods[0],
|
|
161
|
+
props.formatDate
|
|
162
|
+
)
|
|
163
|
+
currentDateTo.value = $formattedDate(
|
|
164
|
+
props.selectedPeriods[1],
|
|
165
|
+
props.formatDate
|
|
166
|
+
)
|
|
167
|
+
currentTimeFrom.value = $formattedTime(props.selectedPeriods[0], '', true)
|
|
168
|
+
currentTimeTo.value = $formattedTime(props.selectedPeriods[1], '', true)
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const onUpdateDateFrom = (val: number): void => {
|
|
172
|
+
if (!val) return
|
|
173
|
+
|
|
174
|
+
currentDateFrom.value = $formattedDate(new Date(val), props.formatDate)
|
|
175
|
+
}
|
|
176
|
+
watch(currentDateFrom, (newValue) => {
|
|
177
|
+
if (!newValue) return
|
|
178
|
+
|
|
179
|
+
if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
const onUpdateDateTo = (val: number): void => {
|
|
183
|
+
if (!val) return
|
|
184
|
+
|
|
185
|
+
currentDateTo.value = $formattedDate(new Date(val), props.formatDate)
|
|
186
|
+
}
|
|
187
|
+
watch(currentDateTo, (newValue) => {
|
|
188
|
+
if (!newValue) return
|
|
189
|
+
|
|
190
|
+
if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
const alertShow = ref<boolean>(false)
|
|
194
|
+
const alertItems = ref<string[]>([])
|
|
195
|
+
|
|
196
|
+
const onSubmit = (): void => {
|
|
197
|
+
alertItems.value = []
|
|
198
|
+
alertShow.value = false
|
|
199
|
+
|
|
200
|
+
if (!dateFrom.value || !dateTo.value) return
|
|
201
|
+
|
|
202
|
+
const result = checkDateFunc(
|
|
203
|
+
localization.value,
|
|
204
|
+
currentDateFrom.value,
|
|
205
|
+
currentDateTo.value,
|
|
206
|
+
currentTimeFrom.value,
|
|
207
|
+
currentTimeTo.value,
|
|
208
|
+
props.validDateEnd,
|
|
209
|
+
props.formatDate
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
if (typeof result === 'string') {
|
|
213
|
+
alertShow.value = true
|
|
214
|
+
alertItems.value.push(result)
|
|
215
|
+
return
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
emits('submit', [result[0], result[1]])
|
|
219
|
+
onHide()
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
onMounted(() => {
|
|
223
|
+
selectedItem.value = location.hostname
|
|
224
|
+
getCurrentTime()
|
|
225
|
+
onSubmit()
|
|
226
|
+
})
|
|
227
|
+
</script>
|
|
228
|
+
|
|
229
|
+
<style scoped lang="scss">
|
|
230
|
+
.input-row-container {
|
|
231
|
+
padding-left: 5px;
|
|
232
|
+
|
|
233
|
+
.custom-time-input {
|
|
234
|
+
max-width: 120px;
|
|
235
|
+
margin-right: 15px;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
.text-format-date {
|
|
239
|
+
display: inline-block;
|
|
240
|
+
margin-top: 5px;
|
|
241
|
+
}
|
|
242
|
+
</style>
|
package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts
CHANGED
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
|
|
3
|
-
const isMoreThanOneMonth = (startDate: number, endDate: number): boolean => {
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
!$isDate(
|
|
33
|
-
|
|
34
|
-
!
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
result
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
result =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
|
|
3
|
+
const isMoreThanOneMonth = (startDate: number, endDate: number): boolean => {
|
|
4
|
+
const date1 = new Date(startDate)
|
|
5
|
+
const date2 = new Date(endDate)
|
|
6
|
+
|
|
7
|
+
const nextMonth = new Date(date1)
|
|
8
|
+
nextMonth.setMonth(date1.getMonth() + 1)
|
|
9
|
+
|
|
10
|
+
return nextMonth < date2
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const checkDateFunc = (
|
|
14
|
+
localization: UI_I_Localization,
|
|
15
|
+
dateFrom: string,
|
|
16
|
+
dateTo: string,
|
|
17
|
+
timeFrom: string,
|
|
18
|
+
timeTo: string,
|
|
19
|
+
unixValidEnd: number,
|
|
20
|
+
formatDate: string
|
|
21
|
+
): string | number[] => {
|
|
22
|
+
const { $isDate, $getUnixByDate } = useNuxtApp()
|
|
23
|
+
|
|
24
|
+
let result = ''
|
|
25
|
+
const startDate = dateFrom + ' ' + timeFrom
|
|
26
|
+
const unixStartDate = $getUnixByDate(startDate)
|
|
27
|
+
const endDate = dateTo + ' ' + timeTo
|
|
28
|
+
const unixEndDate = $getUnixByDate(endDate)
|
|
29
|
+
|
|
30
|
+
if (
|
|
31
|
+
!$isDate(unixStartDate) ||
|
|
32
|
+
!$isDate(unixEndDate) ||
|
|
33
|
+
!timeFrom ||
|
|
34
|
+
!timeTo
|
|
35
|
+
) {
|
|
36
|
+
result = localization.inventoryMonitor.invalidTimeEntry
|
|
37
|
+
return result
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (unixEndDate > unixValidEnd) {
|
|
41
|
+
const { $formattedDatetime } = useNuxtApp()
|
|
42
|
+
|
|
43
|
+
const currentShowValidEnd = $formattedDatetime(
|
|
44
|
+
new Date(unixValidEnd),
|
|
45
|
+
formatDate,
|
|
46
|
+
true
|
|
47
|
+
)
|
|
48
|
+
result =
|
|
49
|
+
localization.inventoryMonitor.timeRangeShouldNotBeMoreThanValidTo.replace(
|
|
50
|
+
'{0}',
|
|
51
|
+
currentShowValidEnd
|
|
52
|
+
)
|
|
53
|
+
} else if (unixEndDate === unixStartDate)
|
|
54
|
+
result = localization.inventoryMonitor.timeToShouldBeLaterTimeFrom
|
|
55
|
+
else if (unixEndDate - unixStartDate <= 3600000)
|
|
56
|
+
result = localization.inventoryMonitor.timeRangeShouldNotBeSmallerThanHour
|
|
57
|
+
else if (isMoreThanOneMonth(unixStartDate, unixEndDate))
|
|
58
|
+
result = localization.inventoryMonitor.timeRangeShouldNotBeMoreThanMonth
|
|
59
|
+
else return [unixStartDate, unixEndDate]
|
|
60
|
+
|
|
61
|
+
return result
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bfg-common",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.4.
|
|
4
|
+
"version": "1.4.719",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "nuxt build",
|
|
7
7
|
"dev": "nuxt dev --port=3002",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@vueuse/components": "^10.1.2",
|
|
36
36
|
"date-fns": "^2.29.3",
|
|
37
37
|
"bfg-nuxt-3-graph": "1.0.15",
|
|
38
|
-
"bfg-uikit": "1.0.
|
|
38
|
+
"bfg-uikit": "1.0.301",
|
|
39
39
|
"html2canvas": "^1.4.1",
|
|
40
40
|
"prettier-eslint": "^15.0.1"
|
|
41
41
|
}
|