bfg-common 1.5.648 → 1.5.649
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/clone/new/New.vue +1 -0
- package/components/common/vm/actions/clone/old/Old.vue +1 -0
- package/components/common/vm/actions/common/select/options/New.vue +263 -259
- package/components/common/vm/actions/common/select/options/Old.vue +109 -102
- package/components/common/vm/actions/common/select/options/Options.vue +58 -53
- package/package.json +1 -1
|
@@ -121,6 +121,7 @@
|
|
|
121
121
|
<template #content>
|
|
122
122
|
<common-vm-actions-common-select-options
|
|
123
123
|
:is-new-vm-from-template="props.isNewVmFromTemplate"
|
|
124
|
+
:project="props.project"
|
|
124
125
|
@change="emits('change-select-options', $event)"
|
|
125
126
|
@change-count="emits('change-clone-count', $event)"
|
|
126
127
|
/>
|
|
@@ -72,6 +72,7 @@
|
|
|
72
72
|
<common-vm-actions-common-select-options
|
|
73
73
|
v-show="selectedStep.id === props.dynamicSteps.selectOptions"
|
|
74
74
|
:is-new-vm-from-template="props.isNewVmFromTemplate"
|
|
75
|
+
:project="props.project"
|
|
75
76
|
@change="emits('change-select-options', $event)"
|
|
76
77
|
@change-count="emits('change-clone-count', $event)"
|
|
77
78
|
/>
|
|
@@ -1,259 +1,263 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="mainContainer"
|
|
4
|
-
:class="[
|
|
5
|
-
'select-options grid gap-3 mt-4',
|
|
6
|
-
{ 'is-sm-size': isContainerSm },
|
|
7
|
-
{ 'three-items': !props.isNewVmFromTemplate },
|
|
8
|
-
]"
|
|
9
|
-
>
|
|
10
|
-
<div
|
|
11
|
-
:class="[
|
|
12
|
-
'checkbox-container',
|
|
13
|
-
{ checked: isCustomizeOs },
|
|
14
|
-
{ disabled: props.isNewVmFromTemplate },
|
|
15
|
-
]"
|
|
16
|
-
@click.stop.prevent="onToggleCustomizeOs"
|
|
17
|
-
>
|
|
18
|
-
<ui-checkbox
|
|
19
|
-
v-model="isCustomizeOs"
|
|
20
|
-
:label-text="localization.vmWizard.customizeOS"
|
|
21
|
-
:title="localization.vmWizard.customizeOS"
|
|
22
|
-
:disabled="props.isNewVmFromTemplate"
|
|
23
|
-
test-id="customize-os"
|
|
24
|
-
size="md"
|
|
25
|
-
/>
|
|
26
|
-
<p
|
|
27
|
-
:class="[
|
|
28
|
-
'checkbox-block-description mt-2 ml-7 mr-3',
|
|
29
|
-
{ disabled: props.isNewVmFromTemplate },
|
|
30
|
-
]"
|
|
31
|
-
>
|
|
32
|
-
{{ localization.vmWizard.customizeOperatingSystem }}
|
|
33
|
-
</p>
|
|
34
|
-
</div>
|
|
35
|
-
<div
|
|
36
|
-
v-if="!props.isNewVmFromTemplate"
|
|
37
|
-
:class="[
|
|
38
|
-
'checkbox-container',
|
|
39
|
-
{ checked: isCustomizeHardware },
|
|
40
|
-
{ disabled: props.isNewVmFromTemplate },
|
|
41
|
-
]"
|
|
42
|
-
@click.stop.prevent="onToggleCustomizeHardware"
|
|
43
|
-
>
|
|
44
|
-
<ui-checkbox
|
|
45
|
-
v-model="isCustomizeHardware"
|
|
46
|
-
:label-text="localization.common.customizeHardware"
|
|
47
|
-
:title="localization.common.customizeHardware"
|
|
48
|
-
:disabled="props.isNewVmFromTemplate"
|
|
49
|
-
test-id="customize-hardware"
|
|
50
|
-
size="md"
|
|
51
|
-
/>
|
|
52
|
-
<p
|
|
53
|
-
:class="[
|
|
54
|
-
'checkbox-block-description mt-2 ml-7 mr-3',
|
|
55
|
-
{ disabled: props.isNewVmFromTemplate },
|
|
56
|
-
]"
|
|
57
|
-
>
|
|
58
|
-
{{ localization.vmWizard.customizeVMHardware }}
|
|
59
|
-
</p>
|
|
60
|
-
</div>
|
|
61
|
-
<div
|
|
62
|
-
:class="[
|
|
63
|
-
'checkbox-container',
|
|
64
|
-
{ checked: isPowerOn },
|
|
65
|
-
{ disabled: props.isNewVmFromTemplate },
|
|
66
|
-
]"
|
|
67
|
-
@click.stop.prevent="onTogglePowerOn"
|
|
68
|
-
>
|
|
69
|
-
<!-- :disabled="props.isNewVmFromTemplate"-->
|
|
70
|
-
<ui-checkbox
|
|
71
|
-
v-model="isPowerOn"
|
|
72
|
-
:label-text="localization.vmWizard.autoPowerOn"
|
|
73
|
-
:title="localization.vmWizard.autoPowerOn"
|
|
74
|
-
:disabled="props.isNewVmFromTemplate"
|
|
75
|
-
test-id="power-on"
|
|
76
|
-
size="md"
|
|
77
|
-
/>
|
|
78
|
-
<!-- { disabled: props.isNewVmFromTemplate },-->
|
|
79
|
-
<p :class="['checkbox-block-description mt-2 ml-7 mr-3']">
|
|
80
|
-
{{ localization.vmWizard.powerVMAfterCreation }}
|
|
81
|
-
</p>
|
|
82
|
-
</div>
|
|
83
|
-
<div
|
|
84
|
-
v-if="props.isNewVmFromTemplate"
|
|
85
|
-
:class="['checkbox-container', { checked: isLinkedClone }]"
|
|
86
|
-
@click.stop.prevent="onToggleLinkedClone"
|
|
87
|
-
>
|
|
88
|
-
<ui-checkbox
|
|
89
|
-
v-model="isLinkedClone"
|
|
90
|
-
:label-text="localization.vmWizard.createLinkedClone"
|
|
91
|
-
:title="localization.vmWizard.createLinkedClone"
|
|
92
|
-
test-id="create-linked-clone"
|
|
93
|
-
size="md"
|
|
94
|
-
/>
|
|
95
|
-
|
|
96
|
-
<ui-input
|
|
97
|
-
v-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
import
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
isNewVmFromTemplate
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
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
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
&.
|
|
215
|
-
grid-template-columns: 1fr
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
box-shadow: inset 0 0 0
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
ref="mainContainer"
|
|
4
|
+
:class="[
|
|
5
|
+
'select-options grid gap-3 mt-4',
|
|
6
|
+
{ 'is-sm-size': isContainerSm },
|
|
7
|
+
{ 'three-items': !props.isNewVmFromTemplate },
|
|
8
|
+
]"
|
|
9
|
+
>
|
|
10
|
+
<div
|
|
11
|
+
:class="[
|
|
12
|
+
'checkbox-container',
|
|
13
|
+
{ checked: isCustomizeOs },
|
|
14
|
+
{ disabled: props.isNewVmFromTemplate },
|
|
15
|
+
]"
|
|
16
|
+
@click.stop.prevent="onToggleCustomizeOs"
|
|
17
|
+
>
|
|
18
|
+
<ui-checkbox
|
|
19
|
+
v-model="isCustomizeOs"
|
|
20
|
+
:label-text="localization.vmWizard.customizeOS"
|
|
21
|
+
:title="localization.vmWizard.customizeOS"
|
|
22
|
+
:disabled="props.isNewVmFromTemplate"
|
|
23
|
+
test-id="customize-os"
|
|
24
|
+
size="md"
|
|
25
|
+
/>
|
|
26
|
+
<p
|
|
27
|
+
:class="[
|
|
28
|
+
'checkbox-block-description mt-2 ml-7 mr-3',
|
|
29
|
+
{ disabled: props.isNewVmFromTemplate },
|
|
30
|
+
]"
|
|
31
|
+
>
|
|
32
|
+
{{ localization.vmWizard.customizeOperatingSystem }}
|
|
33
|
+
</p>
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
v-if="!props.isNewVmFromTemplate"
|
|
37
|
+
:class="[
|
|
38
|
+
'checkbox-container',
|
|
39
|
+
{ checked: isCustomizeHardware },
|
|
40
|
+
{ disabled: props.isNewVmFromTemplate },
|
|
41
|
+
]"
|
|
42
|
+
@click.stop.prevent="onToggleCustomizeHardware"
|
|
43
|
+
>
|
|
44
|
+
<ui-checkbox
|
|
45
|
+
v-model="isCustomizeHardware"
|
|
46
|
+
:label-text="localization.common.customizeHardware"
|
|
47
|
+
:title="localization.common.customizeHardware"
|
|
48
|
+
:disabled="props.isNewVmFromTemplate"
|
|
49
|
+
test-id="customize-hardware"
|
|
50
|
+
size="md"
|
|
51
|
+
/>
|
|
52
|
+
<p
|
|
53
|
+
:class="[
|
|
54
|
+
'checkbox-block-description mt-2 ml-7 mr-3',
|
|
55
|
+
{ disabled: props.isNewVmFromTemplate },
|
|
56
|
+
]"
|
|
57
|
+
>
|
|
58
|
+
{{ localization.vmWizard.customizeVMHardware }}
|
|
59
|
+
</p>
|
|
60
|
+
</div>
|
|
61
|
+
<div
|
|
62
|
+
:class="[
|
|
63
|
+
'checkbox-container',
|
|
64
|
+
{ checked: isPowerOn },
|
|
65
|
+
{ disabled: props.isNewVmFromTemplate },
|
|
66
|
+
]"
|
|
67
|
+
@click.stop.prevent="onTogglePowerOn"
|
|
68
|
+
>
|
|
69
|
+
<!-- :disabled="props.isNewVmFromTemplate"-->
|
|
70
|
+
<ui-checkbox
|
|
71
|
+
v-model="isPowerOn"
|
|
72
|
+
:label-text="localization.vmWizard.autoPowerOn"
|
|
73
|
+
:title="localization.vmWizard.autoPowerOn"
|
|
74
|
+
:disabled="props.isNewVmFromTemplate"
|
|
75
|
+
test-id="power-on"
|
|
76
|
+
size="md"
|
|
77
|
+
/>
|
|
78
|
+
<!-- { disabled: props.isNewVmFromTemplate },-->
|
|
79
|
+
<p :class="['checkbox-block-description mt-2 ml-7 mr-3']">
|
|
80
|
+
{{ localization.vmWizard.powerVMAfterCreation }}
|
|
81
|
+
</p>
|
|
82
|
+
</div>
|
|
83
|
+
<div
|
|
84
|
+
v-if="props.isNewVmFromTemplate"
|
|
85
|
+
:class="['checkbox-container', { checked: isLinkedClone }]"
|
|
86
|
+
@click.stop.prevent="onToggleLinkedClone"
|
|
87
|
+
>
|
|
88
|
+
<ui-checkbox
|
|
89
|
+
v-model="isLinkedClone"
|
|
90
|
+
:label-text="localization.vmWizard.createLinkedClone"
|
|
91
|
+
:title="localization.vmWizard.createLinkedClone"
|
|
92
|
+
test-id="create-linked-clone"
|
|
93
|
+
size="md"
|
|
94
|
+
/>
|
|
95
|
+
|
|
96
|
+
<ui-input
|
|
97
|
+
v-if="props.project !== 'sphere'"
|
|
98
|
+
v-model="cloneCount"
|
|
99
|
+
:disabled="!isLinkedClone"
|
|
100
|
+
test-id="clone-count"
|
|
101
|
+
type="number"
|
|
102
|
+
class="ml-1 mt-2"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
107
|
+
|
|
108
|
+
<script setup lang="ts">
|
|
109
|
+
import { useElementSize } from '@vueuse/core'
|
|
110
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
111
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
112
|
+
|
|
113
|
+
const modelValue = defineModel<string[]>({ required: true })
|
|
114
|
+
const cloneCount = defineModel<number>('cloneCount')
|
|
115
|
+
|
|
116
|
+
const props = withDefaults(
|
|
117
|
+
defineProps<{
|
|
118
|
+
project?: UI_T_Project
|
|
119
|
+
isNewVmFromTemplate?: boolean // TODO change
|
|
120
|
+
}>(),
|
|
121
|
+
{
|
|
122
|
+
project: undefined,
|
|
123
|
+
isNewVmFromTemplate: undefined,
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
128
|
+
|
|
129
|
+
const mainContainer = ref<HTMLElement | null>(null)
|
|
130
|
+
const { width: mainContainerWidth } = useElementSize(mainContainer)
|
|
131
|
+
|
|
132
|
+
const isCustomizeOs = ref<boolean>(false)
|
|
133
|
+
const isCustomizeHardware = ref<boolean>(false)
|
|
134
|
+
const isPowerOn = ref<boolean>(false)
|
|
135
|
+
const isLinkedClone = ref<boolean>(false)
|
|
136
|
+
|
|
137
|
+
const onToggleCustomizeOs = (): void => {
|
|
138
|
+
if (props.isNewVmFromTemplate) return
|
|
139
|
+
|
|
140
|
+
isCustomizeOs.value = !isCustomizeOs.value
|
|
141
|
+
if (isCustomizeOs.value) {
|
|
142
|
+
!modelValue.value.includes('customize-os') &&
|
|
143
|
+
modelValue.value.push('customize-os')
|
|
144
|
+
} else {
|
|
145
|
+
modelValue.value = modelValue.value.filter(
|
|
146
|
+
(item) => item !== 'customize-os'
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const onToggleCustomizeHardware = (): void => {
|
|
152
|
+
if (props.isNewVmFromTemplate) return
|
|
153
|
+
|
|
154
|
+
isCustomizeHardware.value = !isCustomizeHardware.value
|
|
155
|
+
if (isCustomizeHardware.value) {
|
|
156
|
+
!modelValue.value.includes('customize-hardware') &&
|
|
157
|
+
modelValue.value.push('customize-hardware')
|
|
158
|
+
} else {
|
|
159
|
+
modelValue.value = modelValue.value.filter(
|
|
160
|
+
(item) => item !== 'customize-hardware'
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const onTogglePowerOn = (): void => {
|
|
166
|
+
if (props.isNewVmFromTemplate) return
|
|
167
|
+
|
|
168
|
+
isPowerOn.value = !isPowerOn.value
|
|
169
|
+
if (isPowerOn.value) {
|
|
170
|
+
!modelValue.value.includes('power-on') && modelValue.value.push('power-on')
|
|
171
|
+
} else {
|
|
172
|
+
modelValue.value = modelValue.value.filter((item) => item !== 'power-on')
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
const onToggleLinkedClone = (): void => {
|
|
177
|
+
isLinkedClone.value = !isLinkedClone.value
|
|
178
|
+
if (isLinkedClone.value) {
|
|
179
|
+
!modelValue.value.includes('create-linked-clone') &&
|
|
180
|
+
modelValue.value.push('create-linked-clone')
|
|
181
|
+
} else {
|
|
182
|
+
modelValue.value = modelValue.value.filter(
|
|
183
|
+
(item) => item !== 'create-linked-clone'
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const isContainerSm = ref<boolean>(false)
|
|
189
|
+
watch(
|
|
190
|
+
mainContainerWidth,
|
|
191
|
+
(newValue) => {
|
|
192
|
+
isContainerSm.value = newValue <= 600
|
|
193
|
+
},
|
|
194
|
+
{ immediate: true }
|
|
195
|
+
)
|
|
196
|
+
</script>
|
|
197
|
+
|
|
198
|
+
<style>
|
|
199
|
+
:root {
|
|
200
|
+
--select-option-target-vm-checkbox-description-disabled: #bdc3c7;
|
|
201
|
+
}
|
|
202
|
+
:root.dark-theme {
|
|
203
|
+
--select-option-target-vm-checkbox-description-disabled: #bdc3c770;
|
|
204
|
+
}
|
|
205
|
+
</style>
|
|
206
|
+
|
|
207
|
+
<style scoped lang="scss">
|
|
208
|
+
.select-options {
|
|
209
|
+
grid-template-columns: 1fr 1fr;
|
|
210
|
+
grid-template-rows: max-content;
|
|
211
|
+
overflow-y: auto;
|
|
212
|
+
padding-bottom: 16px;
|
|
213
|
+
|
|
214
|
+
&.is-sm-size {
|
|
215
|
+
grid-template-columns: 1fr;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
&.three-items {
|
|
219
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.checkbox-container {
|
|
223
|
+
width: 100%;
|
|
224
|
+
background-color: var(--select-bg);
|
|
225
|
+
border-radius: 8px;
|
|
226
|
+
padding: 12px;
|
|
227
|
+
transition: box-shadow 0.1s ease-in-out;
|
|
228
|
+
box-shadow: inset 0 0 0 1px var(--line-color);
|
|
229
|
+
|
|
230
|
+
&.disabled {
|
|
231
|
+
cursor: not-allowed;
|
|
232
|
+
}
|
|
233
|
+
&:not(.disabled):hover {
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
}
|
|
236
|
+
&:not(.disabled):not(.checked):hover {
|
|
237
|
+
box-shadow: inset 0 0 0 1px var(--select-border);
|
|
238
|
+
}
|
|
239
|
+
&.checked {
|
|
240
|
+
background-color: var(--radio-btn-active-label-bg-color);
|
|
241
|
+
box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
:deep(.ui-checkbox-label) {
|
|
245
|
+
align-items: flex-start;
|
|
246
|
+
|
|
247
|
+
.ui-checkbox-label-text {
|
|
248
|
+
line-height: 18px;
|
|
249
|
+
margin-top: 1px;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.checkbox-block-description {
|
|
254
|
+
color: #9da6ad;
|
|
255
|
+
line-height: 18px;
|
|
256
|
+
|
|
257
|
+
&.disabled {
|
|
258
|
+
color: var(--select-option-target-vm-checkbox-description-disabled);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
</style>
|
|
@@ -1,102 +1,109 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="select-options">
|
|
3
|
-
<div
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-options">
|
|
3
|
+
<div
|
|
4
|
+
v-show="!props.isNewVmFromTemplate"
|
|
5
|
+
:class="['checkbox', { disabled: props.isNewVmFromTemplate }]"
|
|
6
|
+
>
|
|
7
|
+
<input
|
|
8
|
+
id="customize-os"
|
|
9
|
+
v-model="modelValue"
|
|
10
|
+
data-id="customize-os"
|
|
11
|
+
type="checkbox"
|
|
12
|
+
value="customize-os"
|
|
13
|
+
/>
|
|
14
|
+
<label for="customize-os">{{
|
|
15
|
+
localization.common.customizeTheOperatingSystem
|
|
16
|
+
}}</label>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="!props.isNewVmFromTemplate" class="checkbox">
|
|
19
|
+
<input
|
|
20
|
+
id="customize-hardware"
|
|
21
|
+
v-model="modelValue"
|
|
22
|
+
data-id="customize-hardware"
|
|
23
|
+
type="checkbox"
|
|
24
|
+
value="customize-hardware"
|
|
25
|
+
/>
|
|
26
|
+
<label for="customize-hardware">{{
|
|
27
|
+
localization.common.customizeThisVirtualMachineHardware
|
|
28
|
+
}}</label>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="checkbox">
|
|
31
|
+
<!-- :disabled="props.isNewVmFromTemplate"-->
|
|
32
|
+
<input
|
|
33
|
+
id="power-on"
|
|
34
|
+
v-model="modelValue"
|
|
35
|
+
data-id="power-on"
|
|
36
|
+
type="checkbox"
|
|
37
|
+
value="power-on"
|
|
38
|
+
/>
|
|
39
|
+
<label for="power-on">{{
|
|
40
|
+
localization.common.powerOnVirtualMachineAfterCreation
|
|
41
|
+
}}</label>
|
|
42
|
+
</div>
|
|
43
|
+
<div v-if="props.isNewVmFromTemplate" class="checkbox">
|
|
44
|
+
<!-- :disabled="props.isNewVmFromTemplate"-->
|
|
45
|
+
<input
|
|
46
|
+
id="create-linked-clone"
|
|
47
|
+
v-model="modelValue"
|
|
48
|
+
data-id="create-linked-clone"
|
|
49
|
+
type="checkbox"
|
|
50
|
+
value="create-linked-clone"
|
|
51
|
+
/>
|
|
52
|
+
<label for="create-linked-clone">{{
|
|
53
|
+
localization.vmWizard.createLinkedClone
|
|
54
|
+
}}</label>
|
|
55
|
+
|
|
56
|
+
<input
|
|
57
|
+
v-if="props.project !== 'sphere'"
|
|
58
|
+
v-model="cloneCount"
|
|
59
|
+
:disabled="!isLinkedClone"
|
|
60
|
+
data-id="clone-count"
|
|
61
|
+
type="number"
|
|
62
|
+
class="ml-1"
|
|
63
|
+
:min="0"
|
|
64
|
+
:max="1000"
|
|
65
|
+
/>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
|
|
70
|
+
<script setup lang="ts">
|
|
71
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
72
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
73
|
+
|
|
74
|
+
const modelValue = defineModel<string[]>()
|
|
75
|
+
const cloneCount = defineModel<number>('cloneCount')
|
|
76
|
+
|
|
77
|
+
const props = withDefaults(
|
|
78
|
+
defineProps<{
|
|
79
|
+
project?: UI_T_Project
|
|
80
|
+
isNewVmFromTemplate?: boolean // TODO change
|
|
81
|
+
}>(),
|
|
82
|
+
{
|
|
83
|
+
project: undefined,
|
|
84
|
+
isNewVmFromTemplate: undefined,
|
|
85
|
+
}
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
89
|
+
|
|
90
|
+
const isLinkedClone = computed<boolean>(
|
|
91
|
+
() => modelValue.value?.includes('create-linked-clone') || false
|
|
92
|
+
)
|
|
93
|
+
</script>
|
|
94
|
+
|
|
95
|
+
<style scoped lang="scss">
|
|
96
|
+
.select-options {
|
|
97
|
+
padding: 12px 0 0;
|
|
98
|
+
|
|
99
|
+
.disabled {
|
|
100
|
+
input,
|
|
101
|
+
label {
|
|
102
|
+
cursor: not-allowed;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.checkbox {
|
|
106
|
+
margin: 6px 0;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<component
|
|
3
|
-
|
|
4
|
-
v-model="
|
|
5
|
-
|
|
6
|
-
:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
v-model="selectedOptions"
|
|
4
|
+
v-model:clone-count="cloneCount"
|
|
5
|
+
:is="currentComponent"
|
|
6
|
+
:project="props.project"
|
|
7
|
+
:is-new-vm-from-template="props.isNewVmFromTemplate"
|
|
8
|
+
/>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup lang="ts">
|
|
12
|
+
import type { UI_T_Project } from '~/lib/models/types'
|
|
13
|
+
|
|
14
|
+
const props = withDefaults(
|
|
15
|
+
defineProps<{
|
|
16
|
+
project?: UI_T_Project
|
|
17
|
+
isNewVmFromTemplate?: boolean // TODO change
|
|
18
|
+
}>(),
|
|
19
|
+
{
|
|
20
|
+
project: undefined,
|
|
21
|
+
isNewVmFromTemplate: undefined,
|
|
22
|
+
}
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
const emits = defineEmits<{
|
|
26
|
+
(event: 'change', value: string[]): void
|
|
27
|
+
(event: 'change-count', value: number): void
|
|
28
|
+
}>()
|
|
29
|
+
|
|
30
|
+
const { $store }: any = useNuxtApp()
|
|
31
|
+
|
|
32
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
33
|
+
const currentComponent = computed(() =>
|
|
34
|
+
isNewView.value
|
|
35
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
36
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
const selectedOptions = ref<string[]>([])
|
|
40
|
+
watch(selectedOptions, (newValue) => {
|
|
41
|
+
emits('change', newValue)
|
|
42
|
+
})
|
|
43
|
+
const cloneCount = ref<number>(0) // For Deploy
|
|
44
|
+
watch(cloneCount, (newValue) => {
|
|
45
|
+
if (newValue < 0) {
|
|
46
|
+
cloneCount.value = 0
|
|
47
|
+
return
|
|
48
|
+
}
|
|
49
|
+
if (newValue > 1000) {
|
|
50
|
+
cloneCount.value = 1000
|
|
51
|
+
return
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
emits('change-count', newValue)
|
|
55
|
+
})
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<style scoped lang="scss"></style>
|