bfg-common 1.2.168 → 1.2.170
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.
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/Bus.vue +2 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/config/options.ts +8 -1
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +1 -0
- package/package.json +1 -1
- package/utils/base64.ts +29 -3
|
@@ -73,6 +73,7 @@ const props = defineProps<{
|
|
|
73
73
|
componentType: string
|
|
74
74
|
errorValidationFields: UI_I_ErrorValidationField<string>[]
|
|
75
75
|
disabled?: boolean
|
|
76
|
+
shortOptions?: boolean
|
|
76
77
|
}>()
|
|
77
78
|
const emits = defineEmits<{
|
|
78
79
|
(event: 'update:bus', value: string): void
|
|
@@ -81,7 +82,7 @@ const emits = defineEmits<{
|
|
|
81
82
|
|
|
82
83
|
const helpId = ref<string>(`bus-field-help-icon${useUniqueId()}`)
|
|
83
84
|
|
|
84
|
-
const busOptions = ref<UI_I_OptionItem[]>(busOptionsFunc(localization.value))
|
|
85
|
+
const busOptions = ref<UI_I_OptionItem[]>(busOptionsFunc(localization.value, props.shortOptions))
|
|
85
86
|
|
|
86
87
|
const busLocal = computed<string>({
|
|
87
88
|
get() {
|
package/components/common/vm/actions/common/customizeHardware/virtualHardware/bus/config/options.ts
CHANGED
|
@@ -2,8 +2,15 @@ import { UI_I_Localization } from '~/models/interfaces'
|
|
|
2
2
|
import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
|
|
3
3
|
|
|
4
4
|
export const busOptionsFunc = (
|
|
5
|
-
localization: UI_I_Localization
|
|
5
|
+
localization: UI_I_Localization,
|
|
6
|
+
shortOptions?: boolean
|
|
6
7
|
): UI_I_OptionItem[] => {
|
|
8
|
+
if (shortOptions) {
|
|
9
|
+
return [
|
|
10
|
+
{ text: localization.ide, value: 'ide' },
|
|
11
|
+
{ text: localization.sata, value: 'sata' },
|
|
12
|
+
]
|
|
13
|
+
}
|
|
7
14
|
return [
|
|
8
15
|
{ text: localization.ide, value: 'ide' },
|
|
9
16
|
{ text: localization.scsi, value: 'scsi' },
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
:validation-type="busValidationType"
|
|
72
72
|
:error-validation-fields="props.errorValidationFields"
|
|
73
73
|
:disabled="isRunning"
|
|
74
|
+
:short-options="props.type === 'edit'"
|
|
74
75
|
component-type="disk_devices"
|
|
75
76
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
76
77
|
/>
|
package/package.json
CHANGED
package/utils/base64.ts
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
|
+
// export const base64 = {
|
|
2
|
+
// encode: function <T>(data: T): string {
|
|
3
|
+
// return btoa(JSON.stringify(data))
|
|
4
|
+
// },
|
|
5
|
+
// decode: function <T>(data: string): T | '' {
|
|
6
|
+
// if (!data) return ''
|
|
7
|
+
//
|
|
8
|
+
// return JSON.parse(atob(data))
|
|
9
|
+
// },
|
|
10
|
+
// }
|
|
11
|
+
|
|
1
12
|
export const base64 = {
|
|
2
13
|
encode: function <T>(data: T): string {
|
|
3
|
-
|
|
14
|
+
const st = JSON.stringify(data)
|
|
15
|
+
return btoa(
|
|
16
|
+
encodeURIComponent(st).replace(/%([0-9A-F]{2})/g, function (_match, p1) {
|
|
17
|
+
return String.fromCharCode(parseInt(p1, 16))
|
|
18
|
+
})
|
|
19
|
+
)
|
|
4
20
|
},
|
|
5
|
-
decode: function <T>(data: string): T {
|
|
6
|
-
|
|
21
|
+
decode: function <T>(data: string): T | '' {
|
|
22
|
+
if (!data) return ''
|
|
23
|
+
|
|
24
|
+
return JSON.parse(
|
|
25
|
+
decodeURIComponent(
|
|
26
|
+
Array.prototype.map
|
|
27
|
+
.call(atob(data), function (c) {
|
|
28
|
+
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
|
|
29
|
+
})
|
|
30
|
+
.join('')
|
|
31
|
+
)
|
|
32
|
+
)
|
|
7
33
|
},
|
|
8
34
|
}
|