bfg-common 1.4.839 → 1.4.841

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.
Files changed (40) hide show
  1. package/assets/localization/local_be.json +17 -4
  2. package/assets/localization/local_en.json +17 -4
  3. package/assets/localization/local_hy.json +17 -4
  4. package/assets/localization/local_kk.json +17 -4
  5. package/assets/localization/local_ru.json +18 -5
  6. package/assets/localization/local_zh.json +17 -4
  7. package/components/atoms/collapse/CollapseNav.vue +4 -4
  8. package/components/atoms/dropdown/dropdown/Dropdown.vue +12 -0
  9. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +2 -2
  10. package/components/atoms/table/dataGrid/lib/utils/export.ts +1 -1
  11. package/components/common/graph/GraphNew.vue +176 -176
  12. package/components/common/modals/confirmByInput/ConfirmByInput.vue +57 -177
  13. package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +103 -0
  14. package/components/common/modals/confirmByInput/ConfirmByInputOld.vue +204 -0
  15. package/components/common/monitor/advanced/Advanced.vue +196 -170
  16. package/components/common/monitor/advanced/AdvancedNew.vue +181 -206
  17. package/components/common/monitor/advanced/AdvancedOld.vue +12 -40
  18. package/components/common/monitor/advanced/graphView/GraphView.vue +181 -170
  19. package/components/common/monitor/advanced/graphView/GraphViewNew.vue +35 -35
  20. package/components/common/monitor/advanced/graphView/GraphViewOld.vue +56 -56
  21. package/components/common/monitor/advanced/table/Table.vue +31 -31
  22. package/components/common/monitor/advanced/table/tableNew/TableNew.vue +85 -85
  23. package/components/common/monitor/advanced/table/tableNew/lib/config/options.ts +139 -139
  24. package/components/common/monitor/advanced/table/tableNew/lib/utils/constructBody.ts +27 -27
  25. package/components/common/monitor/advanced/tools/Tools.vue +304 -163
  26. package/components/common/monitor/advanced/tools/ToolsNew.vue +220 -366
  27. package/components/common/monitor/advanced/tools/ToolsOld.vue +29 -165
  28. package/components/common/pages/tasks/Tasks.vue +3 -1
  29. package/components/common/pages/tasks/table/Table.vue +1 -0
  30. package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +23 -7
  31. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +1 -0
  32. package/components/common/pages/tasks/table/lib/config/config.ts +2 -2
  33. package/components/common/portlets/customAttributes/Portlet.vue +9 -2
  34. package/components/common/portlets/customAttributes/lib/config/config.ts +7 -0
  35. package/components/common/portlets/tag/Portlet.vue +9 -2
  36. package/components/common/portlets/tag/lib/config/config.ts +7 -0
  37. package/components/common/tools/Actions.vue +5 -2
  38. package/lib/config/uiTable.ts +20 -20
  39. package/lib/models/store/interfaces.ts +1 -0
  40. package/package.json +2 -2
@@ -1,163 +1,304 @@
1
- <template>
2
- <common-monitor-advanced-tools-new
3
- v-if="isNewView"
4
- v-model:selected-timespan-type="localSelectedTimespanType"
5
- :type="props.type"
6
- :start-date="props.startDate"
7
- :end-date="props.endDate"
8
- :chart-title="props.chartTitle"
9
- :language="props.language"
10
- :selected-counters-keys="props.selectedCountersKeys"
11
- :selected-metric="props.selectedMetric"
12
- :selected-metric-local="props.selectedMetricLocal"
13
- :disabled-period="props.disabledPeriod"
14
- :disabled-view="props.disabledView"
15
- :selected-chart-type="props.selectedChartType"
16
- :units-count="props.unitsCount"
17
- :period-type="props.periodType"
18
- :selected-custom-time="props.selectedCustomTime"
19
- :selected-chart-option-name="props.selectedChartOptionName"
20
- :custom-date-from="props.customDateFrom"
21
- :custom-date-to="props.customDateTo"
22
- :custom-time-from="props.customTimeFrom"
23
- :custom-time-to="props.customTimeTo"
24
- :total-cores="totalCores"
25
- :host-id="props.hostId"
26
- :selected-objects="props.selectedObjects"
27
- :project="props.project"
28
- :objects-loading="props.objectsLoading"
29
- :objects-data="props.objectsData"
30
- :valid-date-end="props.validDateEnd"
31
- :format-date="props.formatDate"
32
- @update-tools="emits('update-tools', $event)"
33
- @exporting="onExporting"
34
- @open-advanced-page="emits('open-advanced-page')"
35
- @select-row="emits('select-row', $event)"
36
- @select-metric-local="emits('select-metric-local', $event)"
37
- @update-chart-type="emits('update-chart-type', $event)"
38
- @update-timespan-type="emits('update-timespan-type', $event)"
39
- @update-unit-count="emits('update-unit-count', $event)"
40
- @update-period-type="emits('update-period-type', $event)"
41
- @update-custom-time="emits('update-custom-time', $event)"
42
- @delete-option="emits('delete-option')"
43
- @submit-options="emits('submit-options', $event)"
44
- />
45
- <common-monitor-advanced-tools-old
46
- v-else
47
- v-model:selected-timespan-type="localSelectedTimespanType"
48
- :type="props.type"
49
- :start-date="props.startDate"
50
- :end-date="props.endDate"
51
- :chart-title="props.chartTitle"
52
- :language="props.language"
53
- :selected-counters-keys="props.selectedCountersKeys"
54
- :selected-metric="props.selectedMetric"
55
- :selected-metric-local="props.selectedMetricLocal"
56
- :disabled-period="props.disabledPeriod"
57
- :disabled-view="props.disabledView"
58
- :selected-chart-type="props.selectedChartType"
59
- :units-count="props.unitsCount"
60
- :period-type="props.periodType"
61
- :selected-custom-time="props.selectedCustomTime"
62
- :selected-chart-option-name="props.selectedChartOptionName"
63
- :custom-date-from="props.customDateFrom"
64
- :custom-date-to="props.customDateTo"
65
- :custom-time-from="props.customTimeFrom"
66
- :custom-time-to="props.customTimeTo"
67
- :total-cores="totalCores"
68
- :host-id="props.hostId"
69
- :selected-objects="props.selectedObjects"
70
- :project="props.project"
71
- :objects-loading="props.objectsLoading"
72
- :objects-data="props.objectsData"
73
- :valid-date-end="props.validDateEnd"
74
- :format-date="props.formatDate"
75
- @update-tools="emits('update-tools', $event)"
76
- @exporting="onExporting"
77
- @open-advanced-page="emits('open-advanced-page')"
78
- @select-row="emits('select-row', $event)"
79
- @select-metric-local="emits('select-metric-local', $event)"
80
- @update-chart-type="emits('update-chart-type', $event)"
81
- @update-timespan-type="emits('update-timespan-type', $event)"
82
- @update-unit-count="emits('update-unit-count', $event)"
83
- @update-period-type="emits('update-period-type', $event)"
84
- @update-custom-time="emits('update-custom-time', $event)"
85
- @delete-option="emits('delete-option')"
86
- @submit-options="emits('submit-options', $event)"
87
- />
88
- </template>
89
-
90
- <script setup lang="ts">
91
- import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
92
- import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
93
- import type {
94
- UI_T_ChartHost,
95
- UI_T_ChartVm,
96
- } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
97
- import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
98
- import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
99
- import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
100
- import type { UI_T_Project } from '~/lib/models/types'
101
-
102
- const props = defineProps<{
103
- type: UI_T_AdvancedType
104
- startDate: number
105
- endDate: number
106
- chartTitle: string
107
- language: string
108
- selectedCountersKeys: number[]
109
- selectedMetric: UI_T_ChartHost | UI_T_ChartVm
110
- selectedMetricLocal: UI_T_ChartHost | UI_T_ChartVm
111
- selectedChartType: string
112
- selectedTimespanType: string
113
- unitsCount: number
114
- periodType: string
115
- selectedCustomTime: string
116
- selectedChartOptionName: string
117
- customDateFrom: string
118
- customDateTo: string
119
- customTimeFrom: string
120
- customTimeTo: string
121
- totalCores: number
122
- hostId: string
123
- selectedObjects: string
124
- project: UI_T_Project
125
- objectsLoading: boolean
126
- objectsData: UI_I_ObjectItem[]
127
- validDateEnd: number
128
- formatDate: string
129
- disabledPeriod?: boolean
130
- disabledView?: boolean
131
- }>()
132
-
133
- const emits = defineEmits<{
134
- (event: 'update-tools', value: UI_I_MonitorGraphPayload): void
135
- (event: 'exporting', value: string): void
136
- (event: 'open-advanced-page'): void
137
- (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
138
- (event: 'select-metric-local', value: string): void
139
- (event: 'update-chart-type', value: string): void
140
- (event: 'update-timespan-type', value: string): void
141
- (event: 'update-unit-count', value: number): void
142
- (event: 'update-period-type', value: string): void
143
- (event: 'update-custom-time', value: string): void
144
- (event: 'delete-option'): void
145
- (event: 'submit-options', value: UI_I_OptionsForm): void
146
- (event: 'update:selected-timespan-type', value: string): void
147
- }>()
148
-
149
- const { $store }: any = useNuxtApp()
150
-
151
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
152
-
153
- const localSelectedTimespanType = computed<string>({
154
- get() {
155
- return props.selectedTimespanType
156
- },
157
- set(newValue) {
158
- emits('update:selected-timespan-type', newValue)
159
- },
160
- })
161
- </script>
162
-
163
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-monitor-advanced-tools-new
3
+ v-if="isNewView"
4
+ v-model:selected-view="selectedView"
5
+ v-model:is-show-modal-local="isShowModal"
6
+ v-model:selected-period="selectedPeriod"
7
+ :selected-timespan-type="localSelectedTimespanType"
8
+ :type="props.type"
9
+ :chart-title-date="chartTitleDate"
10
+ :language="props.language"
11
+ :selected-counters-keys="props.selectedCountersKeys"
12
+ :selected-metric="props.selectedMetric"
13
+ :selected-metric-local="props.selectedMetricLocal"
14
+ :disabled-period="props.disabledPeriod"
15
+ :disabled-view="props.disabledView"
16
+ :selected-chart-type="props.selectedChartType"
17
+ :units-count="props.unitsCount"
18
+ :period-type="props.periodType"
19
+ :selected-custom-time="props.selectedCustomTime"
20
+ :selected-chart-option-name="props.selectedChartOptionName"
21
+ :custom-date-from="props.customDateFrom"
22
+ :custom-date-to="props.customDateTo"
23
+ :custom-time-from="props.customTimeFrom"
24
+ :custom-time-to="props.customTimeTo"
25
+ :total-cores="totalCores"
26
+ :host-id="props.hostId"
27
+ :selected-objects="props.selectedObjects"
28
+ :project="props.project"
29
+ :objects-loading="props.objectsLoading"
30
+ :objects-data="props.objectsData"
31
+ :valid-date-end="props.validDateEnd"
32
+ :format-date="props.formatDate"
33
+ :view-options="viewOptions"
34
+ :period-options="periodOptions"
35
+ @save-option-name="onSaveOptionName"
36
+ @change-period="updateTools"
37
+ @change-view="updateTools"
38
+ @select-row="emits('select-row', $event)"
39
+ @select-metric-local="emits('select-metric-local', $event)"
40
+ @update-chart-type="emits('update-chart-type', $event)"
41
+ @update-timespan-type="emits('update-timespan-type', $event)"
42
+ @update-unit-count="emits('update-unit-count', $event)"
43
+ @update-period-type="emits('update-period-type', $event)"
44
+ @update-custom-time="emits('update-custom-time', $event)"
45
+ @delete-option="onDeleteOption"
46
+ @submit-options="emits('submit-options', $event)"
47
+ />
48
+ <common-monitor-advanced-tools-old
49
+ v-else
50
+ v-model:selected-view="selectedView"
51
+ v-model:is-show-modal-local="isShowModal"
52
+ v-model:selected-period="selectedPeriod"
53
+ :selected-timespan-type="localSelectedTimespanType"
54
+ :type="props.type"
55
+ :chart-title="props.chartTitle"
56
+ :chart-title-date="chartTitleDate"
57
+ :language="props.language"
58
+ :selected-counters-keys="props.selectedCountersKeys"
59
+ :selected-metric="props.selectedMetric"
60
+ :selected-metric-local="props.selectedMetricLocal"
61
+ :disabled-period="props.disabledPeriod"
62
+ :disabled-view="props.disabledView"
63
+ :selected-chart-type="props.selectedChartType"
64
+ :units-count="props.unitsCount"
65
+ :period-type="props.periodType"
66
+ :selected-custom-time="props.selectedCustomTime"
67
+ :selected-chart-option-name="props.selectedChartOptionName"
68
+ :custom-date-from="props.customDateFrom"
69
+ :custom-date-to="props.customDateTo"
70
+ :custom-time-from="props.customTimeFrom"
71
+ :custom-time-to="props.customTimeTo"
72
+ :total-cores="totalCores"
73
+ :host-id="props.hostId"
74
+ :selected-objects="props.selectedObjects"
75
+ :project="props.project"
76
+ :objects-loading="props.objectsLoading"
77
+ :objects-data="props.objectsData"
78
+ :valid-date-end="props.validDateEnd"
79
+ :format-date="props.formatDate"
80
+ :options-names="optionsNames"
81
+ :view-options="viewOptions"
82
+ :period-options="periodOptions"
83
+ @save-option-name="onSaveOptionName"
84
+ @change-period="updateTools"
85
+ @change-view="updateTools"
86
+ @exporting="emits('exporting', $event)"
87
+ @open-advanced-page="emits('open-advanced-page')"
88
+ @select-row="emits('select-row', $event)"
89
+ @select-metric-local="emits('select-metric-local', $event)"
90
+ @update-chart-type="emits('update-chart-type', $event)"
91
+ @update-timespan-type="emits('update-timespan-type', $event)"
92
+ @update-unit-count="emits('update-unit-count', $event)"
93
+ @update-period-type="emits('update-period-type', $event)"
94
+ @update-custom-time="emits('update-custom-time', $event)"
95
+ @delete-option="onDeleteOption"
96
+ @submit-options="emits('submit-options', $event)"
97
+ />
98
+ </template>
99
+
100
+ <script setup lang="ts">
101
+ import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
102
+ import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
103
+ import type {
104
+ UI_T_ChartHost,
105
+ UI_T_ChartVm,
106
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
107
+ import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
108
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
109
+ import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
110
+ import type { UI_T_Project } from '~/lib/models/types'
111
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
112
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
113
+ import {
114
+ getCurrentOptionsStorageFunc,
115
+ periodFunc,
116
+ viewFunc,
117
+ } from '~/components/common/monitor/advanced/tools/lib/config/advancedToolbar'
118
+ import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
119
+ import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
120
+
121
+ const props = defineProps<{
122
+ type: UI_T_AdvancedType
123
+ startDate: number
124
+ endDate: number
125
+ chartTitle: string
126
+ language: string
127
+ selectedCountersKeys: number[]
128
+ selectedMetric: UI_T_ChartHost | UI_T_ChartVm
129
+ selectedMetricLocal: UI_T_ChartHost | UI_T_ChartVm
130
+ selectedChartType: string
131
+ selectedTimespanType: string
132
+ unitsCount: number
133
+ periodType: string
134
+ selectedCustomTime: string
135
+ selectedChartOptionName: string
136
+ customDateFrom: string
137
+ customDateTo: string
138
+ customTimeFrom: string
139
+ customTimeTo: string
140
+ totalCores: number
141
+ hostId: string
142
+ selectedObjects: string
143
+ project: UI_T_Project
144
+ objectsLoading: boolean
145
+ objectsData: UI_I_ObjectItem[]
146
+ validDateEnd: number
147
+ formatDate: string
148
+ disabledPeriod?: boolean
149
+ disabledView?: boolean
150
+ }>()
151
+
152
+ const emits = defineEmits<{
153
+ (event: 'update-tools', value: UI_I_MonitorGraphPayload): void
154
+ (event: 'exporting', value: string): void
155
+ (event: 'open-advanced-page'): void
156
+ (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
157
+ (event: 'select-metric-local', value: string): void
158
+ (event: 'update-chart-type', value: string): void
159
+ (event: 'update-timespan-type', value: string): void
160
+ (event: 'update-unit-count', value: number): void
161
+ (event: 'update-period-type', value: string): void
162
+ (event: 'update-custom-time', value: string): void
163
+ (event: 'delete-option'): void
164
+ (event: 'submit-options', value: UI_I_OptionsForm): void
165
+ (event: 'update:selected-timespan-type', value: string): void
166
+ }>()
167
+
168
+ const { $store, $formattedDatetime }: any = useNuxtApp()
169
+
170
+ const localization = computed<UI_I_Localization>(() => useLocal())
171
+
172
+ const routeType = '' + useRoute().params.type
173
+
174
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
175
+
176
+ const localSelectedTimespanType = computed<string>({
177
+ get() {
178
+ return props.selectedTimespanType
179
+ },
180
+ set(newValue) {
181
+ emits('update:selected-timespan-type', newValue)
182
+ },
183
+ })
184
+
185
+ const optionsNames = ref<string[]>([])
186
+ const viewOptions = computed<UI_I_OptionItem[]>(() =>
187
+ viewFunc(localization.value, props.type, optionsNames.value)
188
+ )
189
+
190
+ const selectedView = ref<string>('')
191
+
192
+ watch(
193
+ () => props.selectedChartOptionName,
194
+ (newValue) => {
195
+ let currentValue = ''
196
+
197
+ if (newValue) currentValue = newValue
198
+ else if (
199
+ selectedView.value &&
200
+ optionsNames.value.includes(selectedView.value)
201
+ )
202
+ currentValue = selectedView.value
203
+ else currentValue = selectedView.value || viewOptions.value[0]?.value
204
+
205
+ selectedView.value = currentValue
206
+ },
207
+ { immediate: true }
208
+ )
209
+
210
+ const periodOptions = computed<UI_I_OptionItem[]>(() =>
211
+ periodFunc(localization.value, props.selectedTimespanType)
212
+ )
213
+ const selectedPeriod = computed<string>({
214
+ get() {
215
+ return props.selectedTimespanType || periodOptions.value[0].value
216
+ },
217
+ set(newValue) {
218
+ emits('update:selected-timespan-type', newValue)
219
+ },
220
+ })
221
+
222
+ const updateTools = (): void => {
223
+ const periodValue = localSelectedTimespanType.value
224
+ const viewValue = selectedView.value
225
+ const prefix = props.project === 'sphere'
226
+ const selectedValue = useLocalStorage(
227
+ viewValue + 'ChartOptions',
228
+ undefined,
229
+ prefix
230
+ )
231
+
232
+ const fields = selectedValue
233
+ ? selectedValue.counters.map((item) => item.name).join(', ')
234
+ : ''
235
+ const validPeriodData = getValidDateByOptionFunc(
236
+ periodValue,
237
+ selectedValue,
238
+ props.unitsCount,
239
+ props.selectedCustomTime
240
+ )
241
+
242
+ const period = [
243
+ Math.round(validPeriodData[0] / 1000),
244
+ Math.round(validPeriodData[1] / 1000),
245
+ ]
246
+
247
+ if (periodValue === 'custom_interval' && props.periodType === 'period') {
248
+ const checkDateResult = checkDateFunc(
249
+ localization.value,
250
+ props.customDateFrom,
251
+ props.customDateTo,
252
+ props.customTimeFrom,
253
+ props.customTimeTo,
254
+ props.validDateEnd,
255
+ props.formatDate
256
+ )
257
+ if (Array.isArray(checkDateResult)) {
258
+ period[0] = Math.round(checkDateResult[0] / 1000)
259
+ period[1] = Math.round(checkDateResult[1] / 1000)
260
+ }
261
+ }
262
+
263
+ const tools: UI_I_MonitorGraphPayload = {
264
+ fields,
265
+ period,
266
+ periodType: periodValue,
267
+ view: viewValue,
268
+ }
269
+ if (selectedValue.metric) tools.metricType = selectedValue.metric
270
+
271
+ emits('update-timespan-type', localSelectedTimespanType.value)
272
+ emits('update-tools', tools)
273
+ }
274
+
275
+ const chartTitleDate = computed<string>(() => {
276
+ if (!props.startDate) return ''
277
+
278
+ const start = $formattedDatetime(props.startDate, '', true)
279
+ const end = $formattedDatetime(props.endDate, '', true)
280
+ return `${start} - ${end}`
281
+ })
282
+
283
+ const onDeleteOption = (): void => {
284
+ emits('delete-option')
285
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
286
+ }
287
+
288
+ const onSaveOptionName = (): void => {
289
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
290
+ }
291
+
292
+ const isShowModal = ref<boolean>()
293
+ watch(isShowModal, (newValue) => {
294
+ if (!newValue && !selectedView.value)
295
+ selectedView.value = viewOptions.value[0].value
296
+ })
297
+
298
+ onMounted(() => {
299
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
300
+ updateTools()
301
+ })
302
+ </script>
303
+
304
+ <style scoped lang="scss"></style>