bfg-common 1.2.195 → 1.2.196

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.
@@ -33,6 +33,8 @@
33
33
  :total-cores="totalCores"
34
34
  :host-id="props.hostId"
35
35
  :selected-objects="props.selectedObjects"
36
+ :project="props.project"
37
+ :objects-loading="props.objectsLoading"
36
38
  @update-tools="emits('update-tools', $event)"
37
39
  @exporting="onExporting"
38
40
  @open-advanced-page="onGetEmptyPage"
@@ -49,6 +51,7 @@
49
51
  @update-custom-time-from="emits('update-custom-time-from', $event)"
50
52
  @update-custom-time-to="emits('update-custom-time-to', $event)"
51
53
  @submit-options="emits('submit-options', $event)"
54
+ @update-cores="emits('update-cores')"
52
55
  />
53
56
 
54
57
  <div v-show="!props.data" class="empty-container">
@@ -92,11 +95,12 @@ import { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/models/interfaces'
92
95
  import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
93
96
  import { UI_I_PerformanceItem } from '~/components/common/monitor/advanced/table/models/interfaces'
94
97
  import {
95
- T_ChartHost,
96
- T_ChartVm,
98
+ UI_T_ChartHost,
99
+ UI_T_ChartVm,
97
100
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
98
101
  import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/interfaces'
99
102
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
103
+ import { UI_T_Project } from '~/models/types'
100
104
  import { getCountCores } from '~/components/common/monitor/advanced/tools/utils/countCores'
101
105
 
102
106
  const props = defineProps<{
@@ -110,7 +114,7 @@ const props = defineProps<{
110
114
  formattedDatetime: any
111
115
  getDateFormat: any
112
116
  selectedCountersKeys: number[]
113
- selectedMetric: T_ChartHost | T_ChartVm
117
+ selectedMetric: UI_T_ChartHost | UI_T_ChartVm
114
118
  selectedChartType: string
115
119
  selectedTimespanType: string
116
120
  unitsCount: number
@@ -123,6 +127,8 @@ const props = defineProps<{
123
127
  customTimeTo: string
124
128
  hostId: string
125
129
  selectedObjects: string
130
+ project: UI_T_Project
131
+ objectsLoading: boolean
126
132
  disabledPeriod?: boolean
127
133
  disabledView?: boolean
128
134
  isEmpty?: boolean
@@ -146,6 +152,7 @@ const emits = defineEmits<{
146
152
  (event: 'update-custom-time-to', value: string): void
147
153
  (event: 'submit-options', value: UI_I_OptionsForm): void
148
154
  (event: 'update:selected-timespan-type', value: string): void
155
+ (event: 'update-cores'): void
149
156
  }>()
150
157
 
151
158
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -101,6 +101,8 @@
101
101
  :total-cores="props.totalCores"
102
102
  :host-id="props.hostId"
103
103
  :selected-objects="props.selectedObjects"
104
+ :project="props.project"
105
+ :objects-loading="props.objectsLoading"
104
106
  @hide="isShowModal = false"
105
107
  @select-row="emits('select-row', $event)"
106
108
  @select-metric="emits('select-metric', $event)"
@@ -116,6 +118,7 @@
116
118
  @update-custom-time-from="emits('update-custom-time-from', $event)"
117
119
  @update-custom-time-to="emits('update-custom-time-to', $event)"
118
120
  @submit-options="emits('submit-options', $event)"
121
+ @update-cores="emits('update-cores')"
119
122
  />
120
123
  </template>
121
124
 
@@ -126,11 +129,12 @@ import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/int
126
129
  import { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/models/interfaces'
127
130
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
128
131
  import {
129
- T_ChartHost,
130
- T_ChartVm,
132
+ UI_T_ChartHost,
133
+ UI_T_ChartVm,
131
134
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
132
135
  import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/interfaces'
133
136
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
137
+ import { UI_T_Project } from '~/models/types'
134
138
  import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
135
139
  import {
136
140
  periodFunc,
@@ -146,7 +150,7 @@ const props = defineProps<{
146
150
  chartTitle: string
147
151
  language: string
148
152
  selectedCountersKeys: number[]
149
- selectedMetric: T_ChartHost | T_ChartVm
153
+ selectedMetric: UI_T_ChartHost | UI_T_ChartVm
150
154
  selectedChartType: string
151
155
  selectedTimespanType: string
152
156
  unitsCount: number
@@ -160,6 +164,8 @@ const props = defineProps<{
160
164
  totalCores: number
161
165
  hostId: string
162
166
  selectedObjects: string
167
+ project: UI_T_Project
168
+ objectsLoading: boolean
163
169
  disabledPeriod?: boolean
164
170
  disabledView?: boolean
165
171
  }>()
@@ -182,6 +188,7 @@ const emits = defineEmits<{
182
188
  (event: 'update-custom-time-to', value: string): void
183
189
  (event: 'submit-options', value: UI_I_OptionsForm): void
184
190
  (event: 'update:selected-timespan-type', value: string): void
191
+ (event: 'update-cores'): void
185
192
  }>()
186
193
 
187
194
  const routeType = '' + useRoute().params.type
@@ -215,7 +222,7 @@ watch(
215
222
 
216
223
  const onDeleteOption = (): void => {
217
224
  emits('delete-option')
218
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
225
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
219
226
  }
220
227
 
221
228
  const periodOptions = computed<UI_I_OptionItem[]>(() =>
@@ -239,10 +246,11 @@ watch(isShowModal, (newValue) => {
239
246
  const updateTools = (): void => {
240
247
  const periodValue = selectedPeriod.value
241
248
  const viewValue = selectedView.value
249
+ const prefix = props.project === 'sphere'
242
250
  const selectedValue = useLocalStorage(
243
251
  viewValue + 'ChartOptions',
244
252
  undefined,
245
- false
253
+ prefix
246
254
  )
247
255
 
248
256
  const fields = selectedValue
@@ -314,11 +322,11 @@ const onShowChartOptions = (): void => {
314
322
  }
315
323
 
316
324
  const onSaveOptionName = (): void => {
317
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
325
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
318
326
  }
319
327
 
320
328
  onMounted(() => {
321
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
329
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
322
330
  updateTools()
323
331
  })
324
332
  </script>
@@ -48,6 +48,7 @@
48
48
  :host-id="props.hostId"
49
49
  :selected-metrics-keys="selectedMetricsKeys"
50
50
  :selected-objects="props.selectedObjects"
51
+ :objects-loading="props.objectsLoading"
51
52
  @select-row="selectedRows = $event"
52
53
  @update-chart-type="selectedChartTypeLocal = $event"
53
54
  @update-custom-time="localCustomTime = $event"
@@ -59,6 +60,7 @@
59
60
  @update-custom-time-from="onUpdateCustomTimeFrom"
60
61
  @update-custom-time-to="onUpdateCustomTimeTo"
61
62
  @select-objects="localSelectedObjects = $event"
63
+ @update-cores="emits('update-cores')"
62
64
  />
63
65
  </div>
64
66
  </div>
@@ -73,10 +75,11 @@ import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/t
73
75
  import { UI_I_VerticalTabs } from '~/components/atoms/tabs/models/interfaces'
74
76
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
75
77
  import {
76
- T_ChartHost,
77
- T_ChartVm,
78
+ UI_T_ChartHost,
79
+ UI_T_ChartVm,
78
80
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
79
81
  import { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/interfaces'
82
+ import { UI_T_Project } from '~/models/types'
80
83
  import { metricsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/metrics/config/optionsMetrics'
81
84
  import { getCurrentOptionsStorageFunc } from '~/components/common/monitor/advanced/tools/config/advancedToolbar'
82
85
  import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/config/dateChecker'
@@ -86,7 +89,7 @@ const props = defineProps<{
86
89
  type: UI_T_AdvancedType
87
90
  language: string
88
91
  selectedCountersKeys: number[]
89
- selectedMetric: T_ChartHost | T_ChartVm
92
+ selectedMetric: UI_T_ChartHost | UI_T_ChartVm
90
93
  selectedChartType: string
91
94
  selectedTimespanType: string
92
95
  unitsCount: number
@@ -100,6 +103,8 @@ const props = defineProps<{
100
103
  totalCores: number
101
104
  hostId: string
102
105
  selectedObjects: string
106
+ project: UI_T_Project
107
+ objectsLoading: boolean
103
108
  }>()
104
109
 
105
110
  const emits = defineEmits<{
@@ -119,6 +124,7 @@ const emits = defineEmits<{
119
124
  (event: 'update-custom-time-to', value: string): void
120
125
  (event: 'submit-options', value: UI_I_OptionsForm): void
121
126
  (event: 'select-objects', value: string): void
127
+ (event: 'update-cores'): void
122
128
  }>()
123
129
 
124
130
  const routeType = '' + useRoute().params.type
@@ -145,7 +151,7 @@ const onUpdateCustomTimeTo = (value: string): void => {
145
151
  const metricsItems = computed<UI_I_VerticalTabs[]>(() =>
146
152
  metricsFunc(localization.value, props.type)
147
153
  )
148
- const selectedMetric = ref<T_ChartHost | T_ChartVm>(
154
+ const selectedMetric = ref<UI_T_ChartHost | UI_T_ChartVm>(
149
155
  props.selectedMetric || '' + metricsItems.value[0]?.value
150
156
  )
151
157
 
@@ -375,8 +381,9 @@ const onSaveOptions = (name: string): void => {
375
381
  type: timespanType.value,
376
382
  },
377
383
  }
378
- useLocalStorage(`${name}ChartOptions`, saveOptionsData, false)
379
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
384
+ const prefix = props.project === 'sphere'
385
+ useLocalStorage(`${name}ChartOptions`, saveOptionsData, prefix)
386
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
380
387
  localSelectedChartOptionName.value = name
381
388
  emits('save-option-name')
382
389
  }
@@ -402,7 +409,12 @@ const setDefaultOptions = (): void => {
402
409
  }
403
410
 
404
411
  const setCustomOptions = (name: string): void => {
405
- const selectedValue = useLocalStorage(name + 'ChartOptions', undefined, false)
412
+ const prefix = props.project === 'sphere'
413
+ const selectedValue = useLocalStorage(
414
+ name + 'ChartOptions',
415
+ undefined,
416
+ prefix
417
+ )
406
418
 
407
419
  if (selectedValue.routeType !== routeType) return
408
420
 
@@ -442,7 +454,7 @@ watch(
442
454
 
443
455
  const onDeleteChartName = (name: string): void => {
444
456
  window.localStorage.removeItem(name + 'ChartOptions')
445
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
457
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
446
458
  setSelectOptions()
447
459
  emits('delete-option')
448
460
  }
@@ -455,7 +467,7 @@ const isDisabledSubmit = computed<boolean>(
455
467
  )
456
468
 
457
469
  onMounted(() => {
458
- optionsNames.value = getCurrentOptionsStorageFunc(routeType)
470
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
459
471
  })
460
472
  </script>
461
473
 
@@ -25,6 +25,7 @@
25
25
  :selected-metrics-keys="props.selectedMetricsKeys"
26
26
  :total-metric-items="totalMetricItems"
27
27
  :selected-objects="props.selectedObjects"
28
+ :objects-loading="props.objectsLoading"
28
29
  @update-chart-type="emits('update-chart-type', $event)"
29
30
  @update-custom-time="emits('update-custom-time', $event)"
30
31
  @update-timespan-type="emits('update-timespan-type', $event)"
@@ -35,21 +36,22 @@
35
36
  @update-custom-time-from="emits('update-custom-time-from', $event)"
36
37
  @update-custom-time-to="emits('update-custom-time-to', $event)"
37
38
  @select-objects="emits('select-objects', $event)"
39
+ @update-cores="emits('update-cores')"
38
40
  />
39
41
  </div>
40
42
  </template>
41
43
 
42
44
  <script setup lang="ts">
43
45
  import {
44
- T_ChartHost,
45
- T_ChartVm,
46
+ UI_T_ChartHost,
47
+ UI_T_ChartVm,
46
48
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
47
49
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
48
50
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
49
51
 
50
52
  const props = defineProps<{
51
53
  language: string
52
- chart: T_ChartHost | T_ChartVm
54
+ chart: UI_T_ChartHost | UI_T_ChartVm
53
55
  type: UI_T_AdvancedType
54
56
  selectedKeys: number[]
55
57
  selectedChartType: string
@@ -65,6 +67,7 @@ const props = defineProps<{
65
67
  hostId: string
66
68
  selectedMetricsKeys: number[]
67
69
  selectedObjects: string
70
+ objectsLoading: boolean
68
71
  }>()
69
72
 
70
73
  const emits = defineEmits<{
@@ -79,6 +82,7 @@ const emits = defineEmits<{
79
82
  (event: 'update-custom-time-from', value: string): void
80
83
  (event: 'update-custom-time-to', value: string): void
81
84
  (event: 'select-objects', value: string): void
85
+ (event: 'update-cores'): void
82
86
  }>()
83
87
 
84
88
  const totalMetricItems = ref<number>(0)
@@ -32,14 +32,14 @@ import {UI_I_Localization, UI_I_Pagination} from '~/models/interfaces'
32
32
  import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/tableConfig'
33
33
  import { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
34
34
  import {
35
- T_ChartHost,
36
- T_ChartVm,
35
+ UI_T_ChartHost,
36
+ UI_T_ChartVm,
37
37
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
38
38
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
39
39
  import { countersItemsFunc } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/config/utils'
40
40
 
41
41
  const props = defineProps<{
42
- chart: T_ChartHost | T_ChartVm
42
+ chart: UI_T_ChartHost | UI_T_ChartVm
43
43
  type: UI_T_AdvancedType
44
44
  selectedKeys: number[]
45
45
  }>()
@@ -5,13 +5,13 @@ import {
5
5
  I_VmMetrics,
6
6
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/models/interfaces'
7
7
  import {
8
- T_ChartHost,
9
- T_ChartVm,
8
+ UI_T_ChartHost,
9
+ UI_T_ChartVm,
10
10
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
11
11
  import { UI_I_Localization } from '~/models/interfaces'
12
12
 
13
13
  const hostItemsFunc = (
14
- chart: T_ChartHost,
14
+ chart: UI_T_ChartHost,
15
15
  localization: UI_I_Localization
16
16
  ): UI_I_AdvancedCounterItem[] => {
17
17
  const cpu: UI_I_AdvancedCounterItem[] = [
@@ -395,7 +395,7 @@ const hostItemsFunc = (
395
395
  }
396
396
 
397
397
  const vmItemsFunc = (
398
- chart: T_ChartVm,
398
+ chart: UI_T_ChartVm,
399
399
  localization: UI_I_Localization
400
400
  ): UI_I_AdvancedCounterItem[] => {
401
401
  const disk: UI_I_AdvancedCounterItem[] = [
@@ -614,7 +614,7 @@ const vmItemsFunc = (
614
614
 
615
615
  export const countersItemsFunc = (
616
616
  type: UI_T_AdvancedType,
617
- chart: T_ChartHost | T_ChartVm,
617
+ chart: UI_T_ChartHost | UI_T_ChartVm,
618
618
  localization: UI_I_Localization
619
619
  ): UI_I_AdvancedCounterItem[] => {
620
620
  let result: UI_I_AdvancedCounterItem[] = []
@@ -29,7 +29,9 @@
29
29
  :selected-metrics-keys="props.selectedMetricsKeys"
30
30
  :total-metric-items="props.totalMetricItems"
31
31
  :selected-objects="props.selectedObjects"
32
+ :loading="props.objectsLoading"
32
33
  @select-objects="emits('select-objects', $event)"
34
+ @update-cores="emits('update-cores')"
33
35
  />
34
36
  </div>
35
37
  </template>
@@ -37,13 +39,13 @@
37
39
  <script setup lang="ts">
38
40
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
39
41
  import {
40
- T_ChartHost,
41
- T_ChartVm,
42
+ UI_T_ChartHost,
43
+ UI_T_ChartVm,
42
44
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
43
45
 
44
46
  const props = defineProps<{
45
47
  type: UI_T_AdvancedType
46
- chart: T_ChartHost | T_ChartVm
48
+ chart: UI_T_ChartHost | UI_T_ChartVm
47
49
  language: string
48
50
  selectedChartType: string
49
51
  selectedTimespanType: string
@@ -59,6 +61,7 @@ const props = defineProps<{
59
61
  selectedMetricsKeys: number[]
60
62
  totalMetricItems: number
61
63
  selectedObjects: string
64
+ objectsLoading: boolean
62
65
  }>()
63
66
 
64
67
  const emits = defineEmits<{
@@ -73,6 +76,7 @@ const emits = defineEmits<{
73
76
  (event: 'update-custom-time-from', value: string): void
74
77
  (event: 'update-custom-time-to', value: string): void
75
78
  (event: 'select-objects', value: string): void
79
+ (event: 'update-cores'): void
76
80
  }>()
77
81
  </script>
78
82
 
@@ -12,6 +12,7 @@
12
12
  v-model:page="pagination.page"
13
13
  type="checkbox"
14
14
  class="data-table"
15
+ :loading="props.loading"
15
16
  :head-items="headItems"
16
17
  :body-items="bodyItems"
17
18
  :total-items="bodyItems.length"
@@ -36,22 +37,24 @@ import { UI_I_AdvancedTargetObject } from '~/components/common/monitor/advanced/
36
37
  import * as table from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/config/objectTable'
37
38
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
38
39
  import {
39
- T_ChartHost,
40
- T_ChartVm,
40
+ UI_T_ChartHost,
41
+ UI_T_ChartVm,
41
42
  } from '~/components/common/monitor/advanced/tools/chartOptionsModal/models/types'
42
43
 
43
44
  const props = defineProps<{
44
45
  type: UI_T_AdvancedType
45
- chart: T_ChartHost | T_ChartVm
46
+ chart: UI_T_ChartHost | UI_T_ChartVm
46
47
  totalCores: number
47
48
  hostId: string
48
49
  selectedMetricsKeys: number[]
49
50
  totalMetricItems: number
50
51
  selectedObjects: string
52
+ loading: boolean
51
53
  }>()
52
54
 
53
55
  const emits = defineEmits<{
54
56
  (event: 'select-objects', value: string): void
57
+ (event: 'update-cores'): void
55
58
  }>()
56
59
 
57
60
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -72,6 +75,24 @@ const columnItems = computed<UI_I_ColumnKey[]>(() =>
72
75
  const bodyItems = ref<UI_I_BodyItem[][]>([])
73
76
 
74
77
  let items: UI_I_AdvancedTargetObject[] = []
78
+ let firstRequest = false
79
+ const getTotalCores = (): void => {
80
+ if (
81
+ props.selectedMetricsKeys.includes(1) &&
82
+ !props.totalCores &&
83
+ !firstRequest
84
+ ) {
85
+ emits('update-cores')
86
+ firstRequest = true
87
+ }
88
+ }
89
+ watch(
90
+ () => props.selectedMetricsKeys,
91
+ () => {
92
+ getTotalCores()
93
+ },
94
+ { deep: true }
95
+ )
75
96
  watch(
76
97
  () => [
77
98
  props.type,
@@ -1,3 +1,3 @@
1
- export type T_ChartHost = 'cpu' | 'memory' | 'network' | 'disk'
1
+ export type UI_T_ChartHost = 'cpu' | 'memory' | 'network' | 'disk'
2
2
 
3
- export type T_ChartVm = 'cpu' | 'memory' | 'network' | 'disk' | 'datastore'
3
+ export type UI_T_ChartVm = 'cpu' | 'memory' | 'network' | 'disk' | 'datastore'
@@ -3,6 +3,7 @@ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
3
3
  import { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/models/interfaces'
4
4
  import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/models/types'
5
5
  import { UI_I_OptionData } from '~/components/common/monitor/advanced/models/interfaces'
6
+ import { UI_T_Project } from '~/models/types'
6
7
 
7
8
  export const periodFunc = (
8
9
  localization: UI_I_Localization,
@@ -103,15 +104,21 @@ export const exportFunc = (
103
104
  { text: localization.toCsv + '...', action: 'csv' },
104
105
  ]
105
106
 
106
- export const getCurrentOptionsStorageFunc = (routeType: string): string[] => {
107
+ export const getCurrentOptionsStorageFunc = (
108
+ routeType: string,
109
+ project: UI_T_Project
110
+ ): string[] => {
111
+ const prefix = project === 'sphere'
107
112
  const optionsNames = []
108
113
  for (const key of Object.entries(localStorage)) {
109
- const currentOptions = useLocalStorage(key[0], undefined, false)
110
- if (
111
- key[0].includes('ChartOptions') &&
112
- currentOptions.routeType === routeType
113
- ) {
114
- optionsNames.push(key[0].replace('ChartOptions', ''))
114
+ if (key[0].includes('ChartOptions')) {
115
+ const currentOptions = useLocalStorage(key[0], undefined, prefix)
116
+ if (
117
+ key[0].includes('ChartOptions') &&
118
+ currentOptions.routeType === routeType
119
+ ) {
120
+ optionsNames.push(key[0].replace('ChartOptions', ''))
121
+ }
115
122
  }
116
123
  }
117
124
  return optionsNames
@@ -55,13 +55,14 @@
55
55
  <script setup lang="ts">
56
56
  import { UI_I_Localization } from '~/models/interfaces'
57
57
  import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
58
+ import { UI_T_Project } from '~/models/types'
59
+ import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
60
+ import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
58
61
  import {
59
62
  periodFunc,
60
63
  viewFunc,
61
64
  } from '~/components/common/monitor/overview/filters/config/filterOptions'
62
- import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/models/interfaces'
63
65
  import { getValidDateByOptionFunc } from '~/components/common/monitor/config/getValidDateByOption'
64
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
65
66
 
66
67
  const localization = computed<UI_I_Localization>(() => useLocal())
67
68
  const { $formattedDatetime } = useNuxtApp()
@@ -73,7 +74,7 @@ const props = defineProps<{
73
74
  view: UI_T_OverviewViewType
74
75
  selectedPeriods: number[]
75
76
  formatDate: string
76
- projectType?: number
77
+ project: UI_T_Project
77
78
  formatTime?: string
78
79
  }>()
79
80
 
@@ -142,7 +143,7 @@ const disabledPeriodOptions = computed<boolean>(() => props.chartType === 'pie')
142
143
 
143
144
  const selectedView = ref<string>('')
144
145
  const viewOptions = computed<UI_I_OptionItem[]>(() =>
145
- viewFunc(localization.value, props.view, props.projectType)
146
+ viewFunc(localization.value, props.view, props.project)
146
147
  )
147
148
  watch(
148
149
  () => viewOptions.value,
@@ -2,6 +2,7 @@ import { UI_I_Localization } from '~/models/interfaces'
2
2
  import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
3
3
  import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/models/interfaces'
4
4
  import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/models/types'
5
+ import { UI_T_Project } from '~/models/types'
5
6
 
6
7
  export const periodFunc = (
7
8
  localization: UI_I_Localization
@@ -35,7 +36,7 @@ export const periodFunc = (
35
36
  export const viewFunc = (
36
37
  localization: UI_I_Localization,
37
38
  viewType: UI_T_OverviewViewType,
38
- projectType?: number
39
+ project: UI_T_Project
39
40
  ): UI_I_OptionItem[] => {
40
41
  const host = [
41
42
  { text: localization.overview, value: 'overview' },
@@ -45,7 +46,7 @@ export const viewFunc = (
45
46
  { text: localization.disks, value: 'disks' },
46
47
  // { text: localization.virtual_machines, value: 'virtual_machines' },
47
48
  ]
48
- if (projectType === 1)
49
+ if (project === 'procurator')
49
50
  host.push({
50
51
  text: localization.spaceUtilization,
51
52
  value: 'spaceUtilization',
@@ -0,0 +1,71 @@
1
+ <template>
2
+ <div class="info-container">
3
+ <atoms-nav-bar
4
+ v-if="props.tabs && props.tabs.length > 0"
5
+ v-model="selectedTabViewSettings"
6
+ :items="props.tabs"
7
+ />
8
+
9
+ <slot :value="selectedTabViewSettings"></slot>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup lang="ts">
14
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/models/interfaces'
15
+ import type { UI_I_ViewSettingsFields } from '~/components/common/tools/viewSettings/models/interfaces'
16
+
17
+ // Props from up
18
+
19
+ const props = withDefaults(
20
+ defineProps<{
21
+ tabs?: UI_I_CollapseNavItem[]
22
+ viewSettingsFields?: UI_I_ViewSettingsFields[]
23
+ activeDefaultTab?: number | string
24
+ }>(),
25
+ {
26
+ viewSettingsFields: () => [],
27
+ activeDefaultTab: '',
28
+ tabs: undefined,
29
+ }
30
+ )
31
+
32
+ // Selected tab id on the view settings
33
+ const selectedTabViewSettings = ref<number | string>(props.activeDefaultTab)
34
+
35
+ // Filtering the selected tab content
36
+ // const viewSettingsTabContent = (tab: number): UI_I_ViewSettingsFields[] =>
37
+ // tab === 0
38
+ // ? props.viewSettingsFields
39
+ // : props.viewSettingsFields.filter(
40
+ // (field: UI_I_ViewSettingsFields): boolean => field.type === tab
41
+ // )
42
+ </script>
43
+
44
+ <style lang="scss">
45
+ :root.dark-theme {
46
+ .info-container {
47
+ background-color: var(--pannel-bg-color);
48
+ color: var(--main-color-mode2);
49
+
50
+ &:has(.no-items-selected-container) {
51
+ background-color: transparent;
52
+ }
53
+
54
+ td span {
55
+ color: var(--main-color-mode2);
56
+ }
57
+
58
+ button span {
59
+ color: var(--main-color-mode2);
60
+
61
+ &:hover:not(.disabled) {
62
+ background-color: transparent;
63
+ }
64
+ }
65
+
66
+ button.active span {
67
+ color: #fff;
68
+ }
69
+ }
70
+ }
71
+ </style>
@@ -0,0 +1,9 @@
1
+ export interface UI_I_ViewSettingsFields {
2
+ title?: string
3
+ id: number
4
+ type: number
5
+ rows: {
6
+ name: string
7
+ value?: string | string[]
8
+ }[]
9
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.2.195",
4
+ "version": "1.2.196",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",