bfg-common 1.0.29 → 1.0.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.
Files changed (26) hide show
  1. package/assets/localization/local_be.json +160 -1
  2. package/assets/localization/local_en.json +161 -1
  3. package/assets/localization/local_hy.json +160 -1
  4. package/assets/localization/local_kk.json +160 -1
  5. package/assets/localization/local_ru.json +161 -1
  6. package/assets/localization/local_zh.json +160 -1
  7. package/components/common/monitor/advanced/Advanced.vue +33 -18
  8. package/components/common/monitor/advanced/GraphView.vue +78 -146
  9. package/components/common/monitor/advanced/tools/Tools.vue +41 -20
  10. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +35 -19
  11. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +22 -21
  12. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +44 -35
  13. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/tableConfig.ts +13 -15
  14. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils.ts +634 -0
  15. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces.ts +19 -6
  16. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/types.ts +3 -5
  17. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +4 -1
  18. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +8 -15
  19. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +18 -8
  20. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/config/optionsMetrics.ts +52 -58
  21. package/components/common/monitor/advanced/tools/chartOptionsModal/models/types.ts +3 -0
  22. package/components/common/monitor/models/interfaces.ts +2 -0
  23. package/package.json +1 -1
  24. package/public/spice-console/application/application.js +1 -1
  25. package/public/spice-console/network/spicechannel.js +346 -287
  26. package/public/spice-console-minify/application/application.min.js +1 -1
@@ -5,7 +5,7 @@
5
5
  }}</span>
6
6
 
7
7
  <atoms-table-data-grid
8
- v-model:selected-row="selectedCountersLocal"
8
+ v-model:selected-row="selectedCounters"
9
9
  v-model:column-keys="columnItems"
10
10
  v-model:page-size="pagination.pageSize"
11
11
  v-model:page="pagination.page"
@@ -15,12 +15,10 @@
15
15
  :body-items="bodyItems"
16
16
  :total-items="totalItems"
17
17
  :total-pages="totalPages"
18
- :loading="props.loading"
19
18
  hide-footer
20
19
  server-off
21
20
  @change="onChangeRow"
22
- >
23
- </atoms-table-data-grid>
21
+ />
24
22
  </div>
25
23
  </template>
26
24
 
@@ -32,33 +30,47 @@ import {
32
30
  } from '~/components/atoms/table/dataGrid/models/interfaces'
33
31
  import { UI_I_Localization } from '~/models/interfaces'
34
32
  import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/tableConfig'
35
- import { UI_I_AdvancedTargetObject } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
33
+ import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
34
+ import {
35
+ T_ChartHost,
36
+ T_ChartVm,
37
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
38
+ import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
39
+ import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils'
36
40
 
37
41
  const props = defineProps<{
38
- counters: any
39
- loading: boolean
40
- selectedCounters: number[]
42
+ chart: T_ChartHost | T_ChartVm
43
+ type: UI_T_AdvancedType
44
+ selectedKeys: number[]
41
45
  }>()
42
46
 
43
47
  const emits = defineEmits<{
44
- (event: 'change', array: UI_I_AdvancedTargetObject[][]): void
45
- (event: 'update:selected-counters', value: number[]): void
48
+ (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
46
49
  }>()
47
50
 
48
51
  const localization = computed<UI_I_Localization>(() => useLocal())
49
52
 
50
- const totalItems = computed<number>(() => props.counters?.total_items || 0)
51
- const totalPages = computed<number>(() => props.counters?.total_pages || 1)
53
+ const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
54
+ countersItemsFunc(props.type, props.chart, localization.value)
55
+ )
56
+
57
+ const totalItems = computed<number>(() => counters.value.length)
58
+ const totalPages = computed<number>(() => 1)
52
59
 
53
- // const selectedRow = ref<number[]>([])
54
- const selectedCountersLocal = computed<number[]>({
55
- get() {
56
- return props.selectedCounters
57
- },
58
- set(newValue) {
59
- emits('update:selected-counters', newValue)
60
+ const selectedCounters = ref<number[]>([])
61
+ watch(
62
+ () => props.selectedKeys,
63
+ (newValue) => {
64
+ selectedCounters.value = newValue
60
65
  },
61
- })
66
+ { immediate: true, deep: true }
67
+ )
68
+ watch(
69
+ () => props.chart,
70
+ () => {
71
+ selectedCounters.value = []
72
+ }
73
+ )
62
74
  const pagination = ref<any>({
63
75
  page: 1,
64
76
  pageSize: 35,
@@ -73,26 +85,23 @@ const headItems = computed<UI_I_HeadItem[]>(() =>
73
85
  const bodyItems = ref<UI_I_BodyItem[][]>([])
74
86
 
75
87
  watch(
76
- () => props.counters,
77
- (val) => {
78
- if (!val.items) return
88
+ counters,
89
+ (newValue) => {
90
+ if (!newValue.length) return
79
91
 
80
- bodyItems.value = table.bodyItems(val.items)
92
+ bodyItems.value = table.bodyItems(newValue)
81
93
  },
82
- { deep: true }
94
+ { deep: true, immediate: true }
83
95
  )
84
96
 
85
97
  const onChangeRow = (val: number[]): void => {
86
- let sendData: UI_I_AdvancedTargetObject[][] = []
87
- if (!val.length) sendData = []
88
- else {
89
- val.forEach((index) => {
90
- props.counters.items.forEach((item) => {
91
- if (index === item.id) sendData.push(item.target_object)
92
- })
93
- })
94
- }
95
- emits('change', sendData)
98
+ const result: UI_I_AdvancedCounterItem[] = []
99
+
100
+ counters.value.forEach((item) => {
101
+ if (val.includes(item.id)) result.push(item)
102
+ })
103
+
104
+ emits('select-row', result)
96
105
  }
97
106
  </script>
98
107
 
@@ -12,28 +12,26 @@ import { UI_T_AdvancedCountersColumnKey } from '~/components/common/monitor/adva
12
12
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
13
13
 
14
14
  export const countersTableKey: UI_T_AdvancedCountersColumnKey[] = [
15
- 'counters',
16
- 'rollups',
17
- 'units',
18
- 'internal_name',
19
- 'stat_type',
15
+ 'name',
20
16
  'description',
17
+ 'measurement',
18
+ 'units',
21
19
  ]
22
20
 
23
21
  const getItems = (
24
22
  localization: UI_I_Localization
25
23
  ): [string, boolean, string, string][] => {
26
24
  return [
27
- [localization.counters, true, '140px', countersTableKey[0]],
28
- [localization.rollups, true, '140px', countersTableKey[1]],
29
- [localization.units, true, '140px', countersTableKey[2]],
30
- [localization.internalName, true, '140px', countersTableKey[3]],
31
- [localization.statType, true, '140px', countersTableKey[4]],
32
- [localization.description, true, '140px', countersTableKey[5]],
25
+ [localization.name, true, '140px', countersTableKey[0]],
26
+ [localization.description, true, '140px', countersTableKey[1]],
27
+ [localization.measurement, true, '140px', countersTableKey[2]],
28
+ [localization.units, true, '140px', countersTableKey[3]],
33
29
  ]
34
30
  }
35
31
 
36
- export const columnKeys = (localization: UI_I_Localization): UI_I_ColumnKey[] => {
32
+ export const columnKeys = (
33
+ localization: UI_I_Localization
34
+ ): UI_I_ColumnKey[] => {
37
35
  const result: UI_I_ColumnKey[] = []
38
36
  getItems(localization).forEach((item, i) => {
39
37
  const col = `col${i + 1}`
@@ -52,7 +50,9 @@ export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
52
50
  return result
53
51
  }
54
52
 
55
- export const bodyItems = (counter: UI_I_AdvancedCounterItem[]): UI_I_BodyItem[][] => {
53
+ export const bodyItems = (
54
+ counter: UI_I_AdvancedCounterItem[]
55
+ ): UI_I_BodyItem[][] => {
56
56
  const bodyItems: UI_I_BodyItem[][] = []
57
57
 
58
58
  counter.forEach((counters: UI_I_AdvancedCounterItem, key: number) => {
@@ -65,8 +65,6 @@ export const bodyItems = (counter: UI_I_AdvancedCounterItem[]): UI_I_BodyItem[][
65
65
  { key: 'col2', text: counters[countersTableKey[1]], id: key },
66
66
  { key: 'col3', text: counters[countersTableKey[2]], id: key },
67
67
  { key: 'col4', text: counters[countersTableKey[3]], id: key },
68
- { key: 'col5', text: counters[countersTableKey[4]], id: key },
69
- { key: 'col6', text: counters[countersTableKey[5]], id: key },
70
68
  ])
71
69
  })
72
70
  return bodyItems