bfg-common 1.4.861 → 1.4.862

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 (56) hide show
  1. package/.idea/inspectionProfiles/Project_Default.xml +2 -1
  2. package/assets/localization/local_be.json +3012 -3009
  3. package/assets/localization/local_en.json +5 -2
  4. package/assets/localization/local_hy.json +5 -2
  5. package/assets/localization/local_kk.json +5 -2
  6. package/assets/localization/local_ru.json +5 -2
  7. package/assets/localization/local_zh.json +5 -2
  8. package/components/common/chartOptionsModal/counters/timespan/form/Form.vue +40 -313
  9. package/components/common/chartOptionsModal/counters/timespan/form/FormNew.vue +241 -0
  10. package/components/common/chartOptionsModal/counters/timespan/form/FormOld.vue +372 -0
  11. package/components/common/graph/GraphOld.vue +50 -31
  12. package/components/common/monitor/advanced/Advanced.vue +0 -3
  13. package/components/common/monitor/advanced/AdvancedNew.vue +0 -2
  14. package/components/common/monitor/advanced/AdvancedOld.vue +0 -2
  15. package/components/common/monitor/advanced/graphView/GraphView.vue +16 -18
  16. package/components/common/monitor/advanced/tools/Tools.vue +0 -3
  17. package/components/common/monitor/advanced/tools/ToolsNew.vue +0 -2
  18. package/components/common/monitor/advanced/tools/ToolsOld.vue +0 -2
  19. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +113 -114
  20. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalNew.vue +190 -0
  21. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModalOld.vue +189 -0
  22. package/components/common/monitor/advanced/tools/chartOptionsModal/Notification.vue +13 -20
  23. package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationNew.vue +20 -0
  24. package/components/common/monitor/advanced/tools/chartOptionsModal/NotificationOld.vue +27 -0
  25. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +28 -79
  26. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsNew.vue +160 -0
  27. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/ActionsOld.vue +114 -0
  28. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +75 -56
  29. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersNew.vue +97 -0
  30. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/CountersOld.vue +110 -0
  31. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +19 -58
  32. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/TableNew.vue +46 -0
  33. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/options.ts +19 -0
  34. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/tableData.ts +71 -0
  35. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/utils/constructTable.ts +29 -0
  36. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/TableOld.vue +85 -0
  37. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{lib → tableOld/lib}/config/tableConfig.ts +1 -1
  38. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +71 -47
  39. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/TimespanNew.vue +150 -0
  40. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/TimespanOld.vue +95 -0
  41. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +21 -26
  42. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/ObjectNew.vue +56 -0
  43. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/config/options.ts +25 -0
  44. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/config/tableData.ts +47 -0
  45. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectNew/lib/utils/constructTable.ts +22 -0
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/objectOld/ObjectOld.vue +84 -0
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +17 -29
  48. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/MetricsOld.vue +32 -0
  49. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/metricsNew/MetricsNew.vue +101 -0
  50. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/metricsNew/lib/utils/constructAccordion.ts +32 -0
  51. package/components/common/monitor/overview/Overview.vue +224 -221
  52. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModalNew.vue +186 -181
  53. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +26 -30
  54. package/lib/utils/date.ts +12 -0
  55. package/package.json +2 -2
  56. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{lib → tableOld/lib}/models/types.ts +0 -0
@@ -1,37 +1,23 @@
1
1
  <template>
2
- <div class="vertical-flex-container chart-option-counters-vertical-split">
3
- <span class="chart-options-grid-title">{{
4
- localization.inventoryMonitor.selectCountersForThisChart
5
- }}</span>
6
-
7
- <atoms-table-data-grid
8
- v-model:selected-row="selectedCounters"
9
- v-model:column-keys="columnItems"
10
- v-model:page-size="pagination.pageSize"
11
- v-model:page="pagination.page"
12
- type="checkbox"
13
- class="data-table"
14
- test-id="chart-options-table"
15
- :head-items="headItems"
16
- :body-items="bodyItems"
17
- :total-items="totalItems"
18
- :total-pages="totalPages"
19
- hide-footer
20
- server-off
21
- @change="onChangeRow"
22
- />
23
- </div>
2
+ <common-monitor-advanced-tools-chart-options-modal-counters-table-table-new
3
+ v-if="isNewView"
4
+ v-model:selected-counters="selectedCounters"
5
+ :counters="counters"
6
+ />
7
+ <common-monitor-advanced-tools-chart-options-modal-counters-table-table-old
8
+ v-else
9
+ v-model:selected-counters="selectedCounters"
10
+ v-model:pagination="pagination"
11
+ :counters="counters"
12
+ :total-items="totalItems"
13
+ :total-pages="totalPages"
14
+ @change-row="onChangeRow"
15
+ />
24
16
  </template>
25
17
 
26
18
  <script setup lang="ts">
27
- import type {
28
- UI_I_HeadItem,
29
- UI_I_BodyItem,
30
- UI_I_ColumnKey,
31
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
32
19
  import type { UI_I_Localization } from '~/lib/models/interfaces'
33
20
  import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
34
- import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig'
35
21
  import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
36
22
  import type {
37
23
  UI_T_ChartHost,
@@ -52,6 +38,10 @@ const emits = defineEmits<{
52
38
  (event: 'total-items', value: number): void
53
39
  }>()
54
40
 
41
+ const { $store }: any = useNuxtApp()
42
+
43
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
44
+
55
45
  const localization = computed<UI_I_Localization>(() => useLocal())
56
46
 
57
47
  const counters = computed<UI_I_AdvancedCounterItem[]>(() =>
@@ -93,24 +83,6 @@ const pagination = ref<UI_I_Pagination>({
93
83
  pageSize: 35,
94
84
  })
95
85
 
96
- const columnItems = computed<UI_I_ColumnKey[]>(() =>
97
- table.columnKeys(localization.value)
98
- )
99
- const headItems = computed<UI_I_HeadItem[]>(() =>
100
- table.headItems(localization.value)
101
- )
102
- const bodyItems = ref<UI_I_BodyItem[][]>([])
103
-
104
- watch(
105
- counters,
106
- (newValue) => {
107
- if (!newValue.length) return
108
-
109
- bodyItems.value = table.bodyItems(newValue)
110
- },
111
- { deep: true, immediate: true }
112
- )
113
-
114
86
  const onChangeRow = (val: number[]): void => {
115
87
  const result: UI_I_AdvancedCounterItem[] = []
116
88
 
@@ -130,15 +102,4 @@ watch(
130
102
  )
131
103
  </script>
132
104
 
133
- <style scoped lang="scss">
134
- .chart-option-counters-vertical-split {
135
- .chart-options-grid-title {
136
- display: block;
137
- margin-bottom: -20px;
138
- }
139
-
140
- :deep(.datagrid-table-wrapper) {
141
- max-height: 176px;
142
- }
143
- }
144
- </style>
105
+ <style scoped lang="scss"></style>
@@ -0,0 +1,46 @@
1
+ <template>
2
+ <div class="chart-options-table-container">
3
+ <ui-data-table
4
+ test-id="chart-options-table"
5
+ :data="dataLocal"
6
+ :options="options"
7
+ size="sm"
8
+ @select-row="onSelectRow"
9
+ />
10
+ </div>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import type { UI_I_DataTable } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
15
+ import type { UI_I_DataTableBody } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
16
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
17
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
18
+ import { options } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/options'
19
+ import { tableDataFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/config/tableData'
20
+
21
+ const selectedCountersLocal = defineModel<number[]>('selectedCounters', {
22
+ required: true,
23
+ })
24
+
25
+ const props = defineProps<{
26
+ counters: UI_I_AdvancedCounterItem[]
27
+ }>()
28
+
29
+ const localization = computed<UI_I_Localization>(() => useLocal())
30
+
31
+ const dataLocal = computed<UI_I_DataTable>(() =>
32
+ tableDataFunc(localization.value, props.counters, selectedCountersLocal.value)
33
+ )
34
+
35
+ const onSelectRow = (value: UI_I_DataTableBody[]): void => {
36
+ selectedCountersLocal.value = value.map((item) => item.row)
37
+ }
38
+ </script>
39
+
40
+ <style scoped lang="scss">
41
+ .chart-options-table-container {
42
+ :deep(.bottom-grid-content) {
43
+ max-height: 235px;
44
+ }
45
+ }
46
+ </style>
@@ -0,0 +1,19 @@
1
+ import type { UI_I_DataTableOptions } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
+
3
+ export const options: UI_I_DataTableOptions = {
4
+ perPageOptions: [
5
+ { text: '10', value: 10 },
6
+ { text: '25', value: 25 },
7
+ { text: '50', value: 50 },
8
+ { text: '100', value: 100 },
9
+ ],
10
+ isSelectable: true,
11
+ showPagination: false,
12
+ showPageInfo: false,
13
+ isSortable: true,
14
+ server: false,
15
+ isResizable: true,
16
+ showSearch: false,
17
+ showColumnManager: false,
18
+ inBlock: true,
19
+ }
@@ -0,0 +1,71 @@
1
+ import type { UI_I_DataTable } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
3
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
4
+ import { constructTable } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableNew/utils/constructTable'
5
+
6
+ export const tableDataFunc = (
7
+ localization: UI_I_Localization,
8
+ items: UI_I_AdvancedCounterItem[],
9
+ selectedKeys: number[]
10
+ ): UI_I_DataTable => {
11
+ const currentBody = constructTable(items)
12
+ const selectedRows: number[] = []
13
+
14
+ currentBody.forEach((item) => {
15
+ if (selectedKeys.includes(item.row)) {
16
+ selectedRows.push(item.row)
17
+ }
18
+ })
19
+
20
+ return {
21
+ id: 'chart-options-table',
22
+ selectedRows,
23
+ isAllSelected: false,
24
+ title: `${localization.common.counters} (${items.length})`,
25
+ subTitle: '',
26
+ header: [
27
+ {
28
+ col: 'col0',
29
+ colName: 'name',
30
+ text: localization.common.name,
31
+ isSortable: true,
32
+ sort: 'asc',
33
+ width: '20%',
34
+ show: true,
35
+ filter: true,
36
+ },
37
+ {
38
+ col: 'col1',
39
+ colName: 'description',
40
+ text: localization.common.description,
41
+ isSortable: true,
42
+ sort: 'asc',
43
+ width: '50%',
44
+ show: true,
45
+ filter: true,
46
+ },
47
+ {
48
+ col: 'col2',
49
+ colName: 'measurement',
50
+ text: localization.common.measurement,
51
+ isSortable: true,
52
+ sort: 'asc',
53
+ width: '20%',
54
+ show: true,
55
+ filter: true,
56
+ },
57
+ {
58
+ col: 'col3',
59
+ colName: 'units',
60
+ text: localization.common.units,
61
+ isSortable: true,
62
+ sort: 'asc',
63
+ width: '10%',
64
+ show: true,
65
+ filter: true,
66
+ },
67
+ ],
68
+
69
+ body: currentBody,
70
+ }
71
+ }
@@ -0,0 +1,29 @@
1
+ import type { UI_I_DataTableBody } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
2
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
3
+
4
+ export const constructTable = (
5
+ items: UI_I_AdvancedCounterItem[]
6
+ ): UI_I_DataTableBody[] =>
7
+ items.map((item, key) => {
8
+ return {
9
+ row: key,
10
+ data: [
11
+ {
12
+ col: 'col0',
13
+ text: item.name,
14
+ },
15
+ {
16
+ col: 'col1',
17
+ text: item.description,
18
+ },
19
+ {
20
+ col: 'col2',
21
+ text: item.measurement,
22
+ },
23
+ {
24
+ col: 'col3',
25
+ text: item.units,
26
+ },
27
+ ],
28
+ }
29
+ })
@@ -0,0 +1,85 @@
1
+ <template>
2
+ <div class="vertical-flex-container chart-option-counters-vertical-split">
3
+ <span class="chart-options-grid-title">{{
4
+ localization.inventoryMonitor.selectCountersForThisChart
5
+ }}</span>
6
+
7
+ <atoms-table-data-grid
8
+ v-model:selected-row="selectedCountersLocal"
9
+ v-model:column-keys="columnItems"
10
+ v-model:page-size="paginationLocal.pageSize"
11
+ v-model:page="paginationLocal.page"
12
+ type="checkbox"
13
+ class="data-table"
14
+ test-id="chart-options-table"
15
+ :head-items="headItems"
16
+ :body-items="bodyItems"
17
+ :total-items="props.totalItems"
18
+ :total-pages="props.totalPages"
19
+ hide-footer
20
+ server-off
21
+ @change="emits('change-row', $event)"
22
+ />
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import type {
28
+ UI_I_HeadItem,
29
+ UI_I_BodyItem,
30
+ UI_I_ColumnKey,
31
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
32
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
33
+ import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
34
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
35
+ import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/lib/config/tableConfig'
36
+
37
+ const selectedCountersLocal = defineModel<number[]>('selectedCounters', {
38
+ required: true,
39
+ })
40
+ const paginationLocal = defineModel<UI_I_Pagination>('pagination', {
41
+ required: true,
42
+ })
43
+
44
+ const props = defineProps<{
45
+ counters: UI_I_AdvancedCounterItem[]
46
+ totalItems: number
47
+ totalPages: number
48
+ }>()
49
+
50
+ const emits = defineEmits<{
51
+ (event: 'change-row', value: number[]): void
52
+ }>()
53
+
54
+ const localization = computed<UI_I_Localization>(() => useLocal())
55
+
56
+ const columnItems = computed<UI_I_ColumnKey[]>(() =>
57
+ table.columnKeys(localization.value)
58
+ )
59
+ const headItems = computed<UI_I_HeadItem[]>(() =>
60
+ table.headItems(localization.value)
61
+ )
62
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
63
+ watch(
64
+ () => props.counters,
65
+ (newValue) => {
66
+ if (!newValue.length) return
67
+
68
+ bodyItems.value = table.bodyItems(newValue)
69
+ },
70
+ { deep: true, immediate: true }
71
+ )
72
+ </script>
73
+
74
+ <style scoped lang="scss">
75
+ .chart-option-counters-vertical-split {
76
+ .chart-options-grid-title {
77
+ display: block;
78
+ margin-bottom: -20px;
79
+ }
80
+
81
+ :deep(.datagrid-table-wrapper) {
82
+ max-height: 176px;
83
+ }
84
+ }
85
+ </style>
@@ -8,7 +8,7 @@ import {
8
8
  constructColumnKey,
9
9
  constructHeadItem,
10
10
  } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
11
- import type { UI_T_AdvancedCountersColumnKey } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/types'
11
+ import type { UI_T_AdvancedCountersColumnKey } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/tableOld/lib/models/types'
12
12
  import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
13
13
 
14
14
  export const countersTableKey: UI_T_AdvancedCountersColumnKey[] = [
@@ -1,40 +1,70 @@
1
1
  <template>
2
- <div class="timespan-objects-section-direction">
3
- <common-chart-options-modal-counters-timespan-form
4
- :language="props.language"
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"
10
- :custom-date-from="props.customDateFrom"
11
- :custom-date-to="props.customDateTo"
12
- :custom-time-from="props.customTimeFrom"
13
- :custom-time-to="props.customTimeTo"
14
- :valid-date-end="props.validDateEnd"
15
- @update-chart-type="emits('update-chart-type', $event)"
16
- @update-custom-time="emits('update-custom-time', $event)"
17
- @update-timespan-type="emits('update-timespan-type', $event)"
18
- @update-unit-count="emits('update-unit-count', $event)"
19
- @update-period-type="emits('update-period-type', $event)"
20
- @update-custom-date-from="emits('update-custom-date-from', $event)"
21
- @update-custom-date-to="emits('update-custom-date-to', $event)"
22
- @update-custom-time-from="emits('update-custom-time-from', $event)"
23
- @update-custom-time-to="emits('update-custom-time-to', $event)"
24
- />
25
- <common-monitor-advanced-tools-chart-options-modal-counters-timespan-object
26
- :type="props.type"
27
- :chart="props.chart"
28
- :total-cores="props.totalCores"
29
- :host-id="props.hostId"
30
- :selected-metrics-keys="props.selectedMetricsKeys"
31
- :total-metric-items="props.totalMetricItems"
32
- :selected-objects="props.selectedObjects"
33
- :loading="props.objectsLoading"
34
- :current-items="props.objectsData"
35
- @select-objects="emits('select-objects', $event)"
36
- />
37
- </div>
2
+ <common-monitor-advanced-tools-chart-options-modal-counters-timespan-new
3
+ v-if="isNewView"
4
+ :type="props.type"
5
+ :chart="props.chart"
6
+ :language="props.language"
7
+ :selected-chart-type="props.selectedChartType"
8
+ :selected-timespan-type="props.selectedTimespanType"
9
+ :units-count="props.unitsCount"
10
+ :period-type="props.periodType"
11
+ :selected-custom-time="props.selectedCustomTime"
12
+ :custom-date-from="props.customDateFrom"
13
+ :custom-date-to="props.customDateTo"
14
+ :custom-time-from="props.customTimeFrom"
15
+ :custom-time-to="props.customTimeTo"
16
+ :total-cores="props.totalCores"
17
+ :host-id="props.hostId"
18
+ :selected-metrics-keys="props.selectedMetricsKeys"
19
+ :total-metric-items="props.totalMetricItems"
20
+ :selected-objects="props.selectedObjects"
21
+ :objects-loading="props.objectsLoading"
22
+ :objects-data="props.objectsData"
23
+ :valid-date-end="props.validDateEnd"
24
+ @update-chart-type="emits('update-chart-type', $event)"
25
+ @update-custom-time="emits('update-custom-time', $event)"
26
+ @update-timespan-type="emits('update-timespan-type', $event)"
27
+ @update-unit-count="emits('update-unit-count', $event)"
28
+ @update-period-type="emits('update-period-type', $event)"
29
+ @update-custom-date-from="emits('update-custom-date-from', $event)"
30
+ @update-custom-date-to="emits('update-custom-date-to', $event)"
31
+ @update-custom-time-from="emits('update-custom-time-from', $event)"
32
+ @update-custom-time-to="emits('update-custom-time-to', $event)"
33
+ @select-objects="emits('select-objects', $event)"
34
+ />
35
+ <common-monitor-advanced-tools-chart-options-modal-counters-timespan-old
36
+ v-else
37
+ :type="props.type"
38
+ :chart="props.chart"
39
+ :language="props.language"
40
+ :selected-chart-type="props.selectedChartType"
41
+ :selected-timespan-type="props.selectedTimespanType"
42
+ :units-count="props.unitsCount"
43
+ :period-type="props.periodType"
44
+ :selected-custom-time="props.selectedCustomTime"
45
+ :custom-date-from="props.customDateFrom"
46
+ :custom-date-to="props.customDateTo"
47
+ :custom-time-from="props.customTimeFrom"
48
+ :custom-time-to="props.customTimeTo"
49
+ :total-cores="props.totalCores"
50
+ :host-id="props.hostId"
51
+ :selected-metrics-keys="props.selectedMetricsKeys"
52
+ :total-metric-items="props.totalMetricItems"
53
+ :selected-objects="props.selectedObjects"
54
+ :objects-loading="props.objectsLoading"
55
+ :objects-data="props.objectsData"
56
+ :valid-date-end="props.validDateEnd"
57
+ @update-chart-type="emits('update-chart-type', $event)"
58
+ @update-custom-time="emits('update-custom-time', $event)"
59
+ @update-timespan-type="emits('update-timespan-type', $event)"
60
+ @update-unit-count="emits('update-unit-count', $event)"
61
+ @update-period-type="emits('update-period-type', $event)"
62
+ @update-custom-date-from="emits('update-custom-date-from', $event)"
63
+ @update-custom-date-to="emits('update-custom-date-to', $event)"
64
+ @update-custom-time-from="emits('update-custom-time-from', $event)"
65
+ @update-custom-time-to="emits('update-custom-time-to', $event)"
66
+ @select-objects="emits('select-objects', $event)"
67
+ />
38
68
  </template>
39
69
 
40
70
  <script setup lang="ts">
@@ -80,16 +110,10 @@ const emits = defineEmits<{
80
110
  (event: 'update-custom-time-to', value: string): void
81
111
  (event: 'select-objects', value: string): void
82
112
  }>()
113
+
114
+ const { $store }: any = useNuxtApp()
115
+
116
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
83
117
  </script>
84
118
 
85
- <style scoped lang="scss">
86
- .timespan-objects-section-direction {
87
- display: flex;
88
- flex-direction: row;
89
- }
90
- @media (max-width: 1024px) {
91
- .timespan-objects-section-direction {
92
- flex-direction: column;
93
- }
94
- }
95
- </style>
119
+ <style scoped lang="scss"></style>
@@ -0,0 +1,150 @@
1
+ <template>
2
+ <div class="timespan-container">
3
+ <common-chart-options-modal-counters-timespan-form
4
+ :language="props.language"
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"
10
+ :custom-date-from="props.customDateFrom"
11
+ :custom-date-to="props.customDateTo"
12
+ :custom-time-from="props.customTimeFrom"
13
+ :custom-time-to="props.customTimeTo"
14
+ :valid-date-end="props.validDateEnd"
15
+ @update-chart-type="emits('update-chart-type', $event)"
16
+ @update-custom-time="emits('update-custom-time', $event)"
17
+ @update-timespan-type="emits('update-timespan-type', $event)"
18
+ @update-unit-count="emits('update-unit-count', $event)"
19
+ @update-period-type="emits('update-period-type', $event)"
20
+ @update-custom-date-from="emits('update-custom-date-from', $event)"
21
+ @update-custom-date-to="emits('update-custom-date-to', $event)"
22
+ @update-custom-time-from="emits('update-custom-time-from', $event)"
23
+ @update-custom-time-to="emits('update-custom-time-to', $event)"
24
+ />
25
+ <div class="timespan-object-container">
26
+ <div class="chart-type-container">
27
+ <p class="title-block">{{ localization.inventoryMonitor.chartType }}</p>
28
+ <div class="radio-buttons-container">
29
+ <ui-radio
30
+ v-model="chartTypeLocal"
31
+ :label="localization.inventoryMonitor.lineGraph"
32
+ test-id="line-graph"
33
+ value="spline"
34
+ size="sm"
35
+ />
36
+ <ui-radio
37
+ v-model="chartTypeLocal"
38
+ :label="localization.inventoryMonitor.stackedGraph"
39
+ test-id="stacked-graph"
40
+ value="area"
41
+ size="sm"
42
+ />
43
+ </div>
44
+ </div>
45
+ <common-monitor-advanced-tools-chart-options-modal-counters-timespan-object
46
+ :type="props.type"
47
+ :chart="props.chart"
48
+ :total-cores="props.totalCores"
49
+ :host-id="props.hostId"
50
+ :selected-metrics-keys="props.selectedMetricsKeys"
51
+ :total-metric-items="props.totalMetricItems"
52
+ :selected-objects="props.selectedObjects"
53
+ :loading="props.objectsLoading"
54
+ :current-items="props.objectsData"
55
+ @select-objects="emits('select-objects', $event)"
56
+ />
57
+ </div>
58
+ </div>
59
+ </template>
60
+
61
+ <script setup lang="ts">
62
+ import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
63
+ import type {
64
+ UI_T_ChartHost,
65
+ UI_T_ChartVm,
66
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
67
+ import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
68
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
69
+
70
+ const props = defineProps<{
71
+ type: UI_T_AdvancedType
72
+ chart: UI_T_ChartHost | UI_T_ChartVm
73
+ language: string
74
+ selectedChartType: string
75
+ selectedTimespanType: string
76
+ unitsCount: number
77
+ periodType: string
78
+ selectedCustomTime: string
79
+ customDateFrom: string
80
+ customDateTo: string
81
+ customTimeFrom: string
82
+ customTimeTo: string
83
+ totalCores: number
84
+ hostId: string
85
+ selectedMetricsKeys: number[]
86
+ totalMetricItems: number
87
+ selectedObjects: string
88
+ objectsLoading: boolean
89
+ objectsData: UI_I_ObjectItem[]
90
+ validDateEnd: number
91
+ }>()
92
+
93
+ const emits = defineEmits<{
94
+ (event: 'update-chart-type', value: string): void
95
+ (event: 'update-custom-time', value: string): void
96
+ (event: 'update-timespan-type', value: string): void
97
+ (event: 'update-unit-count', value: number): void
98
+ (event: 'update-period-type', value: string): void
99
+ (event: 'update-custom-date-from', value: string): void
100
+ (event: 'update-custom-date-to', value: string): void
101
+ (event: 'update-custom-time-from', value: string): void
102
+ (event: 'update-custom-time-to', value: string): void
103
+ (event: 'select-objects', value: string): void
104
+ }>()
105
+
106
+ const localization = computed<UI_I_Localization>(() => useLocal())
107
+
108
+ const chartTypeLocal = computed<string>({
109
+ get() {
110
+ return props.selectedChartType
111
+ },
112
+ set(newValue) {
113
+ emits('update-chart-type', newValue)
114
+ },
115
+ })
116
+ </script>
117
+
118
+ <style scoped lang="scss">
119
+ .timespan-container {
120
+ display: grid;
121
+ grid-template-columns: 55% 45%;
122
+ grid-gap: 12px;
123
+ margin-top: 12px;
124
+
125
+ .timespan-object-container {
126
+ display: grid;
127
+ grid-template-rows: max-content 1fr;
128
+ grid-gap: 12px;
129
+
130
+ .chart-type-container {
131
+ padding: 12px;
132
+ background: var(--chart-options-timespan-blocks-bg);
133
+ box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.0784313725);
134
+ border-radius: 8px;
135
+
136
+ .title-block {
137
+ color: var(--chart-options-timespan-blocks-title-color);
138
+ font-size: 14px;
139
+ font-weight: 500;
140
+ margin-bottom: 16px;
141
+ }
142
+ .radio-buttons-container {
143
+ display: flex;
144
+ flex-direction: column;
145
+ grid-gap: 12px;
146
+ }
147
+ }
148
+ }
149
+ }
150
+ </style>