bfg-common 1.1.62 → 1.1.64
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/add/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +1 -1
- package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/order/Order.vue +203 -195
- package/package.json +1 -1
package/components/common/vm/actions/add/customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue
CHANGED
|
@@ -209,7 +209,7 @@ watch(
|
|
|
209
209
|
io: 'native',
|
|
210
210
|
limit_iops: 0,
|
|
211
211
|
discard: 'unmap',
|
|
212
|
-
boot_order:
|
|
212
|
+
boot_order: props.cdDvdDrive.boot_order,
|
|
213
213
|
detach: props.type === 'removed',
|
|
214
214
|
remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
|
|
215
215
|
})
|
|
@@ -382,7 +382,7 @@ watch(
|
|
|
382
382
|
limit_iops: limitIopsLocal,
|
|
383
383
|
discard: discard.value,
|
|
384
384
|
capacity: sizeInMb.value,
|
|
385
|
-
boot_order:
|
|
385
|
+
boot_order: props.hardDisk.boot_order,
|
|
386
386
|
detach: props.type === 'removed',
|
|
387
387
|
remove: props.type === 'removed' && deleteFilesFromDatastore.value, // Проверяем если удалили диск и указали Delete files from datastore
|
|
388
388
|
})
|
package/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/order/Order.vue
CHANGED
|
@@ -1,195 +1,203 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="boot-orders">
|
|
3
|
-
<atoms-stack-block :has-children="false">
|
|
4
|
-
<template #stackBlockKey>
|
|
5
|
-
{{ localization.bootOrder }}
|
|
6
|
-
</template>
|
|
7
|
-
<template #stackBlockContent>
|
|
8
|
-
<atoms-list-drag-drop-list
|
|
9
|
-
:items="bootList"
|
|
10
|
-
grab-item-key="text"
|
|
11
|
-
@drop="onChangeOrder"
|
|
12
|
-
>
|
|
13
|
-
<template
|
|
14
|
-
v-for="(item, index) in bootList"
|
|
15
|
-
:key="index"
|
|
16
|
-
#[`leftSide${index}`]
|
|
17
|
-
>
|
|
18
|
-
<input
|
|
19
|
-
v-model="item.isChecked"
|
|
20
|
-
:id="`boot-order-${index}`"
|
|
21
|
-
type="checkbox"
|
|
22
|
-
/>
|
|
23
|
-
</template>
|
|
24
|
-
<template
|
|
25
|
-
v-for="(item, index) in bootList"
|
|
26
|
-
:key="index + 5"
|
|
27
|
-
#[`rightSide${index}`]
|
|
28
|
-
>
|
|
29
|
-
<div :class="['device-icon', item.iconClassName]" />
|
|
30
|
-
<span>{{ item.text }}</span>
|
|
31
|
-
</template>
|
|
32
|
-
</atoms-list-drag-drop-list>
|
|
33
|
-
</template>
|
|
34
|
-
</atoms-stack-block>
|
|
35
|
-
</div>
|
|
36
|
-
</template>
|
|
37
|
-
|
|
38
|
-
<script setup lang="ts">
|
|
39
|
-
import type { UI_I_BootItem } from '~/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/order/models/interfaces'
|
|
40
|
-
import {
|
|
41
|
-
UI_I_SendDataNewCdDvdDrive,
|
|
42
|
-
UI_I_SendDataNewHardDisk,
|
|
43
|
-
UI_I_SendDataNewNetwork,
|
|
44
|
-
} from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
|
|
45
|
-
import { UI_I_Localization } from '~/models/interfaces'
|
|
46
|
-
import { UI_I_DropEvent } from '~/components/atoms/list/dragDropList/config/events'
|
|
47
|
-
|
|
48
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
-
|
|
50
|
-
const props = defineProps<{
|
|
51
|
-
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
52
|
-
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
53
|
-
networks: UI_I_SendDataNewNetwork[] | null
|
|
54
|
-
}>()
|
|
55
|
-
const emits = defineEmits<{
|
|
56
|
-
(
|
|
57
|
-
event: 'change',
|
|
58
|
-
value: [
|
|
59
|
-
UI_I_SendDataNewHardDisk[],
|
|
60
|
-
UI_I_SendDataNewCdDvdDrive[],
|
|
61
|
-
UI_I_SendDataNewNetwork[]
|
|
62
|
-
]
|
|
63
|
-
): void
|
|
64
|
-
}>()
|
|
65
|
-
|
|
66
|
-
const bootList = ref<UI_I_BootItem[]>([])
|
|
67
|
-
|
|
68
|
-
const hardDisksAndNetworks = computed<
|
|
69
|
-
[
|
|
70
|
-
UI_I_SendDataNewHardDisk[] | null,
|
|
71
|
-
UI_I_SendDataNewCdDvdDrive[] | null,
|
|
72
|
-
UI_I_SendDataNewNetwork[] | null
|
|
73
|
-
]
|
|
74
|
-
>(() => [props.hardDisks, props.cdDvdDrives, props.networks])
|
|
75
|
-
watch(
|
|
76
|
-
hardDisksAndNetworks,
|
|
77
|
-
(
|
|
78
|
-
newValue: [
|
|
79
|
-
UI_I_SendDataNewHardDisk[] | null,
|
|
80
|
-
UI_I_SendDataNewCdDvdDrive[] | null,
|
|
81
|
-
UI_I_SendDataNewNetwork[] | null
|
|
82
|
-
]
|
|
83
|
-
) => {
|
|
84
|
-
const hardDisks: UI_I_BootItem[] =
|
|
85
|
-
newValue[0]?.map((item, index) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
order
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
)
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
</
|
|
1
|
+
<template>
|
|
2
|
+
<div class="boot-orders">
|
|
3
|
+
<atoms-stack-block :has-children="false">
|
|
4
|
+
<template #stackBlockKey>
|
|
5
|
+
{{ localization.bootOrder }}
|
|
6
|
+
</template>
|
|
7
|
+
<template #stackBlockContent>
|
|
8
|
+
<atoms-list-drag-drop-list
|
|
9
|
+
:items="bootList"
|
|
10
|
+
grab-item-key="text"
|
|
11
|
+
@drop="onChangeOrder"
|
|
12
|
+
>
|
|
13
|
+
<template
|
|
14
|
+
v-for="(item, index) in bootList"
|
|
15
|
+
:key="index"
|
|
16
|
+
#[`leftSide${index}`]
|
|
17
|
+
>
|
|
18
|
+
<input
|
|
19
|
+
v-model="item.isChecked"
|
|
20
|
+
:id="`boot-order-${index}`"
|
|
21
|
+
type="checkbox"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
<template
|
|
25
|
+
v-for="(item, index) in bootList"
|
|
26
|
+
:key="index + 5"
|
|
27
|
+
#[`rightSide${index}`]
|
|
28
|
+
>
|
|
29
|
+
<div :class="['device-icon', item.iconClassName]" />
|
|
30
|
+
<span>{{ item.text }}</span>
|
|
31
|
+
</template>
|
|
32
|
+
</atoms-list-drag-drop-list>
|
|
33
|
+
</template>
|
|
34
|
+
</atoms-stack-block>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
|
|
38
|
+
<script setup lang="ts">
|
|
39
|
+
import type { UI_I_BootItem } from '~/components/common/vm/actions/add/customizeHardware/vmoptions/bootOptions/order/models/interfaces'
|
|
40
|
+
import {
|
|
41
|
+
UI_I_SendDataNewCdDvdDrive,
|
|
42
|
+
UI_I_SendDataNewHardDisk,
|
|
43
|
+
UI_I_SendDataNewNetwork,
|
|
44
|
+
} from '~/components/common/vm/actions/add/customizeHardware/virtualHardware/models/interfaces'
|
|
45
|
+
import { UI_I_Localization } from '~/models/interfaces'
|
|
46
|
+
import { UI_I_DropEvent } from '~/components/atoms/list/dragDropList/config/events'
|
|
47
|
+
|
|
48
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
49
|
+
|
|
50
|
+
const props = defineProps<{
|
|
51
|
+
hardDisks: UI_I_SendDataNewHardDisk[] | null
|
|
52
|
+
cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] | null
|
|
53
|
+
networks: UI_I_SendDataNewNetwork[] | null
|
|
54
|
+
}>()
|
|
55
|
+
const emits = defineEmits<{
|
|
56
|
+
(
|
|
57
|
+
event: 'change',
|
|
58
|
+
value: [
|
|
59
|
+
UI_I_SendDataNewHardDisk[],
|
|
60
|
+
UI_I_SendDataNewCdDvdDrive[],
|
|
61
|
+
UI_I_SendDataNewNetwork[]
|
|
62
|
+
]
|
|
63
|
+
): void
|
|
64
|
+
}>()
|
|
65
|
+
|
|
66
|
+
const bootList = ref<UI_I_BootItem[]>([])
|
|
67
|
+
|
|
68
|
+
const hardDisksAndNetworks = computed<
|
|
69
|
+
[
|
|
70
|
+
UI_I_SendDataNewHardDisk[] | null,
|
|
71
|
+
UI_I_SendDataNewCdDvdDrive[] | null,
|
|
72
|
+
UI_I_SendDataNewNetwork[] | null
|
|
73
|
+
]
|
|
74
|
+
>(() => [props.hardDisks, props.cdDvdDrives, props.networks])
|
|
75
|
+
watch(
|
|
76
|
+
hardDisksAndNetworks,
|
|
77
|
+
(
|
|
78
|
+
newValue: [
|
|
79
|
+
UI_I_SendDataNewHardDisk[] | null,
|
|
80
|
+
UI_I_SendDataNewCdDvdDrive[] | null,
|
|
81
|
+
UI_I_SendDataNewNetwork[] | null
|
|
82
|
+
]
|
|
83
|
+
) => {
|
|
84
|
+
const hardDisks: UI_I_BootItem[] =
|
|
85
|
+
newValue[0]?.map((item, index) => {
|
|
86
|
+
const order = item.boot_order || 0
|
|
87
|
+
return {
|
|
88
|
+
order,
|
|
89
|
+
isChecked: !!order,
|
|
90
|
+
text: `disk${index}`,
|
|
91
|
+
iconClassName: 'icon-disk',
|
|
92
|
+
type: 'disk',
|
|
93
|
+
name: item.source + index,
|
|
94
|
+
}
|
|
95
|
+
}) || []
|
|
96
|
+
const cdDvdDrives: UI_I_BootItem[] =
|
|
97
|
+
newValue[1]?.map((item, index) => {
|
|
98
|
+
const order = item.boot_order || 0
|
|
99
|
+
return {
|
|
100
|
+
order,
|
|
101
|
+
isChecked: !!order,
|
|
102
|
+
text: `cdrom${index}`,
|
|
103
|
+
iconClassName: 'icon-disk',
|
|
104
|
+
type: 'cdDvd',
|
|
105
|
+
name: item.source + index,
|
|
106
|
+
}
|
|
107
|
+
}) || []
|
|
108
|
+
const networks: UI_I_BootItem[] =
|
|
109
|
+
newValue[2]?.map((item, index) => {
|
|
110
|
+
const order = item.boot_order || 0
|
|
111
|
+
return {
|
|
112
|
+
order,
|
|
113
|
+
isChecked: !!order,
|
|
114
|
+
text: `nic${index} ${item.mac || undefined} mac`,
|
|
115
|
+
iconClassName: 'vsphere-icon-network',
|
|
116
|
+
type: 'nic',
|
|
117
|
+
name: item.network + index,
|
|
118
|
+
}
|
|
119
|
+
}) || []
|
|
120
|
+
|
|
121
|
+
bootList.value = [...hardDisks, ...cdDvdDrives, ...networks].sort(
|
|
122
|
+
(a, b) => a.order - b.order
|
|
123
|
+
)
|
|
124
|
+
},
|
|
125
|
+
{ deep: true, immediate: true }
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
const onChangeOrder = (event: UI_I_DropEvent): void => {
|
|
129
|
+
let order = -1
|
|
130
|
+
bootList.value = bootList.value
|
|
131
|
+
.map((item) => {
|
|
132
|
+
if (item === event.target) {
|
|
133
|
+
item.order = event.toPosition
|
|
134
|
+
return item
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
item.order = order + 1 === event.toPosition ? (order += 2) : order++
|
|
138
|
+
|
|
139
|
+
return item
|
|
140
|
+
})
|
|
141
|
+
.sort((a, b) => a.order - b.order)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
watch(
|
|
145
|
+
bootList,
|
|
146
|
+
(newValue) => {
|
|
147
|
+
// const boots = newValue.filter((item) => item.isChecked).map((item) => item)
|
|
148
|
+
// const boots = newValue.map((item) => {
|
|
149
|
+
// if (!item.isChecked) item.boot_order = 0
|
|
150
|
+
// return item
|
|
151
|
+
// })
|
|
152
|
+
|
|
153
|
+
const networks: UI_I_SendDataNewNetwork[] = []
|
|
154
|
+
const hardDisks: UI_I_SendDataNewHardDisk[] = []
|
|
155
|
+
const cdDvdDrives: UI_I_SendDataNewCdDvdDrive[] = []
|
|
156
|
+
let index = 0
|
|
157
|
+
newValue.forEach((boot) => {
|
|
158
|
+
if (boot.type === 'nic') {
|
|
159
|
+
const network = props.networks?.find(
|
|
160
|
+
(network, index2) => network.network + index2 === boot.name
|
|
161
|
+
)
|
|
162
|
+
if (network) {
|
|
163
|
+
networks.push({
|
|
164
|
+
...network,
|
|
165
|
+
boot_order: boot.isChecked ? ++index : 0,
|
|
166
|
+
})
|
|
167
|
+
}
|
|
168
|
+
} else if (boot.type === 'disk') {
|
|
169
|
+
const hardDisk = props.hardDisks?.find(
|
|
170
|
+
(hardDisk, index2) => hardDisk.source + index2 === boot.name
|
|
171
|
+
)
|
|
172
|
+
if (hardDisk) {
|
|
173
|
+
hardDisks.push({
|
|
174
|
+
...hardDisk,
|
|
175
|
+
boot_order: boot.isChecked ? ++index : 0,
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
const cdDvdDrive = props.cdDvdDrives?.find(
|
|
180
|
+
(cdDvdDrive, index2) => cdDvdDrive.source + index2 === boot.name
|
|
181
|
+
)
|
|
182
|
+
if (cdDvdDrive) {
|
|
183
|
+
cdDvdDrives.push({
|
|
184
|
+
...cdDvdDrive,
|
|
185
|
+
boot_order: boot.isChecked ? ++index : 0,
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
emits('change', [hardDisks, cdDvdDrives, networks])
|
|
192
|
+
},
|
|
193
|
+
{ deep: true, immediate: true }
|
|
194
|
+
)
|
|
195
|
+
</script>
|
|
196
|
+
|
|
197
|
+
<style scoped lang="scss">
|
|
198
|
+
.boot-orders {
|
|
199
|
+
.device-icon {
|
|
200
|
+
margin-right: 6px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
</style>
|