bfg-common 1.5.556 → 1.5.558
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/assets/localization/local_be.json +4 -20
- package/assets/localization/local_en.json +4 -20
- package/assets/localization/local_hy.json +4 -20
- package/assets/localization/local_kk.json +4 -20
- package/assets/localization/local_ru.json +4 -20
- package/assets/localization/local_zh.json +5 -21
- package/components/common/modals/confirmByInput/ConfirmByInput.vue +1 -9
- package/components/common/modals/confirmByInput/ConfirmByInputNew.vue +2 -7
- package/components/common/pages/backups/modals/createBackup/New.vue +2 -8
- package/components/common/pages/backups/modals/restore/Restore.vue +5 -9
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +3 -13
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +18 -6
- package/components/common/vm/actions/add/Add.vue +46 -119
- package/components/common/vm/actions/add/New.vue +16 -54
- package/components/common/vm/actions/add/Old.vue +16 -55
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +14 -81
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +7 -56
- package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +8 -56
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +73 -142
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +60 -54
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +61 -55
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +139 -159
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +8 -15
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +8 -13
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +62 -75
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +58 -74
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +6 -17
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +6 -3
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +17 -39
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
- package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +6 -93
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +8 -62
- package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +8 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +5 -69
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +12 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +12 -33
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +114 -132
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +41 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +44 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +8 -23
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +21 -31
- package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +26 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +28 -34
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +24 -30
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +8 -112
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +3 -3
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +6 -6
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +5 -5
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +6 -7
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +4 -38
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsNew.vue +7 -26
- package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/ToolsOld.vue +24 -50
- package/components/common/vm/actions/common/lib/models/interfaces.ts +57 -25
- package/components/common/vm/actions/editSettings/EditSettings.vue +21 -35
- package/components/common/vm/actions/editSettings/EditSettingsOld.vue +14 -41
- package/components/common/vm/actions/editSettings/new/New.vue +14 -41
- package/components/common/vm/actions/lib/models/interfaces.ts +4 -29
- package/components/common/vm/actions/lib/utils.ts +37 -32
- package/package.json +1 -3
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
- /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue
CHANGED
|
@@ -1,70 +1,39 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-new
|
|
3
3
|
v-if="isNewView"
|
|
4
|
-
v-model
|
|
5
|
-
v-model:secure-boot="secureBoot"
|
|
6
|
-
v-model:boot-menu="bootMenu"
|
|
7
|
-
v-model:boot-delay="bootDelay"
|
|
4
|
+
v-model="model"
|
|
8
5
|
:error-validation-fields="props.errorValidationFields"
|
|
9
|
-
:hard-disks="props.hardDisks"
|
|
10
|
-
:cd-dvd-drives="props.cdDvdDrives"
|
|
11
|
-
:networks="props.networks"
|
|
12
6
|
:is-edit="props.isEdit"
|
|
13
7
|
:is-disabled="isDisabled"
|
|
14
|
-
@change-boot-order="emits('change-boot-order', $event)"
|
|
15
8
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
16
9
|
/>
|
|
17
10
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-old
|
|
18
11
|
v-else
|
|
19
|
-
v-model
|
|
20
|
-
v-model:secure-boot="secureBoot"
|
|
21
|
-
v-model:boot-menu="bootMenu"
|
|
22
|
-
v-model:boot-delay="bootDelay"
|
|
12
|
+
v-model="model"
|
|
23
13
|
:error-validation-fields="props.errorValidationFields"
|
|
24
|
-
:hard-disks="props.hardDisks"
|
|
25
|
-
:cd-dvd-drives="props.cdDvdDrives"
|
|
26
|
-
:networks="props.networks"
|
|
27
14
|
:is-edit="props.isEdit"
|
|
28
15
|
:is-disabled="isDisabled"
|
|
29
|
-
@change-boot-order="emits('change-boot-order', $event)"
|
|
30
16
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
31
17
|
/>
|
|
32
18
|
</template>
|
|
33
19
|
|
|
34
20
|
<script setup lang="ts">
|
|
35
|
-
import type { UI_I_SendDataBootOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
|
|
36
|
-
import type {
|
|
37
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
38
|
-
UI_I_SendDataNewHardDisk,
|
|
39
|
-
UI_I_SendDataNewNetwork,
|
|
40
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
41
21
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
22
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
23
|
+
|
|
24
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
42
25
|
|
|
43
26
|
const props = withDefaults(
|
|
44
27
|
defineProps<{
|
|
45
28
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
46
|
-
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
47
|
-
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
48
|
-
networks: UI_I_SendDataNewNetwork[] | null
|
|
49
29
|
isEdit: boolean
|
|
50
|
-
bootOptions?: UI_I_SendDataBootOptions
|
|
51
30
|
state?: string | number
|
|
52
31
|
}>(),
|
|
53
32
|
{
|
|
54
|
-
bootOptions: undefined,
|
|
55
33
|
state: undefined,
|
|
56
34
|
}
|
|
57
35
|
)
|
|
58
36
|
const emits = defineEmits<{
|
|
59
|
-
(
|
|
60
|
-
event: 'change-boot-order',
|
|
61
|
-
value: [
|
|
62
|
-
UI_I_SendDataNewHardDisk[],
|
|
63
|
-
UI_I_SendDataNewCdDvdDrive[],
|
|
64
|
-
UI_I_SendDataNewNetwork[]
|
|
65
|
-
]
|
|
66
|
-
): void
|
|
67
|
-
(event: 'send-data', value: UI_I_SendDataBootOptions): void
|
|
68
37
|
(event: 'remove-error-by-title', value: string): void
|
|
69
38
|
}>()
|
|
70
39
|
|
|
@@ -72,39 +41,6 @@ const { $store }: any = useNuxtApp()
|
|
|
72
41
|
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
73
42
|
|
|
74
43
|
const isDisabled = computed<boolean>(() => props.isEdit && props.state !== 1)
|
|
75
|
-
|
|
76
|
-
const firmware = ref<string>('efi')
|
|
77
|
-
|
|
78
|
-
const secureBoot = ref<boolean>(true)
|
|
79
|
-
|
|
80
|
-
const bootMenu = ref<boolean>(true)
|
|
81
|
-
|
|
82
|
-
const bootDelay = ref<number>(1000)
|
|
83
|
-
|
|
84
|
-
watch(
|
|
85
|
-
[firmware, secureBoot, bootMenu, bootDelay],
|
|
86
|
-
() => {
|
|
87
|
-
emits('send-data', {
|
|
88
|
-
firmware: firmware.value,
|
|
89
|
-
boot_delay_ms: bootDelay.value,
|
|
90
|
-
boot_menu: bootMenu.value,
|
|
91
|
-
})
|
|
92
|
-
},
|
|
93
|
-
{ immediate: true }
|
|
94
|
-
)
|
|
95
|
-
|
|
96
|
-
// Добавляем данные для редактирования
|
|
97
|
-
watch(
|
|
98
|
-
() => props.bootOptions,
|
|
99
|
-
(newValue) => {
|
|
100
|
-
if (!newValue || !props.bootOptions) return
|
|
101
|
-
|
|
102
|
-
firmware.value = props.bootOptions.firmware
|
|
103
|
-
bootDelay.value = props.bootOptions.boot_delay_ms
|
|
104
|
-
bootMenu.value = props.bootOptions.boot_menu
|
|
105
|
-
},
|
|
106
|
-
{ immediate: true }
|
|
107
|
-
)
|
|
108
44
|
</script>
|
|
109
45
|
|
|
110
46
|
<style scoped lang="scss"></style>
|
|
@@ -15,67 +15,47 @@
|
|
|
15
15
|
</template>
|
|
16
16
|
<template #stackChildren>
|
|
17
17
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-firmware
|
|
18
|
-
v-model:firmware="firmware"
|
|
18
|
+
v-model:firmware="model.options.boot_options.firmware"
|
|
19
19
|
:error-validation-fields="props.errorValidationFields"
|
|
20
20
|
:is-edit="props.isEdit"
|
|
21
21
|
:is-disabled="isDisabled"
|
|
22
22
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
23
23
|
/>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
v-
|
|
27
|
-
:
|
|
28
|
-
|
|
24
|
+
<!-- TODO 700-->
|
|
25
|
+
<!-- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-secure-->
|
|
26
|
+
<!-- v-if="firmware === 'uefi'"-->
|
|
27
|
+
<!-- v-model:secure-boot="secureBoot"-->
|
|
28
|
+
<!-- :is-disabled="isDisabled"-->
|
|
29
|
+
<!-- />-->
|
|
29
30
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-menu
|
|
30
|
-
v-model:boot-menu="
|
|
31
|
+
v-model:boot-menu="model.options.boot_options.boot_menu"
|
|
31
32
|
:is-disabled="isDisabled"
|
|
32
33
|
/>
|
|
33
34
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-delay
|
|
34
|
-
v-model:boot-delay="
|
|
35
|
+
v-model:boot-delay="model.options.boot_options.boot_delay_ms"
|
|
35
36
|
:is-disabled="isDisabled"
|
|
36
37
|
/>
|
|
37
38
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-order
|
|
38
|
-
|
|
39
|
-
:cd-dvd-drives="props.cdDvdDrives"
|
|
40
|
-
:networks="props.networks"
|
|
39
|
+
v-model="model"
|
|
41
40
|
:is-disabled="isDisabled"
|
|
42
|
-
@change="emits('change-boot-order', $event)"
|
|
43
41
|
/>
|
|
44
42
|
</template>
|
|
45
43
|
</ui-stack-block>
|
|
46
44
|
</template>
|
|
47
45
|
|
|
48
46
|
<script setup lang="ts">
|
|
49
|
-
import type {
|
|
50
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
51
|
-
UI_I_SendDataNewHardDisk,
|
|
52
|
-
UI_I_SendDataNewNetwork,
|
|
53
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
54
47
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
55
48
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
49
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
56
50
|
|
|
57
|
-
const
|
|
58
|
-
const secureBoot = defineModel<boolean>('secureBoot', { required: true })
|
|
59
|
-
const bootMenu = defineModel<boolean>('bootMenu', { required: true })
|
|
60
|
-
const bootDelay = defineModel<number>('bootDelay', { required: true })
|
|
51
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
61
52
|
|
|
62
53
|
const props = defineProps<{
|
|
63
54
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
64
|
-
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
65
|
-
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
66
|
-
networks: UI_I_SendDataNewNetwork[] | null
|
|
67
55
|
isEdit: boolean
|
|
68
56
|
isDisabled: boolean
|
|
69
57
|
}>()
|
|
70
58
|
const emits = defineEmits<{
|
|
71
|
-
(
|
|
72
|
-
event: 'change-boot-order',
|
|
73
|
-
value: [
|
|
74
|
-
UI_I_SendDataNewHardDisk[],
|
|
75
|
-
UI_I_SendDataNewCdDvdDrive[],
|
|
76
|
-
UI_I_SendDataNewNetwork[]
|
|
77
|
-
]
|
|
78
|
-
): void
|
|
79
59
|
(event: 'remove-error-by-title', value: string): void
|
|
80
60
|
}>()
|
|
81
61
|
|
|
@@ -12,31 +12,29 @@
|
|
|
12
12
|
</template>
|
|
13
13
|
<template #stackChildren>
|
|
14
14
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-firmware
|
|
15
|
-
v-model:firmware="firmware"
|
|
15
|
+
v-model:firmware="model.options.boot_options.firmware"
|
|
16
16
|
:error-validation-fields="props.errorValidationFields"
|
|
17
17
|
:is-edit="props.isEdit"
|
|
18
18
|
:is-disabled="props.isDisabled"
|
|
19
19
|
@remove-error-by-title="emits('remove-error-by-title', $event)"
|
|
20
20
|
/>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
v-
|
|
24
|
-
:
|
|
25
|
-
|
|
21
|
+
<!-- TODO 700-->
|
|
22
|
+
<!-- <common-vm-actions-common-customize-hardware-vmoptions-boot-options-secure-->
|
|
23
|
+
<!-- v-if="firmware === 'uefi'"-->
|
|
24
|
+
<!-- v-model:secure-boot="secureBoot"-->
|
|
25
|
+
<!-- :is-disabled="props.isDisabled"-->
|
|
26
|
+
<!-- />-->
|
|
26
27
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-menu
|
|
27
|
-
v-model:boot-menu="
|
|
28
|
+
v-model:boot-menu="model.options.boot_options.boot_menu"
|
|
28
29
|
:is-disabled="props.isDisabled"
|
|
29
30
|
/>
|
|
30
31
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-delay
|
|
31
|
-
v-model:boot-delay="
|
|
32
|
+
v-model:boot-delay="model.options.boot_options.boot_delay_ms"
|
|
32
33
|
:is-disabled="props.isDisabled"
|
|
33
34
|
/>
|
|
34
35
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-order
|
|
35
|
-
|
|
36
|
-
:cd-dvd-drives="props.cdDvdDrives"
|
|
37
|
-
:networks="props.networks"
|
|
36
|
+
v-model="model"
|
|
38
37
|
:is-disabled="props.isDisabled"
|
|
39
|
-
@change="emits('change-boot-order', $event)"
|
|
40
38
|
/>
|
|
41
39
|
</template>
|
|
42
40
|
</atoms-stack-block>
|
|
@@ -45,25 +43,15 @@
|
|
|
45
43
|
|
|
46
44
|
<script setup lang="ts">
|
|
47
45
|
import type { UI_I_SendDataBootOptions } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/lib/models/interfaces'
|
|
48
|
-
import type {
|
|
49
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
50
|
-
UI_I_SendDataNewHardDisk,
|
|
51
|
-
UI_I_SendDataNewNetwork,
|
|
52
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
53
46
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
54
47
|
import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
|
|
48
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
55
49
|
|
|
56
|
-
const
|
|
57
|
-
const secureBoot = defineModel<boolean>('secureBoot', { required: true })
|
|
58
|
-
const bootMenu = defineModel<boolean>('bootMenu', { required: true })
|
|
59
|
-
const bootDelay = defineModel<number>('bootDelay', { required: true })
|
|
50
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
60
51
|
|
|
61
52
|
const props = withDefaults(
|
|
62
53
|
defineProps<{
|
|
63
54
|
errorValidationFields: UI_I_ErrorValidationField[]
|
|
64
|
-
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
65
|
-
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
66
|
-
networks: UI_I_SendDataNewNetwork[] | null
|
|
67
55
|
isEdit: boolean
|
|
68
56
|
isDisabled: boolean
|
|
69
57
|
bootOptions?: UI_I_SendDataBootOptions
|
|
@@ -73,15 +61,6 @@ const props = withDefaults(
|
|
|
73
61
|
}
|
|
74
62
|
)
|
|
75
63
|
const emits = defineEmits<{
|
|
76
|
-
(
|
|
77
|
-
event: 'change-boot-order',
|
|
78
|
-
value: [
|
|
79
|
-
UI_I_SendDataNewHardDisk[],
|
|
80
|
-
UI_I_SendDataNewCdDvdDrive[],
|
|
81
|
-
UI_I_SendDataNewNetwork[]
|
|
82
|
-
]
|
|
83
|
-
): void
|
|
84
|
-
(event: 'send-data', value: UI_I_SendDataBootOptions): void
|
|
85
64
|
(event: 'remove-error-by-title', value: string): void
|
|
86
65
|
}>()
|
|
87
66
|
|
package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue
CHANGED
|
@@ -4,171 +4,153 @@
|
|
|
4
4
|
:boot-list="bootList"
|
|
5
5
|
:is-disabled="props.isDisabled"
|
|
6
6
|
@change-order="onChangeOrder"
|
|
7
|
+
@update:boot-list="onBootListUpdate"
|
|
7
8
|
/>
|
|
8
9
|
<common-vm-actions-common-customize-hardware-vmoptions-boot-options-order-old
|
|
9
10
|
v-else
|
|
10
11
|
:boot-list="bootList"
|
|
11
12
|
:is-disabled="props.isDisabled"
|
|
12
13
|
@change-order="onChangeOrder"
|
|
14
|
+
@update:boot-list="onBootListUpdate"
|
|
13
15
|
/>
|
|
14
16
|
</template>
|
|
15
17
|
|
|
16
18
|
<script setup lang="ts">
|
|
17
19
|
import type { UI_I_BootItem } from '~/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces'
|
|
18
|
-
import type {
|
|
19
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
20
|
-
UI_I_SendDataNewHardDisk,
|
|
21
|
-
UI_I_SendDataNewNetwork,
|
|
22
|
-
} from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
|
|
23
20
|
import type { UI_I_DropEvent } from '~/components/atoms/list/dragDropList/lib/config/events'
|
|
21
|
+
import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
|
|
22
|
+
|
|
23
|
+
const model = defineModel<UI_I_CreateVmData>({ required: true })
|
|
24
24
|
|
|
25
25
|
const props = defineProps<{
|
|
26
|
-
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
27
|
-
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
28
|
-
networks: UI_I_SendDataNewNetwork[] | null
|
|
29
26
|
isDisabled: boolean
|
|
30
27
|
}>()
|
|
31
|
-
const emits = defineEmits<{
|
|
32
|
-
(
|
|
33
|
-
event: 'change',
|
|
34
|
-
value: [
|
|
35
|
-
UI_I_SendDataNewHardDisk[],
|
|
36
|
-
UI_I_SendDataNewCdDvdDrive[],
|
|
37
|
-
UI_I_SendDataNewNetwork[]
|
|
38
|
-
]
|
|
39
|
-
): void
|
|
40
|
-
}>()
|
|
41
28
|
|
|
42
29
|
const { $store }: any = useNuxtApp()
|
|
43
30
|
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
44
31
|
|
|
45
32
|
const bootList = ref<UI_I_BootItem[]>([])
|
|
46
33
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
34
|
+
// Используем computed для автоматического обновления bootList при изменении модели
|
|
35
|
+
const hardDisksAndNetworks = computed(() => [
|
|
36
|
+
model.value.disk_devices?.filter((disk) => disk.device_type !== 'cdrom') ||
|
|
37
|
+
[],
|
|
38
|
+
model.value.disk_devices?.filter((disk) => disk.device_type === 'cdrom') ||
|
|
39
|
+
[],
|
|
40
|
+
model.value.network_devices || [],
|
|
41
|
+
])
|
|
42
|
+
|
|
43
|
+
// Watcher для обновления bootList при изменении модели
|
|
54
44
|
watch(
|
|
55
45
|
hardDisksAndNetworks,
|
|
56
|
-
(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
order,
|
|
68
|
-
isChecked: !!order,
|
|
69
|
-
text: `disk${index}`,
|
|
70
|
-
iconClassName: 'icon-disk',
|
|
71
|
-
type: 'disk',
|
|
72
|
-
name: item.source + index,
|
|
73
|
-
testId: `select-disk-value-${index + 1}`,
|
|
74
|
-
}
|
|
75
|
-
}) || []
|
|
76
|
-
const cdDvdDrives: UI_I_BootItem[] =
|
|
77
|
-
newValue[1]?.map((item, index) => {
|
|
78
|
-
const order = item.boot_order || 0
|
|
79
|
-
return {
|
|
80
|
-
order,
|
|
81
|
-
isChecked: !!order,
|
|
82
|
-
text: `cdrom${index}`,
|
|
83
|
-
iconClassName: 'icon-disk',
|
|
84
|
-
type: 'cdDvd',
|
|
85
|
-
name: item.source + index,
|
|
86
|
-
testId: `select-cd-dvd-value-${index + 1}`,
|
|
87
|
-
}
|
|
88
|
-
}) || []
|
|
89
|
-
const networks: UI_I_BootItem[] =
|
|
90
|
-
newValue[2]?.map((item, index) => {
|
|
91
|
-
const order = item.boot_order || 0
|
|
92
|
-
return {
|
|
93
|
-
order,
|
|
94
|
-
isChecked: !!order,
|
|
95
|
-
text: item.mac || 'undefined',
|
|
96
|
-
iconClassName: 'vsphere-icon-network',
|
|
97
|
-
type: 'nic',
|
|
98
|
-
name: item.network + index,
|
|
99
|
-
testId: `select-nic-value-${index + 1}`,
|
|
100
|
-
}
|
|
101
|
-
}) || []
|
|
102
|
-
|
|
103
|
-
bootList.value = [...hardDisks, ...cdDvdDrives, ...networks].sort(
|
|
104
|
-
(a, b) => a.order - b.order
|
|
105
|
-
)
|
|
106
|
-
},
|
|
107
|
-
{ deep: true, immediate: true }
|
|
108
|
-
)
|
|
109
|
-
|
|
110
|
-
const onChangeOrder = (event: UI_I_DropEvent): void => {
|
|
111
|
-
let order = -1
|
|
112
|
-
bootList.value = bootList.value
|
|
113
|
-
.map((item) => {
|
|
114
|
-
if (item === event.target) {
|
|
115
|
-
item.order = event.toPosition
|
|
116
|
-
return item
|
|
46
|
+
([hardDisks, cdDvdDrives, networks]) => {
|
|
47
|
+
const hardDiskItems: UI_I_BootItem[] = hardDisks.map((item, index) => {
|
|
48
|
+
const order = item.boot_order || 0
|
|
49
|
+
return {
|
|
50
|
+
order,
|
|
51
|
+
isChecked: !!order,
|
|
52
|
+
text: `disk${index}`,
|
|
53
|
+
iconClassName: 'icon-disk',
|
|
54
|
+
type: 'disk' as const,
|
|
55
|
+
name: `${item.source}_${index}`,
|
|
56
|
+
testId: `select-disk-value-${index + 1}`,
|
|
117
57
|
}
|
|
58
|
+
})
|
|
118
59
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
return
|
|
60
|
+
const cdDvdDriveItems: UI_I_BootItem[] = cdDvdDrives.map((item, index) => {
|
|
61
|
+
const order = item.boot_order || 0
|
|
62
|
+
return {
|
|
63
|
+
order,
|
|
64
|
+
isChecked: !!order,
|
|
65
|
+
text: `cdrom${index}`,
|
|
66
|
+
iconClassName: 'icon-disk',
|
|
67
|
+
type: 'cdDvd' as const,
|
|
68
|
+
name: `${item.source}_${hardDisks.length + index}`,
|
|
69
|
+
testId: `select-cd-dvd-value-${index + 1}`,
|
|
70
|
+
}
|
|
122
71
|
})
|
|
123
|
-
.sort((a, b) => a.order - b.order)
|
|
124
|
-
}
|
|
125
72
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
(network, index2) => network.network + index2 === boot.name
|
|
137
|
-
)
|
|
138
|
-
if (network) {
|
|
139
|
-
networks.push({
|
|
140
|
-
...network,
|
|
141
|
-
boot_order: boot.isChecked ? ++index : 0,
|
|
142
|
-
})
|
|
143
|
-
}
|
|
144
|
-
} else if (boot.type === 'disk') {
|
|
145
|
-
const hardDisk = props.hardDisks?.find(
|
|
146
|
-
(hardDisk, index2) => hardDisk.source + index2 === boot.name
|
|
147
|
-
)
|
|
148
|
-
if (hardDisk) {
|
|
149
|
-
hardDisks.push({
|
|
150
|
-
...hardDisk,
|
|
151
|
-
boot_order: boot.isChecked ? ++index : 0,
|
|
152
|
-
})
|
|
153
|
-
}
|
|
154
|
-
} else {
|
|
155
|
-
const cdDvdDrive = props.cdDvdDrives?.find(
|
|
156
|
-
(cdDvdDrive, index2) => cdDvdDrive.source + index2 === boot.name
|
|
157
|
-
)
|
|
158
|
-
if (cdDvdDrive) {
|
|
159
|
-
cdDvdDrives.push({
|
|
160
|
-
...cdDvdDrive,
|
|
161
|
-
boot_order: boot.isChecked ? ++index : 0,
|
|
162
|
-
})
|
|
163
|
-
}
|
|
73
|
+
const networkItems: UI_I_BootItem[] = networks.map((item, index) => {
|
|
74
|
+
const order = item.boot_order || 0
|
|
75
|
+
return {
|
|
76
|
+
order,
|
|
77
|
+
isChecked: !!order,
|
|
78
|
+
text: item.mac || 'undefined',
|
|
79
|
+
iconClassName: 'vsphere-icon-network',
|
|
80
|
+
type: 'nic' as const,
|
|
81
|
+
name: `${item.network}_${index}`,
|
|
82
|
+
testId: `select-nic-value-${index + 1}`,
|
|
164
83
|
}
|
|
165
84
|
})
|
|
166
85
|
|
|
167
|
-
|
|
86
|
+
bootList.value = [...hardDiskItems, ...cdDvdDriveItems, ...networkItems]
|
|
87
|
+
.filter((item) => item.order >= 0)
|
|
88
|
+
.sort((a, b) => a.order - b.order)
|
|
168
89
|
},
|
|
169
90
|
{ deep: true, immediate: true }
|
|
170
91
|
)
|
|
92
|
+
|
|
93
|
+
// Обработчик изменения порядка через drag & drop
|
|
94
|
+
const onChangeOrder = (event: UI_I_DropEvent): void => {
|
|
95
|
+
const updatedList = [...bootList.value]
|
|
96
|
+
const movedItem = updatedList.find((item) => item.name === event.target.name)
|
|
97
|
+
|
|
98
|
+
if (!movedItem) return
|
|
99
|
+
|
|
100
|
+
// Удаляем элемент из текущей позиции
|
|
101
|
+
const fromIndex = updatedList.indexOf(movedItem)
|
|
102
|
+
updatedList.splice(fromIndex, 1)
|
|
103
|
+
|
|
104
|
+
// Вставляем элемент в новую позицию
|
|
105
|
+
updatedList.splice(event.toPosition, 0, movedItem)
|
|
106
|
+
|
|
107
|
+
// Обновляем порядок всех элементов
|
|
108
|
+
updatedList.forEach((item, index) => {
|
|
109
|
+
item.order = index + 1
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
bootList.value = updatedList
|
|
113
|
+
updateModelFromBootList(updatedList)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// Обработчик обновления bootList (при изменении чекбоксов)
|
|
117
|
+
const onBootListUpdate = (updatedBootList: UI_I_BootItem[]): void => {
|
|
118
|
+
bootList.value = updatedBootList
|
|
119
|
+
updateModelFromBootList(updatedBootList)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Функция для обновления модели на основе bootList
|
|
123
|
+
const updateModelFromBootList = (bootItems: UI_I_BootItem[]): void => {
|
|
124
|
+
// Сначала сбрасываем все boot_order
|
|
125
|
+
model.value.disk_devices?.forEach((disk) => {
|
|
126
|
+
disk.boot_order = 0
|
|
127
|
+
})
|
|
128
|
+
model.value.network_devices?.forEach((network) => {
|
|
129
|
+
network.boot_order = 0
|
|
130
|
+
})
|
|
131
|
+
|
|
132
|
+
// Затем устанавливаем boot_order только для выбранных элементов
|
|
133
|
+
let currentOrder = 1
|
|
134
|
+
bootItems.forEach((bootItem) => {
|
|
135
|
+
if (!bootItem.isChecked) return
|
|
136
|
+
|
|
137
|
+
if (bootItem.type === 'nic') {
|
|
138
|
+
const [networkName, indexStr] = bootItem.name.split('_')
|
|
139
|
+
const index = parseInt(indexStr, 10)
|
|
140
|
+
const network = model.value.network_devices?.[index]
|
|
141
|
+
if (network && network.network === networkName) {
|
|
142
|
+
network.boot_order = currentOrder++
|
|
143
|
+
}
|
|
144
|
+
} else {
|
|
145
|
+
const [source, indexStr] = bootItem.name.split('_')
|
|
146
|
+
const index = parseInt(indexStr, 10)
|
|
147
|
+
const disk = model.value.disk_devices?.[index]
|
|
148
|
+
if (disk && disk.source === source) {
|
|
149
|
+
disk.boot_order = currentOrder++
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
})
|
|
153
|
+
}
|
|
171
154
|
</script>
|
|
172
155
|
|
|
173
|
-
<style scoped lang="scss">
|
|
174
|
-
</style>
|
|
156
|
+
<style scoped lang="scss"></style>
|
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<ui-stack-block
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
:has-children="false"
|
|
4
|
+
test-id="boot-options-order-stack-block"
|
|
5
5
|
>
|
|
6
6
|
<template #stackBlockKey>
|
|
7
7
|
{{ localization.common.bootOrder }}
|
|
8
8
|
</template>
|
|
9
9
|
<template #stackBlockContent>
|
|
10
10
|
<ui-drag-drop-list
|
|
11
|
-
:items="
|
|
11
|
+
:items="localBootList"
|
|
12
12
|
:disabled="props.isDisabled"
|
|
13
13
|
grab-item-key="text"
|
|
14
14
|
@drop="emits('change-order', $event)"
|
|
15
15
|
@grab="onGrab"
|
|
16
16
|
>
|
|
17
17
|
<template
|
|
18
|
-
v-for="(item, index) in
|
|
18
|
+
v-for="(item, index) in localBootList"
|
|
19
19
|
:key="index"
|
|
20
20
|
#[`leftSide${index}`]
|
|
21
21
|
>
|
|
22
22
|
<ui-checkbox
|
|
23
|
-
|
|
23
|
+
:model-value="item.isChecked"
|
|
24
24
|
:test-id="item.testId"
|
|
25
25
|
:disabled="props.isDisabled"
|
|
26
26
|
size="md"
|
|
27
|
+
@update:model-value="onCheckboxChange(index, $event)"
|
|
27
28
|
/>
|
|
28
29
|
</template>
|
|
29
30
|
<template
|
|
30
|
-
v-for="(item, index) in
|
|
31
|
+
v-for="(item, index) in localBootList"
|
|
31
32
|
:key="props.bootList.length + index"
|
|
32
33
|
#[`rightSide${index}`]
|
|
33
34
|
>
|
|
@@ -53,14 +54,48 @@ const props = defineProps<{
|
|
|
53
54
|
bootList: UI_I_BootItem[]
|
|
54
55
|
isDisabled: boolean
|
|
55
56
|
}>()
|
|
57
|
+
|
|
56
58
|
const emits = defineEmits<{
|
|
57
59
|
(event: 'change-order', value: UI_I_DropEvent): void
|
|
60
|
+
(event: 'update:boot-list', value: UI_I_BootItem[]): void
|
|
58
61
|
}>()
|
|
59
62
|
|
|
60
63
|
const grabedItem = ref<any>(null)
|
|
64
|
+
const localBootList = ref<UI_I_BootItem[]>([])
|
|
65
|
+
|
|
66
|
+
// Синхронизируем с props
|
|
67
|
+
watch(
|
|
68
|
+
() => props.bootList,
|
|
69
|
+
(newBootList) => {
|
|
70
|
+
localBootList.value = newBootList.map((item) => ({ ...item }))
|
|
71
|
+
},
|
|
72
|
+
{ deep: true, immediate: true }
|
|
73
|
+
)
|
|
74
|
+
|
|
61
75
|
const onGrab = (item: any): void => {
|
|
62
76
|
grabedItem.value = item
|
|
63
77
|
}
|
|
78
|
+
|
|
79
|
+
// Обработчик изменения чекбокса
|
|
80
|
+
const onCheckboxChange = (index: number, isChecked: boolean): void => {
|
|
81
|
+
localBootList.value[index].isChecked = isChecked
|
|
82
|
+
|
|
83
|
+
// Сохраняем порядок при изменении чекбокса
|
|
84
|
+
let currentOrder = 1
|
|
85
|
+
localBootList.value.forEach((item) => {
|
|
86
|
+
if (item.isChecked) {
|
|
87
|
+
item.order = currentOrder++
|
|
88
|
+
} else {
|
|
89
|
+
item.order = 0
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
// Сортируем список
|
|
94
|
+
localBootList.value.sort((a, b) => a.order - b.order)
|
|
95
|
+
|
|
96
|
+
// Отправляем обновленный список родителю
|
|
97
|
+
emits('update:boot-list', localBootList.value)
|
|
98
|
+
}
|
|
64
99
|
</script>
|
|
65
100
|
|
|
66
101
|
<style scoped lang="scss">
|