bfg-common 1.3.153 → 1.3.155

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 (38) hide show
  1. package/assets/localization/local_be.json +6 -2
  2. package/assets/localization/local_en.json +6 -2
  3. package/assets/localization/local_hy.json +6 -2
  4. package/assets/localization/local_kk.json +6 -2
  5. package/assets/localization/local_ru.json +6 -2
  6. package/assets/localization/local_zh.json +6 -2
  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/tools/chartOptionsModal/counters/table/Table.vue +1 -1
  11. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +12 -2
  12. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/Form.vue +1 -1
  13. package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +16 -1
  14. package/components/common/pages/Tasks.vue +120 -120
  15. package/components/common/recursionTree/RecursionTree.vue +203 -203
  16. package/components/common/vm/actions/add/Add.vue +575 -575
  17. package/components/common/vm/actions/clone/Clone.vue +518 -518
  18. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +682 -682
  20. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  21. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +164 -164
  22. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  23. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  24. package/composables/useAppVersion.ts +21 -21
  25. package/composables/useEnvLanguage.ts +20 -20
  26. package/composables/useLocal.ts +38 -38
  27. package/lib/utils/sendTask.ts +72 -72
  28. package/minify.js +146 -146
  29. package/package.json +1 -1
  30. package/public/spice-console/application/codec.js +257 -257
  31. package/public/spice-console/lib/rasterEngine.js +907 -907
  32. package/public/spice-console/network/spicechannel.js +369 -369
  33. package/store/main/lib/interfaces.ts +9 -9
  34. package/store/tasks/actions.ts +133 -133
  35. package/store/tasks/getters.ts +25 -25
  36. package/store/tasks/lib/models/interfaces.ts +18 -18
  37. package/store/tasks/mutations.ts +58 -58
  38. package/store/tasks/state.ts +16 -16
@@ -137,7 +137,7 @@ watch(
137
137
  }
138
138
 
139
139
  :deep(.datagrid-table-wrapper) {
140
- max-height: 88px;
140
+ max-height: 176px;
141
141
  }
142
142
  }
143
143
  </style>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="timespan-objects-section-direction flex horizontal">
2
+ <div class="timespan-objects-section-direction">
3
3
  <common-monitor-advanced-tools-chart-options-modal-counters-timespan-form
4
4
  :language="props.language"
5
5
  :selected-chart-type="props.selectedChartType"
@@ -80,4 +80,14 @@ const emits = defineEmits<{
80
80
  }>()
81
81
  </script>
82
82
 
83
- <style scoped lang="scss"></style>
83
+ <style scoped lang="scss">
84
+ .timespan-objects-section-direction {
85
+ display: flex;
86
+ flex-direction: row;
87
+ }
88
+ @media (max-width: 1024px) {
89
+ .timespan-objects-section-direction {
90
+ flex-direction: column;
91
+ }
92
+ }
93
+ </style>
@@ -409,7 +409,7 @@ onMounted(() => {
409
409
  <style scoped lang="scss">
410
410
  .chart-option-timespan-split {
411
411
  overflow-x: auto;
412
- flex-basis: 56%;
412
+ //flex-basis: 56%;
413
413
  padding: 5px;
414
414
 
415
415
  .timespan-objects-section-direction {
@@ -1,4 +1,17 @@
1
- import { UI_I_Localization } from '~/lib/models/interfaces'
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+
3
+ const isMoreThanOneMonth = (startDate: number, endDate: number): boolean => {
4
+ const start = new Date(startDate)
5
+ const end = new Date(endDate)
6
+ const yearDiff = end.getFullYear() - start.getFullYear()
7
+ const monthDiff = end.getMonth() - start.getMonth()
8
+
9
+ return (
10
+ yearDiff > 0 ||
11
+ (yearDiff === 0 && monthDiff > 1) ||
12
+ (yearDiff === 0 && monthDiff === 1 && end.getDate() >= start.getDate())
13
+ )
14
+ }
2
15
 
3
16
  export const checkDateFunc = (
4
17
  localization: UI_I_Localization,
@@ -31,6 +44,8 @@ export const checkDateFunc = (
31
44
  result = localization.timeToShouldBeLaterTimeFrom
32
45
  else if (unixEndDate - unixStartDate <= 3600000)
33
46
  result = localization.timeRangeShouldNotBeSmallerThanHour
47
+ else if (isMoreThanOneMonth(unixStartDate, unixEndDate))
48
+ result = localization.timeRangeShouldNotBeMoreThanMonth
34
49
  else return [unixStartDate, unixEndDate]
35
50
 
36
51
  return result
@@ -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>