bfg-common 1.3.141 → 1.3.143

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 (64) hide show
  1. package/assets/localization/local_be.json +1 -7
  2. package/assets/localization/local_en.json +1 -7
  3. package/assets/localization/local_hy.json +1 -7
  4. package/assets/localization/local_kk.json +1 -7
  5. package/assets/localization/local_ru.json +1 -7
  6. package/assets/localization/local_zh.json +1 -7
  7. package/assets/scss/common/icons/icons-2.scss +222 -222
  8. package/components/atoms/switch/Switch.vue +107 -107
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1576 -1576
  10. package/components/common/monitor/advanced/Advanced.vue +9 -9
  11. package/components/common/monitor/advanced/GraphView.vue +2 -2
  12. package/components/common/monitor/advanced/lib/models/interfaces.ts +2 -1
  13. package/components/common/monitor/advanced/lib/models/types.ts +1 -1
  14. package/components/common/monitor/advanced/table/Table.vue +3 -3
  15. package/components/common/monitor/advanced/table/lib/config/performanceDatatable.ts +4 -4
  16. package/components/common/monitor/advanced/tools/Tools.vue +9 -9
  17. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +7 -7
  18. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +2 -2
  19. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +2 -2
  20. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/saveOptionsModal/SaveOptionsModal.vue +1 -1
  21. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +3 -3
  22. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +6 -6
  23. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/tableConfig.ts +4 -4
  24. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/lib/config/utils.ts +5 -5
  25. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +2 -2
  26. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +2 -2
  27. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +2 -2
  28. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +6 -6
  29. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/lib/config/objectTable.ts +4 -4
  30. package/components/common/monitor/advanced/tools/chartOptionsModal/lib/models/interfaces.ts +1 -1
  31. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +2 -2
  32. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/lib/config/optionsMetrics.ts +40 -4
  33. package/components/common/monitor/advanced/tools/lib/config/advancedToolbar.ts +130 -125
  34. package/components/common/monitor/advanced/tools/lib/utils/countCores.ts +1 -1
  35. package/components/common/monitor/lib/models/interfaces.ts +2 -2
  36. package/components/common/monitor/overview/filters/Filters.vue +5 -5
  37. package/components/common/monitor/overview/filters/lib/config/filterOptions.ts +6 -5
  38. package/components/common/monitor/overview/filters/lib/models/interfaces.ts +2 -1
  39. package/components/common/monitor/overview/filters/lib/models/types.ts +13 -3
  40. package/components/common/pages/Tasks.vue +120 -120
  41. package/components/common/recursionTree/RecursionTree.vue +203 -203
  42. package/components/common/vm/actions/add/Add.vue +575 -575
  43. package/components/common/vm/actions/clone/Clone.vue +518 -518
  44. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  45. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +682 -682
  46. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  47. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +164 -164
  48. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  49. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  50. package/composables/useAppVersion.ts +21 -21
  51. package/composables/useEnvLanguage.ts +20 -20
  52. package/composables/useLocal.ts +38 -38
  53. package/lib/utils/sendTask.ts +72 -72
  54. package/minify.js +146 -146
  55. package/package.json +1 -1
  56. package/public/spice-console/application/codec.js +257 -257
  57. package/public/spice-console/lib/rasterEngine.js +907 -907
  58. package/public/spice-console/network/spicechannel.js +369 -369
  59. package/store/main/lib/interfaces.ts +9 -9
  60. package/store/tasks/actions.ts +133 -133
  61. package/store/tasks/getters.ts +25 -25
  62. package/store/tasks/lib/models/interfaces.ts +18 -18
  63. package/store/tasks/mutations.ts +58 -58
  64. package/store/tasks/state.ts +16 -16
@@ -1,125 +1,130 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
- import { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/lib/models/interfaces'
4
- import { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
5
- import { UI_I_OptionData } from '~/components/common/monitor/advanced/lib/models/interfaces'
6
- import { UI_T_Project } from '~/lib/models/types'
7
-
8
- export const periodFunc = (
9
- localization: UI_I_Localization,
10
- selectedTimespanType: string
11
- ): UI_I_OptionItem[] => {
12
- const result = [
13
- {
14
- text: localization.realTime,
15
- value: 'real_time',
16
- },
17
- {
18
- text: localization.lastDay,
19
- value: 'last_day',
20
- },
21
- {
22
- text: localization.lastWeek,
23
- value: 'last_week',
24
- },
25
- {
26
- text: localization.lastMonth,
27
- value: 'last_month',
28
- },
29
- // {
30
- // text: localization.lastYear,
31
- // value: 'last_year',
32
- // },
33
- ]
34
-
35
- if (selectedTimespanType === 'custom_interval') {
36
- result.push({
37
- text: localization.customInterval,
38
- value: 'custom_interval',
39
- })
40
- }
41
-
42
- return result
43
- }
44
-
45
- export const viewFunc = (
46
- localization: UI_I_Localization,
47
- type: UI_T_AdvancedType,
48
- optionsNames?: string[]
49
- ): UI_I_OptionItem[] => {
50
- const viewData: UI_I_OptionData = {
51
- cluster: [],
52
- datacenter: [
53
- {
54
- text: localization.virtualMachineOperations,
55
- value: 'virtualMachineOperations',
56
- },
57
- ],
58
- host: [
59
- { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
60
- // { text: localization.datastore, value: 'datastore' },
61
- { text: localization.memory, value: 'memory' },
62
- { text: localization.disk, value: 'disk' },
63
- { text: localization.network, value: 'network' },
64
- // { text: localization.power, value: 'power' },
65
- // { text: localization.storageAdapters, value: 'storageAdapters' },
66
- // { text: localization.storagePath, value: 'storagePath' },
67
- // { text: localization.system, value: 'system' },
68
- // {
69
- // text: localization.procuratorReplication,
70
- // value: 'procuratorReplication',
71
- // },
72
- ],
73
- vm: [
74
- { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
75
- // { text: localization.cpuUsageInMhz, value: 'cpuUsageInMhz' },
76
- // { text: localization.cpuReady, value: 'cpuReady' },
77
- // { text: localization.datastore, value: 'datastore' },
78
- { text: localization.memory, value: 'memory' },
79
- { text: localization.disk, value: 'disk' },
80
- { text: localization.network, value: 'network' },
81
- // { text: localization.power, value: 'power' },
82
- // { text: localization.virtualDisk, value: 'virtualDisk' },
83
- ],
84
- }
85
- const currentOptions = viewData[type]
86
-
87
- if (optionsNames) {
88
- optionsNames.forEach((item) => {
89
- currentOptions.push({
90
- text: item,
91
- value: item,
92
- })
93
- })
94
- }
95
- return currentOptions
96
- }
97
-
98
- export const exportFunc = (
99
- localization: UI_I_Localization
100
- ): UI_I_DropMenu<string>[] => [
101
- { text: localization.toPng + '...', action: 'png' },
102
- { text: localization.toJpeg + '...', action: 'jpeg' },
103
- { text: localization.toSvg + '...', action: 'svg' },
104
- { text: localization.toCsv + '...', action: 'csv' },
105
- ]
106
-
107
- export const getCurrentOptionsStorageFunc = (
108
- routeType: string,
109
- project: UI_T_Project
110
- ): string[] => {
111
- const prefix = project === 'sphere'
112
- const optionsNames = []
113
- for (const key of Object.entries(localStorage)) {
114
- if (key[0].includes('ChartOptions')) {
115
- const currentOptions = useLocalStorage(key[0], undefined, prefix)
116
- if (
117
- key[0].includes('ChartOptions') &&
118
- currentOptions.routeType === routeType
119
- ) {
120
- optionsNames.push(key[0].replace('ChartOptions', ''))
121
- }
122
- }
123
- }
124
- return optionsNames
125
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
+ import type { UI_I_DropMenu } from '~/components/common/monitor/advanced/tools/lib/models/interfaces'
4
+ import type { UI_T_AdvancedType } from '~/components/common/monitor/advanced/lib/models/types'
5
+ import type { UI_I_OptionData } from '~/components/common/monitor/advanced/lib/models/interfaces'
6
+ import type { UI_T_Project } from '~/lib/models/types'
7
+
8
+ export const periodFunc = (
9
+ localization: UI_I_Localization,
10
+ selectedTimespanType: string
11
+ ): UI_I_OptionItem[] => {
12
+ const result = [
13
+ {
14
+ text: localization.realTime,
15
+ value: 'real_time',
16
+ },
17
+ {
18
+ text: localization.lastDay,
19
+ value: 'last_day',
20
+ },
21
+ {
22
+ text: localization.lastWeek,
23
+ value: 'last_week',
24
+ },
25
+ {
26
+ text: localization.lastMonth,
27
+ value: 'last_month',
28
+ },
29
+ // {
30
+ // text: localization.lastYear,
31
+ // value: 'last_year',
32
+ // },
33
+ ]
34
+
35
+ if (selectedTimespanType === 'custom_interval') {
36
+ result.push({
37
+ text: localization.customInterval,
38
+ value: 'custom_interval',
39
+ })
40
+ }
41
+
42
+ return result
43
+ }
44
+
45
+ export const viewFunc = (
46
+ localization: UI_I_Localization,
47
+ type: UI_T_AdvancedType,
48
+ optionsNames?: string[]
49
+ ): UI_I_OptionItem[] => {
50
+ const viewData: UI_I_OptionData = {
51
+ zone: [
52
+ { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
53
+ ],
54
+ cluster: [
55
+ { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
56
+ ],
57
+ datacenter: [
58
+ {
59
+ text: localization.virtualMachineOperations,
60
+ value: 'virtualMachineOperations',
61
+ },
62
+ ],
63
+ host: [
64
+ { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
65
+ // { text: localization.datastore, value: 'datastore' },
66
+ { text: localization.memory, value: 'memory' },
67
+ { text: localization.disk, value: 'disk' },
68
+ { text: localization.network, value: 'network' },
69
+ // { text: localization.power, value: 'power' },
70
+ // { text: localization.storageAdapters, value: 'storageAdapters' },
71
+ // { text: localization.storagePath, value: 'storagePath' },
72
+ // { text: localization.system, value: 'system' },
73
+ // {
74
+ // text: localization.procuratorReplication,
75
+ // value: 'procuratorReplication',
76
+ // },
77
+ ],
78
+ vm: [
79
+ { text: localization.cpuUsageInPercent, value: 'cpuUsageInPercent' },
80
+ // { text: localization.cpuUsageInMhz, value: 'cpuUsageInMhz' },
81
+ // { text: localization.cpuReady, value: 'cpuReady' },
82
+ // { text: localization.datastore, value: 'datastore' },
83
+ { text: localization.memory, value: 'memory' },
84
+ { text: localization.disk, value: 'disk' },
85
+ { text: localization.network, value: 'network' },
86
+ // { text: localization.power, value: 'power' },
87
+ // { text: localization.virtualDisk, value: 'virtualDisk' },
88
+ ],
89
+ }
90
+ const currentOptions = viewData[type]
91
+
92
+ if (optionsNames) {
93
+ optionsNames.forEach((item) => {
94
+ currentOptions.push({
95
+ text: item,
96
+ value: item,
97
+ })
98
+ })
99
+ }
100
+ return currentOptions
101
+ }
102
+
103
+ export const exportFunc = (
104
+ localization: UI_I_Localization
105
+ ): UI_I_DropMenu<string>[] => [
106
+ { text: localization.toPng + '...', action: 'png' },
107
+ { text: localization.toJpeg + '...', action: 'jpeg' },
108
+ { text: localization.toSvg + '...', action: 'svg' },
109
+ { text: localization.toCsv + '...', action: 'csv' },
110
+ ]
111
+
112
+ export const getCurrentOptionsStorageFunc = (
113
+ routeType: string,
114
+ project: UI_T_Project
115
+ ): string[] => {
116
+ const prefix = project === 'sphere'
117
+ const optionsNames = []
118
+ for (const key of Object.entries(localStorage)) {
119
+ if (key[0].includes('ChartOptions')) {
120
+ const currentOptions = useLocalStorage(key[0], undefined, prefix)
121
+ if (
122
+ key[0].includes('ChartOptions') &&
123
+ currentOptions.routeType === routeType
124
+ ) {
125
+ optionsNames.push(key[0].replace('ChartOptions', ''))
126
+ }
127
+ }
128
+ }
129
+ return optionsNames
130
+ }
@@ -1,4 +1,4 @@
1
- import { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
1
+ import type { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
2
2
 
3
3
  export const getCountCores = (data: I_SeriesLine | null): number => {
4
4
  if (!data) return 0
@@ -1,5 +1,5 @@
1
- import { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
2
- import { UI_T_OverviewRequestType } from '~/components/common/monitor/overview/filters/lib/models/types'
1
+ import type { I_SeriesLine } from 'bfg-nuxt-3-graph/graph/lib/models/interfaces'
2
+ import type { UI_T_OverviewRequestType } from '~/components/common/monitor/overview/filters/lib/models/types'
3
3
 
4
4
  export interface UI_I_GraphDataSettingItem {
5
5
  title: string
@@ -53,11 +53,11 @@
53
53
  </template>
54
54
 
55
55
  <script setup lang="ts">
56
- import { UI_I_Localization } from '~/lib/models/interfaces'
57
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
58
- import { UI_T_Project } from '~/lib/models/types'
59
- import { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
60
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
56
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
57
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
58
+ import type { UI_T_Project } from '~/lib/models/types'
59
+ import type { UI_I_MonitorGraphPayload } from '~/components/common/monitor/lib/models/interfaces'
60
+ import type { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
61
61
  import {
62
62
  periodFunc,
63
63
  viewFunc,
@@ -1,8 +1,8 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
2
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
- import { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/lib/models/interfaces'
4
- import { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
5
- import { UI_T_Project } from '~/lib/models/types'
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
+ import type { UI_I_OverviewViewOptionData } from '~/components/common/monitor/overview/filters/lib/models/interfaces'
4
+ import type { UI_T_OverviewViewType } from '~/components/common/monitor/overview/filters/lib/models/types'
5
+ import type { UI_T_Project } from '~/lib/models/types'
6
6
 
7
7
  export const periodFunc = (
8
8
  localization: UI_I_Localization
@@ -53,6 +53,7 @@ export const viewFunc = (
53
53
  })
54
54
 
55
55
  const viewData: UI_I_OverviewViewOptionData = {
56
+ zone: [{ text: localization.overview, value: 'overview' }],
56
57
  datacenter: [
57
58
  {
58
59
  text: localization.clusters,
@@ -1,6 +1,7 @@
1
- import { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
1
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
2
2
 
3
3
  export interface UI_I_OverviewViewOptionData {
4
+ zone: UI_I_OptionItem[]
4
5
  datacenter: UI_I_OptionItem[]
5
6
  host: UI_I_OptionItem[]
6
7
  vm: UI_I_OptionItem[]
@@ -1,3 +1,13 @@
1
- export type UI_T_OverviewViewType = 'host' | 'vm' | 'datacenter' | 'cluster'
2
-
3
- export type UI_T_OverviewRequestType = 'hosts' | 'vms' | 'datacenters'
1
+ export type UI_T_OverviewViewType =
2
+ | 'zone'
3
+ | 'host'
4
+ | 'vm'
5
+ | 'datacenter'
6
+ | 'cluster'
7
+
8
+ export type UI_T_OverviewRequestType =
9
+ | 'cluster'
10
+ | 'zone'
11
+ | 'hosts'
12
+ | 'vms'
13
+ | 'datacenters'
@@ -1,120 +1,120 @@
1
- <template>
2
- <div class="tasks">
3
- <common-headline
4
- :headline="localization.taskConsole"
5
- class="tasks__headline"
6
- />
7
-
8
- <div class="btn-group">
9
- <button
10
- id="task-previous-button"
11
- class="btn btn-sm btn-link nav-link"
12
- :disabled="pagination.page === 1"
13
- @click="onClickButton('previous')"
14
- >
15
- {{ localization.previous }}
16
- </button>
17
-
18
- <button
19
- id="task-next-button"
20
- class="btn btn-sm btn-link nav-link"
21
- :disabled="pagination.page === tasksList?.total_pages"
22
- @click="onClickButton('next')"
23
- >
24
- {{ localization.next }}
25
- </button>
26
- </div>
27
-
28
- <templates-tasks-table-view
29
- :data-table="tasksList?.items || []"
30
- :total-items="tasksList?.total_items || 0"
31
- :total-pages="tasksList?.total_pages || 1"
32
- :pagination="pagination"
33
- :loading="isLoading"
34
- @pagination="onUpdatePagination"
35
- @sort="onSortTable"
36
- />
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- import type {
42
- UI_I_Localization,
43
- } from '~/lib/models/interfaces'
44
- import type {
45
- UI_I_Pagination,
46
- UI_I_DataTableQuery,
47
- } from '~/lib/models/table/interfaces'
48
- import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
49
-
50
- definePageMeta({
51
- middleware: ['auth'],
52
- })
53
-
54
- const localization = computed<UI_I_Localization>(() => useLocal())
55
- const { $store }: any = useNuxtApp()
56
-
57
- const pagination = ref<UI_I_Pagination>({
58
- page: 1,
59
- pageSize: 100,
60
- })
61
- const sort = ref<string | null>(null)
62
-
63
- const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
64
-
65
- const onClickButton = (status: string): void => {
66
- if (status === 'next') {
67
- pagination.value.page += 1
68
- return
69
- }
70
-
71
- pagination.value.page -= 1
72
- }
73
-
74
- const getTasks = async (): Promise<void> => {
75
- pauseGlobalRefresh()
76
-
77
- const payload: UI_I_DataTableQuery = {
78
- ...pagination.value,
79
- sortBy: sort.value || '',
80
- }
81
- await $store.dispatch('tasks/A_GET_TASKS', payload)
82
- }
83
-
84
- const onUpdatePagination = (event: UI_I_Pagination): void => {
85
- pagination.value = event
86
- getTasks()
87
- }
88
-
89
- const onSortTable = (event: string): void => {
90
- sort.value = event
91
- getTasks()
92
- }
93
-
94
- const isLoading = computed<boolean>(() =>
95
- $store.getters['tasks/getLoading']('tasks')
96
- )
97
- const pauseGlobalRefresh = (): void => {
98
- const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
99
- $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
100
- }
101
- onUnmounted(() => {
102
- pauseGlobalRefresh()
103
- })
104
- </script>
105
-
106
- <style lang="scss">
107
- @import '~/node_modules/bfg-common/assets/scss/common/mixins';
108
- .tasks {
109
- @include flex($dir: column);
110
- height: 100%;
111
- padding-left: 10px;
112
- &__headline {
113
- padding-left: 10px;
114
- margin-bottom: 0.6rem;
115
- }
116
- .btn {
117
- text-transform: uppercase;
118
- }
119
- }
120
- </style>
1
+ <template>
2
+ <div class="tasks">
3
+ <common-headline
4
+ :headline="localization.taskConsole"
5
+ class="tasks__headline"
6
+ />
7
+
8
+ <div class="btn-group">
9
+ <button
10
+ id="task-previous-button"
11
+ class="btn btn-sm btn-link nav-link"
12
+ :disabled="pagination.page === 1"
13
+ @click="onClickButton('previous')"
14
+ >
15
+ {{ localization.previous }}
16
+ </button>
17
+
18
+ <button
19
+ id="task-next-button"
20
+ class="btn btn-sm btn-link nav-link"
21
+ :disabled="pagination.page === tasksList?.total_pages"
22
+ @click="onClickButton('next')"
23
+ >
24
+ {{ localization.next }}
25
+ </button>
26
+ </div>
27
+
28
+ <templates-tasks-table-view
29
+ :data-table="tasksList?.items || []"
30
+ :total-items="tasksList?.total_items || 0"
31
+ :total-pages="tasksList?.total_pages || 1"
32
+ :pagination="pagination"
33
+ :loading="isLoading"
34
+ @pagination="onUpdatePagination"
35
+ @sort="onSortTable"
36
+ />
37
+ </div>
38
+ </template>
39
+
40
+ <script lang="ts" setup>
41
+ import type {
42
+ UI_I_Localization,
43
+ } from '~/lib/models/interfaces'
44
+ import type {
45
+ UI_I_Pagination,
46
+ UI_I_DataTableQuery,
47
+ } from '~/lib/models/table/interfaces'
48
+ import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
49
+
50
+ definePageMeta({
51
+ middleware: ['auth'],
52
+ })
53
+
54
+ const localization = computed<UI_I_Localization>(() => useLocal())
55
+ const { $store }: any = useNuxtApp()
56
+
57
+ const pagination = ref<UI_I_Pagination>({
58
+ page: 1,
59
+ pageSize: 100,
60
+ })
61
+ const sort = ref<string | null>(null)
62
+
63
+ const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
64
+
65
+ const onClickButton = (status: string): void => {
66
+ if (status === 'next') {
67
+ pagination.value.page += 1
68
+ return
69
+ }
70
+
71
+ pagination.value.page -= 1
72
+ }
73
+
74
+ const getTasks = async (): Promise<void> => {
75
+ pauseGlobalRefresh()
76
+
77
+ const payload: UI_I_DataTableQuery = {
78
+ ...pagination.value,
79
+ sortBy: sort.value || '',
80
+ }
81
+ await $store.dispatch('tasks/A_GET_TASKS', payload)
82
+ }
83
+
84
+ const onUpdatePagination = (event: UI_I_Pagination): void => {
85
+ pagination.value = event
86
+ getTasks()
87
+ }
88
+
89
+ const onSortTable = (event: string): void => {
90
+ sort.value = event
91
+ getTasks()
92
+ }
93
+
94
+ const isLoading = computed<boolean>(() =>
95
+ $store.getters['tasks/getLoading']('tasks')
96
+ )
97
+ const pauseGlobalRefresh = (): void => {
98
+ const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
99
+ $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
100
+ }
101
+ onUnmounted(() => {
102
+ pauseGlobalRefresh()
103
+ })
104
+ </script>
105
+
106
+ <style lang="scss">
107
+ @import '~/node_modules/bfg-common/assets/scss/common/mixins';
108
+ .tasks {
109
+ @include flex($dir: column);
110
+ height: 100%;
111
+ padding-left: 10px;
112
+ &__headline {
113
+ padding-left: 10px;
114
+ margin-bottom: 0.6rem;
115
+ }
116
+ .btn {
117
+ text-transform: uppercase;
118
+ }
119
+ }
120
+ </style>