bfg-common 1.4.838 → 1.4.839

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 (76) hide show
  1. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  2. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  3. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  5. package/assets/localization/local_be.json +5 -16
  6. package/assets/localization/local_en.json +7 -19
  7. package/assets/localization/local_hy.json +5 -16
  8. package/assets/localization/local_kk.json +5 -16
  9. package/assets/localization/local_ru.json +6 -17
  10. package/assets/localization/local_zh.json +5 -16
  11. package/components/atoms/collapse/CollapseNav.vue +4 -4
  12. package/components/atoms/dropdown/dropdown/Dropdown.vue +0 -12
  13. package/components/atoms/table/dataGrid/DataGridColumnSwitch.vue +2 -2
  14. package/components/atoms/table/dataGrid/lib/utils/export.ts +1 -1
  15. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  16. package/components/common/browse/lib/models/interfaces.ts +5 -5
  17. package/components/common/diagramMain/Header.vue +211 -211
  18. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  19. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  20. package/components/common/diagramMain/lib/models/types.ts +21 -21
  21. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  22. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  23. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  24. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  25. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  26. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  27. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  28. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  29. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  30. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  31. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  32. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  33. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  34. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  35. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  36. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  37. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  38. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  39. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  40. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  41. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  42. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  43. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  44. package/components/common/diagramMain/port/Ports.vue +47 -47
  45. package/components/common/graph/GraphNew.vue +176 -144
  46. package/components/common/modals/confirmByInput/ConfirmByInput.vue +177 -57
  47. package/components/common/monitor/advanced/Advanced.vue +170 -244
  48. package/components/common/monitor/advanced/AdvancedNew.vue +206 -0
  49. package/components/common/monitor/advanced/AdvancedOld.vue +243 -0
  50. package/components/common/monitor/advanced/{GraphView.vue → graphView/GraphView.vue} +170 -180
  51. package/components/common/monitor/advanced/graphView/GraphViewNew.vue +35 -0
  52. package/components/common/monitor/advanced/graphView/GraphViewOld.vue +56 -0
  53. package/components/common/monitor/advanced/table/Table.vue +31 -93
  54. package/components/common/monitor/advanced/table/tableNew/TableNew.vue +85 -0
  55. package/components/common/monitor/advanced/table/tableNew/lib/config/options.ts +139 -0
  56. package/components/common/monitor/advanced/table/tableNew/lib/utils/constructBody.ts +27 -0
  57. package/components/common/monitor/advanced/table/tableOld/TableOld.vue +93 -0
  58. package/components/common/monitor/advanced/tools/Tools.vue +163 -447
  59. package/components/common/monitor/advanced/tools/ToolsNew.vue +366 -0
  60. package/components/common/monitor/advanced/tools/ToolsOld.vue +447 -0
  61. package/components/common/pages/tasks/Tasks.vue +1 -3
  62. package/components/common/pages/tasks/table/Table.vue +0 -1
  63. package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +7 -23
  64. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +0 -1
  65. package/components/common/pages/tasks/table/lib/config/config.ts +2 -2
  66. package/components/common/portlets/customAttributes/Portlet.vue +2 -9
  67. package/components/common/portlets/customAttributes/lib/config/config.ts +0 -7
  68. package/components/common/portlets/tag/Portlet.vue +2 -9
  69. package/components/common/portlets/tag/lib/config/config.ts +0 -7
  70. package/components/common/tools/Actions.vue +2 -5
  71. package/lib/config/uiTable.ts +20 -0
  72. package/lib/models/store/interfaces.ts +0 -1
  73. package/package.json +3 -3
  74. package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +0 -103
  75. package/components/common/modals/confirmByInput/ConfirmByInputOld.vue +0 -204
  76. /package/components/common/monitor/advanced/table/{lib → tableOld/lib}/config/performanceDatatable.ts +0 -0
@@ -0,0 +1,243 @@
1
+ <template>
2
+ <div id="advanced-page" class="fill-parent">
3
+ <div class="routed-view-panel-layout">
4
+ <div class="settingsViewHeader">
5
+ <h3 class="settingsBlockTitle m-0">
6
+ {{ localization.inventoryMonitor.advancedPerformance }}
7
+ </h3>
8
+ </div>
9
+ <div v-if="props.isEmpty" class="empty-data">
10
+ {{ localization.inventoryMonitor.emptyAdvancedGraphText }}
11
+ </div>
12
+ <div v-else class="fill-parent flex-column">
13
+ <div class="vertical-flex-container fill-parent">
14
+ <common-monitor-advanced-tools
15
+ v-model:selected-timespan-type="localSelectedTimespanType"
16
+ :type="props.type"
17
+ :start-date="props.data?.pointStart || 0"
18
+ :end-date="props.data?.pointEnd || 0"
19
+ :chart-title="props.data?.groupName || ''"
20
+ :language="props.language"
21
+ :selected-counters-keys="props.selectedCountersKeys"
22
+ :selected-metric="props.selectedMetric"
23
+ :selected-metric-local="props.selectedMetricLocal"
24
+ :disabled-period="props.disabledPeriod"
25
+ :disabled-view="props.disabledView"
26
+ :selected-chart-type="props.selectedChartType"
27
+ :units-count="props.unitsCount"
28
+ :period-type="props.periodType"
29
+ :selected-custom-time="props.selectedCustomTime"
30
+ :selected-chart-option-name="props.selectedChartOptionName"
31
+ :custom-date-from="props.customDateFrom"
32
+ :custom-date-to="props.customDateTo"
33
+ :custom-time-from="props.customTimeFrom"
34
+ :custom-time-to="props.customTimeTo"
35
+ :total-cores="totalCores"
36
+ :host-id="props.hostId"
37
+ :selected-objects="props.selectedObjects"
38
+ :project="props.project"
39
+ :objects-loading="props.objectsLoading"
40
+ :objects-data="props.objectsData"
41
+ :valid-date-end="props.validDateEnd"
42
+ :format-date="props.formatDate"
43
+ @update-tools="emits('update-tools', $event)"
44
+ @exporting="onExporting"
45
+ @open-advanced-page="onGetEmptyPage"
46
+ @select-row="emits('select-row', $event)"
47
+ @select-metric-local="emits('select-metric-local', $event)"
48
+ @update-chart-type="emits('update-chart-type', $event)"
49
+ @update-timespan-type="emits('update-timespan-type', $event)"
50
+ @update-unit-count="emits('update-unit-count', $event)"
51
+ @update-period-type="emits('update-period-type', $event)"
52
+ @update-custom-time="emits('update-custom-time', $event)"
53
+ @delete-option="emits('delete-option')"
54
+ @submit-options="emits('submit-options', $event)"
55
+ />
56
+
57
+ <div v-show="!props.data" class="empty-container">
58
+ {{
59
+ localization.inventoryMonitor
60
+ .noPerformanceCurrentlySelectedMetrics
61
+ }}
62
+ </div>
63
+
64
+ <div v-show="props.data">
65
+ <div class="main-graphs-loader relative">
66
+ <common-monitor-advanced-graph-view
67
+ :loading="props.advancedLoading"
68
+ :data="props.data"
69
+ :update="update"
70
+ :export="exportGraph"
71
+ :selected-row="selectedRow"
72
+ :dark-mode="props.darkMode"
73
+ :formatted-datetime="props.formattedDatetime"
74
+ :get-date-format="props.getDateFormat"
75
+ :language="props.language"
76
+ :selected-chart-type="props.selectedChartType"
77
+ />
78
+ <div class="datatable">
79
+ <common-monitor-advanced-table
80
+ :data="props.tableData"
81
+ @select="onCheckSelectedRow"
82
+ />
83
+ </div>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ </div>
88
+ </div>
89
+ </div>
90
+ </template>
91
+
92
+ <script setup lang="ts">
93
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
94
+ import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
95
+ import type { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
96
+ import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
97
+ import type { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/lib/models/interfaces'
98
+ import type {
99
+ UI_T_ChartHost,
100
+ UI_T_ChartVm,
101
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
102
+ import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
103
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
104
+ import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
105
+ import type { UI_T_Project } from '~/lib/models/types'
106
+ import { getCountCores } from '~/components/common/monitor/advanced/tools/lib/utils/countCores'
107
+
108
+ const props = defineProps<{
109
+ type: UI_T_AdvancedType
110
+ advancedLoading: boolean
111
+ data: I_SeriesLine | null
112
+ cpuCoresDataData: I_SeriesLine | null
113
+ tableData: UI_I_PerformanceItem[] | []
114
+ language: string
115
+ darkMode: boolean
116
+ formattedDatetime: any
117
+ getDateFormat: any
118
+ selectedCountersKeys: number[]
119
+ selectedMetric: UI_T_ChartHost | UI_T_ChartVm
120
+ selectedMetricLocal: UI_T_ChartHost | UI_T_ChartVm
121
+ selectedChartType: string
122
+ selectedTimespanType: string
123
+ unitsCount: number
124
+ periodType: string
125
+ selectedCustomTime: string
126
+ selectedChartOptionName: string
127
+ customDateFrom: string
128
+ customDateTo: string
129
+ customTimeFrom: string
130
+ customTimeTo: string
131
+ hostId: string
132
+ selectedObjects: string
133
+ project: UI_T_Project
134
+ objectsLoading: boolean
135
+ objectsData: UI_I_ObjectItem[]
136
+ validDateEnd: number
137
+ formatDate: string
138
+ disabledPeriod?: boolean
139
+ disabledView?: boolean
140
+ isEmpty?: boolean
141
+ }>()
142
+
143
+ const emits = defineEmits<{
144
+ (event: 'update:selected-timespan-type', value: string): void
145
+ (event: 'update-tools', value: UI_I_MonitorGraphPayload): void
146
+ (event: 'open-advanced-page'): void
147
+ (event: 'select-row', value: UI_I_AdvancedCounterItem[]): void
148
+ (event: 'select-metric-local', value: string): void
149
+ (event: 'update-chart-type', value: string): void
150
+ (event: 'update-timespan-type', value: string): void
151
+ (event: 'update-unit-count', value: number): void
152
+ (event: 'update-period-type', value: string): void
153
+ (event: 'update-custom-time', value: string): void
154
+ (event: 'delete-option'): void
155
+ (event: 'submit-options', value: UI_I_OptionsForm): void
156
+ }>()
157
+
158
+ const localization = computed<UI_I_Localization>(() => useLocal())
159
+
160
+ const localSelectedTimespanType = computed<string>({
161
+ get() {
162
+ return props.selectedTimespanType
163
+ },
164
+ set(newValue) {
165
+ emits('update:selected-timespan-type', newValue)
166
+ },
167
+ })
168
+
169
+ const totalCores = ref<number>(0)
170
+ let isFirstUpdate = true
171
+ watch(
172
+ () => props.cpuCoresDataData,
173
+ (newValue) => {
174
+ if (!newValue || !isFirstUpdate) return
175
+
176
+ totalCores.value = getCountCores(newValue)
177
+ isFirstUpdate = false
178
+ },
179
+ { immediate: true }
180
+ )
181
+
182
+ const exportGraph = ref<string>('')
183
+ const onExporting = (key: string): void => {
184
+ exportGraph.value = key
185
+ }
186
+
187
+ const onGetEmptyPage = (): void => emits('open-advanced-page')
188
+
189
+ const update = ref<number>(0)
190
+
191
+ const selectedRow = ref<number[]>([])
192
+ const onCheckSelectedRow = (data: number[]): void => {
193
+ selectedRow.value = data
194
+ }
195
+ </script>
196
+
197
+ <style scoped lang="scss">
198
+ #advanced-page {
199
+ overflow-x: hidden;
200
+ }
201
+ .fill-parent {
202
+ flex-direction: column;
203
+
204
+ .empty-data {
205
+ height: 100%;
206
+ display: flex;
207
+ align-items: center;
208
+ justify-content: center;
209
+ }
210
+ .empty-container {
211
+ min-height: 300px;
212
+ height: 100%;
213
+ background-color: var(--block-view-bg-color5);
214
+ display: flex;
215
+ flex-grow: 1;
216
+ flex-shrink: 1;
217
+ justify-content: center;
218
+ align-items: center;
219
+ width: 100%;
220
+ }
221
+
222
+ .routed-view-panel-layout {
223
+ width: 100%;
224
+ height: 100%;
225
+ box-sizing: border-box;
226
+ display: flex;
227
+ flex-direction: column;
228
+
229
+ .settingsViewHeader {
230
+ display: flex;
231
+ align-items: center;
232
+ box-sizing: border-box;
233
+
234
+ .settingsBlockTitle {
235
+ font-size: 22px;
236
+ font-weight: 400;
237
+ color: var(--light-white-100);
238
+ padding: 4px 0 4px 2px;
239
+ }
240
+ }
241
+ }
242
+ }
243
+ </style>
@@ -1,180 +1,170 @@
1
- <template>
2
- <div ref="chartsView" class="advanced-graph-container">
3
- <div v-if="isLoading" class="graphic-loader-block">
4
- <div class="spinner"></div>
5
- <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
- </div>
7
- <template v-if="!props.loading && chartData">
8
- <common-graph
9
- :chart="chart"
10
- :data="chartData"
11
- :update="chartHelper"
12
- :export-type="exportType"
13
- :selected-row="props.selectedRow"
14
- />
15
- </template>
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import { useDebounceFn, useElementSize } from '@vueuse/core'
21
- import { format } from 'date-fns'
22
- import type { UI_I_Localization } from '~/lib/models/interfaces'
23
- import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
24
- import type {
25
- I_LineGraph,
26
- I_SeriesLine,
27
- } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
28
-
29
- const localization = computed<UI_I_Localization>(() => useLocal())
30
-
31
- const props = defineProps<{
32
- loading: boolean
33
- data: I_SeriesLine | null
34
- export: string
35
- selectedRow: number[]
36
- darkMode: boolean
37
- formattedDatetime: any
38
- getDateFormat: any
39
- language: string
40
- selectedChartType: string
41
- }>()
42
-
43
- const isLoading = ref<boolean>(true)
44
-
45
- const chartData = ref<I_LineGraph | null>(null)
46
-
47
- const isFullScreen = ref<boolean>(false)
48
- const chart = ref<any>(null)
49
- const chartHelper = ref<number>(0)
50
-
51
- const fullScreenCallBack = (newValue: boolean): void => {
52
- isFullScreen.value = newValue
53
- }
54
-
55
- const chartCallback = (newValue: any): void => {
56
- newValue && (chart.value = newValue)
57
- }
58
-
59
- watch(
60
- chart,
61
- (newValue) => {
62
- isLoading.value = !newValue?.hasLoaded
63
- },
64
- { immediate: true, deep: true }
65
- )
66
-
67
- let dateFormat = ''
68
-
69
- const chartsView = ref(null)
70
- const { width } = useElementSize(chartsView)
71
-
72
- const startChart = useDebounceFn(() => {
73
- if (!props.data || !width.value) return
74
-
75
- chartData.value = graphDataFunc(
76
- props.data,
77
- props.darkMode,
78
- localization.value,
79
- fullScreenCallBack,
80
- true,
81
- false,
82
- false,
83
- props.selectedChartType,
84
- '',
85
- Math.floor(width.value),
86
- chartCallback,
87
- props.formattedDatetime,
88
- format,
89
- dateFormat
90
- )
91
-
92
- chartHelper.value++
93
- }, 1000)
94
-
95
- watch(
96
- () => props.data,
97
- (newValue) => {
98
- if (!newValue) {
99
- isLoading.value = true
100
- return
101
- }
102
-
103
- startChart()
104
- },
105
- { immediate: true }
106
- )
107
-
108
- watch(
109
- () => props.darkMode,
110
- () => {
111
- startChart()
112
- }
113
- )
114
-
115
- watch(
116
- () => props.language,
117
- () => {
118
- dateFormat = props.getDateFormat(props.language)
119
- startChart()
120
- }
121
- )
122
-
123
- watch(
124
- () => props.selectedChartType,
125
- () => {
126
- startChart()
127
- },
128
- { immediate: true }
129
- )
130
-
131
- watch(width, (newValue) => {
132
- if (newValue) startChart()
133
-
134
- if (!chart.value?.isResizing) return
135
-
136
- chart.value.setSize(1, chart.chartHeight)
137
-
138
- if (isFullScreen.value) {
139
- chart.value.setSize(window.innerWidth, chart.chartHeight)
140
- return
141
- }
142
-
143
- setTimeout(() => {
144
- chart.value.setSize(newValue, chart.chartHeight)
145
- }, 1000)
146
- })
147
-
148
- const exportType = ref<string>('')
149
- watch(
150
- () => props.export,
151
- (newValue) => {
152
- if (!newValue) return
153
-
154
- exportType.value = newValue
155
- },
156
- { immediate: true }
157
- )
158
- </script>
159
-
160
- <style scoped lang="scss">
161
- .advanced-graph-container {
162
- position: relative;
163
- min-height: 400px;
164
-
165
- .graphic-loader-block {
166
- background-color: var(--loader-bg-color);
167
- height: 100%;
168
- display: flex;
169
- flex-direction: column;
170
- align-items: center;
171
- justify-content: center;
172
- position: absolute;
173
- top: 0;
174
- left: 0;
175
- right: 0;
176
- bottom: 0;
177
- z-index: 1;
178
- }
179
- }
180
- </style>
1
+ <template>
2
+ <common-monitor-advanced-graph-view-new
3
+ v-if="isNewView"
4
+ :loading="props.loading"
5
+ :is-loading="isLoading"
6
+ :chart-data="chartData"
7
+ :chart="chart"
8
+ :chart-helper="chartHelper"
9
+ :export-type="props.export"
10
+ :selected-row="props.selectedRow"
11
+ :group-name="props.data?.groupName || ''"
12
+ />
13
+ <common-monitor-advanced-graph-view-old
14
+ v-else
15
+ :loading="props.loading"
16
+ :is-loading="isLoading"
17
+ :chart-data="chartData"
18
+ :chart="chart"
19
+ :chart-helper="chartHelper"
20
+ :export-type="props.export"
21
+ :selected-row="props.selectedRow"
22
+ />
23
+ </template>
24
+
25
+ <script setup lang="ts">
26
+ import type {
27
+ I_LineGraph,
28
+ I_SeriesLine,
29
+ } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
30
+ import { useDebounceFn, useElementSize } from '@vueuse/core'
31
+ import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
32
+ import { format } from 'date-fns'
33
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
34
+
35
+ const props = defineProps<{
36
+ loading: boolean
37
+ data: I_SeriesLine | null
38
+ export: string
39
+ selectedRow: number[]
40
+ darkMode: boolean
41
+ formattedDatetime: any
42
+ getDateFormat: any
43
+ language: string
44
+ selectedChartType: string
45
+ }>()
46
+
47
+ const { $store }: any = useNuxtApp()
48
+
49
+ const localization = computed<UI_I_Localization>(() => useLocal())
50
+
51
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
52
+
53
+ const isLoading = ref<boolean>(true)
54
+
55
+ const chartData = ref<I_LineGraph | null>(null)
56
+
57
+ const isFullScreen = ref<boolean>(false)
58
+ const chart = ref<any>(null)
59
+ const chartHelper = ref<number>(0)
60
+
61
+ const fullScreenCallBack = (newValue: boolean): void => {
62
+ isFullScreen.value = newValue
63
+ }
64
+
65
+ const chartCallback = (newValue: any): void => {
66
+ newValue && (chart.value = newValue)
67
+ }
68
+
69
+ watch(
70
+ chart,
71
+ (newValue) => {
72
+ isLoading.value = !newValue?.hasLoaded
73
+ },
74
+ { immediate: true, deep: true }
75
+ )
76
+
77
+ let dateFormat = ''
78
+
79
+ const chartsView = ref(null)
80
+ const { width } = useElementSize(chartsView)
81
+
82
+ const startChart = useDebounceFn(() => {
83
+ if (!props.data || !width.value) return
84
+
85
+ chartData.value = graphDataFunc(
86
+ props.data,
87
+ props.darkMode,
88
+ localization.value,
89
+ fullScreenCallBack,
90
+ true,
91
+ false,
92
+ false,
93
+ props.selectedChartType,
94
+ '',
95
+ Math.floor(width.value),
96
+ chartCallback,
97
+ props.formattedDatetime,
98
+ format,
99
+ dateFormat
100
+ )
101
+
102
+ chartHelper.value++
103
+ }, 1000)
104
+
105
+ watch(
106
+ () => props.data,
107
+ (newValue) => {
108
+ if (!newValue) {
109
+ isLoading.value = true
110
+ return
111
+ }
112
+
113
+ startChart()
114
+ },
115
+ { immediate: true }
116
+ )
117
+
118
+ watch(
119
+ () => props.darkMode,
120
+ () => {
121
+ startChart()
122
+ }
123
+ )
124
+
125
+ watch(
126
+ () => props.language,
127
+ () => {
128
+ dateFormat = props.getDateFormat(props.language)
129
+ startChart()
130
+ }
131
+ )
132
+
133
+ watch(
134
+ () => props.selectedChartType,
135
+ () => {
136
+ startChart()
137
+ },
138
+ { immediate: true }
139
+ )
140
+
141
+ watch(width, (newValue) => {
142
+ if (newValue) startChart()
143
+
144
+ if (!chart.value?.isResizing) return
145
+
146
+ chart.value.setSize(1, chart.chartHeight)
147
+
148
+ if (isFullScreen.value) {
149
+ chart.value.setSize(window.innerWidth, chart.chartHeight)
150
+ return
151
+ }
152
+
153
+ setTimeout(() => {
154
+ chart.value.setSize(newValue, chart.chartHeight)
155
+ }, 1000)
156
+ })
157
+
158
+ const exportType = ref<string>('')
159
+ watch(
160
+ () => props.export,
161
+ (newValue) => {
162
+ if (!newValue) return
163
+
164
+ exportType.value = newValue
165
+ },
166
+ { immediate: true }
167
+ )
168
+ </script>
169
+
170
+ <style scoped lang="scss"></style>
@@ -0,0 +1,35 @@
1
+ <template>
2
+ <div ref="chartsView" class="advanced-graph-container">
3
+ <ui-skeleton-long-metric v-if="props.isLoading" :title="props.groupName" />
4
+ <template v-if="!props.loading && props.chartData">
5
+ <common-graph
6
+ :chart="props.chart"
7
+ :data="props.chartData"
8
+ :update="props.chartHelper"
9
+ :export-type="props.exportType"
10
+ :selected-row="props.selectedRow"
11
+ />
12
+ </template>
13
+ </div>
14
+ </template>
15
+
16
+ <script setup lang="ts">
17
+ import type { I_LineGraph } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
18
+
19
+ const props = defineProps<{
20
+ loading: boolean
21
+ isLoading: boolean
22
+ chartData: I_LineGraph | null
23
+ chart: any
24
+ chartHelper: number
25
+ exportType: string
26
+ selectedRow: number[]
27
+ groupName: string
28
+ }>()
29
+ </script>
30
+
31
+ <style scoped lang="scss">
32
+ .advanced-graph-container {
33
+ min-height: 400px;
34
+ }
35
+ </style>
@@ -0,0 +1,56 @@
1
+ <template>
2
+ <div ref="chartsView" class="advanced-graph-container">
3
+ <div v-if="props.isLoading" class="graphic-loader-block">
4
+ <div class="spinner"></div>
5
+ <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
+ </div>
7
+ <template v-if="!props.loading && props.chartData">
8
+ <common-graph
9
+ :chart="props.chart"
10
+ :data="props.chartData"
11
+ :update="props.chartHelper"
12
+ :export-type="props.exportType"
13
+ :selected-row="props.selectedRow"
14
+ />
15
+ </template>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
21
+ import type { I_LineGraph } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
22
+
23
+ const localization = computed<UI_I_Localization>(() => useLocal())
24
+
25
+ const props = defineProps<{
26
+ loading: boolean
27
+ isLoading: boolean
28
+ chartData: I_LineGraph | null
29
+ chart: any
30
+ chartHelper: number
31
+ exportType: string
32
+ selectedRow: number[]
33
+ }>()
34
+ </script>
35
+
36
+ <style scoped lang="scss">
37
+ .advanced-graph-container {
38
+ position: relative;
39
+ min-height: 400px;
40
+
41
+ .graphic-loader-block {
42
+ background-color: var(--loader-bg-color);
43
+ height: 100%;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ right: 0;
52
+ bottom: 0;
53
+ z-index: 1;
54
+ }
55
+ }
56
+ </style>