bfg-common 1.3.224 → 1.3.225

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 (33) hide show
  1. package/components/atoms/alert/Alert.vue +95 -95
  2. package/components/atoms/alert/Notification.vue +170 -170
  3. package/components/atoms/switch/Switch.vue +111 -111
  4. package/components/atoms/table/compact/Compact.vue +526 -526
  5. package/components/atoms/tooltip/Signpost.vue +225 -225
  6. package/components/common/pages/Tasks.vue +120 -120
  7. package/components/common/recursionTree/RecursionTree.vue +203 -203
  8. package/components/common/vm/actions/add/Add.vue +575 -575
  9. package/components/common/vm/actions/clone/Clone.vue +518 -518
  10. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  11. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
  12. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  13. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +294 -294
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
  16. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  17. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  18. package/components/common/weekSelect/WeekSelect.vue +112 -112
  19. package/components/common/weekSelect/lib/config/options.ts +10 -10
  20. package/composables/useAppVersion.ts +21 -21
  21. package/composables/useEnvLanguage.ts +20 -20
  22. package/lib/utils/sendTask.ts +72 -72
  23. package/minify.js +146 -146
  24. package/package.json +1 -1
  25. package/public/spice-console/application/codec.js +257 -257
  26. package/public/spice-console/lib/rasterEngine.js +907 -907
  27. package/public/spice-console/network/spicechannel.js +369 -369
  28. package/store/main/lib/interfaces.ts +9 -9
  29. package/store/tasks/actions.ts +133 -133
  30. package/store/tasks/getters.ts +25 -25
  31. package/store/tasks/lib/models/interfaces.ts +18 -18
  32. package/store/tasks/mutations.ts +58 -58
  33. package/store/tasks/state.ts +16 -16
@@ -1,225 +1,225 @@
1
- <template>
2
- <div
3
- id="signpost"
4
- :class="['signpost', signpostClass]"
5
- :style="signpostStyles"
6
- @click.stop
7
- @mouseenter="hovered = true"
8
- @mouseleave="hovered = false"
9
- >
10
- <div class="signpost-wrap">
11
- <div class="popover-pointer" />
12
- <div class="signpost-content-header">
13
- <button
14
- :id="`${props.testId}-close-icon`"
15
- class="signpost-action close"
16
- @click="hide"
17
- >
18
- <atoms-the-icon class="close-icon" name="close" />
19
- </button>
20
- </div>
21
- <div class="signpost-content-body">
22
- <slot />
23
- </div>
24
- </div>
25
- </div>
26
- </template>
27
-
28
- <script setup lang="ts">
29
- import { UI_I_ElPosition } from '~/components/atoms/tooltip/lib/models/interfaces'
30
- const props = withDefaults(
31
- defineProps<{
32
- elemId: string
33
- testId?: string
34
- }>(),
35
- { testId: 'ui-signpost' }
36
- )
37
- const emits = defineEmits<{
38
- (event: 'hide'): void
39
- }>()
40
- const hide = (): void => {
41
- emits('hide')
42
- }
43
-
44
- const signpostStyles = ref<UI_I_ElPosition | null>(null)
45
- watch(
46
- () => props.elemId,
47
- (newValue: string) => {
48
- const element =
49
- (document.getElementById(newValue) as HTMLDivElement) || null
50
- const { width, x, y } = element.getBoundingClientRect()
51
-
52
- signpostStyles.value = {
53
- top: `${y}px`,
54
- left: `${x + width / 2}px`,
55
- }
56
- setTimeout(() => {
57
- setSignpostPosition()
58
- }, 0)
59
- },
60
- { immediate: true }
61
- )
62
- const signpostClass = ref<string[]>([])
63
- const setSignpostPosition = (): void => {
64
- const signpost =
65
- (document.getElementById('signpost') as HTMLDivElement) || null
66
- const signpostRect = (signpost?.getBoundingClientRect() as DOMRect) || null
67
-
68
- type PositionX = 'right' | 'left'
69
- let positionX: PositionX = 'right'
70
-
71
- type PositionY = 'top' | 'middle'
72
- let positionY: PositionY = 'middle'
73
-
74
- const isOutRight = signpostRect.left + signpostRect.width > window.innerWidth
75
- const isOutTop = signpostRect.top < 0
76
-
77
- if (isOutTop) {
78
- positionY = 'top'
79
- }
80
- if (isOutRight) {
81
- positionX = 'left'
82
- }
83
-
84
- signpostClass.value.push(positionY)
85
- signpostClass.value.push(positionX)
86
- signpostClass.value.push('show')
87
- }
88
-
89
- const hovered = ref<boolean>(false)
90
- const windowClick = (): void => {
91
- hide()
92
- }
93
- const windowScroll = (): void => {
94
- if (hovered.value) {
95
- return
96
- }
97
- hide()
98
- }
99
- onMounted(() => {
100
- setTimeout(() => {
101
- window.addEventListener('click', windowClick)
102
- window.addEventListener('scroll', windowScroll, true)
103
- })
104
- })
105
- onUnmounted(() => {
106
- window.removeEventListener('click', windowClick)
107
- window.removeEventListener('scroll', windowScroll, true)
108
- })
109
- </script>
110
-
111
- <style scoped lang="scss">
112
- .signpost {
113
- opacity: 0;
114
- position: fixed;
115
- cursor: default;
116
- transform: translateY(calc(-50% + 14px)) translateX(20px);
117
- z-index: 1000000000;
118
-
119
- &.show {
120
- opacity: 1;
121
- }
122
- &.left {
123
- transform: translateY(calc(-50% + 14px)) translateX(calc(-100% - 20px));
124
-
125
- .signpost-wrap {
126
- .popover-pointer {
127
- left: 100%;
128
- border-right: unset;
129
- border-left: 12px solid var(--signpost-border-color);
130
-
131
- &::before {
132
- border-right: unset;
133
- border-left: 12px solid var(--signpost-bgcolor);
134
- left: unset;
135
- right: 2px;
136
- }
137
- }
138
- }
139
- }
140
- &.top {
141
- transform: translateY(calc(0% + 10px)) translateX(20px);
142
-
143
- &.left {
144
- transform: translateY(calc(0% + 10px)) translateX(calc(-100% - 20px));
145
-
146
- .popover-pointer {
147
- top: 5px;
148
- }
149
- }
150
-
151
- .signpost-wrap {
152
- .popover-pointer {
153
- top: 5px;
154
- }
155
- }
156
- }
157
-
158
- .signpost-wrap {
159
- border-radius: 3px;
160
- border: 1px solid var(--signpost-border-color);
161
- background-color: var(--signpost-bgcolor);
162
- position: relative;
163
-
164
- .popover-pointer {
165
- border-bottom: 12px solid transparent;
166
- top: 50%;
167
- transform: translateY(-50%);
168
- border-right: 12px solid var(--signpost-border-color);
169
- left: -12px;
170
- height: 0;
171
- width: 0;
172
- position: absolute;
173
-
174
- &::before {
175
- border-bottom: 12px solid transparent;
176
- top: 1px;
177
- border-right: 12px solid var(--signpost-bgcolor);
178
- left: 2px;
179
- content: '';
180
- height: 0;
181
- width: 0;
182
- position: absolute;
183
- }
184
- }
185
-
186
- .signpost-content-header {
187
- display: flex;
188
- justify-content: flex-end;
189
- position: absolute;
190
- width: 100%;
191
- background-color: inherit;
192
- top: 0;
193
-
194
- button {
195
- line-height: 24px;
196
-
197
- .close-icon {
198
- width: 16px;
199
- height: 16px;
200
- }
201
- }
202
- }
203
-
204
- .signpost-content-body {
205
- padding: 24px;
206
- max-height: 480px;
207
- overflow-y: auto;
208
- text-transform: none;
209
- }
210
- }
211
- }
212
- </style>
213
-
214
- <style>
215
- :root {
216
- --signpost-bgcolor: #fff;
217
- --signpost-border-color: #b3b3b3;
218
- --signpost-color: #acbac3;
219
- }
220
- :root.dark-theme {
221
- --signpost-bgcolor: #21333b;
222
- --signpost-border-color: #000;
223
- --signpost-color: #acbac3;
224
- }
225
- </style>
1
+ <template>
2
+ <div
3
+ id="signpost"
4
+ :class="['signpost', signpostClass]"
5
+ :style="signpostStyles"
6
+ @click.stop
7
+ @mouseenter="hovered = true"
8
+ @mouseleave="hovered = false"
9
+ >
10
+ <div class="signpost-wrap">
11
+ <div class="popover-pointer" />
12
+ <div class="signpost-content-header">
13
+ <button
14
+ :id="`${props.testId}-close-icon`"
15
+ class="signpost-action close"
16
+ @click="hide"
17
+ >
18
+ <atoms-the-icon class="close-icon" name="close" />
19
+ </button>
20
+ </div>
21
+ <div class="signpost-content-body">
22
+ <slot />
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </template>
27
+
28
+ <script setup lang="ts">
29
+ import { UI_I_ElPosition } from '~/components/atoms/tooltip/lib/models/interfaces'
30
+ const props = withDefaults(
31
+ defineProps<{
32
+ elemId: string
33
+ testId?: string
34
+ }>(),
35
+ { testId: 'ui-signpost' }
36
+ )
37
+ const emits = defineEmits<{
38
+ (event: 'hide'): void
39
+ }>()
40
+ const hide = (): void => {
41
+ emits('hide')
42
+ }
43
+
44
+ const signpostStyles = ref<UI_I_ElPosition | null>(null)
45
+ watch(
46
+ () => props.elemId,
47
+ (newValue: string) => {
48
+ const element =
49
+ (document.getElementById(newValue) as HTMLDivElement) || null
50
+ const { width, x, y } = element.getBoundingClientRect()
51
+
52
+ signpostStyles.value = {
53
+ top: `${y}px`,
54
+ left: `${x + width / 2}px`,
55
+ }
56
+ setTimeout(() => {
57
+ setSignpostPosition()
58
+ }, 0)
59
+ },
60
+ { immediate: true }
61
+ )
62
+ const signpostClass = ref<string[]>([])
63
+ const setSignpostPosition = (): void => {
64
+ const signpost =
65
+ (document.getElementById('signpost') as HTMLDivElement) || null
66
+ const signpostRect = (signpost?.getBoundingClientRect() as DOMRect) || null
67
+
68
+ type PositionX = 'right' | 'left'
69
+ let positionX: PositionX = 'right'
70
+
71
+ type PositionY = 'top' | 'middle'
72
+ let positionY: PositionY = 'middle'
73
+
74
+ const isOutRight = signpostRect.left + signpostRect.width > window.innerWidth
75
+ const isOutTop = signpostRect.top < 0
76
+
77
+ if (isOutTop) {
78
+ positionY = 'top'
79
+ }
80
+ if (isOutRight) {
81
+ positionX = 'left'
82
+ }
83
+
84
+ signpostClass.value.push(positionY)
85
+ signpostClass.value.push(positionX)
86
+ signpostClass.value.push('show')
87
+ }
88
+
89
+ const hovered = ref<boolean>(false)
90
+ const windowClick = (): void => {
91
+ hide()
92
+ }
93
+ const windowScroll = (): void => {
94
+ if (hovered.value) {
95
+ return
96
+ }
97
+ hide()
98
+ }
99
+ onMounted(() => {
100
+ setTimeout(() => {
101
+ window.addEventListener('click', windowClick)
102
+ window.addEventListener('scroll', windowScroll, true)
103
+ })
104
+ })
105
+ onUnmounted(() => {
106
+ window.removeEventListener('click', windowClick)
107
+ window.removeEventListener('scroll', windowScroll, true)
108
+ })
109
+ </script>
110
+
111
+ <style scoped lang="scss">
112
+ .signpost {
113
+ opacity: 0;
114
+ position: fixed;
115
+ cursor: default;
116
+ transform: translateY(calc(-50% + 14px)) translateX(20px);
117
+ z-index: 1000000000;
118
+
119
+ &.show {
120
+ opacity: 1;
121
+ }
122
+ &.left {
123
+ transform: translateY(calc(-50% + 14px)) translateX(calc(-100% - 20px));
124
+
125
+ .signpost-wrap {
126
+ .popover-pointer {
127
+ left: 100%;
128
+ border-right: unset;
129
+ border-left: 12px solid var(--signpost-border-color);
130
+
131
+ &::before {
132
+ border-right: unset;
133
+ border-left: 12px solid var(--signpost-bgcolor);
134
+ left: unset;
135
+ right: 2px;
136
+ }
137
+ }
138
+ }
139
+ }
140
+ &.top {
141
+ transform: translateY(calc(0% + 10px)) translateX(20px);
142
+
143
+ &.left {
144
+ transform: translateY(calc(0% + 10px)) translateX(calc(-100% - 20px));
145
+
146
+ .popover-pointer {
147
+ top: 5px;
148
+ }
149
+ }
150
+
151
+ .signpost-wrap {
152
+ .popover-pointer {
153
+ top: 5px;
154
+ }
155
+ }
156
+ }
157
+
158
+ .signpost-wrap {
159
+ border-radius: 3px;
160
+ border: 1px solid var(--signpost-border-color);
161
+ background-color: var(--signpost-bgcolor);
162
+ position: relative;
163
+
164
+ .popover-pointer {
165
+ border-bottom: 12px solid transparent;
166
+ top: 50%;
167
+ transform: translateY(-50%);
168
+ border-right: 12px solid var(--signpost-border-color);
169
+ left: -12px;
170
+ height: 0;
171
+ width: 0;
172
+ position: absolute;
173
+
174
+ &::before {
175
+ border-bottom: 12px solid transparent;
176
+ top: 1px;
177
+ border-right: 12px solid var(--signpost-bgcolor);
178
+ left: 2px;
179
+ content: '';
180
+ height: 0;
181
+ width: 0;
182
+ position: absolute;
183
+ }
184
+ }
185
+
186
+ .signpost-content-header {
187
+ display: flex;
188
+ justify-content: flex-end;
189
+ position: absolute;
190
+ width: 100%;
191
+ background-color: inherit;
192
+ top: 0;
193
+
194
+ button {
195
+ line-height: 24px;
196
+
197
+ .close-icon {
198
+ width: 16px;
199
+ height: 16px;
200
+ }
201
+ }
202
+ }
203
+
204
+ .signpost-content-body {
205
+ padding: 24px;
206
+ max-height: 480px;
207
+ overflow-y: auto;
208
+ text-transform: none;
209
+ }
210
+ }
211
+ }
212
+ </style>
213
+
214
+ <style>
215
+ :root {
216
+ --signpost-bgcolor: #fff;
217
+ --signpost-border-color: #b3b3b3;
218
+ --signpost-color: #acbac3;
219
+ }
220
+ :root.dark-theme {
221
+ --signpost-bgcolor: #21333b;
222
+ --signpost-border-color: #000;
223
+ --signpost-color: #acbac3;
224
+ }
225
+ </style>
@@ -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>