bfg-common 1.5.199 → 1.5.201

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 (127) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/components/atoms/TheIcon3.vue +50 -50
  3. package/components/atoms/perPage/PerPage.vue +58 -58
  4. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  5. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  6. package/components/atoms/tabs/VerticalTabs.vue +105 -105
  7. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  8. package/components/common/context/lib/models/interfaces.ts +31 -31
  9. package/components/common/context/recursion/RecursionNew.vue +238 -238
  10. package/components/common/diagramMain/DiagramMain.vue +897 -897
  11. package/components/common/diagramMain/Header.vue +214 -214
  12. package/components/common/graph/GraphOld.vue +50 -50
  13. package/components/common/graph/graphNew/GraphNew.vue +194 -194
  14. package/components/common/layout/theHeader/helpMenu/About.vue +82 -82
  15. package/components/common/layout/theHeader/userMenu/modals/preferences/view/ViewOld.vue +112 -112
  16. package/components/common/monitor/advanced/graphView/GraphView.vue +145 -178
  17. package/components/common/monitor/advanced/graphView/GraphViewOld.vue +56 -56
  18. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils.ts +1040 -1040
  19. package/components/common/monitor/overview/OverviewOld.vue +139 -139
  20. package/components/common/pages/home/headline/Headline.vue +45 -45
  21. package/components/common/pages/home/headline/HeadlineOld.vue +42 -42
  22. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  23. package/components/common/pages/home/widgets/Widgets.vue +49 -49
  24. package/components/common/pages/home/widgets/WidgetsNew.vue +86 -86
  25. package/components/common/pages/home/widgets/WidgetsOld.vue +34 -34
  26. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  27. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  28. package/components/common/pages/home/widgets/vms/Vms.vue +26 -26
  29. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  30. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  31. package/components/common/pages/packages/Packages.vue +208 -208
  32. package/components/common/pages/shortcuts/block/BlockOld.vue +68 -68
  33. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  34. package/components/common/recursionTree/RecursionTree.vue +223 -223
  35. package/components/common/select/button/ButtonDropdown.vue +108 -108
  36. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  37. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  38. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  39. package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -50
  40. package/components/common/vm/actions/add/lib/config/steps.ts +263 -263
  41. package/components/common/vm/actions/clone/lib/config/steps.ts +291 -291
  42. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +116 -116
  43. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +337 -337
  44. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +480 -480
  45. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +319 -319
  46. package/components/common/vm/actions/common/customizeHardware/virtualHardware/browseView/BrowseView.vue +219 -219
  47. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +100 -100
  48. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +232 -232
  49. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDriveOld.vue +168 -168
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +25 -25
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaNew.vue +78 -78
  52. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/media/MediaOld.vue +50 -50
  53. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +2 -17
  54. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +190 -190
  55. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/model/ModelNew.vue +237 -237
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/tooltip/TooltipNew.vue +154 -154
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +220 -220
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +288 -304
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +154 -154
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +375 -382
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDiskNew.vue +289 -289
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +151 -151
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationNew.vue +73 -73
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/LocationOld.vue +83 -83
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +288 -288
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/lib/config/config.ts +94 -94
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +205 -205
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoNew.vue +66 -66
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIoOld.vue +62 -62
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIoOld.vue +76 -76
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/Note.vue +15 -15
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteNew.vue +42 -42
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/note/NoteOld.vue +30 -30
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGridOld.vue +84 -84
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/OtherNew.vue +30 -30
  81. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/inputDevices/InputDevicesNew.vue +40 -40
  82. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +145 -145
  83. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +106 -106
  84. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +81 -81
  85. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  86. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  87. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  88. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +67 -67
  89. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +149 -149
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +140 -140
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/copyPaste/CopyPasteNew.vue +31 -31
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/fileTransfer/FileTransferNew.vue +31 -31
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/PasswordNew.vue +128 -128
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionNew.vue +39 -39
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirectionOld.vue +44 -44
  98. package/components/common/vm/actions/common/lib/utils/capabilities.ts +52 -52
  99. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  100. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +134 -134
  101. package/components/common/vm/actions/common/select/computeResource/treeView/New.vue +44 -44
  102. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +118 -118
  103. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  104. package/components/common/vm/actions/common/select/createType/New.vue +84 -84
  105. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  106. package/components/common/vm/actions/common/select/name/Name.vue +167 -167
  107. package/components/common/vm/actions/common/select/os/New.vue +122 -122
  108. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  109. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  110. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  111. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  112. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  113. package/components/common/wizards/vm/migrate/lib/config/constructDataReady.ts +220 -220
  114. package/components/common/wizards/vm/migrate/lib/config/steps.ts +157 -157
  115. package/components/common/wizards/vm/migrate/lib/validations.ts +68 -68
  116. package/components/common/wizards/vm/migrate/select/computeResource/tableView/TableView.vue +137 -137
  117. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  118. package/components/common/wizards/vm/migrate/select/network/table/network/lib/config/advancedTable.ts +91 -91
  119. package/composables/productNameLocal.ts +30 -30
  120. package/composables/useAppVersion.ts +21 -21
  121. package/package.json +2 -2
  122. package/plugins/date.ts +233 -233
  123. package/public/spice-console/lib/images/bitmap.js +203 -203
  124. package/public/spice-console/network/spicechannel.js +383 -383
  125. package/store/main/mutations.ts +7 -7
  126. package/store/main/state.ts +7 -7
  127. package/store/tasks/mappers/recentTasks.ts +64 -64
@@ -1,112 +1,112 @@
1
- <template>
2
- <form id="view-form" class="compact">
3
- <div class="description">
4
- {{ props.description }}
5
- </div>
6
-
7
- <div class="flex-align-center" :title="localization.common.inDevelopment">
8
- <label for="view">{{ localization.common.newView }}</label>
9
- <input
10
- id="view"
11
- v-model="newViewLocal"
12
- :disabled="isDisabled"
13
- type="checkbox"
14
- class="switch"
15
- />
16
- </div>
17
- </form>
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import type { UI_I_Localization } from '~/lib/models/interfaces'
22
-
23
- const props = defineProps<{
24
- description: string
25
- }>()
26
-
27
- const localization = computed<UI_I_Localization>(() => useLocal())
28
-
29
- const newViewLocal = defineModel<boolean>()
30
-
31
- const isDisabled = ref<boolean>(true)
32
- // @ts-ignore
33
- window.tools = new Proxy(
34
- {},
35
- {
36
- set: function (_obj, prop, value): boolean {
37
- if (prop === 'isDev') isDisabled.value = !value
38
- return true
39
- },
40
- }
41
- )
42
- </script>
43
-
44
- <style lang="scss" scoped>
45
- .description {
46
- margin-bottom: 10px;
47
- }
48
-
49
- label {
50
- margin-right: 6px;
51
- }
52
-
53
- input[type='checkbox'] {
54
- --active: var(--checkbox-value-active-color);
55
- --active-inner: var(--checkbox-mark-color);
56
- --border: var(--checkbox-mark-color);
57
- --background: var(--checkbox-mark-background-color);
58
- -webkit-appearance: none;
59
- -moz-appearance: none;
60
- height: 20px;
61
- outline: none;
62
- display: inline-block;
63
- vertical-align: top;
64
- position: relative;
65
- margin: 0;
66
- cursor: pointer;
67
- border: 1px solid var(--bc, var(--border));
68
- background: var(--b, var(--background));
69
- transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
70
- &:after {
71
- content: '';
72
- display: block;
73
- left: 0;
74
- top: 0;
75
- position: absolute;
76
- transition: transform var(--d-t, 0.3s) var(--d-t-e, ease),
77
- opacity var(--d-o, 0.2s);
78
- }
79
- &:checked {
80
- --b: var(--active);
81
- --bc: var(--active);
82
- --d-o: 0.3s;
83
- --d-t: 0.6s;
84
- --d-t-e: cubic-bezier(0.2, 0.85, 0.32, 1.2);
85
- }
86
- }
87
- input[type='checkbox'] {
88
- &.switch {
89
- width: 35px;
90
- border-radius: 11px;
91
- &:after {
92
- left: 2px;
93
- top: 2px;
94
- bottom: 2px;
95
- border-radius: 50%;
96
- width: 14px;
97
- height: 14px;
98
- border: 1px solid var(--bc, var(--border));
99
- background: var(--ab, var(--border));
100
- transform: translateX(var(--x, 0));
101
- }
102
- &:checked {
103
- --ab: var(--active-inner);
104
- --x: 14px;
105
- }
106
- &:disabled {
107
- cursor: not-allowed;
108
- opacity: 0.5;
109
- }
110
- }
111
- }
112
- </style>
1
+ <template>
2
+ <form id="view-form" class="compact">
3
+ <div class="description">
4
+ {{ props.description }}
5
+ </div>
6
+
7
+ <div class="flex-align-center" :title="localization.common.inDevelopment">
8
+ <label for="view">{{ localization.common.newView }}</label>
9
+ <input
10
+ id="view"
11
+ v-model="newViewLocal"
12
+ :disabled="isDisabled"
13
+ type="checkbox"
14
+ class="switch"
15
+ />
16
+ </div>
17
+ </form>
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+
23
+ const props = defineProps<{
24
+ description: string
25
+ }>()
26
+
27
+ const localization = computed<UI_I_Localization>(() => useLocal())
28
+
29
+ const newViewLocal = defineModel<boolean>()
30
+
31
+ const isDisabled = ref<boolean>(true)
32
+ // @ts-ignore
33
+ window.tools = new Proxy(
34
+ {},
35
+ {
36
+ set: function (_obj, prop, value): boolean {
37
+ if (prop === 'isDev') isDisabled.value = !value
38
+ return true
39
+ },
40
+ }
41
+ )
42
+ </script>
43
+
44
+ <style lang="scss" scoped>
45
+ .description {
46
+ margin-bottom: 10px;
47
+ }
48
+
49
+ label {
50
+ margin-right: 6px;
51
+ }
52
+
53
+ input[type='checkbox'] {
54
+ --active: var(--checkbox-value-active-color);
55
+ --active-inner: var(--checkbox-mark-color);
56
+ --border: var(--checkbox-mark-color);
57
+ --background: var(--checkbox-mark-background-color);
58
+ -webkit-appearance: none;
59
+ -moz-appearance: none;
60
+ height: 20px;
61
+ outline: none;
62
+ display: inline-block;
63
+ vertical-align: top;
64
+ position: relative;
65
+ margin: 0;
66
+ cursor: pointer;
67
+ border: 1px solid var(--bc, var(--border));
68
+ background: var(--b, var(--background));
69
+ transition: background 0.3s, border-color 0.3s, box-shadow 0.2s;
70
+ &:after {
71
+ content: '';
72
+ display: block;
73
+ left: 0;
74
+ top: 0;
75
+ position: absolute;
76
+ transition: transform var(--d-t, 0.3s) var(--d-t-e, ease),
77
+ opacity var(--d-o, 0.2s);
78
+ }
79
+ &:checked {
80
+ --b: var(--active);
81
+ --bc: var(--active);
82
+ --d-o: 0.3s;
83
+ --d-t: 0.6s;
84
+ --d-t-e: cubic-bezier(0.2, 0.85, 0.32, 1.2);
85
+ }
86
+ }
87
+ input[type='checkbox'] {
88
+ &.switch {
89
+ width: 35px;
90
+ border-radius: 11px;
91
+ &:after {
92
+ left: 2px;
93
+ top: 2px;
94
+ bottom: 2px;
95
+ border-radius: 50%;
96
+ width: 14px;
97
+ height: 14px;
98
+ border: 1px solid var(--bc, var(--border));
99
+ background: var(--ab, var(--border));
100
+ transform: translateX(var(--x, 0));
101
+ }
102
+ &:checked {
103
+ --ab: var(--active-inner);
104
+ --x: 14px;
105
+ }
106
+ &:disabled {
107
+ cursor: not-allowed;
108
+ opacity: 0.5;
109
+ }
110
+ }
111
+ }
112
+ </style>
@@ -1,178 +1,145 @@
1
- <template>
2
- <div ref="chartsView">
3
- <common-monitor-advanced-graph-view-new
4
- v-if="isNewView"
5
- :loading="props.loading"
6
- :is-loading="isLoading"
7
- :chart-data="chartData"
8
- :chart="chart"
9
- :chart-helper="chartHelper"
10
- :export-type="props.export"
11
- :selected-row="props.selectedRow"
12
- />
13
- <common-monitor-advanced-graph-view-old
14
- v-else
15
- :loading="props.loading"
16
- :is-loading="isLoading"
17
- :chart-data="chartData"
18
- :chart="chart"
19
- :chart-helper="chartHelper"
20
- :export-type="props.export"
21
- :selected-row="props.selectedRow"
22
- />
23
- </div>
24
- </template>
25
-
26
- <script setup lang="ts">
27
- import type {
28
- I_LineGraph,
29
- I_SeriesLine,
30
- } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
31
- import { useDebounceFn, useElementSize } from '@vueuse/core'
32
- import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
33
- import { format } from 'date-fns'
34
- import type { UI_I_Localization } from '~/lib/models/interfaces'
35
-
36
- const props = defineProps<{
37
- loading: boolean
38
- data: I_SeriesLine | null
39
- export: string
40
- selectedRow: number[]
41
- darkMode: boolean
42
- language: string
43
- selectedChartType: string
44
- }>()
45
- const emits = defineEmits<{
46
- (event: 'open-advanced-page'): void
47
- }>()
48
-
49
- const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
50
-
51
- const localization = computed<UI_I_Localization>(() => useLocal())
52
-
53
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
54
-
55
- const isLoading = ref<boolean>(true)
56
-
57
- const chartData = ref<I_LineGraph | null>(null)
58
-
59
- const isFullScreen = ref<boolean>(false)
60
- const chart = ref<any>(null)
61
- const chartHelper = ref<number>(0)
62
-
63
- const fullScreenCallBack = (newValue: boolean): void => {
64
- isFullScreen.value = newValue
65
- }
66
-
67
- const chartCallback = (newValue: any): void => {
68
- newValue && (chart.value = newValue)
69
- }
70
-
71
- const newTabCallback = (newValue: boolean): void => {
72
- newValue && emits('open-advanced-page')
73
- }
74
-
75
- watch(
76
- chart,
77
- (newValue) => {
78
- isLoading.value = !newValue?.hasLoaded
79
- },
80
- { immediate: true, deep: true }
81
- )
82
-
83
- let dateFormat = ''
84
-
85
- const chartsView = ref(null)
86
- const { width } = useElementSize(chartsView)
87
-
88
- const startChart = useDebounceFn(() => {
89
- if (!props.data || !width.value) return
90
-
91
- chartData.value = graphDataFunc({
92
- fullScreenCallBack,
93
- format,
94
- graphData: props.data,
95
- isDarkMode: props.darkMode,
96
- localization: localization.value,
97
- disabledTitle: isNewView.value,
98
- disabledExportButton: !isNewView.value,
99
- disabledLegends: false,
100
- graphType: props.selectedChartType,
101
- width: Math.floor(width.value),
102
- chartCallBack: chartCallback,
103
- formattedDatetime: $formattedDatetime,
104
- formatDate: dateFormat,
105
- isNewView: isNewView.value,
106
- isShowLinkNewWindow: true,
107
- newTabCallBack: newTabCallback,
108
- })
109
-
110
- chartHelper.value++
111
- }, 1000)
112
-
113
- watch(
114
- () => props.data,
115
- (newValue) => {
116
- if (!newValue) {
117
- isLoading.value = true
118
- return
119
- }
120
-
121
- startChart()
122
- },
123
- { immediate: true }
124
- )
125
-
126
- watch(
127
- () => props.darkMode,
128
- () => {
129
- startChart()
130
- }
131
- )
132
-
133
- watch(
134
- () => props.language,
135
- () => {
136
- dateFormat = $getDateFormat(props.language)
137
- startChart()
138
- }
139
- )
140
-
141
- watch(
142
- () => props.selectedChartType,
143
- () => {
144
- startChart()
145
- },
146
- { immediate: true }
147
- )
148
-
149
- watch(width, (newValue) => {
150
- if (newValue) startChart()
151
-
152
- if (!chart.value?.isResizing) return
153
-
154
- chart.value.setSize(1, chart.chartHeight)
155
-
156
- if (isFullScreen.value) {
157
- chart.value.setSize(window.innerWidth, chart.chartHeight)
158
- return
159
- }
160
-
161
- setTimeout(() => {
162
- chart.value.setSize(newValue, chart.chartHeight)
163
- }, 1000)
164
- })
165
-
166
- const exportType = ref<string>('')
167
- watch(
168
- () => props.export,
169
- (newValue) => {
170
- if (!newValue) return
171
-
172
- exportType.value = newValue
173
- },
174
- { immediate: true }
175
- )
176
- </script>
177
-
178
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div ref="chartsView">
3
+ <common-monitor-advanced-graph-view-new
4
+ v-if="isNewView"
5
+ :loading="props.loading"
6
+ :is-loading="isLoading"
7
+ :chart-data="chartData"
8
+ :chart="chart"
9
+ :chart-helper="chartHelper"
10
+ :export-type="props.export"
11
+ :selected-row="props.selectedRow"
12
+ />
13
+ <common-monitor-advanced-graph-view-old
14
+ v-else
15
+ :loading="props.loading"
16
+ :is-loading="isLoading"
17
+ :chart-data="chartData"
18
+ :chart="chart"
19
+ :chart-helper="chartHelper"
20
+ :export-type="props.export"
21
+ :selected-row="props.selectedRow"
22
+ />
23
+ </div>
24
+ </template>
25
+
26
+ <script setup lang="ts">
27
+ import type {
28
+ I_LineGraph,
29
+ I_SeriesLine,
30
+ } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
31
+ import { useDebounceFn, useElementSize } from '@vueuse/core'
32
+ import { graphDataFunc } from 'bfg-nuxt-3-graph/graph/lib/utils/renderGraph'
33
+ import { format } from 'date-fns'
34
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
35
+
36
+ const props = defineProps<{
37
+ loading: boolean
38
+ data: I_SeriesLine | null
39
+ export: string
40
+ selectedRow: number[]
41
+ darkMode: boolean
42
+ language: string
43
+ selectedChartType: string
44
+ }>()
45
+ const emits = defineEmits<{
46
+ (event: 'open-advanced-page'): void
47
+ }>()
48
+
49
+ const { $store, $formattedDatetime, $getDateFormat }: any = useNuxtApp()
50
+
51
+ const localization = computed<UI_I_Localization>(() => useLocal())
52
+
53
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
54
+
55
+ const isLoading = ref<boolean>(true)
56
+
57
+ const chartData = ref<I_LineGraph | null>(null)
58
+
59
+ const chart = ref<any>(null)
60
+ const chartHelper = ref<number>(0)
61
+
62
+ const chartCallback = (newValue: any): void => {
63
+ newValue && (chart.value = newValue)
64
+ }
65
+
66
+ const newTabCallback = (newValue: boolean): void => {
67
+ newValue && emits('open-advanced-page')
68
+ }
69
+
70
+ watch(
71
+ chart,
72
+ (newValue) => {
73
+ isLoading.value = !newValue?.hasLoaded
74
+ },
75
+ { immediate: true, deep: true }
76
+ )
77
+
78
+ let dateFormat = ''
79
+
80
+ const chartsView = ref(null)
81
+ const { width } = useElementSize(chartsView)
82
+
83
+ const startChart = useDebounceFn(() => {
84
+ if (!props.data || !width.value) return
85
+
86
+ chartData.value = graphDataFunc({
87
+ fullScreenCallBack: () => ({}),
88
+ format,
89
+ graphData: props.data,
90
+ isDarkMode: props.darkMode,
91
+ localization: localization.value,
92
+ disabledTitle: isNewView.value,
93
+ disabledExportButton: !isNewView.value,
94
+ disabledLegends: false,
95
+ graphType: props.selectedChartType,
96
+ width: Math.floor(width.value),
97
+ chartCallBack: chartCallback,
98
+ formattedDatetime: $formattedDatetime,
99
+ formatDate: dateFormat,
100
+ isNewView: isNewView.value,
101
+ isShowLinkNewWindow: true,
102
+ newTabCallBack: newTabCallback,
103
+ })
104
+
105
+ chartHelper.value++
106
+ }, 1000)
107
+
108
+ watch(
109
+ () => props.data,
110
+ (newValue) => {
111
+ if (!newValue) {
112
+ isLoading.value = true
113
+ return
114
+ }
115
+
116
+ startChart()
117
+ },
118
+ { immediate: true }
119
+ )
120
+
121
+ watch(
122
+ () => props.darkMode,
123
+ () => {
124
+ startChart()
125
+ }
126
+ )
127
+
128
+ watch(
129
+ () => props.language,
130
+ () => {
131
+ dateFormat = $getDateFormat(props.language)
132
+ startChart()
133
+ }
134
+ )
135
+
136
+ watch(
137
+ () => props.selectedChartType,
138
+ () => {
139
+ startChart()
140
+ },
141
+ { immediate: true }
142
+ )
143
+ </script>
144
+
145
+ <style scoped lang="scss"></style>
@@ -1,56 +1,56 @@
1
- <template>
2
- <div class="advanced-graph-container">
3
- <div v-if="props.isLoading" class="graphic-loader-block">
4
- <div class="spinner"></div>
5
- <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
- </div>
7
- <template v-if="!props.loading && props.chartData">
8
- <common-graph
9
- :chart="props.chart"
10
- :data="props.chartData"
11
- :update="props.chartHelper"
12
- :export-type="props.exportType"
13
- :selected-row="props.selectedRow"
14
- />
15
- </template>
16
- </div>
17
- </template>
18
-
19
- <script setup lang="ts">
20
- import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
21
- import type { UI_I_Localization } from '~/lib/models/interfaces'
22
-
23
- const localization = computed<UI_I_Localization>(() => useLocal())
24
-
25
- const props = defineProps<{
26
- loading: boolean
27
- isLoading: boolean
28
- chartData: I_LineGraph | null
29
- chart: any
30
- chartHelper: number
31
- exportType: string
32
- selectedRow: number[]
33
- }>()
34
- </script>
35
-
36
- <style scoped lang="scss">
37
- .advanced-graph-container {
38
- position: relative;
39
- min-height: 400px;
40
-
41
- .graphic-loader-block {
42
- background-color: var(--loader-bg-color);
43
- height: 100%;
44
- display: flex;
45
- flex-direction: column;
46
- align-items: center;
47
- justify-content: center;
48
- position: absolute;
49
- top: 0;
50
- left: 0;
51
- right: 0;
52
- bottom: 0;
53
- z-index: var(--z-fixed);
54
- }
55
- }
56
- </style>
1
+ <template>
2
+ <div class="advanced-graph-container">
3
+ <div v-if="props.isLoading" class="graphic-loader-block">
4
+ <div class="spinner"></div>
5
+ <p>{{ localization.inventoryMonitor.retrievingData }}...</p>
6
+ </div>
7
+ <template v-if="!props.loading && props.chartData">
8
+ <common-graph
9
+ :chart="props.chart"
10
+ :data="props.chartData"
11
+ :update="props.chartHelper"
12
+ :export-type="props.exportType"
13
+ :selected-row="props.selectedRow"
14
+ />
15
+ </template>
16
+ </div>
17
+ </template>
18
+
19
+ <script setup lang="ts">
20
+ import type { I_LineGraph } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+
23
+ const localization = computed<UI_I_Localization>(() => useLocal())
24
+
25
+ const props = defineProps<{
26
+ loading: boolean
27
+ isLoading: boolean
28
+ chartData: I_LineGraph | null
29
+ chart: any
30
+ chartHelper: number
31
+ exportType: string
32
+ selectedRow: number[]
33
+ }>()
34
+ </script>
35
+
36
+ <style scoped lang="scss">
37
+ .advanced-graph-container {
38
+ position: relative;
39
+ min-height: 400px;
40
+
41
+ .graphic-loader-block {
42
+ background-color: var(--loader-bg-color);
43
+ height: 100%;
44
+ display: flex;
45
+ flex-direction: column;
46
+ align-items: center;
47
+ justify-content: center;
48
+ position: absolute;
49
+ top: 0;
50
+ left: 0;
51
+ right: 0;
52
+ bottom: 0;
53
+ z-index: var(--z-fixed);
54
+ }
55
+ }
56
+ </style>