bfg-common 1.1.30 → 1.1.31
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 +4 -1
- package/assets/localization/local_en.json +4 -1
- package/assets/localization/local_hy.json +4 -1
- package/assets/localization/local_kk.json +4 -1
- package/assets/localization/local_ru.json +4 -1
- package/assets/localization/local_zh.json +4 -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 +174 -174
- 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 +204 -204
- 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/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/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/Confirmation.vue +18 -4
- package/components/common/modals/Rename.vue +165 -165
- package/components/common/monitor/advanced/Advanced.vue +22 -0
- package/components/common/monitor/advanced/tools/Tools.vue +78 -7
- package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +218 -9
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +80 -9
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/config/optionsActions.ts +22 -10
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +27 -4
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +16 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +16 -0
- package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +100 -29
- package/components/common/monitor/advanced/tools/config/advancedToolbar.ts +29 -3
- package/components/common/perPage/PerPage.vue +51 -51
- package/components/common/recursionTree/RecursionTree.vue +201 -201
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +445 -445
- 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/index.ts +92 -92
- 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
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
:show="true"
|
|
6
6
|
:title="localization.chartOptions"
|
|
7
7
|
@hide="onHide"
|
|
8
|
-
@submit="
|
|
8
|
+
@submit="onSubmit"
|
|
9
9
|
>
|
|
10
10
|
<template #modalBody>
|
|
11
11
|
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
@@ -14,7 +14,15 @@
|
|
|
14
14
|
@remove="onRemoveAlerts"
|
|
15
15
|
/>
|
|
16
16
|
<div>
|
|
17
|
-
<common-monitor-advanced-tools-chart-options-modal-actions
|
|
17
|
+
<common-monitor-advanced-tools-chart-options-modal-actions
|
|
18
|
+
:is-disabled-save="!selectedRows.length"
|
|
19
|
+
:options-names="optionsNames"
|
|
20
|
+
:selected-chart-option-name="localSelectedChartOptionName"
|
|
21
|
+
@save="onSaveOptions"
|
|
22
|
+
@check-validation="checkValidations"
|
|
23
|
+
@select-local-option-name="onSelectLocalOptionName"
|
|
24
|
+
@delete-chart-name="onDeleteChartName"
|
|
25
|
+
/>
|
|
18
26
|
|
|
19
27
|
<div class="horizontal-flex-container chart-options-content">
|
|
20
28
|
<common-monitor-advanced-tools-chart-options-modal-metrics
|
|
@@ -25,10 +33,18 @@
|
|
|
25
33
|
:chart="selectedMetric"
|
|
26
34
|
:language="props.language"
|
|
27
35
|
:type="props.type"
|
|
28
|
-
:selected-keys="
|
|
29
|
-
:selected-chart-type="
|
|
36
|
+
:selected-keys="localSelectedCountersKeys"
|
|
37
|
+
:selected-chart-type="localSelectedChartType"
|
|
38
|
+
:selected-timespan-type="localSelectedTimespanType"
|
|
39
|
+
:units-count="localUnitsCount"
|
|
40
|
+
:period-type="localPeriodType"
|
|
41
|
+
:selected-custom-time="localCustomTime"
|
|
30
42
|
@select-row="selectedRows = $event"
|
|
31
|
-
@update-chart-type="
|
|
43
|
+
@update-chart-type="selectedChartTypeLocal = $event"
|
|
44
|
+
@update-custom-time="localCustomTime = $event"
|
|
45
|
+
@update-timespan-type="timespanType = $event"
|
|
46
|
+
@update-unit-count="unitCount = $event"
|
|
47
|
+
@update-period-type="localPeriodType = $event"
|
|
32
48
|
/>
|
|
33
49
|
</div>
|
|
34
50
|
</div>
|
|
@@ -47,6 +63,7 @@ import {
|
|
|
47
63
|
T_ChartVm,
|
|
48
64
|
} from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
|
|
49
65
|
import { metricsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/metrics/config/optionsMetrics'
|
|
66
|
+
import { getCurrentOptionsStorageFunc } from '~/components/common/monitor/advanced/tools/config/advancedToolbar'
|
|
50
67
|
|
|
51
68
|
const props = defineProps<{
|
|
52
69
|
type: UI_T_AdvancedType
|
|
@@ -54,6 +71,11 @@ const props = defineProps<{
|
|
|
54
71
|
selectedCountersKeys: number[]
|
|
55
72
|
selectedMetric: T_ChartHost | T_ChartVm
|
|
56
73
|
selectedChartType: string
|
|
74
|
+
selectedTimespanType: string
|
|
75
|
+
unitsCount: number
|
|
76
|
+
periodType: string
|
|
77
|
+
selectedCustomTime: string
|
|
78
|
+
selectedChartOptionName: string
|
|
57
79
|
}>()
|
|
58
80
|
|
|
59
81
|
const emits = defineEmits<{
|
|
@@ -61,8 +83,17 @@ const emits = defineEmits<{
|
|
|
61
83
|
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
62
84
|
(event: 'select-metric', value: string): void
|
|
63
85
|
(event: 'update-chart-type', value: string): void
|
|
86
|
+
(event: 'update-timespan-type', value: string): void
|
|
87
|
+
(event: 'update-unit-count', value: number): void
|
|
88
|
+
(event: 'update-period-type', value: string): void
|
|
89
|
+
(event: 'update-custom-time', value: string): void
|
|
90
|
+
(event: 'select-chart-name', value: string): void
|
|
91
|
+
(event: 'delete-option'): void
|
|
92
|
+
(event: 'save-option-name'): void
|
|
64
93
|
}>()
|
|
65
94
|
|
|
95
|
+
const routeType = '' + useRoute().params.type
|
|
96
|
+
|
|
66
97
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
67
98
|
|
|
68
99
|
const metricsItems = computed<UI_I_VerticalTabs[]>(() =>
|
|
@@ -72,6 +103,60 @@ const selectedMetric = ref<T_ChartHost | T_ChartVm>(
|
|
|
72
103
|
props.selectedMetric || '' + metricsItems.value[0]?.value
|
|
73
104
|
)
|
|
74
105
|
|
|
106
|
+
const localSelectedCountersKeys = ref<number[]>([])
|
|
107
|
+
watch(
|
|
108
|
+
() => props.selectedCountersKeys,
|
|
109
|
+
(newValue) => {
|
|
110
|
+
localSelectedCountersKeys.value = newValue
|
|
111
|
+
},
|
|
112
|
+
{ immediate: true, deep: true }
|
|
113
|
+
)
|
|
114
|
+
|
|
115
|
+
const localSelectedChartType = ref<string>('')
|
|
116
|
+
watch(
|
|
117
|
+
() => props.selectedChartType,
|
|
118
|
+
(newValue) => {
|
|
119
|
+
localSelectedChartType.value = newValue
|
|
120
|
+
},
|
|
121
|
+
{ immediate: true }
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
const localSelectedTimespanType = ref<string>('')
|
|
125
|
+
watch(
|
|
126
|
+
() => props.selectedTimespanType,
|
|
127
|
+
(newValue) => {
|
|
128
|
+
localSelectedTimespanType.value = newValue
|
|
129
|
+
},
|
|
130
|
+
{ immediate: true }
|
|
131
|
+
)
|
|
132
|
+
|
|
133
|
+
const localUnitsCount = ref<number>(0)
|
|
134
|
+
watch(
|
|
135
|
+
() => props.unitsCount,
|
|
136
|
+
(newValue) => {
|
|
137
|
+
localUnitsCount.value = newValue
|
|
138
|
+
},
|
|
139
|
+
{ immediate: true }
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
const localPeriodType = ref<string>('')
|
|
143
|
+
watch(
|
|
144
|
+
() => props.periodType,
|
|
145
|
+
(newValue) => {
|
|
146
|
+
localPeriodType.value = newValue
|
|
147
|
+
},
|
|
148
|
+
{ immediate: true }
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
const localCustomTime = ref<string>('')
|
|
152
|
+
watch(
|
|
153
|
+
() => props.selectedCustomTime,
|
|
154
|
+
(newValue) => {
|
|
155
|
+
localCustomTime.value = newValue
|
|
156
|
+
},
|
|
157
|
+
{ immediate: true }
|
|
158
|
+
)
|
|
159
|
+
|
|
75
160
|
const isShowAlerts = ref<boolean>(false)
|
|
76
161
|
const alerts = ref<string[]>([''])
|
|
77
162
|
|
|
@@ -85,10 +170,15 @@ const onHide = (): void => {
|
|
|
85
170
|
}
|
|
86
171
|
|
|
87
172
|
const selectedRows = ref<UI_I_AdvancedCounterItem[]>([])
|
|
88
|
-
const
|
|
173
|
+
const selectedChartTypeLocal = ref<string>('')
|
|
89
174
|
|
|
90
175
|
const checkValidations = (): boolean => {
|
|
91
|
-
if (selectedRows.value.length)
|
|
176
|
+
if (selectedRows.value.length) {
|
|
177
|
+
alerts.value = []
|
|
178
|
+
isShowAlerts.value = false
|
|
179
|
+
|
|
180
|
+
return true
|
|
181
|
+
}
|
|
92
182
|
|
|
93
183
|
alerts.value = [localization.value.noCountersSelected]
|
|
94
184
|
isShowAlerts.value = true
|
|
@@ -96,14 +186,133 @@ const checkValidations = (): boolean => {
|
|
|
96
186
|
return false
|
|
97
187
|
}
|
|
98
188
|
|
|
99
|
-
const
|
|
189
|
+
const localSelectedChartOptionName = ref<string>('')
|
|
190
|
+
watch(
|
|
191
|
+
() => props.selectedChartOptionName,
|
|
192
|
+
(newValue) => {
|
|
193
|
+
localSelectedChartOptionName.value = newValue
|
|
194
|
+
},
|
|
195
|
+
{ immediate: true }
|
|
196
|
+
)
|
|
197
|
+
|
|
198
|
+
const selectedLocalOptionName = ref<string>('')
|
|
199
|
+
|
|
200
|
+
const onSubmit = (): void => {
|
|
100
201
|
if (!checkValidations()) return
|
|
101
202
|
|
|
203
|
+
if (['select_options', 'default'].includes(selectedLocalOptionName.value))
|
|
204
|
+
selectedLocalOptionName.value = 'custom'
|
|
205
|
+
|
|
206
|
+
onSaveOptions(selectedLocalOptionName.value)
|
|
207
|
+
|
|
102
208
|
emits('select-metric', selectedMetric.value)
|
|
103
209
|
emits('select-row', selectedRows.value)
|
|
104
|
-
emits('update-chart-type',
|
|
210
|
+
emits('update-chart-type', selectedChartTypeLocal.value)
|
|
211
|
+
emits('update-timespan-type', timespanType.value)
|
|
212
|
+
emits('update-unit-count', unitCount.value)
|
|
213
|
+
emits('update-period-type', localPeriodType.value)
|
|
214
|
+
emits('update-custom-time', localCustomTime.value)
|
|
215
|
+
emits('select-chart-name', selectedLocalOptionName.value)
|
|
105
216
|
onHide()
|
|
106
217
|
}
|
|
218
|
+
|
|
219
|
+
const timespanType = ref<string>('')
|
|
220
|
+
const unitCount = ref<number>(1)
|
|
221
|
+
|
|
222
|
+
const optionsNames = ref<string[]>([])
|
|
223
|
+
|
|
224
|
+
const onSaveOptions = (name: string): void => {
|
|
225
|
+
const counters = selectedRows.value.map((item) => {
|
|
226
|
+
return {
|
|
227
|
+
id: item.id,
|
|
228
|
+
name: item.nameEn,
|
|
229
|
+
}
|
|
230
|
+
})
|
|
231
|
+
let chartType = 'line_graph'
|
|
232
|
+
if (selectedChartTypeLocal.value === 'spline') chartType = 'line_graph'
|
|
233
|
+
else if (selectedChartTypeLocal.value === 'area') chartType = 'stacked_graph'
|
|
234
|
+
|
|
235
|
+
const saveOptionsData = {
|
|
236
|
+
routeType,
|
|
237
|
+
chartType,
|
|
238
|
+
counters,
|
|
239
|
+
metric: selectedMetric.value,
|
|
240
|
+
timespan: {
|
|
241
|
+
periodType: localPeriodType.value,
|
|
242
|
+
units: localCustomTime.value,
|
|
243
|
+
unitsCount: unitCount.value,
|
|
244
|
+
type: timespanType.value,
|
|
245
|
+
},
|
|
246
|
+
}
|
|
247
|
+
useLocalStorage(`${name}ChartOptions`, saveOptionsData, false)
|
|
248
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
249
|
+
localSelectedChartOptionName.value = name
|
|
250
|
+
emits('save-option-name')
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
const setSelectOptions = (): void => {
|
|
254
|
+
setDefaultOptions()
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const setDefaultOptions = (): void => {
|
|
258
|
+
selectedMetric.value = metricsItems.value[0]?.value
|
|
259
|
+
localSelectedCountersKeys.value = []
|
|
260
|
+
localSelectedChartType.value = 'spline'
|
|
261
|
+
localSelectedTimespanType.value = ''
|
|
262
|
+
localUnitsCount.value = 0
|
|
263
|
+
localPeriodType.value = ''
|
|
264
|
+
localCustomTime.value = ''
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
const setCustomOptions = (name: string): void => {
|
|
268
|
+
const selectedValue = useLocalStorage(name + 'ChartOptions', undefined, false)
|
|
269
|
+
|
|
270
|
+
if (selectedValue.routeType !== routeType) return
|
|
271
|
+
|
|
272
|
+
let currentChartType = ''
|
|
273
|
+
if (selectedValue.chartType === 'line_graph') currentChartType = 'spline'
|
|
274
|
+
else if (selectedValue.chartType === 'stacked_graph')
|
|
275
|
+
currentChartType = 'area'
|
|
276
|
+
|
|
277
|
+
selectedMetric.value = selectedValue.metric
|
|
278
|
+
localSelectedCountersKeys.value = selectedValue.counters.map(
|
|
279
|
+
(item) => item.id
|
|
280
|
+
)
|
|
281
|
+
localSelectedChartType.value = currentChartType
|
|
282
|
+
localSelectedTimespanType.value = selectedValue.timespan.type
|
|
283
|
+
localUnitsCount.value = selectedValue.timespan.unitsCount
|
|
284
|
+
localPeriodType.value = selectedValue.timespan.periodType
|
|
285
|
+
localCustomTime.value = selectedValue.timespan.units
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const onSelectLocalOptionName = (name: string): void => {
|
|
289
|
+
selectedLocalOptionName.value = name
|
|
290
|
+
|
|
291
|
+
if (optionsNames.value.includes(name)) setCustomOptions(name)
|
|
292
|
+
else if (name === 'default') setDefaultOptions()
|
|
293
|
+
else if (name === 'select_options') setSelectOptions()
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
watch(
|
|
297
|
+
localSelectedChartOptionName,
|
|
298
|
+
(newValue) => {
|
|
299
|
+
if (!newValue) return
|
|
300
|
+
|
|
301
|
+
setCustomOptions(newValue)
|
|
302
|
+
},
|
|
303
|
+
{ immediate: true }
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
const onDeleteChartName = (name: string): void => {
|
|
307
|
+
window.localStorage.removeItem(name + 'ChartOptions')
|
|
308
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
309
|
+
setSelectOptions()
|
|
310
|
+
emits('delete-option')
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
onMounted(() => {
|
|
314
|
+
optionsNames.value = getCurrentOptionsStorageFunc(routeType)
|
|
315
|
+
})
|
|
107
316
|
</script>
|
|
108
317
|
|
|
109
318
|
<style scoped lang="scss">
|
|
@@ -5,12 +5,11 @@
|
|
|
5
5
|
>{{ localization.chartOptions }}:</label
|
|
6
6
|
>
|
|
7
7
|
<div class="select">
|
|
8
|
-
<select id="chartOptionsSelect" v-model="
|
|
8
|
+
<select id="chartOptionsSelect" v-model="localSelectedChartOption">
|
|
9
9
|
<option
|
|
10
10
|
v-for="item in chartOptions"
|
|
11
11
|
:key="item.value"
|
|
12
12
|
:value="item.value"
|
|
13
|
-
disabled
|
|
14
13
|
>
|
|
15
14
|
{{ item.text }}
|
|
16
15
|
</option>
|
|
@@ -25,15 +24,27 @@
|
|
|
25
24
|
{{ localization.saveOptionsAs }}...
|
|
26
25
|
</button>
|
|
27
26
|
<common-monitor-advanced-tools-chart-options-modal-actions-save-options-modal
|
|
28
|
-
v-
|
|
27
|
+
v-if="isShowSaveOptionsModal"
|
|
29
28
|
@hide="onHideSaveOptionsModal"
|
|
30
29
|
@save="onSaveOptions"
|
|
31
30
|
/>
|
|
32
|
-
<button
|
|
31
|
+
<button
|
|
32
|
+
class="btn chart-options-delete-button"
|
|
33
|
+
:disabled="!disabledDeleteAction"
|
|
34
|
+
@click="onDeleteAction"
|
|
35
|
+
>
|
|
33
36
|
{{ localization.deleteOptions }}
|
|
34
37
|
</button>
|
|
35
38
|
</div>
|
|
36
39
|
</div>
|
|
40
|
+
|
|
41
|
+
<common-modals-confirmation
|
|
42
|
+
v-if="isConfirmModal"
|
|
43
|
+
headline="localization.deletingSavedSettings"
|
|
44
|
+
:description="confirmModalDesc"
|
|
45
|
+
@hide-modal="isConfirmModal = false"
|
|
46
|
+
@confirm="onApplyDelete"
|
|
47
|
+
/>
|
|
37
48
|
</template>
|
|
38
49
|
|
|
39
50
|
<script setup lang="ts">
|
|
@@ -41,19 +52,79 @@ import { UI_I_Localization } from '~/models/interfaces'
|
|
|
41
52
|
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
42
53
|
import { chartOptionItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/actions/config/optionsActions'
|
|
43
54
|
|
|
55
|
+
const props = defineProps<{
|
|
56
|
+
isDisabledSave: boolean
|
|
57
|
+
optionsNames: string[]
|
|
58
|
+
selectedChartOptionName: string
|
|
59
|
+
}>()
|
|
60
|
+
|
|
61
|
+
const emits = defineEmits<{
|
|
62
|
+
(event: 'save', value: string): void
|
|
63
|
+
(event: 'check-validation'): void
|
|
64
|
+
(event: 'select-local-option-name', value: string): void
|
|
65
|
+
(event: 'delete-chart-name', value: string): void
|
|
66
|
+
}>()
|
|
67
|
+
|
|
44
68
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
45
69
|
|
|
46
|
-
const
|
|
70
|
+
const localSelectedChartOption = ref<string>('select_options')
|
|
71
|
+
const disabledDeleteAction = computed<boolean>(() => {
|
|
72
|
+
const chartOptionName = localSelectedChartOption.value
|
|
73
|
+
let result = false
|
|
74
|
+
|
|
75
|
+
if (chartOptionName !== 'select_options' && chartOptionName !== 'default')
|
|
76
|
+
result = true
|
|
77
|
+
|
|
78
|
+
return result
|
|
79
|
+
})
|
|
47
80
|
const chartOptions = computed<UI_I_OptionItem[]>(() =>
|
|
48
|
-
chartOptionItemsFunc(localization.value)
|
|
81
|
+
chartOptionItemsFunc(localization.value, props.optionsNames)
|
|
82
|
+
)
|
|
83
|
+
watch(
|
|
84
|
+
() => props.selectedChartOptionName,
|
|
85
|
+
(newValue) => {
|
|
86
|
+
localSelectedChartOption.value =
|
|
87
|
+
newValue || localSelectedChartOption.value || 'select_options'
|
|
88
|
+
},
|
|
89
|
+
{ immediate: true }
|
|
90
|
+
)
|
|
91
|
+
watch(
|
|
92
|
+
localSelectedChartOption,
|
|
93
|
+
(newValue) => {
|
|
94
|
+
emits('select-local-option-name', newValue)
|
|
95
|
+
},
|
|
96
|
+
{ immediate: true }
|
|
49
97
|
)
|
|
50
98
|
|
|
51
99
|
const isShowSaveOptionsModal = ref<boolean>(false)
|
|
52
|
-
const onShowSaveOptionsModal = ():
|
|
53
|
-
(isShowSaveOptionsModal.value = true
|
|
100
|
+
const onShowSaveOptionsModal = (): void => {
|
|
101
|
+
if (!props.isDisabledSave) isShowSaveOptionsModal.value = true
|
|
102
|
+
|
|
103
|
+
emits('check-validation')
|
|
104
|
+
}
|
|
54
105
|
const onHideSaveOptionsModal = (): boolean =>
|
|
55
106
|
(isShowSaveOptionsModal.value = false)
|
|
56
|
-
const onSaveOptions = ():
|
|
107
|
+
const onSaveOptions = (name: string): void => {
|
|
108
|
+
onHideSaveOptionsModal()
|
|
109
|
+
emits('save', name)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const isConfirmModal = ref<boolean>(false)
|
|
113
|
+
const confirmModalDesc = ref<string>('')
|
|
114
|
+
|
|
115
|
+
const onDeleteAction = (): void => {
|
|
116
|
+
confirmModalDesc.value = localization.value.deletingSavedSettingsDesc.replace(
|
|
117
|
+
'{0}',
|
|
118
|
+
localSelectedChartOption.value
|
|
119
|
+
)
|
|
120
|
+
isConfirmModal.value = true
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const onApplyDelete = (): void => {
|
|
124
|
+
isConfirmModal.value = false
|
|
125
|
+
emits('delete-chart-name', localSelectedChartOption.value)
|
|
126
|
+
localSelectedChartOption.value = 'select_options'
|
|
127
|
+
}
|
|
57
128
|
</script>
|
|
58
129
|
|
|
59
130
|
<style scoped lang="scss">
|
package/components/common/monitor/advanced/tools/chartOptionsModal/actions/config/optionsActions.ts
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { UI_I_Localization } from '~/models/interfaces'
|
|
2
2
|
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
3
3
|
|
|
4
|
-
export const chartOptionItemsFunc = (
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
export const chartOptionItemsFunc = (
|
|
5
|
+
localization: UI_I_Localization,
|
|
6
|
+
names: string[]
|
|
7
|
+
): UI_I_OptionItem[] => {
|
|
8
|
+
const mainOptionsNames = [
|
|
9
|
+
{
|
|
10
|
+
text: `--${localization.selectOption}--`,
|
|
11
|
+
value: 'select_options',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
text: localization.default,
|
|
15
|
+
value: 'default',
|
|
16
|
+
},
|
|
17
|
+
]
|
|
18
|
+
names.forEach((name) => {
|
|
19
|
+
mainOptionsNames.push({
|
|
20
|
+
text: name,
|
|
21
|
+
value: name,
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
return mainOptionsNames
|
|
25
|
+
}
|
|
@@ -7,11 +7,16 @@
|
|
|
7
7
|
@submit="onSave"
|
|
8
8
|
>
|
|
9
9
|
<template #modalBody>
|
|
10
|
+
<common-monitor-advanced-tools-chart-options-modal-notification
|
|
11
|
+
v-show="isShowAlerts"
|
|
12
|
+
:alerts="alerts"
|
|
13
|
+
@remove="onRemoveAlerts"
|
|
14
|
+
/>
|
|
10
15
|
<div class="form-control">
|
|
11
16
|
<label class="save-option-name-label" for="chartOptionsName"
|
|
12
17
|
>{{ localization.chartOptionsName }}:</label
|
|
13
18
|
>
|
|
14
|
-
<input id="chartOptionsName" type="text" />
|
|
19
|
+
<input id="chartOptionsName" v-model="name" type="text" />
|
|
15
20
|
</div>
|
|
16
21
|
</template>
|
|
17
22
|
</atoms-modal>
|
|
@@ -22,22 +27,40 @@ import { UI_I_Localization } from '~/models/interfaces'
|
|
|
22
27
|
|
|
23
28
|
const emits = defineEmits<{
|
|
24
29
|
(event: 'hide'): void
|
|
25
|
-
(event: 'save'): void
|
|
30
|
+
(event: 'save', value: string): void
|
|
26
31
|
}>()
|
|
27
32
|
|
|
28
33
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
29
34
|
|
|
35
|
+
const name = ref<string>('')
|
|
36
|
+
const isShowAlerts = ref<boolean>(false)
|
|
37
|
+
const alerts = ref<string[]>([])
|
|
38
|
+
|
|
30
39
|
const onHide = (): void => {
|
|
31
40
|
emits('hide')
|
|
32
41
|
}
|
|
33
42
|
const onSave = (): void => {
|
|
34
|
-
|
|
43
|
+
if (!name.value) {
|
|
44
|
+
alerts.value = [localization.value.settingsNameErrorDesc + 'aaa']
|
|
45
|
+
isShowAlerts.value = true
|
|
46
|
+
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
emits('save', name.value)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const onRemoveAlerts = (): void => {
|
|
54
|
+
isShowAlerts.value = false
|
|
55
|
+
alerts.value = []
|
|
35
56
|
}
|
|
36
57
|
</script>
|
|
37
58
|
|
|
38
59
|
<style scoped lang="scss">
|
|
39
60
|
:deep(.modal-dialog) {
|
|
40
|
-
|
|
61
|
+
.alert {
|
|
62
|
+
margin-bottom: 20px;
|
|
63
|
+
}
|
|
41
64
|
|
|
42
65
|
.form-control {
|
|
43
66
|
display: flex;
|
|
@@ -10,7 +10,15 @@
|
|
|
10
10
|
:language="props.language"
|
|
11
11
|
:selected="selectedOptions"
|
|
12
12
|
:selected-chart-type="props.selectedChartType"
|
|
13
|
+
:selected-timespan-type="props.selectedTimespanType"
|
|
14
|
+
:units-count="props.unitsCount"
|
|
15
|
+
:period-type="props.periodType"
|
|
16
|
+
:selected-custom-time="props.selectedCustomTime"
|
|
13
17
|
@update-chart-type="emits('update-chart-type', $event)"
|
|
18
|
+
@update-custom-time="emits('update-custom-time', $event)"
|
|
19
|
+
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
20
|
+
@update-unit-count="emits('update-unit-count', $event)"
|
|
21
|
+
@update-period-type="emits('update-period-type', $event)"
|
|
14
22
|
/>
|
|
15
23
|
</div>
|
|
16
24
|
</template>
|
|
@@ -32,11 +40,19 @@ const props = defineProps<{
|
|
|
32
40
|
type: UI_T_AdvancedType
|
|
33
41
|
selectedKeys: number[]
|
|
34
42
|
selectedChartType: string
|
|
43
|
+
selectedTimespanType: string
|
|
44
|
+
unitsCount: number
|
|
45
|
+
periodType: string
|
|
46
|
+
selectedCustomTime: string
|
|
35
47
|
}>()
|
|
36
48
|
|
|
37
49
|
const emits = defineEmits<{
|
|
38
50
|
(event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
|
|
39
51
|
(event: 'update-chart-type', value: string): void
|
|
52
|
+
(event: 'update-custom-time', value: string): void
|
|
53
|
+
(event: 'update-timespan-type', value: string): void
|
|
54
|
+
(event: 'update-unit-count', value: number): void
|
|
55
|
+
(event: 'update-period-type', value: string): void
|
|
40
56
|
}>()
|
|
41
57
|
|
|
42
58
|
const selectedOptions = ref<UI_I_AdvancedTargetObject[][]>([])
|
package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue
CHANGED
|
@@ -3,7 +3,15 @@
|
|
|
3
3
|
<common-monitor-advanced-tools-chart-options-modal-counters-timespan-form
|
|
4
4
|
:language="props.language"
|
|
5
5
|
:selected-chart-type="props.selectedChartType"
|
|
6
|
+
:selected-timespan-type="props.selectedTimespanType"
|
|
7
|
+
:units-count="props.unitsCount"
|
|
8
|
+
:period-type="props.periodType"
|
|
9
|
+
:selected-custom-time="props.selectedCustomTime"
|
|
6
10
|
@update-chart-type="emits('update-chart-type', $event)"
|
|
11
|
+
@update-custom-time="emits('update-custom-time', $event)"
|
|
12
|
+
@update-timespan-type="emits('update-timespan-type', $event)"
|
|
13
|
+
@update-unit-count="emits('update-unit-count', $event)"
|
|
14
|
+
@update-period-type="emits('update-period-type', $event)"
|
|
7
15
|
/>
|
|
8
16
|
<common-monitor-advanced-tools-chart-options-modal-counters-timespan-object
|
|
9
17
|
:selected="props.selected"
|
|
@@ -18,10 +26,18 @@ const props = defineProps<{
|
|
|
18
26
|
selected: UI_I_AdvancedTargetObject[][]
|
|
19
27
|
language: string
|
|
20
28
|
selectedChartType: string
|
|
29
|
+
selectedTimespanType: string
|
|
30
|
+
unitsCount: number
|
|
31
|
+
periodType: string
|
|
32
|
+
selectedCustomTime: string
|
|
21
33
|
}>()
|
|
22
34
|
|
|
23
35
|
const emits = defineEmits<{
|
|
24
36
|
(event: 'update-chart-type', value: string): void
|
|
37
|
+
(event: 'update-custom-time', value: string): void
|
|
38
|
+
(event: 'update-timespan-type', value: string): void
|
|
39
|
+
(event: 'update-unit-count', value: number): void
|
|
40
|
+
(event: 'update-period-type', value: string): void
|
|
25
41
|
}>()
|
|
26
42
|
</script>
|
|
27
43
|
|