bfg-common 1.4.734 → 1.4.736

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 (60) 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 +1 -0
  6. package/assets/localization/local_en.json +1 -0
  7. package/assets/localization/local_hy.json +1 -0
  8. package/assets/localization/local_kk.json +1 -0
  9. package/assets/localization/local_ru.json +1 -0
  10. package/assets/localization/local_zh.json +1 -0
  11. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  12. package/components/common/browse/lib/models/interfaces.ts +5 -5
  13. package/components/common/{monitor/advanced/tools/chartOptionsModal → chartOptionsModal}/counters/timespan/form/Form.vue +17 -12
  14. package/components/common/{pages/hardwareHealth/historyTestimony/tools/chartOptionsModal → chartOptionsModal}/counters/timespan/form/lib/config/dateForm.ts +1 -0
  15. package/components/common/diagramMain/Header.vue +211 -211
  16. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  17. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  18. package/components/common/diagramMain/lib/models/types.ts +21 -21
  19. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  20. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  21. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  22. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  23. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  24. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  25. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  26. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  27. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  28. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
  29. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  30. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  31. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  32. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  33. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  34. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  35. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  36. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  37. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  38. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  39. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  40. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  41. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  42. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  43. package/components/common/diagramMain/port/Ports.vue +47 -47
  44. package/components/common/monitor/advanced/Advanced.vue +5 -0
  45. package/components/common/monitor/advanced/tools/Tools.vue +9 -2
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +9 -2
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +2 -0
  48. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +3 -1
  49. package/components/common/monitor/overview/filters/Filters.vue +3 -0
  50. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +15 -5
  51. package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +24 -14
  52. package/components/common/pages/hardwareHealth/HardwareHealth.vue +12 -5
  53. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +14 -2
  54. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +13 -4
  55. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +21 -6
  56. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +6 -6
  57. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +7 -7
  58. package/package.json +2 -2
  59. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +0 -114
  60. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/form/Form.vue +0 -539
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="timespan-objects-section-direction">
3
- <common-monitor-advanced-tools-chart-options-modal-counters-timespan-form
3
+ <common-chart-options-modal-counters-timespan-form
4
4
  :language="props.language"
5
5
  :selected-chart-type="props.selectedChartType"
6
6
  :selected-timespan-type="props.selectedTimespanType"
@@ -11,6 +11,7 @@
11
11
  :custom-date-to="props.customDateTo"
12
12
  :custom-time-from="props.customTimeFrom"
13
13
  :custom-time-to="props.customTimeTo"
14
+ :valid-date-end="props.validDateEnd"
14
15
  @update-chart-type="emits('update-chart-type', $event)"
15
16
  @update-custom-time="emits('update-custom-time', $event)"
16
17
  @update-timespan-type="emits('update-timespan-type', $event)"
@@ -64,6 +65,7 @@ const props = defineProps<{
64
65
  selectedObjects: string
65
66
  objectsLoading: boolean
66
67
  objectsData: UI_I_ObjectItem[]
68
+ validDateEnd: number
67
69
  }>()
68
70
 
69
71
  const emits = defineEmits<{
@@ -51,10 +51,12 @@
51
51
  </div>
52
52
 
53
53
  <common-monitor-overview-filters-custom-interval-modal
54
+ v-if="props.validDateEnd"
54
55
  v-show="isShowIntervalModal"
55
56
  :selected-periods="props.selectedPeriods"
56
57
  :format-date="props.formatDate"
57
58
  :current-lang="props.currentLang"
59
+ :valid-date-end="props.validDateEnd"
58
60
  @hide="onHideIntervalModal"
59
61
  @submit="onSubmitIntervalModal"
60
62
  />
@@ -82,6 +84,7 @@ const props = defineProps<{
82
84
  selectedPeriods: number[]
83
85
  formatDate: string
84
86
  currentLang: string
87
+ validDateEnd: number
85
88
  formatTime?: string
86
89
  }>()
87
90
 
@@ -113,6 +113,7 @@ const props = defineProps<{
113
113
  formatDate: string
114
114
  selectedPeriods: number[]
115
115
  currentLang: string
116
+ validDateEnd: number
116
117
  }>()
117
118
 
118
119
  const emits = defineEmits<{
@@ -147,11 +148,10 @@ const currentTimeTo = ref<string>('')
147
148
  const getCurrentTime = (): void => {
148
149
  if (!props.selectedPeriods.length) {
149
150
  currentDateFrom.value = $formattedDate(yesterday, props.formatDate)
150
- currentDateTo.value = $formattedDate(new Date(), props.formatDate)
151
+ currentDateTo.value = $formattedDate(props.validDateEnd, props.formatDate)
151
152
 
152
- const currentTime = format(new Date(), 'H:mm:ss')
153
- currentTimeFrom.value = currentTime
154
- currentTimeTo.value = currentTime
153
+ currentTimeFrom.value = format(new Date(), 'H:mm:ss')
154
+ currentTimeTo.value = format(props.validDateEnd, 'H:mm:ss')
155
155
 
156
156
  return
157
157
  }
@@ -204,7 +204,9 @@ const onSubmit = (): void => {
204
204
  currentDateFrom.value,
205
205
  currentDateTo.value,
206
206
  currentTimeFrom.value,
207
- currentTimeTo.value
207
+ currentTimeTo.value,
208
+ props.validDateEnd,
209
+ props.formatDate
208
210
  )
209
211
 
210
212
  if (typeof result === 'string') {
@@ -217,6 +219,14 @@ const onSubmit = (): void => {
217
219
  onHide()
218
220
  }
219
221
 
222
+ watch(
223
+ () => [props.selectedPeriods, props.currentLang],
224
+ (): void => {
225
+ getCurrentTime()
226
+ },
227
+ { deep: true }
228
+ )
229
+
220
230
  onMounted(() => {
221
231
  selectedItem.value = location.hostname
222
232
  getCurrentTime()
@@ -1,16 +1,13 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
2
 
3
3
  const isMoreThanOneMonth = (startDate: number, endDate: number): boolean => {
4
- const start = new Date(startDate)
5
- const end = new Date(endDate)
6
- const yearDiff = end.getFullYear() - start.getFullYear()
7
- const monthDiff = end.getMonth() - start.getMonth()
8
-
9
- return (
10
- yearDiff > 0 ||
11
- (yearDiff === 0 && monthDiff > 1) ||
12
- (yearDiff === 0 && monthDiff === 1 && end.getDate() >= start.getDate())
13
- )
4
+ const date1 = new Date(startDate)
5
+ const date2 = new Date(endDate)
6
+
7
+ const nextMonth = new Date(date1)
8
+ nextMonth.setMonth(date1.getMonth() + 1)
9
+
10
+ return nextMonth < date2
14
11
  }
15
12
 
16
13
  export const checkDateFunc = (
@@ -18,7 +15,9 @@ export const checkDateFunc = (
18
15
  dateFrom: string,
19
16
  dateTo: string,
20
17
  timeFrom: string,
21
- timeTo: string
18
+ timeTo: string,
19
+ unixValidEnd: number,
20
+ formatDate: string
22
21
  ): string | number[] => {
23
22
  const { $isDate, $getUnixByDate } = useNuxtApp()
24
23
 
@@ -38,9 +37,20 @@ export const checkDateFunc = (
38
37
  return result
39
38
  }
40
39
 
41
- if (unixEndDate > new Date().getTime())
42
- result = localization.inventoryMonitor.oneOfSelectedDatesIsInTheFuture
43
- else if (unixEndDate === unixStartDate)
40
+ if (unixEndDate > unixValidEnd) {
41
+ const { $formattedDatetime } = useNuxtApp()
42
+
43
+ const currentShowValidEnd = $formattedDatetime(
44
+ new Date(unixValidEnd),
45
+ formatDate,
46
+ true
47
+ )
48
+ result =
49
+ localization.inventoryMonitor.timeRangeShouldNotBeMoreThanValidTo.replace(
50
+ '{0}',
51
+ currentShowValidEnd
52
+ )
53
+ } else if (unixEndDate === unixStartDate)
44
54
  result = localization.inventoryMonitor.timeToShouldBeLaterTimeFrom
45
55
  else if (unixEndDate - unixStartDate <= 3600000)
46
56
  result = localization.inventoryMonitor.timeRangeShouldNotBeSmallerThanHour
@@ -51,6 +51,8 @@
51
51
  :is-dark-mode="props.isDarkMode"
52
52
  :get-date-format="props.getDateFormat"
53
53
  :main-selected-row="selectedRow"
54
+ :valid-date-end="props.validDateEnd"
55
+ :format-date="props.formatDate"
54
56
  @update-tools="onUpdateHistoryTestimonyTools"
55
57
  />
56
58
 
@@ -76,12 +78,13 @@ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/model
76
78
  import type { UI_I_StorageSensorsAlert } from '~/components/common/pages/hardwareHealth/lib/models/interfaces'
77
79
  import type { UI_T_HardwareHealthTabMode } from '~/components/common/pages/hardwareHealth/lib/models/types'
78
80
  import { hardwareHealthTabsFunc } from '~/components/common/pages/hardwareHealth/lib/config/tabsPannel'
79
- import type {
80
- UI_I_HardwareHealthHistoryTestimonyTools
81
- } from "~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces";
81
+ import type { UI_I_HardwareHealthHistoryTestimonyTools } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
82
82
 
83
83
  const emits = defineEmits<{
84
- (event: 'update-history-testimony-tools', value: UI_I_HardwareHealthHistoryTestimonyTools): void
84
+ (
85
+ event: 'update-history-testimony-tools',
86
+ value: UI_I_HardwareHealthHistoryTestimonyTools
87
+ ): void
85
88
  }>()
86
89
  const props = defineProps<{
87
90
  data: UI_I_HardwareHealthSensors[]
@@ -94,6 +97,8 @@ const props = defineProps<{
94
97
  formattedDatetime: any
95
98
  getDateFormat: any
96
99
  language: string
100
+ validDateEnd: number
101
+ formatDate: string
97
102
  }>()
98
103
 
99
104
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -168,7 +173,9 @@ watch(activeTab, () => {
168
173
  uniqueKey.value++
169
174
  })
170
175
 
171
- const onUpdateHistoryTestimonyTools = (tools: UI_I_HardwareHealthHistoryTestimonyTools): void => {
176
+ const onUpdateHistoryTestimonyTools = (
177
+ tools: UI_I_HardwareHealthHistoryTestimonyTools
178
+ ): void => {
172
179
  emits('update-history-testimony-tools', tools)
173
180
  }
174
181
 
@@ -6,6 +6,7 @@
6
6
  :is-show-chart-modal="isShowChartModal"
7
7
  :chart-title="props.powerData?.groupName || ''"
8
8
  :selected-metric="selectedMetric"
9
+ :selected-chart-type="selectedChartType"
9
10
  :selected-power-counters-keys="selectedPowerCountersKeys"
10
11
  :power-selected-rows-local="powerSelectedRowsLocal"
11
12
  :selected-temperature-counters-keys="selectedTemperatureCountersKeys"
@@ -19,7 +20,10 @@
19
20
  :custom-time-from="customTimeFrom"
20
21
  :custom-time-to="customTimeTo"
21
22
  :start-date="props.powerData?.pointStart || 0"
23
+ :end-date="props.powerData?.pointEnd || 0"
22
24
  :timespan-period-type="timespanPeriodType"
25
+ :valid-date-end="props.validDateEnd"
26
+ :format-date="props.formatDate"
23
27
  @power-selected-rows-local="powerSelectedRowsLocal = $event"
24
28
  @temperature-selected-rows-local="temperatureSelectedRowsLocal = $event"
25
29
  @show-chart-modal="isShowChartModal = true"
@@ -27,7 +31,7 @@
27
31
  @update-tools="onUpdateTools"
28
32
  @delete-option="onDeleteOption"
29
33
  @submit-options="onSubmitOptions"
30
- @update-timespan-period-type="timespanPeriodType = $event"
34
+ @update-period-type="timespanPeriodType = $event"
31
35
  />
32
36
  <div
33
37
  ref="historyTestimonyGraph"
@@ -85,7 +89,7 @@ import type { UI_T_Chart } from '~/components/common/pages/hardwareHealth/histor
85
89
  import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
86
90
  import type {
87
91
  UI_I_HardwareHealthHistoryTestimonyTools,
88
- UI_I_HardwareHealthSensorsGraph
92
+ UI_I_HardwareHealthSensorsGraph,
89
93
  } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/models/interfaces'
90
94
  import type { UI_I_SensorsGraphPayload } from '~/components/common/pages/hardwareHealth/historyTestimony/tools/lib/models/interfaces'
91
95
  import { containerMediumSize } from '~/components/common/pages/hardwareHealth/historyTestimony/lib/config/containerSizes'
@@ -104,6 +108,8 @@ const props = defineProps<{
104
108
  isDarkMode: boolean
105
109
  getDateFormat: any
106
110
  mainSelectedRow: number[]
111
+ validDateEnd: number
112
+ formatDate: string
107
113
  }>()
108
114
  const selectedView = defineModel<string>('selectedView')
109
115
 
@@ -146,6 +152,7 @@ const customDateFrom = ref<string>('')
146
152
  const customDateTo = ref<string>('')
147
153
  const customTimeFrom = ref<string>('')
148
154
  const customTimeTo = ref<string>('')
155
+ const selectedChartType = ref<string>('spline')
149
156
 
150
157
  const selectedRowPower = ref<number[]>([])
151
158
  const selectedRowTemperature = ref<number[]>([])
@@ -364,6 +371,11 @@ const tools: UI_I_HardwareHealthHistoryTestimonyTools = {
364
371
 
365
372
  const onSubmitOptions = (data: UI_I_OptionsForm): void => {
366
373
  selectedTimespanType.value = data.periodName
374
+ customDateFrom.value = data.dateFrom
375
+ customDateTo.value = data.dateTo
376
+ customTimeFrom.value = data.timeFrom
377
+ customTimeTo.value = data.timeTo
378
+ selectedChartType.value = data.chartType
367
379
  updateSelectedCountersKeys(data.metric)
368
380
  if (data.metric === 'power')
369
381
  $store.dispatch(
@@ -65,6 +65,7 @@
65
65
  v-if="props.isShowChartModal"
66
66
  :selected-chart-option-name="props.selectedChartOptionName"
67
67
  :selected-metric="props.selectedMetric"
68
+ :selected-chart-type="props.selectedChartType"
68
69
  :power-selected-rows-local="props.powerSelectedRowsLocal"
69
70
  :temperature-selected-rows-local="props.temperatureSelectedRowsLocal"
70
71
  :selected-power-counters-keys="props.selectedPowerCountersKeys"
@@ -79,10 +80,12 @@
79
80
  :custom-time-from="props.customTimeFrom"
80
81
  :custom-time-to="props.customTimeTo"
81
82
  :timespan-period-type="props.timespanPeriodType"
83
+ :valid-date-end="props.validDateEnd"
84
+ :format-date="props.formatDate"
82
85
  @save-option-name="onSaveOptionName"
83
86
  @delete-option="emits('delete-option')"
84
87
  @power-selected-rows-local="emits('power-selected-rows-local', $event)"
85
- @update-timespan-period-type="emits('update-timespan-period-type', $event)"
88
+ @update-period-type="emits('update-period-type', $event)"
86
89
  @temperature-selected-rows-local="
87
90
  emits('temperature-selected-rows-local', $event)
88
91
  "
@@ -111,6 +114,7 @@ const props = defineProps<{
111
114
  isShowChartModal: boolean
112
115
  chartTitle: string
113
116
  selectedMetric: UI_T_Chart
117
+ selectedChartType: string
114
118
  selectedPowerCountersKeys: number[]
115
119
  powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
116
120
  selectedTemperatureCountersKeys: number[]
@@ -125,7 +129,10 @@ const props = defineProps<{
125
129
  customTimeTo: string
126
130
  selectedTimespanType: string
127
131
  startDate: number
132
+ endDate: number
128
133
  timespanPeriodType: string
134
+ validDateEnd: number
135
+ formatDate: string
129
136
  }>()
130
137
  const selectedView = defineModel<string>('selectedView')
131
138
 
@@ -147,7 +154,7 @@ const emits = defineEmits<{
147
154
  (event: 'update-chart-type', value: string): void
148
155
  (event: 'update-timespan-type', value: string): void
149
156
  (event: 'update-unit-count', value: number): void
150
- (event: 'update-timespan-period-type', value: string): void
157
+ (event: 'update-period-type', value: string): void
151
158
  (event: 'update-custom-time', value: string): void
152
159
  (event: 'delete-option'): void
153
160
  (event: 'update-custom-date-from', value: string): void
@@ -233,7 +240,9 @@ const onUpdateTools = (): void => {
233
240
  props.customDateFrom,
234
241
  props.customDateTo,
235
242
  props.customTimeFrom,
236
- props.customTimeTo
243
+ props.customTimeTo,
244
+ props.validDateEnd,
245
+ props.formatDate
237
246
  )
238
247
  if (Array.isArray(checkDateResult)) {
239
248
  period[0] = Math.round(checkDateResult[0] / 1000)
@@ -257,7 +266,7 @@ const chartTitleDate = computed<string>(() => {
257
266
  if (!props.startDate) return ''
258
267
 
259
268
  const start = $formattedDatetime(props.startDate, '', true)
260
- const end = $formattedDatetime(new Date(), '', true)
269
+ const end = $formattedDatetime(props.endDate, '', true)
261
270
  return `${start} - ${end}`
262
271
  })
263
272
 
@@ -42,19 +42,20 @@
42
42
  :selected-chart-type="localSelectedChartType"
43
43
  :selected-timespan-type="localSelectedTimespanType"
44
44
  :units-count="localUnitsCount"
45
- :timespan-period-type="localTimespanPeriodType"
45
+ :period-type="localTimespanPeriodType"
46
46
  :selected-custom-time="localCustomTime"
47
47
  :custom-date-from="props.customDateFrom"
48
48
  :custom-date-to="props.customDateTo"
49
49
  :custom-time-from="props.customTimeFrom"
50
50
  :custom-time-to="props.customTimeTo"
51
+ :valid-date-end="props.validDateEnd"
51
52
  @select-power-row="onSelectPowerRow"
52
53
  @select-temperature-row="onSelectTemperatureRow"
53
54
  @update-chart-type="selectedChartTypeLocal = $event"
54
55
  @update-custom-time="localCustomTime = $event"
55
56
  @update-timespan-type="timespanType = $event"
56
57
  @update-unit-count="unitCount = $event"
57
- @update-timespan-period-type="localTimespanPeriodType = $event"
58
+ @update-period-type="localTimespanPeriodType = $event"
58
59
  @update-custom-date-from="onUpdateCustomDateFrom"
59
60
  @update-custom-date-to="onUpdateCustomDateTo"
60
61
  @update-custom-time-from="onUpdateCustomTimeFrom"
@@ -81,6 +82,7 @@ import { getCurrentOptionsStorageFunc } from '~/components/common/pages/hardware
81
82
  const props = defineProps<{
82
83
  selectedChartOptionName: string
83
84
  selectedMetric: UI_T_Chart
85
+ selectedChartType: string
84
86
  selectedPowerCountersKeys: number[]
85
87
  powerSelectedRowsLocal: UI_I_HardwareHealthSensorsGraph[]
86
88
  selectedTemperatureCountersKeys: number[]
@@ -95,6 +97,8 @@ const props = defineProps<{
95
97
  customTimeFrom: string
96
98
  customTimeTo: string
97
99
  timespanPeriodType: string
100
+ validDateEnd: number
101
+ formatDate: string
98
102
  }>()
99
103
 
100
104
  const emits = defineEmits<{
@@ -111,7 +115,7 @@ const emits = defineEmits<{
111
115
  (event: 'update-chart-type', value: string): void
112
116
  (event: 'update-timespan-type', value: string): void
113
117
  (event: 'update-unit-count', value: number): void
114
- (event: 'update-timespan-period-type', value: string): void
118
+ (event: 'update-period-type', value: string): void
115
119
  (event: 'update-custom-time', value: string): void
116
120
  (event: 'delete-option'): void
117
121
  (event: 'save-option-name'): void
@@ -169,6 +173,13 @@ watch(
169
173
  )
170
174
 
171
175
  const localSelectedChartType = ref<string>('')
176
+ watch(
177
+ () => props.selectedChartType,
178
+ (newValue) => {
179
+ localSelectedChartType.value = newValue
180
+ },
181
+ { immediate: true }
182
+ )
172
183
 
173
184
  const localSelectedTimespanType = ref<string>('')
174
185
  watch(
@@ -243,7 +254,9 @@ const checkValidations = (): boolean => {
243
254
  localCustomDateFrom.value,
244
255
  localCustomDateTo.value,
245
256
  localCustomTimeFrom.value,
246
- localCustomTimeTo.value
257
+ localCustomTimeTo.value,
258
+ props.validDateEnd,
259
+ props.formatDate
247
260
  )
248
261
 
249
262
  if (isDisabledSubmit.value) {
@@ -310,7 +323,9 @@ const onSubmit = (): void => {
310
323
  localCustomDateFrom.value,
311
324
  localCustomDateTo.value,
312
325
  localCustomTimeFrom.value,
313
- localCustomTimeTo.value
326
+ localCustomTimeTo.value,
327
+ props.validDateEnd,
328
+ props.formatDate
314
329
  )
315
330
  if (Array.isArray(checkDateResult)) {
316
331
  validPeriod[0] = checkDateResult[0]
@@ -334,7 +349,7 @@ const onSubmit = (): void => {
334
349
  period: validPeriod,
335
350
  }
336
351
 
337
- emits('update-timespan-period-type', savedObject.periodType)
352
+ emits('update-period-type', savedObject.periodType)
338
353
  emits('submit-options', savedObject)
339
354
  onHide()
340
355
  }
@@ -15,19 +15,18 @@
15
15
  :selected-chart-type="props.selectedChartType"
16
16
  :selected-timespan-type="props.selectedTimespanType"
17
17
  :units-count="props.unitsCount"
18
- :timespan-period-type="props.timespanPeriodType"
18
+ :period-type="props.periodType"
19
19
  :selected-custom-time="props.selectedCustomTime"
20
20
  :custom-date-from="props.customDateFrom"
21
21
  :custom-date-to="props.customDateTo"
22
22
  :custom-time-from="props.customTimeFrom"
23
23
  :custom-time-to="props.customTimeTo"
24
+ :valid-date-end="props.validDateEnd"
24
25
  @update-chart-type="emits('update-chart-type', $event)"
25
26
  @update-custom-time="emits('update-custom-time', $event)"
26
27
  @update-timespan-type="emits('update-timespan-type', $event)"
27
28
  @update-unit-count="emits('update-unit-count', $event)"
28
- @update-timespan-period-type="
29
- emits('update-timespan-period-type', $event)
30
- "
29
+ @update-period-type="emits('update-period-type', $event)"
31
30
  @update-custom-date-from="emits('update-custom-date-from', $event)"
32
31
  @update-custom-date-to="emits('update-custom-date-to', $event)"
33
32
  @update-custom-time-from="emits('update-custom-time-from', $event)"
@@ -50,12 +49,13 @@ const props = defineProps<{
50
49
  selectedChartType: string
51
50
  selectedTimespanType: string
52
51
  unitsCount: number
53
- timespanPeriodType: string
52
+ periodType: string
54
53
  selectedCustomTime: string
55
54
  customDateFrom: string
56
55
  customDateTo: string
57
56
  customTimeFrom: string
58
57
  customTimeTo: string
58
+ validDateEnd: number
59
59
  }>()
60
60
 
61
61
  const emits = defineEmits<{
@@ -68,7 +68,7 @@ const emits = defineEmits<{
68
68
  (event: 'update-custom-time', value: string): void
69
69
  (event: 'update-timespan-type', value: string): void
70
70
  (event: 'update-unit-count', value: number): void
71
- (event: 'update-timespan-period-type', value: string): void
71
+ (event: 'update-period-type', value: string): void
72
72
  (event: 'update-custom-date-from', value: string): void
73
73
  (event: 'update-custom-date-to', value: string): void
74
74
  (event: 'update-custom-time-from', value: string): void
@@ -1,23 +1,22 @@
1
1
  <template>
2
2
  <div class="timespan-objects-section-direction">
3
- <common-pages-hardware-health-history-testimony-tools-chart-options-modal-counters-timespan-form
3
+ <common-chart-options-modal-counters-timespan-form
4
4
  :language="props.language"
5
5
  :selected-chart-type="props.selectedChartType"
6
6
  :selected-timespan-type="props.selectedTimespanType"
7
7
  :units-count="props.unitsCount"
8
- :timespan-period-type="props.timespanPeriodType"
8
+ :period-type="props.periodType"
9
9
  :selected-custom-time="props.selectedCustomTime"
10
10
  :custom-date-from="props.customDateFrom"
11
11
  :custom-date-to="props.customDateTo"
12
12
  :custom-time-from="props.customTimeFrom"
13
13
  :custom-time-to="props.customTimeTo"
14
+ :valid-date-end="props.validDateEnd"
14
15
  @update-chart-type="emits('update-chart-type', $event)"
15
16
  @update-custom-time="emits('update-custom-time', $event)"
16
17
  @update-timespan-type="emits('update-timespan-type', $event)"
17
18
  @update-unit-count="emits('update-unit-count', $event)"
18
- @update-timespan-period-type="
19
- emits('update-timespan-period-type', $event)
20
- "
19
+ @update-period-type="emits('update-period-type', $event)"
21
20
  @update-custom-date-from="emits('update-custom-date-from', $event)"
22
21
  @update-custom-date-to="emits('update-custom-date-to', $event)"
23
22
  @update-custom-time-from="emits('update-custom-time-from', $event)"
@@ -32,12 +31,13 @@ const props = defineProps<{
32
31
  selectedChartType: string
33
32
  selectedTimespanType: string
34
33
  unitsCount: number
35
- timespanPeriodType: string
34
+ periodType: string
36
35
  selectedCustomTime: string
37
36
  customDateFrom: string
38
37
  customDateTo: string
39
38
  customTimeFrom: string
40
39
  customTimeTo: string
40
+ validDateEnd: number
41
41
  }>()
42
42
 
43
43
  const emits = defineEmits<{
@@ -45,7 +45,7 @@ const emits = defineEmits<{
45
45
  (event: 'update-custom-time', value: string): void
46
46
  (event: 'update-timespan-type', value: string): void
47
47
  (event: 'update-unit-count', value: number): void
48
- (event: 'update-timespan-period-type', value: string): void
48
+ (event: 'update-period-type', value: string): void
49
49
  (event: 'update-custom-date-from', value: string): void
50
50
  (event: 'update-custom-date-to', value: string): void
51
51
  (event: 'update-custom-time-from', value: string): void
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.734",
4
+ "version": "1.4.736",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.17",
38
- "bfg-uikit": "1.0.312",
38
+ "bfg-uikit": "1.0.313",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }
@@ -1,114 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
- import type { UI_I_ArbitraryObject } from '~/lib/models/interfaces'
4
-
5
- export const timespanFunc = (
6
- localization: UI_I_Localization
7
- ): UI_I_OptionItem[] => [
8
- {
9
- text: localization.inventoryMonitor.realTime,
10
- value: 'real_time',
11
- },
12
- {
13
- text: localization.inventoryMonitor.lastDay,
14
- value: 'last_day',
15
- },
16
- {
17
- text: localization.inventoryMonitor.lastWeek,
18
- value: 'last_week',
19
- },
20
- {
21
- text: localization.inventoryMonitor.lastMonth,
22
- value: 'last_month',
23
- },
24
- // {
25
- // text: localization.inventoryMonitor.lastYear,
26
- // value: 'last_year',
27
- // },
28
- {
29
- text: localization.inventoryMonitor.customInterval,
30
- value: 'custom_interval',
31
- },
32
- ]
33
-
34
- export const customTimeFunc = (
35
- localization: UI_I_Localization,
36
- value: number,
37
- lang: string
38
- ): UI_I_OptionItem[] => {
39
- const isLangRu = lang === 'ru_RU'
40
-
41
- const hourText = isLangRu
42
- ? getCorrectRuForm(value, 'hour')
43
- : localization.common.hours2
44
- const dayText = isLangRu
45
- ? getCorrectRuForm(value, 'day')
46
- : localization.common.days2
47
- const weekText = isLangRu
48
- ? getCorrectRuForm(value, 'week')
49
- : localization.common.weeks2
50
- const monthText = isLangRu
51
- ? getCorrectRuForm(value, 'month')
52
- : localization.common.months2
53
-
54
- return [
55
- {
56
- text: hourText,
57
- value: 'hours',
58
- },
59
- {
60
- text: dayText,
61
- value: 'days',
62
- },
63
- {
64
- text: weekText,
65
- value: 'weeks',
66
- },
67
- {
68
- text: monthText,
69
- value: 'months',
70
- },
71
- ]
72
- }
73
-
74
- export const chartTypeFunc = (
75
- localization: UI_I_Localization
76
- ): UI_I_OptionItem[] => [
77
- {
78
- text: localization.inventoryMonitor.lineGraph,
79
- value: 'line_graph',
80
- },
81
- {
82
- text: localization.inventoryMonitor.stackedGraph,
83
- value: 'stacked_graph',
84
- },
85
- ]
86
-
87
- const getCorrectRuForm = (value: number, type: string): string => {
88
- // TODO поправить используя correctRuUnit из плагина date
89
- const forms: UI_I_ArbitraryObject<string[]> = {
90
- hour: ['Час', 'Часа', 'Часов'],
91
- day: ['День', 'Дня', 'Дней'],
92
- week: ['Неделя', 'Недели', 'Недель'],
93
- month: ['Месяц', 'Месяца', 'Месяцев'],
94
- }
95
-
96
- let text: string
97
-
98
- if (!value) {
99
- return getCorrectRuForm[type]
100
- }
101
-
102
- if (value % 10 === 1 && value % 100 !== 11) {
103
- text = forms[type][0]
104
- } else if (
105
- [2, 3, 4].includes(value % 10) &&
106
- ![12, 13, 14].includes(value % 100)
107
- ) {
108
- text = forms[type][1]
109
- } else {
110
- text = forms[type][2]
111
- }
112
- getCorrectRuForm[type] = text
113
- return text
114
- }