bfg-common 1.4.799 → 1.4.801

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 (157) hide show
  1. package/assets/img/icons/icons-sprite-dark-1.svg +31 -14
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-4.svg +6 -1
  4. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  5. package/assets/img/icons/icons-sprite-light-1.svg +30 -13
  6. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  7. package/assets/img/icons/icons-sprite-light-4.svg +6 -1
  8. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  9. package/assets/localization/local_be.json +33 -8
  10. package/assets/localization/local_en.json +33 -8
  11. package/assets/localization/local_hy.json +33 -8
  12. package/assets/localization/local_kk.json +34 -9
  13. package/assets/localization/local_ru.json +43 -18
  14. package/assets/localization/local_zh.json +33 -8
  15. package/assets/scss/clarity/local_ar.json +6 -3
  16. package/assets/scss/common/icons/icons-1.scss +4 -4
  17. package/components/atoms/autocomplete/Autocomplete.vue +68 -12
  18. package/components/atoms/select/TheSelect.vue +10 -1
  19. package/components/atoms/table/dataGrid/DataGrid.vue +12 -4
  20. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +4 -1
  21. package/components/atoms/table/dataGrid/lib/utils/export.ts +13 -13
  22. package/components/atoms/tabs/VerticalTabs.vue +11 -6
  23. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  24. package/components/common/browse/lib/models/interfaces.ts +5 -5
  25. package/components/common/chartOptionsModal/counters/timespan/form/Form.vue +544 -544
  26. package/components/common/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +116 -116
  27. package/components/common/context/Context.vue +16 -4
  28. package/components/common/context/recursion/Recursion.vue +2 -1
  29. package/components/common/context/recursion/RecursionNew.vue +57 -31
  30. package/components/common/context/recursion/RecursionOld.vue +33 -19
  31. package/components/common/diagramMain/Header.vue +211 -211
  32. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  33. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  34. package/components/common/diagramMain/lib/models/types.ts +21 -21
  35. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  36. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  37. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  38. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  39. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  40. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  41. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  42. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  43. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  44. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +7 -7
  45. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  46. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  47. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  48. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  49. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  50. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  51. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  52. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  53. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  54. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  55. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  56. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  57. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  58. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  59. package/components/common/diagramMain/port/Ports.vue +47 -47
  60. package/components/common/feedback/Buttons.vue +2 -2
  61. package/components/common/feedback/Message.vue +1 -0
  62. package/components/common/feedback/VisitPortal.vue +5 -1
  63. package/components/common/graph/Graph.vue +5 -11
  64. package/components/common/graph/GraphNew.vue +71 -0
  65. package/components/common/graph/GraphOld.vue +31 -0
  66. package/components/common/layout/theHeader/feedback/new/New.vue +29 -14
  67. package/components/common/layout/theHeader/feedback/new/additionalDetails/AdditionalDetails.vue +34 -9
  68. package/components/common/layout/theHeader/feedback/new/additionalDetails/Headline.vue +17 -6
  69. package/components/common/layout/theHeader/feedback/new/description/Description.vue +1 -0
  70. package/components/common/layout/theHeader/feedback/new/email/Email.vue +1 -1
  71. package/components/common/layout/theHeader/feedback/new/subtitle/Subtitle.vue +22 -6
  72. package/components/common/layout/theHeader/feedback/new/tabs/Tabs.vue +17 -15
  73. package/components/common/layout/theHeader/userMenu/modals/changePassword/ChangePasswordNew.vue +1 -1
  74. package/components/common/mainNavigationPanel/MainNavigationPanel.vue +3 -2
  75. package/components/common/mainNavigationPanel/MainNavigationPanelNew.vue +1 -1
  76. package/components/common/mainNavigationPanel/MainNavigationPanelOld.vue +1 -1
  77. package/components/common/monitor/advanced/tools/chartOptionsModal/Notification.vue +7 -7
  78. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +95 -95
  79. package/components/common/monitor/overview/Overview.vue +14 -28
  80. package/components/common/monitor/overview/OverviewNew.vue +138 -0
  81. package/components/common/monitor/overview/OverviewOld.vue +137 -0
  82. package/components/common/monitor/overview/filters/Filters.vue +35 -103
  83. package/components/common/monitor/overview/filters/FiltersNew.vue +122 -0
  84. package/components/common/monitor/overview/filters/FiltersOld.vue +151 -0
  85. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +1 -1
  86. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +463 -456
  87. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +389 -387
  88. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +8 -0
  89. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +94 -94
  90. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +66 -66
  91. package/components/common/pages/home/headline/Headline.vue +3 -2
  92. package/components/common/pages/home/headline/HeadlineNew.vue +1 -1
  93. package/components/common/pages/home/headline/HeadlineOld.vue +5 -0
  94. package/components/common/pages/home/widgets/vms/VmsNew.vue +1 -1
  95. package/components/common/pages/packages/Packages.vue +208 -0
  96. package/components/common/pages/packages/lib/config/actions.ts +59 -0
  97. package/components/common/pages/packages/lib/models/types.ts +8 -0
  98. package/components/common/pages/packages/tableView/TableView.vue +120 -0
  99. package/components/common/pages/packages/tableView/lib/config/configTable.ts +136 -0
  100. package/components/common/pages/packages/tableView/lib/config/tableKey.ts +14 -0
  101. package/components/common/pages/packages/tableView/lib/models/types.ts +12 -0
  102. package/components/common/pages/shortcuts/Shortcuts.vue +1 -1
  103. package/components/common/pages/tasks/Tasks.vue +23 -8
  104. package/components/common/pages/tasks/table/Table.vue +66 -16
  105. package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +27 -10
  106. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +28 -12
  107. package/components/common/pages/tasks/table/lib/config/config.ts +11 -11
  108. package/components/common/portlets/customAttributes/Portlet.vue +4 -4
  109. package/components/common/portlets/tag/TagAddNew.vue +4 -4
  110. package/components/common/select/radio/RadioGroup.vue +3 -3
  111. package/components/common/selectLanguage/SelectLanguage.vue +29 -25
  112. package/components/common/selectLanguage/lib/config/config.ts +1 -0
  113. package/components/common/split/horizontal/HorizontalNew.vue +42 -24
  114. package/components/common/split/horizontal/HorizontalOld.vue +43 -13
  115. package/components/common/vm/actions/add/Add.vue +6 -1
  116. package/components/common/vm/actions/clone/Clone.vue +8 -3
  117. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +4 -0
  118. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +6 -4
  119. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +26 -10
  120. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +12 -4
  121. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +6 -3
  122. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +4 -2
  123. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +6 -4
  124. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +9 -3
  125. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +3 -2
  126. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskOld.vue +3 -2
  127. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +87 -24
  128. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +14 -8
  129. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +9 -7
  130. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -4
  131. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +43 -12
  132. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +50 -25
  133. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +5 -7
  134. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoNew.vue +64 -28
  135. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +60 -19
  136. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +11 -4
  137. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +16 -1
  138. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridNew.vue +59 -8
  139. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +60 -7
  140. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +1 -1
  141. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionOld.vue +1 -1
  142. package/components/common/vm/actions/common/lib/config/capabilities.ts +1 -1
  143. package/components/common/vm/actions/editSettings/EditSettings.vue +4 -0
  144. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
  145. package/components/common/vm/actions/editSettings/new/New.vue +2 -0
  146. package/components/common/wizards/datastore/add/Add.vue +4 -4
  147. package/components/common/wizards/datastore/add/lib/config/steps.ts +14 -14
  148. package/components/common/wizards/datastore/add/lib/validations.ts +9 -9
  149. package/components/common/wizards/datastore/add/nfs/Nfs.vue +6 -9
  150. package/components/common/wizards/vm/migrate/Migrate.vue +12 -12
  151. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +1 -1
  152. package/composables/useLocal.ts +3 -1
  153. package/composables/useLocalStorage.ts +1 -1
  154. package/lib/models/store/vm/interfaces.ts +11 -0
  155. package/lib/models/table/interfaces.ts +1 -0
  156. package/package.json +3 -3
  157. package/store/tasks/actions.ts +2 -1
@@ -1,544 +1,544 @@
1
- <template>
2
- <div class="chart-option-timespan-split">
3
- <div class="vertical-flex-container">
4
- <div class="timespan-objects-section-direction">
5
- <label for="chart-timespan-type-select"
6
- >{{ localization.inventoryMonitor.timespan }}:</label
7
- >
8
- <div class="vertical-flex-container chart-option-timespan-settings">
9
- <div class="timespan-select chart-option-setting-row">
10
- <div class="view-select-label horizontal-flex-container">
11
- <div class="select">
12
- <select
13
- id="chart-timespan-type-select"
14
- v-model="localSelectedTimespan"
15
- data-id="chart-timespan-type-select"
16
- >
17
- <option
18
- v-for="(item, index) in timespanOptions"
19
- :key="index"
20
- :value="item.value"
21
- >
22
- {{ item.text }}
23
- </option>
24
- </select>
25
- </div>
26
- </div>
27
- </div>
28
- <div
29
- :class="[
30
- 'custom-timespan-settings-container',
31
- { active: localSelectedTimespan === 'custom_interval' },
32
- ]"
33
- >
34
- <table>
35
- <tbody>
36
- <tr>
37
- <td class="relative">
38
- <input
39
- id="custom-time-lastInput"
40
- v-model="localPeriodType"
41
- data-id="custom-time-lastInput"
42
- type="radio"
43
- value="last"
44
- class="custom-radio-button"
45
- name="lastFrom"
46
- />
47
- <label
48
- for="custom-time-lastInput"
49
- class="custom-radio-label"
50
- >
51
- {{ periodTypeText }}:
52
- </label>
53
- </td>
54
- <td>
55
- <div
56
- :class="[
57
- 'custom-timespan-type-last-container',
58
- { active: localPeriodType === 'last' },
59
- ]"
60
- >
61
- <input
62
- id="chart-option-setting-row"
63
- v-model="localLast"
64
- data-id="chart-option-setting-row"
65
- type="number"
66
- class="chart-option-setting-row custom-time-input"
67
- />
68
- <div
69
- class="chart-option-setting-row custom-time-input inline-block"
70
- >
71
- <div
72
- class="view-select-label horizontal-flex-container"
73
- >
74
- <div class="select">
75
- <select
76
- id="chart-timespan-type-select"
77
- v-model="localSelectedCustomTime"
78
- data-id="chart-timespan-type-select"
79
- >
80
- <option
81
- v-for="(item, index) in customTimeOptions"
82
- :key="index"
83
- :value="item.value"
84
- >
85
- {{ item.text }}
86
- </option>
87
- </select>
88
- </div>
89
- </div>
90
- </div>
91
- </div>
92
- </td>
93
- </tr>
94
- <tr>
95
- <td class="relative">
96
- <input
97
- id="custom-time-fromInput"
98
- v-model="localPeriodType"
99
- data-id="custom-time-from-input"
100
- type="radio"
101
- value="period"
102
- class="custom-radio-button"
103
- name="lastFrom"
104
- />
105
- <label
106
- for="custom-time-fromInput"
107
- class="custom-radio-label text-capitalize text-right"
108
- >{{ localization.common.from2 }}:
109
- </label>
110
- </td>
111
- <td>
112
- <div
113
- :class="[
114
- 'date-container-row disabled-container calendar-date-row',
115
- { active: localPeriodType === 'period' },
116
- ]"
117
- >
118
- <input
119
- id="current-date-from"
120
- v-model.lazy="localCurrentDateFrom"
121
- data-id="current-date-from-input"
122
- type="text"
123
- class="chart-option-setting-row custom-time-input first-from"
124
- />
125
- <div class="section-datepicker">
126
- <atoms-datepicker
127
- v-model="dateFrom"
128
- :lang="props.language"
129
- class="calendar-from calendar-popup btn-show-hide-calendar"
130
- @update="onUpdateDateFrom"
131
- />
132
- </div>
133
- <input
134
- id="current-time-from"
135
- v-model="currentTimeFrom"
136
- data-id="current-time-from-input"
137
- type="text"
138
- class="chart-option-setting-row custom-time-input"
139
- />
140
- </div>
141
- </td>
142
- </tr>
143
- <tr>
144
- <td class="custom-time-label-text text-right">
145
- {{ localization.common.to2 }}:
146
- </td>
147
- <td>
148
- <div
149
- :class="[
150
- 'date-container-row disabled-container calendar-date-row',
151
- { active: localPeriodType === 'period' },
152
- ]"
153
- >
154
- <input
155
- id="current-date-to"
156
- v-model.lazy="currentDateTo"
157
- data-id="current-date-to-input"
158
- type="text"
159
- class="chart-option-setting-row custom-time-input first-to"
160
- />
161
- <div class="section-datepicker">
162
- <atoms-datepicker
163
- v-model="dateTo"
164
- :lang="props.language"
165
- class="calendar-from calendar-popup btn-show-hide-calendar"
166
- @update="onUpdateDateTo"
167
- />
168
- </div>
169
- <input
170
- id="current-time-to"
171
- v-model="currentTimeTo"
172
- data-id="current-time-to-input"
173
- type="text"
174
- class="chart-option-setting-row custom-time-input"
175
- />
176
- </div>
177
- </td>
178
- </tr>
179
- <tr>
180
- <td></td>
181
- <td
182
- :class="[
183
- 'disabled-container',
184
- { active: localPeriodType === 'period' },
185
- ]"
186
- >
187
- <span>
188
- ({{ localization.inventoryMonitor.isoTimeFormat }})
189
- </span>
190
- </td>
191
- </tr>
192
- </tbody>
193
- </table>
194
- </div>
195
- </div>
196
- </div>
197
- <div class="horizontal-flex-container chart-type-container">
198
- <div class="view-select-label horizontal-flex-container">
199
- <label for="chart-type-select" class="label-select"
200
- >{{ localization.inventoryMonitor.chartType }}:</label
201
- >
202
- <div class="select">
203
- <select
204
- id="chart-type-select"
205
- v-model="chartType"
206
- data-id="chart-type-select"
207
- >
208
- <option
209
- v-for="(item, index) in chartTypeOptions"
210
- :key="index"
211
- :value="item.value"
212
- >
213
- {{ item.text }}
214
- </option>
215
- </select>
216
- </div>
217
- </div>
218
- </div>
219
- </div>
220
- </div>
221
- </template>
222
-
223
- <script setup lang="ts">
224
- import { format } from 'date-fns'
225
- import type { UI_I_Localization } from '~/lib/models/interfaces'
226
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
227
- import {
228
- timespanFunc,
229
- customTimeFunc,
230
- chartTypeFunc,
231
- } from '~/components/common/chartOptionsModal/counters/timespan/form/lib/config/dateForm'
232
-
233
- const props = defineProps<{
234
- language: string
235
- selectedChartType: string
236
- selectedTimespanType: string
237
- unitsCount: number
238
- periodType: string
239
- selectedCustomTime: string
240
- customDateFrom: string
241
- customDateTo: string
242
- customTimeFrom: string
243
- customTimeTo: string
244
- validDateEnd: number
245
- }>()
246
-
247
- const emits = defineEmits<{
248
- (event: 'update-chart-type', value: string): void
249
- (event: 'update-custom-time', value: string): void
250
- (event: 'update-timespan-type', value: string): void
251
- (event: 'update-unit-count', value: number): void
252
- (event: 'update-period-type', value: string): void
253
- (event: 'update-custom-date-from', value: string): void
254
- (event: 'update-custom-date-to', value: string): void
255
- (event: 'update-custom-time-from', value: string): void
256
- (event: 'update-custom-time-to', value: string): void
257
- }>()
258
-
259
- const { $formattedDate, $isDate, $getTimeFormat, $getUnixByDate } = useNuxtApp()
260
-
261
- const localization = computed<UI_I_Localization>(() => useLocal())
262
-
263
- const timespanOptions = computed<UI_I_OptionItem[]>(() =>
264
- timespanFunc(localization.value)
265
- )
266
- const localSelectedTimespan = ref<string>(
267
- props.selectedTimespanType || timespanOptions.value[0].value
268
- )
269
- watch(
270
- () => props.selectedTimespanType,
271
- (newValue) => {
272
- localSelectedTimespan.value = newValue || timespanOptions.value[0].value
273
- }
274
- )
275
- const localPeriodType = ref<string>('last')
276
- watch(
277
- () => props.periodType,
278
- (newValue) => {
279
- localPeriodType.value = newValue || 'last'
280
- },
281
- { immediate: true }
282
- )
283
-
284
- watch(
285
- localSelectedTimespan,
286
- (newValue) => {
287
- emits('update-timespan-type', newValue)
288
- },
289
- { immediate: true }
290
- )
291
-
292
- watch(
293
- localPeriodType,
294
- (newValue) => {
295
- const currentValue = newValue || 'period'
296
- emits('update-period-type', currentValue)
297
- },
298
- { immediate: true }
299
- )
300
-
301
- const localLast = ref<number>(1)
302
- watch(
303
- localLast,
304
- (newValue) => {
305
- emits('update-unit-count', newValue)
306
- },
307
- { immediate: true }
308
- )
309
- watch(
310
- () => props.unitsCount,
311
- (newValue) => {
312
- localLast.value = newValue > 0 ? newValue : 1
313
- },
314
- { immediate: true }
315
- )
316
-
317
- const localSelectedCustomTime = ref<string>('hours')
318
- const customTimeOptions = computed<UI_I_OptionItem[]>(() => {
319
- const lang = useLocalStorage('lang')
320
-
321
- return customTimeFunc(localization.value, localLast.value, lang)
322
- })
323
- watch(
324
- () => props.selectedCustomTime,
325
- (newValue) => {
326
- localSelectedCustomTime.value = newValue || 'hours'
327
- },
328
- { immediate: true }
329
- )
330
- watch(
331
- localSelectedCustomTime,
332
- (newValue) => {
333
- emits('update-custom-time', newValue)
334
- },
335
- { immediate: true }
336
- )
337
-
338
- const chartType = ref<string>('line_graph')
339
- const chartTypeOptions = computed<UI_I_OptionItem[]>(() =>
340
- chartTypeFunc(localization.value)
341
- )
342
-
343
- const periodTypeText = computed<string>(() => {
344
- let text = ''
345
- const lang = useLocalStorage('lang')
346
-
347
- if (lang !== 'ru_RU') text = localization.value.common.last
348
- else text = getCorrectRuPeriodTypeText(localLast.value)
349
-
350
- return text
351
- })
352
-
353
- const getCorrectRuPeriodTypeText = (hours: number): string => {
354
- let prefix: string
355
-
356
- if (!hours) return getCorrectRuPeriodTypeText.prefix
357
-
358
- if (hours % 10 === 1 && hours % 100 !== 11) prefix = 'Последний'
359
- else prefix = 'Последние'
360
-
361
- getCorrectRuPeriodTypeText.prefix = prefix
362
- return prefix
363
- }
364
-
365
- const setCurrentChartType = (): void => {
366
- const selected = props.selectedChartType
367
- let result = 'line_graph'
368
-
369
- if (selected === 'spline') result = 'line_graph'
370
- else if (selected === 'area') result = 'stacked_graph'
371
-
372
- chartType.value = result
373
- }
374
-
375
- watch(
376
- () => props.selectedChartType,
377
- () => {
378
- setCurrentChartType()
379
- },
380
- { immediate: true }
381
- )
382
-
383
- watch(
384
- chartType,
385
- (newValue) => {
386
- let currentValue = 'spline'
387
-
388
- if (newValue === 'line_graph') currentValue = 'spline'
389
- else if (newValue === 'stacked_graph') currentValue = 'area'
390
-
391
- emits('update-chart-type', currentValue)
392
- },
393
- { immediate: true }
394
- )
395
-
396
- const yesterday = new Date().setDate(new Date().getDate() - 1)
397
- const dateFrom = ref<number>(yesterday)
398
- const dateTo = ref<number>(new Date().getTime())
399
-
400
- const localCurrentDateFrom = ref<string>('')
401
- const currentDateTo = ref<string>('')
402
- const currentTimeFrom = ref<string>('')
403
- const currentTimeTo = ref<string>('')
404
-
405
- const getCurrentTime = (): void => {
406
- localCurrentDateFrom.value =
407
- props.customDateFrom || $formattedDate(yesterday, '')
408
- currentDateTo.value =
409
- props.customDateTo || $formattedDate(props.validDateEnd, '')
410
-
411
- currentTimeFrom.value =
412
- props.customTimeFrom || format(new Date(), $getTimeFormat(true))
413
- currentTimeTo.value =
414
- props.customTimeTo || format(props.validDateEnd, $getTimeFormat(true))
415
- }
416
-
417
- const onUpdateDateFrom = (value: number): void => {
418
- if (!value) return
419
-
420
- localCurrentDateFrom.value = $formattedDate(new Date(value), '')
421
- }
422
- watch(localCurrentDateFrom, (newValue) => {
423
- emits('update-custom-date-from', newValue)
424
- if (!newValue) return
425
-
426
- if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
427
- })
428
-
429
- const onUpdateDateTo = (value: number): void => {
430
- if (!value) return
431
-
432
- currentDateTo.value = $formattedDate(new Date(value), '')
433
- }
434
- watch(currentDateTo, (newValue) => {
435
- emits('update-custom-date-to', newValue)
436
- if (!newValue) return
437
-
438
- if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
439
- })
440
- watch(currentTimeFrom, (newValue) => {
441
- emits('update-custom-time-from', newValue)
442
- })
443
- watch(currentTimeTo, (newValue) => {
444
- emits('update-custom-time-to', newValue)
445
- })
446
-
447
- onMounted(() => {
448
- getCurrentTime()
449
- })
450
- </script>
451
-
452
- <style scoped lang="scss">
453
- .chart-option-timespan-split {
454
- overflow-x: auto;
455
- //flex-basis: 56%;
456
- padding: 5px;
457
-
458
- .timespan-objects-section-direction {
459
- display: flex;
460
- flex-direction: row;
461
- align-items: flex-start;
462
-
463
- .chart-option-timespan-settings {
464
- margin-left: 15px;
465
-
466
- .chart-option-setting-row {
467
- width: 150px;
468
- margin-bottom: 5px;
469
- }
470
-
471
- .custom-radio-button {
472
- position: absolute;
473
- opacity: 0;
474
-
475
- &:checked + .custom-radio-label:before {
476
- box-shadow: inset 0 0 0 6px #0079b8;
477
- border: none;
478
- }
479
- }
480
- .custom-radio-label {
481
- display: block;
482
- position: relative;
483
- min-height: 19.2px;
484
- padding-left: 23px;
485
- cursor: pointer;
486
- line-height: 19.2px;
487
- color: #454545;
488
-
489
- &:before {
490
- position: absolute;
491
- top: 3px;
492
- left: 0;
493
- content: '';
494
- display: inline-block;
495
- height: 16px;
496
- width: 16px;
497
- border: 0.8px solid #565656;
498
- border-radius: 50%;
499
- }
500
- }
501
-
502
- .calendar-date-row {
503
- display: flex;
504
- align-items: center;
505
-
506
- .custom-time-input.first-from,
507
- .custom-time-input.first-to {
508
- max-width: 114px;
509
- }
510
- .btn-show-hide-calendar {
511
- margin: 0 9px;
512
- cursor: pointer;
513
- }
514
- }
515
-
516
- .custom-time-input {
517
- margin-left: 8px;
518
- margin-right: 8px;
519
- max-width: 140px;
520
- }
521
- }
522
-
523
- .custom-timespan-settings-container:not(.active),
524
- .custom-timespan-type-last-container:not(.active),
525
- .disabled-container:not(.active) {
526
- opacity: 0.6;
527
- pointer-events: none;
528
- }
529
- }
530
-
531
- .chart-type-container {
532
- margin-top: 15px;
533
-
534
- .horizontal-flex-container {
535
- display: flex;
536
- flex-direction: row;
537
-
538
- .select {
539
- margin-left: 15px;
540
- }
541
- }
542
- }
543
- }
544
- </style>
1
+ <template>
2
+ <div class="chart-option-timespan-split">
3
+ <div class="vertical-flex-container">
4
+ <div class="timespan-objects-section-direction">
5
+ <label for="chart-timespan-type-select"
6
+ >{{ localization.inventoryMonitor.timespan }}:</label
7
+ >
8
+ <div class="vertical-flex-container chart-option-timespan-settings">
9
+ <div class="timespan-select chart-option-setting-row">
10
+ <div class="view-select-label horizontal-flex-container">
11
+ <div class="select">
12
+ <select
13
+ id="chart-timespan-type-select"
14
+ v-model="localSelectedTimespan"
15
+ data-id="chart-timespan-type-select"
16
+ >
17
+ <option
18
+ v-for="(item, index) in timespanOptions"
19
+ :key="index"
20
+ :value="item.value"
21
+ >
22
+ {{ item.text }}
23
+ </option>
24
+ </select>
25
+ </div>
26
+ </div>
27
+ </div>
28
+ <div
29
+ :class="[
30
+ 'custom-timespan-settings-container',
31
+ { active: localSelectedTimespan === 'custom_interval' },
32
+ ]"
33
+ >
34
+ <table>
35
+ <tbody>
36
+ <tr>
37
+ <td class="relative">
38
+ <input
39
+ id="custom-time-lastInput"
40
+ v-model="localPeriodType"
41
+ data-id="custom-time-lastInput"
42
+ type="radio"
43
+ value="last"
44
+ class="custom-radio-button"
45
+ name="lastFrom"
46
+ />
47
+ <label
48
+ for="custom-time-lastInput"
49
+ class="custom-radio-label"
50
+ >
51
+ {{ periodTypeText }}:
52
+ </label>
53
+ </td>
54
+ <td>
55
+ <div
56
+ :class="[
57
+ 'custom-timespan-type-last-container',
58
+ { active: localPeriodType === 'last' },
59
+ ]"
60
+ >
61
+ <input
62
+ id="chart-option-setting-row"
63
+ v-model="localLast"
64
+ data-id="chart-option-setting-row"
65
+ type="number"
66
+ class="chart-option-setting-row custom-time-input"
67
+ />
68
+ <div
69
+ class="chart-option-setting-row custom-time-input inline-block"
70
+ >
71
+ <div
72
+ class="view-select-label horizontal-flex-container"
73
+ >
74
+ <div class="select">
75
+ <select
76
+ id="chart-timespan-type-select"
77
+ v-model="localSelectedCustomTime"
78
+ data-id="chart-timespan-type-select"
79
+ >
80
+ <option
81
+ v-for="(item, index) in customTimeOptions"
82
+ :key="index"
83
+ :value="item.value"
84
+ >
85
+ {{ item.text }}
86
+ </option>
87
+ </select>
88
+ </div>
89
+ </div>
90
+ </div>
91
+ </div>
92
+ </td>
93
+ </tr>
94
+ <tr>
95
+ <td class="relative">
96
+ <input
97
+ id="custom-time-fromInput"
98
+ v-model="localPeriodType"
99
+ data-id="custom-time-from-input"
100
+ type="radio"
101
+ value="period"
102
+ class="custom-radio-button"
103
+ name="lastFrom"
104
+ />
105
+ <label
106
+ for="custom-time-fromInput"
107
+ class="custom-radio-label text-capitalize text-right"
108
+ >{{ localization.common.from2 }}:
109
+ </label>
110
+ </td>
111
+ <td>
112
+ <div
113
+ :class="[
114
+ 'date-container-row disabled-container calendar-date-row',
115
+ { active: localPeriodType === 'period' },
116
+ ]"
117
+ >
118
+ <input
119
+ id="current-date-from"
120
+ v-model.lazy="localCurrentDateFrom"
121
+ data-id="current-date-from-input"
122
+ type="text"
123
+ class="chart-option-setting-row custom-time-input first-from"
124
+ />
125
+ <div class="section-datepicker">
126
+ <atoms-datepicker
127
+ v-model="dateFrom"
128
+ :lang="props.language"
129
+ class="calendar-from calendar-popup btn-show-hide-calendar"
130
+ @update="onUpdateDateFrom"
131
+ />
132
+ </div>
133
+ <input
134
+ id="current-time-from"
135
+ v-model="currentTimeFrom"
136
+ data-id="current-time-from-input"
137
+ type="text"
138
+ class="chart-option-setting-row custom-time-input"
139
+ />
140
+ </div>
141
+ </td>
142
+ </tr>
143
+ <tr>
144
+ <td class="custom-time-label-text text-right">
145
+ {{ localization.common.to2 }}:
146
+ </td>
147
+ <td>
148
+ <div
149
+ :class="[
150
+ 'date-container-row disabled-container calendar-date-row',
151
+ { active: localPeriodType === 'period' },
152
+ ]"
153
+ >
154
+ <input
155
+ id="current-date-to"
156
+ v-model.lazy="currentDateTo"
157
+ data-id="current-date-to-input"
158
+ type="text"
159
+ class="chart-option-setting-row custom-time-input first-to"
160
+ />
161
+ <div class="section-datepicker">
162
+ <atoms-datepicker
163
+ v-model="dateTo"
164
+ :lang="props.language"
165
+ class="calendar-from calendar-popup btn-show-hide-calendar"
166
+ @update="onUpdateDateTo"
167
+ />
168
+ </div>
169
+ <input
170
+ id="current-time-to"
171
+ v-model="currentTimeTo"
172
+ data-id="current-time-to-input"
173
+ type="text"
174
+ class="chart-option-setting-row custom-time-input"
175
+ />
176
+ </div>
177
+ </td>
178
+ </tr>
179
+ <tr>
180
+ <td></td>
181
+ <td
182
+ :class="[
183
+ 'disabled-container',
184
+ { active: localPeriodType === 'period' },
185
+ ]"
186
+ >
187
+ <span>
188
+ ({{ localization.inventoryMonitor.isoTimeFormat }})
189
+ </span>
190
+ </td>
191
+ </tr>
192
+ </tbody>
193
+ </table>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ <div class="horizontal-flex-container chart-type-container">
198
+ <div class="view-select-label horizontal-flex-container">
199
+ <label for="chart-type-select" class="label-select"
200
+ >{{ localization.inventoryMonitor.chartType }}:</label
201
+ >
202
+ <div class="select">
203
+ <select
204
+ id="chart-type-select"
205
+ v-model="chartType"
206
+ data-id="chart-type-select"
207
+ >
208
+ <option
209
+ v-for="(item, index) in chartTypeOptions"
210
+ :key="index"
211
+ :value="item.value"
212
+ >
213
+ {{ item.text }}
214
+ </option>
215
+ </select>
216
+ </div>
217
+ </div>
218
+ </div>
219
+ </div>
220
+ </div>
221
+ </template>
222
+
223
+ <script setup lang="ts">
224
+ import { format } from 'date-fns'
225
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
226
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
227
+ import {
228
+ timespanFunc,
229
+ customTimeFunc,
230
+ chartTypeFunc,
231
+ } from '~/components/common/chartOptionsModal/counters/timespan/form/lib/config/dateForm'
232
+
233
+ const props = defineProps<{
234
+ language: string
235
+ selectedChartType: string
236
+ selectedTimespanType: string
237
+ unitsCount: number
238
+ periodType: string
239
+ selectedCustomTime: string
240
+ customDateFrom: string
241
+ customDateTo: string
242
+ customTimeFrom: string
243
+ customTimeTo: string
244
+ validDateEnd: number
245
+ }>()
246
+
247
+ const emits = defineEmits<{
248
+ (event: 'update-chart-type', value: string): void
249
+ (event: 'update-custom-time', value: string): void
250
+ (event: 'update-timespan-type', value: string): void
251
+ (event: 'update-unit-count', value: number): void
252
+ (event: 'update-period-type', value: string): void
253
+ (event: 'update-custom-date-from', value: string): void
254
+ (event: 'update-custom-date-to', value: string): void
255
+ (event: 'update-custom-time-from', value: string): void
256
+ (event: 'update-custom-time-to', value: string): void
257
+ }>()
258
+
259
+ const { $formattedDate, $isDate, $getTimeFormat, $getUnixByDate } = useNuxtApp()
260
+
261
+ const localization = computed<UI_I_Localization>(() => useLocal())
262
+
263
+ const timespanOptions = computed<UI_I_OptionItem[]>(() =>
264
+ timespanFunc(localization.value)
265
+ )
266
+ const localSelectedTimespan = ref<string>(
267
+ props.selectedTimespanType || timespanOptions.value[0].value
268
+ )
269
+ watch(
270
+ () => props.selectedTimespanType,
271
+ (newValue) => {
272
+ localSelectedTimespan.value = newValue || timespanOptions.value[0].value
273
+ }
274
+ )
275
+ const localPeriodType = ref<string>('last')
276
+ watch(
277
+ () => props.periodType,
278
+ (newValue) => {
279
+ localPeriodType.value = newValue || 'last'
280
+ },
281
+ { immediate: true }
282
+ )
283
+
284
+ watch(
285
+ localSelectedTimespan,
286
+ (newValue) => {
287
+ emits('update-timespan-type', newValue)
288
+ },
289
+ { immediate: true }
290
+ )
291
+
292
+ watch(
293
+ localPeriodType,
294
+ (newValue) => {
295
+ const currentValue = newValue || 'period'
296
+ emits('update-period-type', currentValue)
297
+ },
298
+ { immediate: true }
299
+ )
300
+
301
+ const localLast = ref<number>(1)
302
+ watch(
303
+ localLast,
304
+ (newValue) => {
305
+ emits('update-unit-count', newValue)
306
+ },
307
+ { immediate: true }
308
+ )
309
+ watch(
310
+ () => props.unitsCount,
311
+ (newValue) => {
312
+ localLast.value = newValue > 0 ? newValue : 1
313
+ },
314
+ { immediate: true }
315
+ )
316
+
317
+ const localSelectedCustomTime = ref<string>('hours')
318
+ const customTimeOptions = computed<UI_I_OptionItem[]>(() => {
319
+ const lang = useLocalStorage('lang')
320
+
321
+ return customTimeFunc(localization.value, localLast.value, lang)
322
+ })
323
+ watch(
324
+ () => props.selectedCustomTime,
325
+ (newValue) => {
326
+ localSelectedCustomTime.value = newValue || 'hours'
327
+ },
328
+ { immediate: true }
329
+ )
330
+ watch(
331
+ localSelectedCustomTime,
332
+ (newValue) => {
333
+ emits('update-custom-time', newValue)
334
+ },
335
+ { immediate: true }
336
+ )
337
+
338
+ const chartType = ref<string>('line_graph')
339
+ const chartTypeOptions = computed<UI_I_OptionItem[]>(() =>
340
+ chartTypeFunc(localization.value)
341
+ )
342
+
343
+ const periodTypeText = computed<string>(() => {
344
+ let text = ''
345
+ const lang = useLocalStorage('lang')
346
+
347
+ if (lang !== 'ru_RU') text = localization.value.common.last
348
+ else text = getCorrectRuPeriodTypeText(localLast.value)
349
+
350
+ return text
351
+ })
352
+
353
+ const getCorrectRuPeriodTypeText = (hours: number): string => {
354
+ let prefix: string
355
+
356
+ if (!hours) return getCorrectRuPeriodTypeText.prefix
357
+
358
+ if (hours % 10 === 1 && hours % 100 !== 11) prefix = 'Последний'
359
+ else prefix = 'Последние'
360
+
361
+ getCorrectRuPeriodTypeText.prefix = prefix
362
+ return prefix
363
+ }
364
+
365
+ const setCurrentChartType = (): void => {
366
+ const selected = props.selectedChartType
367
+ let result = 'line_graph'
368
+
369
+ if (selected === 'spline') result = 'line_graph'
370
+ else if (selected === 'area') result = 'stacked_graph'
371
+
372
+ chartType.value = result
373
+ }
374
+
375
+ watch(
376
+ () => props.selectedChartType,
377
+ () => {
378
+ setCurrentChartType()
379
+ },
380
+ { immediate: true }
381
+ )
382
+
383
+ watch(
384
+ chartType,
385
+ (newValue) => {
386
+ let currentValue = 'spline'
387
+
388
+ if (newValue === 'line_graph') currentValue = 'spline'
389
+ else if (newValue === 'stacked_graph') currentValue = 'area'
390
+
391
+ emits('update-chart-type', currentValue)
392
+ },
393
+ { immediate: true }
394
+ )
395
+
396
+ const yesterday = new Date().setDate(new Date().getDate() - 1)
397
+ const dateFrom = ref<number>(yesterday)
398
+ const dateTo = ref<number>(new Date().getTime())
399
+
400
+ const localCurrentDateFrom = ref<string>('')
401
+ const currentDateTo = ref<string>('')
402
+ const currentTimeFrom = ref<string>('')
403
+ const currentTimeTo = ref<string>('')
404
+
405
+ const getCurrentTime = (): void => {
406
+ localCurrentDateFrom.value =
407
+ props.customDateFrom || $formattedDate(yesterday, '')
408
+ currentDateTo.value =
409
+ props.customDateTo || $formattedDate(props.validDateEnd, '')
410
+
411
+ currentTimeFrom.value =
412
+ props.customTimeFrom || format(new Date(), $getTimeFormat(true))
413
+ currentTimeTo.value =
414
+ props.customTimeTo || format(props.validDateEnd, $getTimeFormat(true))
415
+ }
416
+
417
+ const onUpdateDateFrom = (value: number): void => {
418
+ if (!value) return
419
+
420
+ localCurrentDateFrom.value = $formattedDate(new Date(value), '')
421
+ }
422
+ watch(localCurrentDateFrom, (newValue) => {
423
+ emits('update-custom-date-from', newValue)
424
+ if (!newValue) return
425
+
426
+ if ($isDate(newValue)) dateFrom.value = $getUnixByDate(newValue)
427
+ })
428
+
429
+ const onUpdateDateTo = (value: number): void => {
430
+ if (!value) return
431
+
432
+ currentDateTo.value = $formattedDate(new Date(value), '')
433
+ }
434
+ watch(currentDateTo, (newValue) => {
435
+ emits('update-custom-date-to', newValue)
436
+ if (!newValue) return
437
+
438
+ if ($isDate(newValue)) dateTo.value = $getUnixByDate(newValue)
439
+ })
440
+ watch(currentTimeFrom, (newValue) => {
441
+ emits('update-custom-time-from', newValue)
442
+ })
443
+ watch(currentTimeTo, (newValue) => {
444
+ emits('update-custom-time-to', newValue)
445
+ })
446
+
447
+ onMounted(() => {
448
+ getCurrentTime()
449
+ })
450
+ </script>
451
+
452
+ <style scoped lang="scss">
453
+ .chart-option-timespan-split {
454
+ overflow-x: auto;
455
+ //flex-basis: 56%;
456
+ padding: 5px;
457
+
458
+ .timespan-objects-section-direction {
459
+ display: flex;
460
+ flex-direction: row;
461
+ align-items: flex-start;
462
+
463
+ .chart-option-timespan-settings {
464
+ margin-left: 15px;
465
+
466
+ .chart-option-setting-row {
467
+ width: 150px;
468
+ margin-bottom: 5px;
469
+ }
470
+
471
+ .custom-radio-button {
472
+ position: absolute;
473
+ opacity: 0;
474
+
475
+ &:checked + .custom-radio-label:before {
476
+ box-shadow: inset 0 0 0 6px #0079b8;
477
+ border: none;
478
+ }
479
+ }
480
+ .custom-radio-label {
481
+ display: block;
482
+ position: relative;
483
+ min-height: 19.2px;
484
+ padding-left: 23px;
485
+ cursor: pointer;
486
+ line-height: 19.2px;
487
+ //color: #454545;
488
+
489
+ &:before {
490
+ position: absolute;
491
+ top: 3px;
492
+ left: 0;
493
+ content: '';
494
+ display: inline-block;
495
+ height: 16px;
496
+ width: 16px;
497
+ border: 0.8px solid #565656;
498
+ border-radius: 50%;
499
+ }
500
+ }
501
+
502
+ .calendar-date-row {
503
+ display: flex;
504
+ align-items: center;
505
+
506
+ .custom-time-input.first-from,
507
+ .custom-time-input.first-to {
508
+ max-width: 114px;
509
+ }
510
+ .btn-show-hide-calendar {
511
+ margin: 0 9px;
512
+ cursor: pointer;
513
+ }
514
+ }
515
+
516
+ .custom-time-input {
517
+ margin-left: 8px;
518
+ margin-right: 8px;
519
+ max-width: 140px;
520
+ }
521
+ }
522
+
523
+ .custom-timespan-settings-container:not(.active),
524
+ .custom-timespan-type-last-container:not(.active),
525
+ .disabled-container:not(.active) {
526
+ opacity: 0.6;
527
+ pointer-events: none;
528
+ }
529
+ }
530
+
531
+ .chart-type-container {
532
+ margin-top: 15px;
533
+
534
+ .horizontal-flex-container {
535
+ display: flex;
536
+ flex-direction: row;
537
+
538
+ .select {
539
+ margin-left: 15px;
540
+ }
541
+ }
542
+ }
543
+ }
544
+ </style>