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,366 @@
1
+ <template>
2
+ <div class="advanced-filters">
3
+ <div class="period-select-wrap">
4
+ <label for="period-select" class="label-select"
5
+ >{{ localization.inventoryMonitor.period }}:</label
6
+ >
7
+
8
+ <ui-select
9
+ v-model="selectedPeriod"
10
+ :items="periodOptions"
11
+ :disabled="props.disabledPeriod"
12
+ test-id="period-select"
13
+ width="auto"
14
+ @change="onChangePeriod"
15
+ />
16
+ <!-- <span v-else class="single-option">{{-->
17
+ <!-- props.periodOptions[0].text-->
18
+ <!-- }}</span>-->
19
+ <span class="chart-text">
20
+ {{ chartTitleDate }}
21
+ </span>
22
+ <ui-skeleton-item v-if="!chartTitleDate" width="320" height="16" />
23
+ <div class="chart-options-button-content">
24
+ <div class="border-line"></div>
25
+ <span
26
+ class="chart-options-button"
27
+ data-id="show-chart-options-button"
28
+ @click="onShowChartOptions"
29
+ >{{ localization.inventoryMonitor.chartOptions }}</span
30
+ >
31
+ </div>
32
+ </div>
33
+
34
+ <div class="view-select-wrap">
35
+ <label for="view-select" class="label-select"
36
+ >{{ localization.common.view }}:</label
37
+ >
38
+ <ui-select
39
+ v-model="selectedView"
40
+ :items="viewOptions"
41
+ :disabled="disabledView"
42
+ test-id="view-select"
43
+ width="auto"
44
+ left
45
+ @change="onChangeView"
46
+ />
47
+ </div>
48
+ </div>
49
+
50
+ <common-monitor-advanced-tools-chart-options-modal
51
+ v-if="isShowModal"
52
+ :type="props.type"
53
+ :language="props.language"
54
+ :selected-counters-keys="props.selectedCountersKeys"
55
+ :selected-metric="props.selectedMetric"
56
+ :selected-metric-local="props.selectedMetricLocal"
57
+ :selected-chart-type="props.selectedChartType"
58
+ :selected-timespan-type="props.selectedTimespanType"
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="props.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
+ @hide="isShowModal = false"
76
+ @select-row="emits('select-row', $event)"
77
+ @select-metric-local="emits('select-metric-local', $event)"
78
+ @update-chart-type="emits('update-chart-type', $event)"
79
+ @update-timespan-type="emits('update-timespan-type', $event)"
80
+ @update-unit-count="emits('update-unit-count', $event)"
81
+ @update-period-type="emits('update-period-type', $event)"
82
+ @update-custom-time="emits('update-custom-time', $event)"
83
+ @delete-option="onDeleteOption"
84
+ @save-option-name="onSaveOptionName"
85
+ @submit-options="emits('submit-options', $event)"
86
+ />
87
+ </template>
88
+
89
+ <script setup lang="ts">
90
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
91
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
92
+ import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
93
+ // import type { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/lib/models/interfaces'
94
+ import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
95
+ import type {
96
+ UI_T_ChartHost,
97
+ UI_T_ChartVm,
98
+ } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/types'
99
+ import type { UI_I_OptionsForm } from '~/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces'
100
+ import type { UI_I_AdvancedCounterItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/models/interfaces'
101
+ import type { UI_I_ObjectItem } from '~/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/models/interfaces'
102
+ import type { UI_T_Project } from '~/lib/models/types'
103
+ import { getValidDateByOptionFunc } from '~/components/common/monitor/lib/config/getValidDateByOption'
104
+ import {
105
+ periodFunc,
106
+ viewFunc,
107
+ // exportFunc,
108
+ getCurrentOptionsStorageFunc,
109
+ } from '~/components/common/monitor/advanced/tools/lib/config/advancedToolbar'
110
+ import { checkDateFunc } from '~/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker'
111
+
112
+ const props = defineProps<{
113
+ type: UI_T_AdvancedType
114
+ startDate: number
115
+ endDate: number
116
+ chartTitle: string
117
+ language: string
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
+ totalCores: number
132
+ hostId: string
133
+ selectedObjects: string
134
+ project: UI_T_Project
135
+ objectsLoading: boolean
136
+ objectsData: UI_I_ObjectItem[]
137
+ validDateEnd: number
138
+ formatDate: string
139
+ disabledPeriod?: boolean
140
+ disabledView?: boolean
141
+ }>()
142
+
143
+ const emits = defineEmits<{
144
+ (event: 'update-tools', value: UI_I_MonitorGraphPayload): void
145
+ (event: 'exporting', value: string): 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
+ (event: 'update:selected-timespan-type', value: string): void
157
+ }>()
158
+
159
+ const routeType = '' + useRoute().params.type
160
+
161
+ const localization = computed<UI_I_Localization>(() => useLocal())
162
+ const { $formattedDatetime } = useNuxtApp()
163
+
164
+ const selectedView = ref<string>('')
165
+ const optionsNames = ref<string[]>([])
166
+ const viewOptions = computed<UI_I_OptionItem[]>(() =>
167
+ viewFunc(localization.value, props.type, optionsNames.value)
168
+ )
169
+
170
+ watch(
171
+ () => props.selectedChartOptionName,
172
+ (newValue) => {
173
+ let currentValue = ''
174
+
175
+ if (newValue) currentValue = newValue
176
+ else if (
177
+ selectedView.value &&
178
+ optionsNames.value.includes(selectedView.value)
179
+ )
180
+ currentValue = selectedView.value
181
+ else currentValue = selectedView.value || viewOptions.value[0]?.value
182
+
183
+ selectedView.value = currentValue
184
+ },
185
+ { immediate: true }
186
+ )
187
+
188
+ const onDeleteOption = (): void => {
189
+ emits('delete-option')
190
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
191
+ }
192
+
193
+ const periodOptions = computed<UI_I_OptionItem[]>(() =>
194
+ periodFunc(localization.value, props.selectedTimespanType)
195
+ )
196
+ const selectedPeriod = computed<string>({
197
+ get() {
198
+ return props.selectedTimespanType || periodOptions.value[0].value
199
+ },
200
+ set(newValue) {
201
+ emits('update:selected-timespan-type', newValue)
202
+ },
203
+ })
204
+
205
+ const isShowModal = ref<boolean>(false)
206
+ watch(isShowModal, (newValue) => {
207
+ if (!newValue && !selectedView.value)
208
+ selectedView.value = viewOptions.value[0].value
209
+ })
210
+
211
+ const updateTools = (): void => {
212
+ const periodValue = selectedPeriod.value
213
+ const viewValue = selectedView.value
214
+ const prefix = props.project === 'sphere'
215
+ const selectedValue = useLocalStorage(
216
+ viewValue + 'ChartOptions',
217
+ undefined,
218
+ prefix
219
+ )
220
+
221
+ const fields = selectedValue
222
+ ? selectedValue.counters.map((item) => item.name).join(', ')
223
+ : ''
224
+ const validPeriodData = getValidDateByOptionFunc(
225
+ periodValue,
226
+ selectedValue,
227
+ props.unitsCount,
228
+ props.selectedCustomTime
229
+ )
230
+
231
+ const period = [
232
+ Math.round(validPeriodData[0] / 1000),
233
+ Math.round(validPeriodData[1] / 1000),
234
+ ]
235
+
236
+ if (periodValue === 'custom_interval' && props.periodType === 'period') {
237
+ const checkDateResult = checkDateFunc(
238
+ localization.value,
239
+ props.customDateFrom,
240
+ props.customDateTo,
241
+ props.customTimeFrom,
242
+ props.customTimeTo,
243
+ props.validDateEnd,
244
+ props.formatDate
245
+ )
246
+ if (Array.isArray(checkDateResult)) {
247
+ period[0] = Math.round(checkDateResult[0] / 1000)
248
+ period[1] = Math.round(checkDateResult[1] / 1000)
249
+ }
250
+ }
251
+
252
+ const tools: UI_I_MonitorGraphPayload = {
253
+ fields,
254
+ period,
255
+ periodType: periodValue,
256
+ view: viewValue,
257
+ }
258
+ if (selectedValue.metric) tools.metricType = selectedValue.metric
259
+
260
+ emits('update-timespan-type', selectedPeriod.value)
261
+ emits('update-tools', tools)
262
+ }
263
+
264
+ const onChangePeriod = (): void => {
265
+ updateTools()
266
+ }
267
+
268
+ const onChangeView = (): void => {
269
+ updateTools()
270
+ }
271
+
272
+ const chartTitleDate = computed<string>(() => {
273
+ if (!props.startDate) return ''
274
+
275
+ const start = $formattedDatetime(props.startDate, '', true)
276
+ const end = $formattedDatetime(props.endDate, '', true)
277
+ return `${start} - ${end}`
278
+ })
279
+
280
+ // const onOpenAdvancedPage = (): void => emits('open-advanced-page')
281
+
282
+ // const exportMenu = ref<UI_I_DropMenu<string>[]>(exportFunc(localization.value))
283
+
284
+ // const onExportMenuItem = (item: UI_I_DropMenu<any>): void =>
285
+ // emits('exporting', item.action)
286
+
287
+ const onShowChartOptions = (): void => {
288
+ isShowModal.value = true
289
+ }
290
+
291
+ const onSaveOptionName = (): void => {
292
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
293
+ }
294
+
295
+ onMounted(() => {
296
+ optionsNames.value = getCurrentOptionsStorageFunc(routeType, props.project)
297
+ updateTools()
298
+ })
299
+ </script>
300
+
301
+ <style>
302
+ :root {
303
+ --advanced-chart-options-border-color: rgba(233, 235, 237, 0.64);
304
+ --advanced-chart-options-text-color: #008fd6;
305
+ --advanced-chart-options-text-hover-color: #0081c1;
306
+ }
307
+ :root.dark-theme {
308
+ --advanced-chart-options-border-color: rgba(233, 235, 237, 0.12);
309
+ --advanced-chart-options-text-color: #2ba2de;
310
+ --advanced-chart-options-text-hover-color: #008fd6;
311
+ }
312
+ </style>
313
+ <style scoped lang="scss">
314
+ .advanced-filters {
315
+ display: flex;
316
+ justify-content: space-between;
317
+ align-items: center;
318
+ padding: 12px 6px 16px 6px;
319
+
320
+ .period-select-wrap {
321
+ display: flex;
322
+ align-items: center;
323
+
324
+ .chart-text {
325
+ font-size: 13px;
326
+ color: var(--overview-filter-text-color);
327
+ margin-left: 12px;
328
+ }
329
+ .chart-options-button-content {
330
+ display: flex;
331
+ align-items: center;
332
+ padding-left: 12px;
333
+
334
+ .border-line {
335
+ border: 1px;
336
+ width: 1px;
337
+ height: 24px;
338
+ background-color: var(--advanced-chart-options-border-color);
339
+ }
340
+ .chart-options-button {
341
+ font-weight: 500;
342
+ font-size: 13px;
343
+ padding-left: 12px;
344
+ color: var(--advanced-chart-options-text-color);
345
+ cursor: pointer;
346
+
347
+ &:hover {
348
+ color: var(--advanced-chart-options-text-hover-color);
349
+ }
350
+ }
351
+ }
352
+ }
353
+
354
+ .view-select-wrap {
355
+ display: flex;
356
+ align-items: center;
357
+ }
358
+
359
+ .label-select {
360
+ font-size: 13px;
361
+ font-weight: 500;
362
+ color: var(--overview-filter-text-color);
363
+ margin-right: 12px;
364
+ }
365
+ }
366
+ </style>