bfg-common 1.6.112 → 1.6.113

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 (68) hide show
  1. package/assets/img/icons/icons-sprite-dark-4.svg +17 -38
  2. package/assets/img/icons/icons-sprite-light-4.svg +17 -49
  3. package/assets/localization/local_be.json +3 -31
  4. package/assets/localization/local_en.json +3 -31
  5. package/assets/localization/local_hy.json +3 -31
  6. package/assets/localization/local_kk.json +3 -31
  7. package/assets/localization/local_ru.json +3 -31
  8. package/assets/localization/local_zh.json +3 -31
  9. package/components/common/graph/Graph.vue +8 -19
  10. package/components/common/graph/{new/New.vue → graphNew/GraphNew.vue} +3 -3
  11. package/components/common/graph/lib/utils/renderGraph.ts +393 -0
  12. package/components/common/modals/confirmation/Confirmation.vue +0 -1
  13. package/components/common/monitor/advanced/Advanced.vue +49 -9
  14. package/components/common/monitor/advanced/graphView/GraphView.vue +12 -8
  15. package/components/common/monitor/advanced/graphView/{New.vue → GraphViewNew.vue} +1 -1
  16. package/components/common/monitor/advanced/table/Table.vue +8 -9
  17. package/components/common/monitor/advanced/table/{new/New.vue → tableNew/TableNew.vue} +5 -6
  18. package/components/common/monitor/advanced/table/{new → tableNew}/lib/config/options.ts +1 -1
  19. package/components/common/monitor/advanced/table/{old/Old.vue → tableOld/TableOld.vue} +3 -6
  20. package/components/common/monitor/advanced/tools/Tools.vue +53 -11
  21. package/components/common/monitor/advanced/tools/{New.vue → ToolsNew.vue} +0 -4
  22. package/components/common/monitor/advanced/tools/{Old.vue → ToolsOld.vue} +0 -2
  23. package/components/common/monitor/advanced/tools/chartOptionsModal/{notification/Notification.vue → Notification.vue} +6 -8
  24. package/components/common/monitor/advanced/tools/chartOptionsModal/{notification/New.vue → NotificationNew.vue} +1 -1
  25. package/components/common/monitor/advanced/tools/chartOptionsModal/{notification/Old.vue → NotificationOld.vue} +5 -1
  26. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +13 -9
  27. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{New.vue → ActionsNew.vue} +3 -6
  28. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +44 -12
  29. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +7 -8
  30. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{new/New.vue → tableNew/TableNew.vue} +2 -2
  31. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{new → tableNew}/config/tableData.ts +1 -1
  32. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{old/Old.vue → tableOld/TableOld.vue} +1 -1
  33. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{old → tableOld}/lib/config/tableConfig.ts +1 -1
  34. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +36 -9
  35. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +9 -8
  36. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{new/New.vue → objectNew/ObjectNew.vue} +2 -2
  37. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{new → objectNew}/lib/config/tableData.ts +1 -1
  38. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{old/Old.vue → objectOld/ObjectOld.vue} +2 -1
  39. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +7 -8
  40. package/components/common/monitor/overview/OverviewNew.vue +1 -1
  41. package/components/common/monitor/overview/OverviewOld.vue +1 -1
  42. package/components/common/monitor/overview/filters/FiltersNew.vue +0 -1
  43. package/components/common/monitor/overview/filters/FiltersOld.vue +0 -1
  44. package/components/common/pages/hardwareHealth/historyTestimony/GraphNew.vue +2 -2
  45. package/lib/models/interfaces.ts +0 -1
  46. package/package.json +1 -1
  47. /package/components/common/graph/{Old.vue → GraphOld.vue} +0 -0
  48. /package/components/common/graph/{new → graphNew}/EmptyBlock.vue +0 -0
  49. /package/components/common/graph/{new → graphNew}/lib/models/enums.ts +0 -0
  50. /package/components/common/monitor/advanced/{New.vue → AdvancedNew.vue} +0 -0
  51. /package/components/common/monitor/advanced/{Old.vue → AdvancedOld.vue} +0 -0
  52. /package/components/common/monitor/advanced/graphView/{Old.vue → GraphViewOld.vue} +0 -0
  53. /package/components/common/monitor/advanced/table/{new → tableNew}/lib/utils/constructBody.ts +0 -0
  54. /package/components/common/monitor/advanced/table/{old → tableOld}/lib/config/performanceDatatable.ts +0 -0
  55. /package/components/common/monitor/advanced/tools/chartOptionsModal/{New.vue → ChartOptionsModalNew.vue} +0 -0
  56. /package/components/common/monitor/advanced/tools/chartOptionsModal/{Old.vue → ChartOptionsModalOld.vue} +0 -0
  57. /package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{Old.vue → ActionsOld.vue} +0 -0
  58. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{New.vue → CountersNew.vue} +0 -0
  59. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{Old.vue → CountersOld.vue} +0 -0
  60. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{new → tableNew}/config/options.ts +0 -0
  61. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{new → tableNew}/utils/constructTable.ts +0 -0
  62. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{old → tableOld}/lib/models/types.ts +0 -0
  63. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{New.vue → TimespanNew.vue} +0 -0
  64. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{Old.vue → TimespanOld.vue} +0 -0
  65. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{new → objectNew}/lib/config/options.ts +0 -0
  66. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{new → objectNew}/lib/utils/constructTable.ts +0 -0
  67. /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{New.vue → MetricsNew.vue} +0 -0
  68. /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{Old.vue → MetricsOld.vue} +0 -0
@@ -2671,14 +2671,9 @@
2671
2671
  "hostFound": "Хост табылды",
2672
2672
  "testConnection": "Қосылымды тексеру",
2673
2673
  "saveAndStart": "Сақтау және іске қосу",
2674
- "saveAndRun": "Сақтау және іске қосу",
2675
2674
  "extended": "Кеңейтілген",
2676
2675
  "deleteConfiguration": "Конфигурацияны жою",
2677
- "editConnection": "Қосылымды өзгерту",
2678
- "deleteDatastores": "Деректер қоймаларын жою",
2679
- "confirmRemoveStorageDescFirst": "Таңдалған деректер қоймаларын ({0}) жойғыңыз келетініне сенімдісіз бе? Бұл әрекет виртуалды машиналарға қатысты барлық файлдарды біржола жояды.",
2680
- "confirmRemoveStorageDescSecond": "Мәжбүрлі түрде орнатылған VMFS деректер қоймалары инвентарьдан жойылады, бірақ олардың деректері жойылмайды.",
2681
- "hostSettings": "Хост параметрлері"
2676
+ "editConnection": "Қосылымды өзгерту"
2682
2677
  },
2683
2678
  "auth": {
2684
2679
  "welcomeTo": "Қош келдіңіз",
@@ -2710,8 +2705,7 @@
2710
2705
  "taskName": "Тапсырма аты",
2711
2706
  "moreTasks": "Деректер мәселелері",
2712
2707
  "vmUpdateSteps": "ВМ жаңарту қадамдары",
2713
- "waitingTime": "Басқару қалыптауы",
2714
- "cancelTask": "Тапсырманы болдырмау"
2708
+ "waitingTime": "Басқару қалыптауы"
2715
2709
  },
2716
2710
  "layout": {
2717
2711
  "alarms": "Budzіlnіkі",
@@ -3945,25 +3939,6 @@
3945
3939
  "issue": "Мәселе",
3946
3940
  "metricsSent": "Метрикалар жіберілді"
3947
3941
  },
3948
- "monq": {
3949
- "monq": "Monq",
3950
- "connectToMonq": "Monq-қа қосылу",
3951
- "connectToMonqDescription": "Data Streams бөлімінен сервер URL мен Stream Key енгізіңіз",
3952
- "monqServerUrl": "Monq серверінің URL-і",
3953
- "streamKeyApiKey": "Stream Key (Data Stream API Key)",
3954
- "streamKey": "Stream Key",
3955
- "getTheKeyInMonqText": "Кілтті Monq-та алыңыз: Settings → Data Streams → Create Stream → Copy API Key",
3956
- "skipTlsCertificateVerification": "TLS сертификатын тексеруді өткізіп жіберу",
3957
- "monqIsAvailable": "Monq қолжетімді",
3958
- "monqIsInvalid": "Monq қолжетімсіз",
3959
- "monqAvailability": "Monq қолжетімділігі",
3960
- "streamKeyIsValid": "Stream Key жарамды",
3961
- "streamKeyIsInvalid": "Stream Key жарамсыз",
3962
- "streamKeyValidation": "Stream Key тексеруі",
3963
- "hostSettingsSubtitle": "Метрикалар Monq-қа жіберілетін хост атауы",
3964
- "hostNameLabel": "Хост атауы (Monq-та көрсетілгендей)",
3965
- "metricsWillAppearInMonqText": "Метрикалар Monq-та осы атаумен көрінеді. Әдетте бұл гипервизордың IP мекенжайы немесе FQDN."
3966
- },
3967
3942
  "glpi": {
3968
3943
  "connectToGlpi": "GLPI-ге қосылыңыз",
3969
3944
  "hostAddress": "GLPI мекен-жайы",
@@ -4573,10 +4548,7 @@
4573
4548
  "reSelect": "Қайта таңдау",
4574
4549
  "nameContainsInvalidCharacters": "Қалта атауы 1-ден 64 таңбаға дейін болуы керек және бос орындарды, '/', '@', '#', басқару таңбаларын қамти алмайды, не '.' / '..' болуы мүмкін емес",
4575
4550
  "fileAlreadyExists": "Файл бұрыннан бар",
4576
- "fileNameAlreadyExists": "«{0}» атауымен файл бұрыннан бар.",
4577
- "pause": "Тоқтату",
4578
- "resume": "Жалғастыру",
4579
- "reSelectFile": "Файлды қайта таңдау"
4551
+ "fileNameAlreadyExists": "«{0}» атауымен файл бұрыннан бар."
4580
4552
  },
4581
4553
  "myPreferences": {
4582
4554
  "twoFactorAuthentication": "Екі факторлы аутентификация",
@@ -2671,14 +2671,9 @@
2671
2671
  "hostFound": "Хост найден",
2672
2672
  "testConnection": "Проверить подключение",
2673
2673
  "saveAndStart": "Сохранить и запустить",
2674
- "saveAndRun": "Сохранить и запустить",
2675
2674
  "extended": "Расширенный",
2676
2675
  "deleteConfiguration": "Удалить конфигурацию",
2677
- "editConnection": "Изменить подключение",
2678
- "deleteDatastores": "Удалить хранилища данных",
2679
- "confirmRemoveStorageDescFirst": "Вы уверены, что хотите удалить выбранные хранилища данных ({0})? Это действие навсегда удалит все файлы виртуальных машин, находящиеся на выбранных хранилищах.",
2680
- "confirmRemoveStorageDescSecond": "Принудительно смонтированные VMFS-хранилища будут удалены из инвентаря, но их данные удалены не будут.",
2681
- "hostSettings": "Настройки хоста"
2676
+ "editConnection": "Изменить подключение"
2682
2677
  },
2683
2678
  "auth": {
2684
2679
  "welcomeTo": "Добро пожаловать в",
@@ -2710,8 +2705,7 @@
2710
2705
  "taskName": "Название задачи",
2711
2706
  "moreTasks": "Дополнительные задачи",
2712
2707
  "vmUpdateSteps": "Шаги обновления ВМ",
2713
- "waitingTime": "Время ожидания",
2714
- "cancelTask": "Отменить задачу"
2708
+ "waitingTime": "Время ожидания"
2715
2709
  },
2716
2710
  "layout": {
2717
2711
  "alarms": "Предупреждения",
@@ -3945,25 +3939,6 @@
3945
3939
  "issue": "Ошибки",
3946
3940
  "metricsSent": "Метрики отправлены"
3947
3941
  },
3948
- "monq": {
3949
- "monq": "Monq",
3950
- "connectToMonq": "Подключиться к Monq",
3951
- "connectToMonqDescription": "Введите URL сервера и Stream Key из раздела Data Streams",
3952
- "monqServerUrl": "URL сервера Monq",
3953
- "streamKeyApiKey": "Stream Key (API-ключ Data Stream)",
3954
- "streamKey": "Stream Key",
3955
- "getTheKeyInMonqText": "Получите ключ в Monq: Settings → Data Streams → Create Stream → Copy API Key",
3956
- "skipTlsCertificateVerification": "Пропустить проверку TLS-сертификата",
3957
- "monqIsAvailable": "Monq доступен",
3958
- "monqIsInvalid": "Monq недоступен",
3959
- "monqAvailability": "Доступность Monq",
3960
- "streamKeyIsValid": "Stream Key действителен",
3961
- "streamKeyIsInvalid": "Stream Key недействителен",
3962
- "streamKeyValidation": "Проверка Stream Key",
3963
- "hostSettingsSubtitle": "Имя хоста, под которым метрики будут отправляться в Monq",
3964
- "hostNameLabel": "Имя хоста (как отображается в Monq)",
3965
- "metricsWillAppearInMonqText": "Метрики будут отображаться в Monq под этим именем. Обычно это IP гипервизора или FQDN."
3966
- },
3967
3942
  "glpi": {
3968
3943
  "connectToGlpi": "Подключитесь к GLPI",
3969
3944
  "hostAddress": "Адрес GLPI",
@@ -4573,10 +4548,7 @@
4573
4548
  "reSelect": "Выбрать заново",
4574
4549
  "nameContainsInvalidCharacters": "Имя папки должно содержать от 1 до 64 символов и не может содержать пробелы, '/', '@', '#', управляющие символы, а также не может быть '.' или '..'",
4575
4550
  "fileAlreadyExists": "Файл уже существует",
4576
- "fileNameAlreadyExists": "Файл с именем «{0}» уже существует.",
4577
- "pause": "Пауза",
4578
- "resume": "Возобновить",
4579
- "reSelectFile": "Выбрать файл заново"
4551
+ "fileNameAlreadyExists": "Файл с именем «{0}» уже существует."
4580
4552
  },
4581
4553
  "myPreferences": {
4582
4554
  "twoFactorAuthentication": "Двухфакторная аутентификация",
@@ -2669,14 +2669,9 @@
2669
2669
  "hostFound": "已找到主机",
2670
2670
  "testConnection": "测试连接",
2671
2671
  "saveAndStart": "保存并启动",
2672
- "saveAndRun": "保存并启动",
2673
2672
  "extended": "扩展版",
2674
2673
  "deleteConfiguration": "删除配置",
2675
- "editConnection": "编辑连接",
2676
- "deleteDatastores": "删除数据存储",
2677
- "confirmRemoveStorageDescFirst": "您确定要删除所选数据存储 ({0}) 吗?此操作将永久删除这些数据存储上所有虚拟机相关文件。",
2678
- "confirmRemoveStorageDescSecond": "强制挂载的 VMFS 数据存储将从清单中移除,但其数据不会被删除。",
2679
- "hostSettings": "主机设置"
2674
+ "editConnection": "编辑连接"
2680
2675
  },
2681
2676
  "auth": {
2682
2677
  "welcomeTo": "欢迎来到",
@@ -2708,8 +2703,7 @@
2708
2703
  "taskName": "任务名称",
2709
2704
  "moreTasks": "附加任务",
2710
2705
  "vmUpdateSteps": "虚拟机更新步骤",
2711
- "waitingTime": "等待时间",
2712
- "cancelTask": "取消任务"
2706
+ "waitingTime": "等待时间"
2713
2707
  },
2714
2708
  "layout": {
2715
2709
  "alarms": "闹钟",
@@ -3943,25 +3937,6 @@
3943
3937
  "issue": "问题",
3944
3938
  "metricsSent": "指标已发送"
3945
3939
  },
3946
- "monq": {
3947
- "monq": "Monq",
3948
- "connectToMonq": "连接到 Monq",
3949
- "connectToMonqDescription": "输入来自 Data Streams 部分的服务器 URL 和 Stream Key",
3950
- "monqServerUrl": "Monq 服务器 URL",
3951
- "streamKeyApiKey": "Stream Key(Data Stream API Key)",
3952
- "streamKey": "Stream Key",
3953
- "getTheKeyInMonqText": "在 Monq 中获取密钥:Settings → Data Streams → Create Stream → Copy API Key",
3954
- "skipTlsCertificateVerification": "跳过 TLS 证书验证",
3955
- "monqIsAvailable": "Monq 可用",
3956
- "monqIsInvalid": "Monq 不可用",
3957
- "monqAvailability": "Monq 可用性",
3958
- "streamKeyIsValid": "Stream Key 有效",
3959
- "streamKeyIsInvalid": "Stream Key 无效",
3960
- "streamKeyValidation": "Stream Key 验证",
3961
- "hostSettingsSubtitle": "用于向 Monq 发送指标的主机名",
3962
- "hostNameLabel": "主机名(在 Monq 中显示)",
3963
- "metricsWillAppearInMonqText": "指标将以此名称显示在 Monq 中。通常为虚拟化主机的 IP 或 FQDN。"
3964
- },
3965
3940
  "glpi": {
3966
3941
  "connectToGlpi": "连接到GLPI",
3967
3942
  "hostAddress": "GLPI地址",
@@ -4571,10 +4546,7 @@
4571
4546
  "reSelect": "重新选择",
4572
4547
  "nameContainsInvalidCharacters": "文件夹名称必须为 1 到 64 个字符,不能包含空格、'/'、'@'、'#'、控制字符,也不能是 '.' 或 '..'",
4573
4548
  "fileAlreadyExists": "文件已存在",
4574
- "fileNameAlreadyExists": "名为“{0}”的文件已存在。",
4575
- "pause": "暂停",
4576
- "resume": "继续",
4577
- "reSelectFile": "重新选择文件"
4549
+ "fileNameAlreadyExists": "名为“{0}”的文件已存在。"
4578
4550
  },
4579
4551
  "myPreferences": {
4580
4552
  "twoFactorAuthentication": "双因素认证",
@@ -1,11 +1,10 @@
1
1
  <template>
2
- <div class="common-graph-block">
3
- <component
4
- :is="currentComponent"
5
- :chart-options="chartOptions"
6
- @select-item="onSelectNewViewExportItem"
7
- />
8
- </div>
2
+ <common-graph-graph-new
3
+ v-if="isNewView"
4
+ :chart-options="chartOptions"
5
+ @select-item="onSelectNewViewExportItem"
6
+ />
7
+ <common-graph-old v-else :chart-options="chartOptions" />
9
8
  </template>
10
9
 
11
10
  <script setup lang="ts">
@@ -25,19 +24,13 @@ const props = withDefaults(
25
24
  {
26
25
  chart: undefined,
27
26
  exportType: undefined,
28
- selectedRow: () => [],
27
+ selectedRow: [],
29
28
  }
30
29
  )
31
30
 
32
31
  const { $store }: any = useNuxtApp()
33
32
  const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
34
33
 
35
- const currentComponent = computed(() =>
36
- isNewView.value
37
- ? defineAsyncComponent(() => import('./new/New.vue'))
38
- : defineAsyncComponent(() => import('./Old.vue'))
39
- )
40
-
41
34
  let localChart: any = null
42
35
  const exportChart = (type: string): void => {
43
36
  if (type === 'png') {
@@ -131,8 +124,4 @@ watch(
131
124
  )
132
125
  </script>
133
126
 
134
- <style scoped lang="scss">
135
- .common-graph-block {
136
- display: contents;
137
- }
138
- </style>
127
+ <style scoped lang="scss"></style>
@@ -15,9 +15,9 @@
15
15
  <ui-button
16
16
  :test-id="`button-metric-${uniqueId}`"
17
17
  :class="['metric-export-button', { active: isShowDropdown }]"
18
- variant="text"
19
18
  is-without-sizes
20
19
  is-without-height
20
+ variant="text"
21
21
  @click="isShowDropdown = !isShowDropdown"
22
22
  >
23
23
  <ui-icon name="burger" width="20" height="20" />
@@ -27,8 +27,8 @@
27
27
  :show="isShowDropdown"
28
28
  :items="dropdownItems"
29
29
  :elem-id="`button-metric-${uniqueId}`"
30
- width="max-content"
31
30
  left
31
+ width="max-content"
32
32
  @select="onSelect($event)"
33
33
  @hide="isShowDropdown = false"
34
34
  />
@@ -48,7 +48,7 @@
48
48
  import { useFullscreen } from '@vueuse/core'
49
49
  import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
50
50
  import type { UI_I_Localization } from '~/lib/models/interfaces'
51
- import { UI_E_ChartExportIconByKey } from '~/components/common/graph/new/lib/models/enums'
51
+ import { UI_E_ChartExportIconByKey } from '~/components/common/graph/graphNew/lib/models/enums'
52
52
 
53
53
  const props = withDefaults(
54
54
  defineProps<{
@@ -0,0 +1,393 @@
1
+ import { Ref } from 'vue'
2
+ import type {
3
+ I_CurrentColor,
4
+ I_LineGraph,
5
+ I_DiskGraph,
6
+ I_Title,
7
+ I_LineSeries,
8
+ I_SeriesLine,
9
+ I_SeriesDisk,
10
+ I_SeriesLineItem,
11
+ } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
12
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
13
+
14
+ export const graphDataFunc = (
15
+ graphData: I_SeriesLine,
16
+ isDarkMode: boolean,
17
+ localization: UI_I_Localization,
18
+ isFullScreen: Ref<boolean>,
19
+ disabledTitle: boolean,
20
+ disabledExportButton: boolean,
21
+ disabledLegends: boolean,
22
+ graphType?: string,
23
+ dateTimeFormat?: string,
24
+ width?: number,
25
+ chart?: Ref<any>
26
+ ): I_LineGraph => {
27
+ const currentColor: I_CurrentColor = {
28
+ backgroundColor: isDarkMode ? '#22343c' : 'white',
29
+ titleColor: isDarkMode ? 'white' : '#333333',
30
+ xAxisColor: isDarkMode ? '#ADBBC4' : '#707070',
31
+ textColor: isDarkMode ? '#ADBBC4' : '#707070',
32
+ legendItemColor: isDarkMode ? '#ADBBC4' : '#333333',
33
+ }
34
+
35
+ const yAxisLength = graphData.yAxis.length
36
+ const yAxisHelper: string[] = []
37
+ const yAxis = graphData.yAxis
38
+ .filter((_: string, key: number) => key >= yAxisLength - 2)
39
+ .map((text: string, i: number) => {
40
+ const opposite = !!i
41
+ if (opposite) yAxisHelper.push(text)
42
+
43
+ return {
44
+ title: {
45
+ text,
46
+ style: {
47
+ color: currentColor.textColor,
48
+ },
49
+ },
50
+ labels: {
51
+ style: {
52
+ color: currentColor.textColor,
53
+ },
54
+ },
55
+ min: text === '%' ? 0 : undefined,
56
+ max: text === '%' ? 100 : undefined,
57
+ opposite,
58
+ gridLineWidth: 0.5,
59
+ }
60
+ })
61
+
62
+ const { $formattedDatetime } = useNuxtApp()
63
+
64
+ const currentDateFunc = (data: number): string => {
65
+ if (dateTimeFormat === 'short')
66
+ return $formattedDatetime(new Date(data), {
67
+ hasSeconds: true,
68
+ separator: ', ',
69
+ formatTime: 'h:mm',
70
+ })
71
+ else
72
+ return $formattedDatetime(new Date(data), {
73
+ hasSeconds: true,
74
+ separator: ', ',
75
+ })
76
+ }
77
+
78
+ let xAxisCategories: string[] = []
79
+ let xAxisLabelPositions: number[] | null = null
80
+ const intervalDate = Math.round(
81
+ (graphData.pointEnd - graphData.pointStart) / graphData.lines[0].data.length
82
+ )
83
+ const series = graphData.lines.map(
84
+ (line: I_SeriesLineItem, key: number): I_LineSeries => {
85
+ const data =
86
+ line.units === 'ms' ? line.data.map((item) => item / 100) : line.data
87
+
88
+ if (key === 0) {
89
+ xAxisCategories = data.map((_: number, key2: number): string => {
90
+ const currentInterval = key2 ? key2 + 1 : 0
91
+ return currentDateFunc(
92
+ graphData.pointStart + intervalDate * currentInterval
93
+ )
94
+ })
95
+ }
96
+ if (width) {
97
+ xAxisLabelPositions = []
98
+ const count = Math.round(width / 250)
99
+ const positionInterval = Math.round(xAxisCategories.length / count)
100
+ for (let i = 0; i <= xAxisCategories.length; i += positionInterval) {
101
+ const currentIndex =
102
+ i === xAxisCategories.length ? xAxisCategories.length - 1 : i
103
+
104
+ if (
105
+ !xAxisLabelPositions?.length ||
106
+ currentIndex > xAxisLabelPositions[xAxisLabelPositions.length - 1]
107
+ ) {
108
+ xAxisLabelPositions?.push(currentIndex)
109
+ }
110
+
111
+ if (i + positionInterval === positionInterval * count) {
112
+ xAxisLabelPositions?.push(xAxisCategories.length - 1)
113
+ }
114
+ }
115
+ }
116
+
117
+ const visible = key < 10
118
+ return {
119
+ data,
120
+ visible,
121
+ name: `${line.measurement}`,
122
+ color: line.color,
123
+ lineWidth: line.lineWidth || 1.5,
124
+ yAxis: yAxisHelper.includes(line.units) ? 1 : 0,
125
+ marker: {
126
+ enabled: false,
127
+ },
128
+ tooltip: {
129
+ pointFormatter: function (): string {
130
+ const { x, y }: any = this
131
+ const currentDate = xAxisCategories.find((_, key) => key === x)
132
+ return `<b>${line.relatedDeviceName}<br>${currentDate}</b><br>${
133
+ line.name
134
+ }: ${new Intl.NumberFormat('en-US').format(y)}`
135
+ },
136
+ },
137
+ }
138
+ }
139
+ )
140
+
141
+ const title = (): I_Title => {
142
+ if (disabledTitle) {
143
+ return {
144
+ text: '',
145
+ }
146
+ } else {
147
+ return {
148
+ text: graphData.groupName,
149
+ style: {
150
+ color: currentColor.titleColor,
151
+ },
152
+ }
153
+ }
154
+ }
155
+
156
+ return {
157
+ chart: {
158
+ type: graphType || 'spline',
159
+ zooming: {
160
+ type: 'xy',
161
+ },
162
+ animation: false,
163
+ backgroundColor: currentColor.backgroundColor,
164
+ events: {
165
+ fullscreenOpen(): void {
166
+ isFullScreen.value = true
167
+ },
168
+ fullscreenClose(): void {
169
+ isFullScreen.value = false
170
+ },
171
+ load: function () {
172
+ if (chart) chart.value = this
173
+ },
174
+ },
175
+ },
176
+
177
+ title: title(),
178
+
179
+ exporting: {
180
+ menuItemDefinitions: {
181
+ viewFullscreen: {
182
+ text: localization.common.viewFullScreen,
183
+ },
184
+ printChart: {
185
+ text: localization.common.printChart,
186
+ },
187
+ downloadPNG: {
188
+ text: localization.common.exportPng,
189
+ },
190
+ downloadJPEG: {
191
+ text: localization.common.exportJpeg,
192
+ },
193
+ downloadSVG: {
194
+ text: localization.common.exportSvg,
195
+ },
196
+ downloadCSV: {
197
+ text: localization.common.exportCsv,
198
+ },
199
+ },
200
+ csv: {
201
+ dateFormat: '%_ISO',
202
+ },
203
+ buttons: {
204
+ contextButton: {
205
+ enabled: disabledExportButton,
206
+ menuItems: [
207
+ 'viewFullscreen',
208
+ 'printChart',
209
+ 'separator',
210
+ 'downloadPNG',
211
+ 'downloadJPEG',
212
+ 'downloadSVG',
213
+ 'downloadCSV',
214
+ ],
215
+ },
216
+ },
217
+ },
218
+
219
+ accessibility: {
220
+ enabled: false,
221
+ },
222
+
223
+ credits: {
224
+ enabled: false,
225
+ },
226
+
227
+ tooltip: {
228
+ headerFormat: '',
229
+ style: {
230
+ width: '300px',
231
+ whiteSpace: 'normal',
232
+ },
233
+ },
234
+
235
+ legend: {
236
+ itemMarginBottom: 5,
237
+ maxHeight: 40,
238
+ itemStyle: {
239
+ color: currentColor.legendItemColor,
240
+ },
241
+ enabled: disabledLegends,
242
+ },
243
+
244
+ xAxis: {
245
+ type: 'datetime',
246
+ labels: {
247
+ autoRotationLimit: 0,
248
+ style: {
249
+ color: currentColor.textColor,
250
+ },
251
+ },
252
+ // tickInterval: 125,
253
+ tickPositions: xAxisLabelPositions,
254
+ categories: xAxisCategories,
255
+ gridLineWidth: 0.5,
256
+ },
257
+
258
+ yAxis,
259
+
260
+ plotOptions: {
261
+ series: {
262
+ animation: false,
263
+ },
264
+ line: {
265
+ animation: false,
266
+ },
267
+ },
268
+
269
+ series,
270
+ }
271
+ }
272
+
273
+ export const graphDiskDataFunc = (
274
+ graphData: I_SeriesDisk,
275
+ isDarkMode: boolean,
276
+ localization: UI_I_Localization,
277
+ isFullScreen: Ref<boolean>
278
+ ): I_DiskGraph => {
279
+ const currentColor: I_CurrentColor = {
280
+ backgroundColor: isDarkMode ? '#22343c' : 'white',
281
+ titleColor: isDarkMode ? 'white' : '#333333',
282
+ xAxisColor: isDarkMode ? '#ADBBC4' : '#707070',
283
+ textColor: isDarkMode ? '#ADBBC4' : '#707070',
284
+ legendItemColor: isDarkMode ? '#ADBBC4' : '#333333',
285
+ }
286
+
287
+ return {
288
+ chart: {
289
+ plotBackgroundColor: null,
290
+ plotBorderWidth: null,
291
+ plotShadow: false,
292
+ type: 'pie',
293
+ backgroundColor: currentColor.backgroundColor,
294
+ events: {
295
+ fullscreenOpen(): void {
296
+ isFullScreen.value = true
297
+ },
298
+ fullscreenClose(): void {
299
+ isFullScreen.value = false
300
+ },
301
+ },
302
+ },
303
+
304
+ exporting: {
305
+ menuItemDefinitions: {
306
+ viewFullscreen: {
307
+ text: localization.common.viewFullScreen,
308
+ },
309
+ printChart: {
310
+ text: localization.common.printChart,
311
+ },
312
+ downloadPNG: {
313
+ text: localization.common.exportPng,
314
+ },
315
+ downloadJPEG: {
316
+ text: localization.common.exportJpeg,
317
+ },
318
+ downloadSVG: {
319
+ text: localization.common.exportSvg,
320
+ },
321
+ downloadCSV: {
322
+ text: localization.common.exportCsv,
323
+ },
324
+ },
325
+ csv: {
326
+ dateFormat: '%_ISO',
327
+ },
328
+ buttons: {
329
+ contextButton: {
330
+ enabled: true,
331
+ menuItems: [
332
+ 'viewFullscreen',
333
+ 'printChart',
334
+ 'separator',
335
+ 'downloadPNG',
336
+ 'downloadJPEG',
337
+ 'downloadSVG',
338
+ 'downloadCSV',
339
+ ],
340
+ },
341
+ },
342
+ },
343
+
344
+ title: {
345
+ text: graphData.title,
346
+ style: {
347
+ color: currentColor.titleColor,
348
+ },
349
+ },
350
+
351
+ accessibility: {
352
+ enabled: false,
353
+ },
354
+
355
+ credits: {
356
+ enabled: false,
357
+ },
358
+
359
+ tooltip: {
360
+ pointFormat: '{point.percentage:.1f}%',
361
+ },
362
+
363
+ plotOptions: {
364
+ pie: {
365
+ cursor: 'pointer',
366
+ dataLabels: {
367
+ enabled: false,
368
+ },
369
+ showInLegend: true,
370
+ },
371
+ },
372
+
373
+ legend: {
374
+ align: 'right',
375
+ layout: 'vertical',
376
+ itemStyle: {
377
+ color: currentColor.legendItemColor,
378
+ },
379
+ itemHoverStyle: {
380
+ color: currentColor.legendItemColor,
381
+ },
382
+ },
383
+
384
+ series: [
385
+ {
386
+ name: 'Brands',
387
+ colorByPoint: true,
388
+ data: graphData.data,
389
+ animation: false,
390
+ },
391
+ ],
392
+ }
393
+ }
@@ -10,7 +10,6 @@
10
10
  @hide-modal="emits('hide-modal')"
11
11
  @confirm="emits('confirm')"
12
12
  >
13
- <!-- TODO fix slot name-->
14
13
  <template #otherContent>
15
14
  <slot v-if="$slots.otherContent" name="otherContent" />
16
15
  </template>