bfg-common 1.4.365 → 1.4.367

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 (42) hide show
  1. package/assets/img/icons/icons-sprite-dark-1.svg +407 -407
  2. package/assets/img/icons/icons-sprite-dark-2.svg +343 -343
  3. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-dark-4.svg +255 -255
  5. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  6. package/assets/img/icons/icons-sprite-dark-6.svg +94 -94
  7. package/assets/img/icons/icons-sprite-light-1.svg +407 -407
  8. package/assets/img/icons/icons-sprite-light-2.svg +343 -343
  9. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  10. package/assets/img/icons/icons-sprite-light-4.svg +255 -255
  11. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  12. package/assets/img/icons/icons-sprite-light-6.svg +94 -94
  13. package/assets/localization/local_en.json +1 -1
  14. package/components/atoms/TheIcon3.vue +50 -50
  15. package/components/atoms/modal/bySteps/BySteps.vue +253 -253
  16. package/components/atoms/stack/StackBlock.vue +185 -185
  17. package/components/common/context/lib/models/interfaces.ts +30 -30
  18. package/components/common/context/recursion/Recursion.vue +86 -86
  19. package/components/common/context/recursion/RecursionNew.vue +199 -199
  20. package/components/common/context/recursion/RecursionOld.vue +213 -213
  21. package/components/common/modals/confirmation/Confirmation.vue +65 -65
  22. package/components/common/vm/actions/add/Add.vue +617 -617
  23. package/components/common/vm/actions/clone/lib/config/steps.ts +129 -129
  24. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +2 -2
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/lib/config/options.ts +20 -20
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +403 -403
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Hv.vue +99 -99
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/{location/Location.vue → Location.vue} +173 -172
  29. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +2 -2
  30. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +201 -201
  31. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +85 -85
  32. package/components/common/vm/actions/common/select/storage/Storage.vue +198 -202
  33. package/components/common/vm/actions/editSettings/EditSettings.vue +1 -1
  34. package/composables/productNameLocal.ts +30 -30
  35. package/package.json +1 -1
  36. package/plugins/date.ts +181 -181
  37. package/plugins/recursion.ts +311 -311
  38. package/public/spice-console/lib/images/bitmap.js +203 -203
  39. package/public/spice-console/network/spicechannel.js +383 -383
  40. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +0 -52
  41. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -175
  42. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -167
@@ -1,202 +1,198 @@
1
- <template>
2
- <div class="select-storage">
3
- <atoms-alert
4
- v-show="errors.length"
5
- status="alert-danger"
6
- test-id="storage-alert"
7
- :items="errors"
8
- @remove="onRemoveValidationErrors"
9
- />
10
- <div class="table-wrap">
11
- <atoms-table-data-grid
12
- v-model:selected-row="selectedRow"
13
- v-model:column-keys="columnKeys"
14
- v-model:page-size="pagination.pageSize"
15
- v-model:page="pagination.page"
16
- type="radio"
17
- test-id="storage-table"
18
- :head-items="headItems"
19
- :body-items="bodyItems"
20
- :total-items="bodyItems.length"
21
- :total-pages="1"
22
- server-off
23
- hide-page-size
24
- @change="changeStorage"
25
- >
26
- <template #icon="{ item }">
27
- <span :class="['datagrid-cell-icon', item.data]" />
28
- <span class="text-ellipsis">
29
- {{ item.text }}
30
- </span>
31
- </template>
32
- </atoms-table-data-grid>
33
- </div>
34
-
35
- <div v-if="!hideCompatibility" class="compatibility-wrap">
36
- <p class="compatibility">
37
- {{ localization.inventorySummary.compatibility }}
38
- </p>
39
- <div class="compatibility-message flex-align-center">
40
- <template v-if="selectedStorage">
41
- <div class="icon-status-ok" />
42
- <span>{{ localization.common.compatibilityChecksSucceeded }}</span>
43
- </template>
44
- <div v-else>
45
- <br />
46
- </div>
47
- </div>
48
- </div>
49
- </div>
50
- </template>
51
-
52
- <script setup lang="ts">
53
- import type {
54
- UI_I_Pagination,
55
- UI_I_TablePayload,
56
- } from '~/lib/models/table/interfaces'
57
- import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
58
- import type { UI_I_Localization } from '~/lib/models/interfaces'
59
- import type {
60
- UI_I_ColumnKey,
61
- UI_I_HeadItem,
62
- UI_I_BodyItem,
63
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
64
- import * as table from '~/components/common/vm/actions/common/select/storage/lib/config/config'
65
-
66
- const props = defineProps<{
67
- storageSubmit: null | Function
68
- datastore: UI_I_DatastoreTableItem[]
69
- storage: UI_I_DatastoreTableItem
70
- hideCompatibility?: boolean
71
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
72
- }>()
73
- const emits = defineEmits<{
74
- (event: 'submit', value: UI_I_DatastoreTableItem): void
75
- }>()
76
-
77
- const localization = computed<UI_I_Localization>(() => useLocal())
78
-
79
- const headItems = ref<UI_I_HeadItem[]>(table.headItems(localization.value))
80
- const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
81
- watch(localization, () => {
82
- columnKeys.value = table.columnKeys(localization.value)
83
- })
84
-
85
- const bodyItems = computed<UI_I_BodyItem[][]>(() => {
86
- return table.bodyItems(props.datastore || [], localization.value)
87
- })
88
-
89
- const pagination = ref<UI_I_Pagination>({
90
- page: 1,
91
- pageSize: 100,
92
- })
93
-
94
- const getStorage = async (): Promise<void> => {
95
- const payload: UI_I_TablePayload = {
96
- pagination: pagination.value,
97
- sortBy: null,
98
- type: 'datastore',
99
- schema: 'full',
100
- }
101
-
102
- props.getDatastoreTableFunc(payload).then(() => {
103
- selectedRow.value = null
104
- setStorageFromProps()
105
- })
106
- }
107
- getStorage()
108
-
109
- const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
110
- const selectedRow = ref<number | null>(null)
111
- const changeStorage = (index: number): void => {
112
- if (!props.datastore) return
113
- selectedStorage.value = props.datastore[index]
114
- selectedRow.value = index
115
- }
116
-
117
- const setStorageFromProps = (): void => {
118
- if (!props.storage) return
119
- props.datastore.forEach((item, index) => {
120
- if (item.id === props.storage.id) changeStorage(index)
121
- })
122
- }
123
- watch(
124
- () => props.storage,
125
- () => {
126
- setStorageFromProps()
127
- },
128
- { immediate: true }
129
- )
130
- watch(
131
- () => props.datastore,
132
- () => {
133
- selectedRow.value = null
134
- selectedStorage.value = null
135
- },
136
- { immediate: true }
137
- )
138
-
139
- watch(
140
- () => props.storageSubmit,
141
- (newValue) => {
142
- newValue && submit(newValue)
143
- }
144
- )
145
- const submit = (cb: Function): void => {
146
- if (!selectedStorage.value) {
147
- showValidationErrors([
148
- localization.value.common.selectValidDestinationStorage,
149
- ])
150
- // TODO удалять проверку по типу
151
- typeof cb !== 'number' && cb(false)
152
- return
153
- }
154
-
155
- emits('submit', selectedStorage.value)
156
- // TODO удалять проверку по типу
157
- typeof cb !== 'number' && cb(true)
158
- }
159
-
160
- const errors = ref<string[]>([])
161
- const showValidationErrors = (arr: string[]): void => {
162
- errors.value = arr
163
- }
164
- const onRemoveValidationErrors = (): void => {
165
- errors.value = []
166
- }
167
- </script>
168
-
169
- <style scoped lang="scss">
170
- .select-storage {
171
- flex: 1;
172
- display: flex;
173
- flex-direction: column;
174
-
175
- .table-wrap {
176
- flex: 1;
177
-
178
- .datagrid-cell-icon {
179
- margin-right: 6px;
180
- }
181
-
182
- :deep(.relative) {
183
- height: 100%;
184
-
185
- .datagrid-outer-wrapper {
186
- height: 100%;
187
- }
188
- }
189
- }
190
-
191
- .compatibility-wrap {
192
- padding-top: 10px;
193
-
194
- .compatibility-message {
195
- border: 1px solid #000;
196
- padding-top: 5px;
197
- padding-left: 5px;
198
- overflow: auto;
199
- }
200
- }
201
- }
202
- </style>
1
+ <template>
2
+ <div class="select-storage">
3
+ <atoms-alert
4
+ v-show="errors.length"
5
+ status="alert-danger"
6
+ test-id="storage-alert"
7
+ :items="errors"
8
+ @remove="onRemoveValidationErrors"
9
+ />
10
+ <div class="table-wrap">
11
+ <atoms-table-data-grid
12
+ v-model:selected-row="selectedRow"
13
+ v-model:column-keys="columnKeys"
14
+ v-model:page-size="pagination.pageSize"
15
+ v-model:page="pagination.page"
16
+ type="radio"
17
+ test-id="storage-table"
18
+ :head-items="headItems"
19
+ :body-items="bodyItems"
20
+ :total-items="bodyItems.length"
21
+ :total-pages="1"
22
+ server-off
23
+ hide-page-size
24
+ @change="changeStorage"
25
+ >
26
+ <template #icon="{ item }">
27
+ <span :class="['datagrid-cell-icon', item.data]" />
28
+ <span class="text-ellipsis">
29
+ {{ item.text }}
30
+ </span>
31
+ </template>
32
+ </atoms-table-data-grid>
33
+ </div>
34
+
35
+ <div v-if="!hideCompatibility" class="compatibility-wrap">
36
+ <p class="compatibility">
37
+ {{ localization.inventorySummary.compatibility }}
38
+ </p>
39
+ <div class="compatibility-message flex-align-center">
40
+ <template v-if="selectedStorage">
41
+ <div class="icon-status-ok" />
42
+ <span>{{ localization.common.compatibilityChecksSucceeded }}</span>
43
+ </template>
44
+ <div v-else>
45
+ <br />
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </template>
51
+
52
+ <script setup lang="ts">
53
+ import type {
54
+ UI_I_Pagination,
55
+ UI_I_TablePayload,
56
+ } from '~/lib/models/table/interfaces'
57
+ import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
58
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
59
+ import type {
60
+ UI_I_ColumnKey,
61
+ UI_I_HeadItem,
62
+ UI_I_BodyItem,
63
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
64
+ import * as table from '~/components/common/vm/actions/common/select/storage/lib/config/config'
65
+
66
+ const props = defineProps<{
67
+ storageSubmit: null | Function
68
+ datastore: UI_I_DatastoreTableItem[]
69
+ storage: UI_I_DatastoreTableItem
70
+ hideCompatibility?: boolean
71
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
72
+ }>()
73
+ const emits = defineEmits<{
74
+ (event: 'submit', value: UI_I_DatastoreTableItem): void
75
+ }>()
76
+
77
+ const localization = computed<UI_I_Localization>(() => useLocal())
78
+
79
+ const headItems = ref<UI_I_HeadItem[]>(table.headItems(localization.value))
80
+ const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
81
+ watch(localization, () => {
82
+ columnKeys.value = table.columnKeys(localization.value)
83
+ })
84
+
85
+ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
86
+ return table.bodyItems(props.datastore || [], localization.value)
87
+ })
88
+
89
+ const pagination = ref<UI_I_Pagination>({
90
+ page: 1,
91
+ pageSize: 100,
92
+ })
93
+
94
+ const getStorage = async (): Promise<void> => {
95
+ const payload: UI_I_TablePayload = {
96
+ pagination: pagination.value,
97
+ sortBy: null,
98
+ type: 'datastore',
99
+ schema: 'full',
100
+ }
101
+
102
+ props.getDatastoreTableFunc(payload).then(() => {
103
+ selectedRow.value = null
104
+ setStorageFromProps()
105
+ })
106
+ }
107
+ getStorage()
108
+
109
+ const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
110
+ const selectedRow = ref<number | null>(null)
111
+ const changeStorage = (index: number): void => {
112
+ if (!props.datastore) return
113
+ selectedStorage.value = props.datastore[index]
114
+ selectedRow.value = index
115
+ }
116
+
117
+ const setStorageFromProps = (): void => {
118
+ if (!props.storage) return
119
+ props.datastore.forEach((item, index) => {
120
+ if (item.id === props.storage.id) changeStorage(index)
121
+ })
122
+ }
123
+ watch(
124
+ () => props.storage,
125
+ () => {
126
+ setStorageFromProps()
127
+ },
128
+ { immediate: true }
129
+ )
130
+ watch(
131
+ () => props.datastore,
132
+ () => {
133
+ selectedRow.value = null
134
+ selectedStorage.value = null
135
+ },
136
+ { immediate: true }
137
+ )
138
+
139
+ watch(
140
+ () => props.storageSubmit,
141
+ (newValue) => {
142
+ newValue && submit(newValue)
143
+ }
144
+ )
145
+ const submit = (cb: Function): void => {
146
+ if (!selectedStorage.value) {
147
+ showValidationErrors([localization.value.common.selectValidDestinationStorage])
148
+ cb(false)
149
+ return
150
+ }
151
+
152
+ emits('submit', selectedStorage.value)
153
+ cb(true)
154
+ }
155
+
156
+ const errors = ref<string[]>([])
157
+ const showValidationErrors = (arr: string[]): void => {
158
+ errors.value = arr
159
+ }
160
+ const onRemoveValidationErrors = (): void => {
161
+ errors.value = []
162
+ }
163
+ </script>
164
+
165
+ <style scoped lang="scss">
166
+ .select-storage {
167
+ flex: 1;
168
+ display: flex;
169
+ flex-direction: column;
170
+
171
+ .table-wrap {
172
+ flex: 1;
173
+
174
+ .datagrid-cell-icon {
175
+ margin-right: 6px;
176
+ }
177
+
178
+ :deep(.relative) {
179
+ height: 100%;
180
+
181
+ .datagrid-outer-wrapper {
182
+ height: 100%;
183
+ }
184
+ }
185
+ }
186
+
187
+ .compatibility-wrap {
188
+ padding-top: 10px;
189
+
190
+ .compatibility-message {
191
+ border: 1px solid #000;
192
+ padding-top: 5px;
193
+ padding-left: 5px;
194
+ overflow: auto;
195
+ }
196
+ }
197
+ }
198
+ </style>
@@ -71,7 +71,7 @@ import type { UI_T_Project } from '~/lib/models/types'
71
71
  import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
72
72
  import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
73
73
  import type {
74
- // UI_I_EditVmPayload,
74
+ UI_I_EditVmPayload,
75
75
  UI_I_PciDevice,
76
76
  } from '~/lib/models/store/vm/interfaces'
77
77
  import type { UI_I_Localization } from '~/lib/models/interfaces'
@@ -1,30 +1,30 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_T_LanguageKey } from '~/lib/models/types'
3
-
4
- export function productNameLocal(
5
- localization: UI_I_Localization
6
- ): UI_I_Localization {
7
- const config = useRuntimeConfig()
8
-
9
- const productName =
10
- config.public.LOCALIZATION_CODE === 'ru'
11
- ? config.public.PRODUCT_NAME_RU
12
- : config.public.PRODUCT_NAME_EN
13
-
14
- return replaceProductNameRecursion(localization, productName)
15
- }
16
-
17
- const replaceProductNameRecursion = (
18
- localization: UI_I_Localization,
19
- productName: any
20
- ): UI_I_Localization => {
21
- for (const key of Object.keys(localization)) {
22
- let item = localization[key as UI_T_LanguageKey]
23
-
24
- for (const key2 of Object.keys(item)) {
25
- item[key2] = item[key2].replaceAll('{productName}', productName)
26
- }
27
- }
28
-
29
- return localization
30
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_T_LanguageKey } from '~/lib/models/types'
3
+
4
+ export function productNameLocal(
5
+ localization: UI_I_Localization
6
+ ): UI_I_Localization {
7
+ const config = useRuntimeConfig()
8
+
9
+ const productName =
10
+ config.public.LOCALIZATION_CODE === 'ru'
11
+ ? config.public.PRODUCT_NAME_RU
12
+ : config.public.PRODUCT_NAME_EN
13
+
14
+ return replaceProductNameRecursion(localization, productName)
15
+ }
16
+
17
+ const replaceProductNameRecursion = (
18
+ localization: UI_I_Localization,
19
+ productName: any
20
+ ): UI_I_Localization => {
21
+ for (const key of Object.keys(localization)) {
22
+ let item = localization[key as UI_T_LanguageKey]
23
+
24
+ for (const key2 of Object.keys(item)) {
25
+ item[key2] = item[key2].replaceAll('{productName}', productName)
26
+ }
27
+ }
28
+
29
+ return localization
30
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.365",
4
+ "version": "1.4.367",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",