bfg-common 1.5.369 → 1.5.370
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 +7 -1
- package/assets/localization/local_en.json +7 -1
- package/assets/localization/local_hy.json +7 -1
- package/assets/localization/local_kk.json +7 -1
- package/assets/localization/local_ru.json +7 -1
- package/assets/localization/local_zh.json +7 -1
- package/components/common/vm/actions/add/New.vue +14 -0
- package/components/common/vm/actions/common/select/options/New.vue +189 -0
- package/components/common/vm/actions/common/select/options/Old.vue +70 -0
- package/components/common/vm/actions/common/select/options/Options.vue +15 -57
- package/components/common/vm/actions/common/select/template/Template.vue +26 -20
- package/components/common/vm/actions/common/select/template/new/New.vue +42 -0
- package/components/common/vm/actions/common/select/template/old/Old.vue +34 -0
- package/components/common/vm/actions/common/select/template/treeView/New.vue +89 -0
- package/components/common/vm/actions/common/select/template/treeView/Old.vue +50 -0
- package/components/common/vm/actions/common/select/template/{TemplateTreeView.vue → treeView/TreeView.vue} +30 -38
- package/package.json +1 -1
@@ -3192,7 +3192,13 @@
|
|
3192
3192
|
"directSync": "Сінхронны прамы запіс",
|
3193
3193
|
"unsafe": "Небяспечны рэжым",
|
3194
3194
|
"lastCreateSubtitle": "Праверце падрабязнасці перад стварэннем віртуальнай машыны.",
|
3195
|
-
"noDestinationComputeResourceSelected": "Не абраны вылічаны рэсурс прызначэння."
|
3195
|
+
"noDestinationComputeResourceSelected": "Не абраны вылічаны рэсурс прызначэння.",
|
3196
|
+
"selectAdvancedOptionsCloning": "Абярыце пашыраныя параметры для кланавання.",
|
3197
|
+
"customizeOS": "Наладзіць АС",
|
3198
|
+
"customizeOperatingSystem": "Наладзіць аперацыйную сістэму.",
|
3199
|
+
"customizeVMHardware": "Наладзіць абсталяванне гэтай віртуальнай машыны.",
|
3200
|
+
"autoPowerOn": "Аўтазапуск",
|
3201
|
+
"powerVMAfterCreation": "Уключыць віртуальную машыну пасля стварэння."
|
3196
3202
|
},
|
3197
3203
|
"feedback": {
|
3198
3204
|
"additionalDetailsHelp": "Даведка па дадатковых звестках",
|
@@ -3196,7 +3196,13 @@
|
|
3196
3196
|
"directSync": "Direct Sync",
|
3197
3197
|
"unsafe": "Unsafe",
|
3198
3198
|
"lastCreateSubtitle": "Review the details before the virtual machine is created.",
|
3199
|
-
"noDestinationComputeResourceSelected": "No destination compute resource selected."
|
3199
|
+
"noDestinationComputeResourceSelected": "No destination compute resource selected.",
|
3200
|
+
"selectAdvancedOptionsCloning": "Select advanced options for cloning.",
|
3201
|
+
"customizeOS": "Customize OS",
|
3202
|
+
"customizeOperatingSystem": "Customize the operating system.",
|
3203
|
+
"customizeVMHardware": "Customize this virtual machine’s hardware.",
|
3204
|
+
"autoPowerOn": "Auto Power On",
|
3205
|
+
"powerVMAfterCreation": "Power on virtual machine after creation."
|
3200
3206
|
},
|
3201
3207
|
"feedback": {
|
3202
3208
|
"additionalDetailsHelp": "Additional Details Help",
|
@@ -3196,7 +3196,13 @@
|
|
3196
3196
|
"directSync": "Սինխրոն ուղիղ ձայնագրություն",
|
3197
3197
|
"unsafe": "Անապահով ռեժիմ",
|
3198
3198
|
"lastCreateSubtitle": "Վիրտուալ մեքենա ստեղծելուց առաջ ստուգեք մանրամասները։",
|
3199
|
-
"noDestinationComputeResourceSelected": "Ընտրված չէ որեւէ նշանակման ռեսուրս:"
|
3199
|
+
"noDestinationComputeResourceSelected": "Ընտրված չէ որեւէ նշանակման ռեսուրս:",
|
3200
|
+
"selectAdvancedOptionsCloning": "Ընտրեք կլոնավորման ընդլայնված պարամետրերը։",
|
3201
|
+
"customizeOS": "Անհատականացնել օպերացիոն համակարգը",
|
3202
|
+
"customizeOperatingSystem": "Անհատականացնել օպերացիոն համակարգը։",
|
3203
|
+
"customizeVMHardware": "Անհատականացնել այս վիրտուալ մեքենայի սարքավորումները։",
|
3204
|
+
"autoPowerOn": "Ավտոմատ միացում",
|
3205
|
+
"powerVMAfterCreation": "Վիրտուալ մեքենան միացնել ստեղծումից հետո։"
|
3200
3206
|
},
|
3201
3207
|
"feedback": {
|
3202
3208
|
"additionalDetailsHelp": "Լրացուցիչ մանրամասներ Օգնություն",
|
@@ -3195,7 +3195,13 @@
|
|
3195
3195
|
"directSync": "Синхронды тікелей жазу",
|
3196
3196
|
"unsafe": "Қауіпті режим",
|
3197
3197
|
"lastCreateSubtitle": "Виртуалды машина құрылмас бұрын мәліметтерді қарап шығыңыз.",
|
3198
|
-
"noDestinationComputeResourceSelected": "Тағайындалған есептеу ресурстары таңдалмайды."
|
3198
|
+
"noDestinationComputeResourceSelected": "Тағайындалған есептеу ресурстары таңдалмайды.",
|
3199
|
+
"selectAdvancedOptionsCloning": "Көшіру үшін кеңейтілген параметрлерді таңдаңыз.",
|
3200
|
+
"customizeOS": "ОЖ баптау",
|
3201
|
+
"customizeOperatingSystem": "Операциялық жүйені баптау.",
|
3202
|
+
"customizeVMHardware": "Бұл виртуалды машинаның жабдығын баптау.",
|
3203
|
+
"autoPowerOn": "Автоқосу",
|
3204
|
+
"powerVMAfterCreation": "Виртуалды машинаны жасау кейін қосу."
|
3199
3205
|
},
|
3200
3206
|
"feedback": {
|
3201
3207
|
"additionalDetailsHelp": "Қосымша мәліметтер анықтамасы",
|
@@ -3195,7 +3195,13 @@
|
|
3195
3195
|
"directSync": "Синхронная прямая запись",
|
3196
3196
|
"unsafe": "Небезопасный режим",
|
3197
3197
|
"lastCreateSubtitle": "Проверьте детали перед созданием виртуальной машины.",
|
3198
|
-
"noDestinationComputeResourceSelected": "Нет выбранного ресурса."
|
3198
|
+
"noDestinationComputeResourceSelected": "Нет выбранного ресурса.",
|
3199
|
+
"selectAdvancedOptionsCloning": "Выберите расширенные параметры для клонирования.",
|
3200
|
+
"customizeOS": "Настроить ОС",
|
3201
|
+
"customizeOperatingSystem": "Настроить операционную систему.",
|
3202
|
+
"customizeVMHardware": "Настроить оборудование этой виртуальной машины.",
|
3203
|
+
"autoPowerOn": "Автоматическое включение",
|
3204
|
+
"powerVMAfterCreation": "Включить виртуальную машину после создания."
|
3199
3205
|
},
|
3200
3206
|
"feedback": {
|
3201
3207
|
"additionalDetailsHelp": "Дополнительная информация Помощь",
|
@@ -3193,7 +3193,13 @@
|
|
3193
3193
|
"directSync": "同步直接记录",
|
3194
3194
|
"unsafe": "不安全模式",
|
3195
3195
|
"lastCreateSubtitle": "在创建虚拟机之前请查看详细信息。",
|
3196
|
-
"noDestinationComputeResourceSelected": "未选择目标计算资源。"
|
3196
|
+
"noDestinationComputeResourceSelected": "未选择目标计算资源。",
|
3197
|
+
"selectAdvancedOptionsCloning": "选择用于克隆的高级选项。",
|
3198
|
+
"customizeOS": "自定义操作系统",
|
3199
|
+
"customizeOperatingSystem": "自定义操作系统。",
|
3200
|
+
"customizeVMHardware": "自定义此虚拟机的硬件。",
|
3201
|
+
"autoPowerOn": "自动开机",
|
3202
|
+
"powerVMAfterCreation": "创建后启动虚拟机。"
|
3197
3203
|
},
|
3198
3204
|
"feedback": {
|
3199
3205
|
"additionalDetailsHelp": "其他详细信息帮助",
|
@@ -157,7 +157,17 @@
|
|
157
157
|
selectedStep.id === dynamicSteps.selectOptions ||
|
158
158
|
selectedStep.id === dynamicSteps.selectOptionsForDeployment
|
159
159
|
"
|
160
|
+
:sub-title-height="heightSelectOptions"
|
160
161
|
>
|
162
|
+
<template #subTitle>
|
163
|
+
<div ref="subTitleBlockSelectOptions">
|
164
|
+
<div class="subtitle-block">
|
165
|
+
<ui-wizard-subtitle
|
166
|
+
:sub-title="localization.vmWizard.selectAdvancedOptionsCloning"
|
167
|
+
/>
|
168
|
+
</div>
|
169
|
+
</div>
|
170
|
+
</template>
|
161
171
|
<template #content>
|
162
172
|
<common-vm-actions-common-select-options
|
163
173
|
:is-create-template="selectedCreateType === '1'"
|
@@ -575,6 +585,10 @@ const subTitleBlockReadyComplete = ref<HTMLElement | null>(null)
|
|
575
585
|
const { height: heightReadyComplete } = useElementSize(
|
576
586
|
subTitleBlockReadyComplete
|
577
587
|
)
|
588
|
+
const subTitleBlockSelectOptions = ref<HTMLElement | null>(null)
|
589
|
+
const { height: heightSelectOptions } = useElementSize(
|
590
|
+
subTitleBlockSelectOptions
|
591
|
+
)
|
578
592
|
|
579
593
|
const isNameAlertWrapperEmpty = ref<boolean>(false)
|
580
594
|
const isComputeResourceAlertWrapperEmpty = ref<boolean>(false)
|
@@ -0,0 +1,189 @@
|
|
1
|
+
<template>
|
2
|
+
<div
|
3
|
+
ref="mainContainer"
|
4
|
+
:class="['select-options grid gap-3 mt-4', { 'is-sm-size': isContainerSm }]"
|
5
|
+
>
|
6
|
+
<div
|
7
|
+
:class="[
|
8
|
+
'checkbox-container',
|
9
|
+
{ checked: isCustomizeOs },
|
10
|
+
{ disabled: props.isCreateTemplate },
|
11
|
+
]"
|
12
|
+
@click.stop.prevent="onToggleCustomizeOs"
|
13
|
+
>
|
14
|
+
<ui-checkbox
|
15
|
+
v-model="isCustomizeOs"
|
16
|
+
:label-text="localization.vmWizard.customizeOS"
|
17
|
+
:title="localization.vmWizard.customizeOS"
|
18
|
+
:disabled="props.isCreateTemplate"
|
19
|
+
test-id="customize-os"
|
20
|
+
/>
|
21
|
+
<p class="checkbox-block-description mt-2 ml-7 mr-3">
|
22
|
+
{{ localization.vmWizard.customizeOperatingSystem }}
|
23
|
+
</p>
|
24
|
+
</div>
|
25
|
+
<div
|
26
|
+
v-if="!props.isCreateTemplate"
|
27
|
+
:class="[
|
28
|
+
'checkbox-container',
|
29
|
+
{ checked: isCustomizeHardware },
|
30
|
+
{ disabled: props.isCreateTemplate },
|
31
|
+
]"
|
32
|
+
@click.stop.prevent="onToggleCustomizeHardware"
|
33
|
+
>
|
34
|
+
<ui-checkbox
|
35
|
+
v-model="isCustomizeHardware"
|
36
|
+
:label-text="localization.common.customizeHardware"
|
37
|
+
:title="localization.common.customizeHardware"
|
38
|
+
:disabled="props.isCreateTemplate"
|
39
|
+
test-id="customize-hardware"
|
40
|
+
/>
|
41
|
+
<p class="checkbox-block-description mt-2 ml-7 mr-3">
|
42
|
+
{{ localization.vmWizard.customizeVMHardware }}
|
43
|
+
</p>
|
44
|
+
</div>
|
45
|
+
<div
|
46
|
+
:class="[
|
47
|
+
'checkbox-container',
|
48
|
+
{ checked: isPowerOn },
|
49
|
+
{ disabled: props.isCreateTemplate },
|
50
|
+
]"
|
51
|
+
@click.stop.prevent="onTogglePowerOn"
|
52
|
+
>
|
53
|
+
<ui-checkbox
|
54
|
+
v-model="isPowerOn"
|
55
|
+
:label-text="localization.vmWizard.autoPowerOn"
|
56
|
+
:title="localization.vmWizard.autoPowerOn"
|
57
|
+
:disabled="props.isCreateTemplate"
|
58
|
+
test-id="power-on"
|
59
|
+
/>
|
60
|
+
<p class="checkbox-block-description mt-2 ml-7 mr-3">
|
61
|
+
{{ localization.vmWizard.powerVMAfterCreation }}
|
62
|
+
</p>
|
63
|
+
</div>
|
64
|
+
</div>
|
65
|
+
</template>
|
66
|
+
|
67
|
+
<script setup lang="ts">
|
68
|
+
import { useElementSize } from '@vueuse/core'
|
69
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
70
|
+
|
71
|
+
const modelValue = defineModel<string[]>({ required: true })
|
72
|
+
|
73
|
+
const props = defineProps<{
|
74
|
+
isCreateTemplate?: boolean // TODO change
|
75
|
+
}>()
|
76
|
+
|
77
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
78
|
+
|
79
|
+
const mainContainer = ref<HTMLElement | null>(null)
|
80
|
+
const { width: mainContainerWidth } = useElementSize(mainContainer)
|
81
|
+
|
82
|
+
const isCustomizeOs = ref<boolean>(false)
|
83
|
+
const isCustomizeHardware = ref<boolean>(false)
|
84
|
+
const isPowerOn = ref<boolean>(false)
|
85
|
+
|
86
|
+
const onToggleCustomizeOs = (): void => {
|
87
|
+
if (props.isCreateTemplate) return
|
88
|
+
|
89
|
+
isCustomizeOs.value = !isCustomizeOs.value
|
90
|
+
if (isCustomizeOs.value) {
|
91
|
+
!modelValue.value.includes('customize-os') &&
|
92
|
+
modelValue.value.push('customize-os')
|
93
|
+
} else {
|
94
|
+
modelValue.value = modelValue.value.filter(
|
95
|
+
(item) => item !== 'customize-os'
|
96
|
+
)
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
const onToggleCustomizeHardware = (): void => {
|
101
|
+
if (props.isCreateTemplate) return
|
102
|
+
|
103
|
+
isCustomizeHardware.value = !isCustomizeHardware.value
|
104
|
+
if (isCustomizeHardware.value) {
|
105
|
+
!modelValue.value.includes('customize-hardware') &&
|
106
|
+
modelValue.value.push('customize-hardware')
|
107
|
+
} else {
|
108
|
+
modelValue.value = modelValue.value.filter(
|
109
|
+
(item) => item !== 'customize-hardware'
|
110
|
+
)
|
111
|
+
}
|
112
|
+
}
|
113
|
+
|
114
|
+
const onTogglePowerOn = (): void => {
|
115
|
+
if (props.isCreateTemplate) return
|
116
|
+
|
117
|
+
isPowerOn.value = !isPowerOn.value
|
118
|
+
if (isPowerOn.value) {
|
119
|
+
!modelValue.value.includes('power-on') && modelValue.value.push('power-on')
|
120
|
+
} else {
|
121
|
+
modelValue.value = modelValue.value.filter((item) => item !== 'power-on')
|
122
|
+
}
|
123
|
+
}
|
124
|
+
|
125
|
+
const isContainerSm = ref<boolean>(false)
|
126
|
+
watch(
|
127
|
+
mainContainerWidth,
|
128
|
+
(newValue) => {
|
129
|
+
isContainerSm.value = newValue <= 600
|
130
|
+
},
|
131
|
+
{ immediate: true }
|
132
|
+
)
|
133
|
+
</script>
|
134
|
+
|
135
|
+
<style>
|
136
|
+
:root {
|
137
|
+
--radio-btn-active-label-bg-color: #f0f8fd;
|
138
|
+
--radio-btn-active-label-border-color: #008fd6;
|
139
|
+
}
|
140
|
+
:root.dark-theme {
|
141
|
+
--radio-btn-active-label-bg-color: #2ba2de14;
|
142
|
+
--radio-btn-active-label-border-color: #2ba2de;
|
143
|
+
}
|
144
|
+
</style>
|
145
|
+
|
146
|
+
<style scoped lang="scss">
|
147
|
+
.select-options {
|
148
|
+
grid-template-columns: 1fr 1fr 1fr;
|
149
|
+
grid-template-rows: max-content;
|
150
|
+
overflow-y: auto;
|
151
|
+
padding-bottom: 16px;
|
152
|
+
|
153
|
+
&.is-sm-size {
|
154
|
+
grid-template-columns: 1fr;
|
155
|
+
}
|
156
|
+
|
157
|
+
.checkbox-container {
|
158
|
+
width: 100%;
|
159
|
+
background-color: var(--select-bg);
|
160
|
+
border-radius: 8px;
|
161
|
+
padding: 12px;
|
162
|
+
transition: box-shadow 0.1s ease-in-out;
|
163
|
+
box-shadow: inset 0 0 0 1px var(--line-color);
|
164
|
+
|
165
|
+
&.disabled {
|
166
|
+
cursor: not-allowed;
|
167
|
+
}
|
168
|
+
&:not(.disabled):hover {
|
169
|
+
cursor: pointer;
|
170
|
+
}
|
171
|
+
&:not(.disabled):not(.checked):hover {
|
172
|
+
box-shadow: inset 0 0 0 1px var(--select-border);
|
173
|
+
}
|
174
|
+
&.checked {
|
175
|
+
background-color: var(--radio-btn-active-label-bg-color);
|
176
|
+
box-shadow: inset 0 0 0 1.5px var(--radio-btn-active-label-border-color);
|
177
|
+
}
|
178
|
+
|
179
|
+
:deep(.ui-checkbox-label) {
|
180
|
+
align-items: flex-start;
|
181
|
+
}
|
182
|
+
|
183
|
+
.checkbox-block-description {
|
184
|
+
color: #9da6ad;
|
185
|
+
line-height: 18px;
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}
|
189
|
+
</style>
|
@@ -0,0 +1,70 @@
|
|
1
|
+
<template>
|
2
|
+
<div :class="['select-options', { disabled: props.isCreateTemplate }]">
|
3
|
+
<div class="checkbox">
|
4
|
+
<input
|
5
|
+
id="customize-os"
|
6
|
+
v-model="modelValue"
|
7
|
+
data-id="customize-os"
|
8
|
+
type="checkbox"
|
9
|
+
value="customize-os"
|
10
|
+
:disabled="props.isCreateTemplate"
|
11
|
+
/>
|
12
|
+
<label for="customize-os">{{
|
13
|
+
localization.common.customizeTheOperatingSystem
|
14
|
+
}}</label>
|
15
|
+
</div>
|
16
|
+
<div v-if="!props.isCreateTemplate" class="checkbox">
|
17
|
+
<input
|
18
|
+
id="customize-hardware"
|
19
|
+
v-model="modelValue"
|
20
|
+
data-id="customize-hardware"
|
21
|
+
type="checkbox"
|
22
|
+
value="customize-hardware"
|
23
|
+
/>
|
24
|
+
<label for="customize-hardware">{{
|
25
|
+
localization.common.customizeThisVirtualMachineHardware
|
26
|
+
}}</label>
|
27
|
+
</div>
|
28
|
+
<div class="checkbox">
|
29
|
+
<input
|
30
|
+
id="power-on"
|
31
|
+
v-model="modelValue"
|
32
|
+
data-id="power-on"
|
33
|
+
type="checkbox"
|
34
|
+
value="power-on"
|
35
|
+
:disabled="props.isCreateTemplate"
|
36
|
+
/>
|
37
|
+
<label for="power-on">{{
|
38
|
+
localization.common.powerOnVirtualMachineAfterCreation
|
39
|
+
}}</label>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</template>
|
43
|
+
|
44
|
+
<script setup lang="ts">
|
45
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
46
|
+
|
47
|
+
const modelValue = defineModel<string[]>()
|
48
|
+
|
49
|
+
const props = defineProps<{
|
50
|
+
isCreateTemplate?: boolean // TODO change
|
51
|
+
}>()
|
52
|
+
|
53
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
54
|
+
</script>
|
55
|
+
|
56
|
+
<style scoped lang="scss">
|
57
|
+
.select-options {
|
58
|
+
padding: 12px 0 0;
|
59
|
+
|
60
|
+
&.disabled {
|
61
|
+
input,
|
62
|
+
label {
|
63
|
+
cursor: not-allowed;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
.checkbox {
|
67
|
+
margin: 6px 0;
|
68
|
+
}
|
69
|
+
}
|
70
|
+
</style>
|
@@ -1,49 +1,17 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<label for="customize-os">{{
|
13
|
-
localization.common.customizeTheOperatingSystem
|
14
|
-
}}</label>
|
15
|
-
</div>
|
16
|
-
<div v-if="!props.isCreateTemplate" class="checkbox">
|
17
|
-
<input
|
18
|
-
id="customize-hardware"
|
19
|
-
v-model="selectedOptions"
|
20
|
-
data-id="customize-hardware"
|
21
|
-
type="checkbox"
|
22
|
-
value="customize-hardware"
|
23
|
-
/>
|
24
|
-
<label for="customize-hardware">{{
|
25
|
-
localization.common.customizeThisVirtualMachineHardware
|
26
|
-
}}</label>
|
27
|
-
</div>
|
28
|
-
<div class="checkbox">
|
29
|
-
<input
|
30
|
-
id="power-on"
|
31
|
-
v-model="selectedOptions"
|
32
|
-
data-id="power-on"
|
33
|
-
type="checkbox"
|
34
|
-
value="power-on"
|
35
|
-
:disabled="props.isCreateTemplate"
|
36
|
-
/>
|
37
|
-
<label for="power-on">{{
|
38
|
-
localization.common.powerOnVirtualMachineAfterCreation
|
39
|
-
}}</label>
|
40
|
-
</div>
|
41
|
-
</div>
|
2
|
+
<common-vm-actions-common-select-options-new
|
3
|
+
v-if="isNewView"
|
4
|
+
v-model="selectedOptions"
|
5
|
+
:is-create-template="props.isCreateTemplate"
|
6
|
+
/>
|
7
|
+
<common-vm-actions-common-select-options-old
|
8
|
+
v-else
|
9
|
+
v-model="selectedOptions"
|
10
|
+
:is-create-template="props.isCreateTemplate"
|
11
|
+
/>
|
42
12
|
</template>
|
43
13
|
|
44
14
|
<script setup lang="ts">
|
45
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
46
|
-
|
47
15
|
const props = defineProps<{
|
48
16
|
isCreateTemplate?: boolean // TODO change
|
49
17
|
}>()
|
@@ -51,7 +19,10 @@ const props = defineProps<{
|
|
51
19
|
const emits = defineEmits<{
|
52
20
|
(event: 'change', value: string[]): void
|
53
21
|
}>()
|
54
|
-
|
22
|
+
|
23
|
+
const { $store }: any = useNuxtApp()
|
24
|
+
|
25
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
55
26
|
|
56
27
|
const selectedOptions = ref<string[]>([])
|
57
28
|
watch(selectedOptions, (newValue) => {
|
@@ -59,17 +30,4 @@ watch(selectedOptions, (newValue) => {
|
|
59
30
|
})
|
60
31
|
</script>
|
61
32
|
|
62
|
-
<style scoped lang="scss">
|
63
|
-
.select-options {
|
64
|
-
padding: 12px 0 0;
|
65
|
-
|
66
|
-
&.disabled {
|
67
|
-
input, label {
|
68
|
-
cursor: not-allowed;
|
69
|
-
}
|
70
|
-
}
|
71
|
-
.checkbox {
|
72
|
-
margin: 6px 0;
|
73
|
-
}
|
74
|
-
}
|
75
|
-
</style>
|
33
|
+
<style scoped lang="scss"></style>
|
@@ -1,20 +1,18 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
</div>
|
17
|
-
</div>
|
2
|
+
<common-vm-actions-common-select-template-new
|
3
|
+
v-if="isNewView"
|
4
|
+
:templates-tree="props.templatesTree"
|
5
|
+
:errors="errors"
|
6
|
+
@remove="onRemove"
|
7
|
+
@select="onSelect"
|
8
|
+
/>
|
9
|
+
<common-vm-actions-common-select-template-old
|
10
|
+
v-else
|
11
|
+
:templates-tree="props.templatesTree"
|
12
|
+
:errors="errors"
|
13
|
+
@remove="onRemove"
|
14
|
+
@select="onSelect"
|
15
|
+
/>
|
18
16
|
</template>
|
19
17
|
|
20
18
|
<script setup lang="ts">
|
@@ -29,10 +27,14 @@ const emits = defineEmits<{
|
|
29
27
|
(event: 'submit', value: UI_I_TreeNode): void
|
30
28
|
}>()
|
31
29
|
|
30
|
+
const { $store }: any = useNuxtApp()
|
31
|
+
|
32
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
33
|
+
|
32
34
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
33
35
|
|
34
36
|
const selectedNode = ref<UI_I_TreeNode | null>(null)
|
35
|
-
const
|
37
|
+
const onSelect = (node: UI_I_TreeNode): void => {
|
36
38
|
selectedNode.value = node
|
37
39
|
}
|
38
40
|
|
@@ -44,19 +46,23 @@ watch(
|
|
44
46
|
)
|
45
47
|
|
46
48
|
const submit = async (cb: Function): Promise<void> => {
|
47
|
-
if (
|
49
|
+
if (
|
50
|
+
!selectedNode.value ||
|
51
|
+
(selectedNode.value.type !== 'vmt' &&
|
52
|
+
selectedNode.value.type !== 'vm_template')
|
53
|
+
) {
|
48
54
|
errors.value = [localization.value.vmWizard.selectValidTemplate]
|
49
55
|
cb(false)
|
50
56
|
return
|
51
57
|
}
|
52
58
|
|
53
|
-
|
59
|
+
onRemove()
|
54
60
|
emits('submit', selectedNode.value)
|
55
61
|
cb(true)
|
56
62
|
}
|
57
63
|
|
58
64
|
const errors = ref<string[]>([])
|
59
|
-
const
|
65
|
+
const onRemove = (): void => {
|
60
66
|
errors.value = []
|
61
67
|
}
|
62
68
|
</script>
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="select-template">
|
3
|
+
<ui-alert
|
4
|
+
v-if="props.errors.length"
|
5
|
+
:messages="props.errors"
|
6
|
+
test-id="select-template-error-alert"
|
7
|
+
type="error"
|
8
|
+
size="md"
|
9
|
+
class="alert-template"
|
10
|
+
@hide="emits('remove')"
|
11
|
+
/>
|
12
|
+
<common-vm-actions-common-select-template-tree-view
|
13
|
+
:templates-tree="props.templatesTree"
|
14
|
+
@select-node="emits('select', $event)"
|
15
|
+
/>
|
16
|
+
</div>
|
17
|
+
</template>
|
18
|
+
|
19
|
+
<script setup lang="ts">
|
20
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
21
|
+
|
22
|
+
const props = defineProps<{
|
23
|
+
templatesTree: UI_I_TreeNode[]
|
24
|
+
errors: string[]
|
25
|
+
}>()
|
26
|
+
|
27
|
+
const emits = defineEmits<{
|
28
|
+
(event: 'remove'): void
|
29
|
+
(event: 'select', value: UI_I_TreeNode): void
|
30
|
+
}>()
|
31
|
+
</script>
|
32
|
+
|
33
|
+
<style scoped lang="scss">
|
34
|
+
.select-template {
|
35
|
+
height: calc(100% - 12px);
|
36
|
+
overflow: hidden;
|
37
|
+
|
38
|
+
.alert-template {
|
39
|
+
margin-bottom: 16px;
|
40
|
+
}
|
41
|
+
}
|
42
|
+
</style>
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="select-template">
|
3
|
+
<atoms-alert
|
4
|
+
v-show="props.errors.length"
|
5
|
+
:items="props.errors"
|
6
|
+
status="alert-danger"
|
7
|
+
test-id="template-alert"
|
8
|
+
@remove="emits('remove')"
|
9
|
+
/>
|
10
|
+
|
11
|
+
<div class="tree-view-wrap">
|
12
|
+
<common-vm-actions-common-select-template-tree-view
|
13
|
+
:templates-tree="props.templatesTree"
|
14
|
+
@select-node="emits('select', $event)"
|
15
|
+
/>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
</template>
|
19
|
+
|
20
|
+
<script setup lang="ts">
|
21
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
22
|
+
|
23
|
+
const props = defineProps<{
|
24
|
+
templatesTree: UI_I_TreeNode[]
|
25
|
+
errors: string[]
|
26
|
+
}>()
|
27
|
+
|
28
|
+
const emits = defineEmits<{
|
29
|
+
(event: 'remove'): void
|
30
|
+
(event: 'select', value: UI_I_TreeNode): void
|
31
|
+
}>()
|
32
|
+
</script>
|
33
|
+
|
34
|
+
<style scoped lang="scss"></style>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="tree-view-wrap">
|
3
|
+
<div class="tree-view">
|
4
|
+
<ui-tree
|
5
|
+
:nodes="props.nodes"
|
6
|
+
:expand-all="false"
|
7
|
+
:is-loading="props.loading"
|
8
|
+
@toggle-node="onToggleNode"
|
9
|
+
@select-node="emits('select-node', $event)"
|
10
|
+
>
|
11
|
+
<template #content="{ node }">
|
12
|
+
<div class="flex-align-center">
|
13
|
+
<span :class="['node-icon', node.iconClassName]"></span>
|
14
|
+
<span class="node-name">{{ node.name }}</span>
|
15
|
+
</div>
|
16
|
+
</template>
|
17
|
+
</ui-tree>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</template>
|
21
|
+
|
22
|
+
<script setup lang="ts">
|
23
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
24
|
+
|
25
|
+
const props = defineProps<{
|
26
|
+
loading: boolean
|
27
|
+
nodes: UI_I_TreeNode[]
|
28
|
+
}>()
|
29
|
+
const emits = defineEmits<{
|
30
|
+
(event: 'select-node', value: UI_I_TreeNode): void
|
31
|
+
(
|
32
|
+
event: 'get-nodes',
|
33
|
+
value: {
|
34
|
+
node: UI_I_TreeNode
|
35
|
+
cb: () => void
|
36
|
+
}
|
37
|
+
): void
|
38
|
+
}>()
|
39
|
+
|
40
|
+
const onToggleNode = (node: UI_I_TreeNode): void => {
|
41
|
+
emits('get-nodes', { node, cb: () => {} })
|
42
|
+
}
|
43
|
+
</script>
|
44
|
+
|
45
|
+
<style>
|
46
|
+
:root {
|
47
|
+
--select-name-border-color: #e9ebeda3;
|
48
|
+
--select-name-location-bg-color: #ffffff;
|
49
|
+
}
|
50
|
+
:root.dark-theme {
|
51
|
+
--select-name-border-color: #e9ebed1f;
|
52
|
+
--select-name-location-bg-color: #1b2a371f;
|
53
|
+
}
|
54
|
+
</style>
|
55
|
+
<style scoped lang="scss">
|
56
|
+
.tree-view-wrap {
|
57
|
+
flex: 1;
|
58
|
+
border-radius: 8px;
|
59
|
+
border: 1px solid var(--select-name-border-color);
|
60
|
+
padding: 8px;
|
61
|
+
background-color: var(--select-name-location-bg-color);
|
62
|
+
overflow: auto;
|
63
|
+
margin-top: 8px;
|
64
|
+
height: inherit;
|
65
|
+
|
66
|
+
:deep(.skeleton-tree) {
|
67
|
+
padding: 4px 8px;
|
68
|
+
|
69
|
+
.skeleton-tree-row:last-child {
|
70
|
+
display: none;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
:deep(.tree-content) {
|
74
|
+
padding: 0 !important;
|
75
|
+
|
76
|
+
.node-wrapper {
|
77
|
+
border-radius: 4px;
|
78
|
+
|
79
|
+
.node-name {
|
80
|
+
font-size: 12px;
|
81
|
+
margin-left: 8px;
|
82
|
+
overflow: hidden;
|
83
|
+
text-overflow: ellipsis;
|
84
|
+
white-space: nowrap;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
</style>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<template>
|
2
|
+
<div class="tree-view">
|
3
|
+
<atoms-loader-pre-loader
|
4
|
+
v-show="props.loading"
|
5
|
+
id="loader"
|
6
|
+
:show="true"
|
7
|
+
class="absolute-center tree-view__loading"
|
8
|
+
/>
|
9
|
+
<common-recursion-tree
|
10
|
+
:nodes="props.nodes"
|
11
|
+
class="recursion-tree"
|
12
|
+
@get-nodes="emits('get-nodes', $event)"
|
13
|
+
@select-node="emits('select-node', $event)"
|
14
|
+
@contextmenu.prevent
|
15
|
+
/>
|
16
|
+
</div>
|
17
|
+
</template>
|
18
|
+
|
19
|
+
<script setup lang="ts">
|
20
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
21
|
+
|
22
|
+
const props = defineProps<{
|
23
|
+
loading: boolean
|
24
|
+
nodes: UI_I_TreeNode[]
|
25
|
+
}>()
|
26
|
+
const emits = defineEmits<{
|
27
|
+
(event: 'select-node', value: UI_I_TreeNode): void
|
28
|
+
(
|
29
|
+
event: 'get-nodes',
|
30
|
+
value: {
|
31
|
+
node: UI_I_TreeNode
|
32
|
+
cb: () => void
|
33
|
+
}
|
34
|
+
): void
|
35
|
+
}>()
|
36
|
+
</script>
|
37
|
+
|
38
|
+
<style scoped lang="scss">
|
39
|
+
.tree-view {
|
40
|
+
&__loading {
|
41
|
+
:deep(.spinner.spinner-inverse) {
|
42
|
+
position: static;
|
43
|
+
width: 45px;
|
44
|
+
height: 45px;
|
45
|
+
min-width: 45px;
|
46
|
+
min-height: 45px;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
</style>
|
@@ -1,19 +1,18 @@
|
|
1
1
|
<template>
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
</div>
|
2
|
+
<common-vm-actions-common-select-template-tree-view-new
|
3
|
+
v-if="isNewView"
|
4
|
+
:loading="loading"
|
5
|
+
:nodes="nodes"
|
6
|
+
@select-node="onSelectNode"
|
7
|
+
@get-nodes="onShowNodes"
|
8
|
+
/>
|
9
|
+
<common-vm-actions-common-select-template-tree-view-old
|
10
|
+
v-else
|
11
|
+
:loading="loading"
|
12
|
+
:nodes="nodes"
|
13
|
+
@select-node="onSelectNode"
|
14
|
+
@get-nodes="onShowNodes"
|
15
|
+
/>
|
17
16
|
</template>
|
18
17
|
|
19
18
|
<script setup lang="ts">
|
@@ -22,22 +21,18 @@ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models
|
|
22
21
|
const props = defineProps<{
|
23
22
|
templatesTree: UI_I_TreeNode[]
|
24
23
|
}>()
|
24
|
+
|
25
25
|
const emits = defineEmits<{
|
26
26
|
(event: 'select-node', value: UI_I_TreeNode): void
|
27
27
|
}>()
|
28
28
|
|
29
29
|
const { $store, $recursion }: any = useNuxtApp()
|
30
30
|
|
31
|
-
const
|
32
|
-
watch(
|
33
|
-
() => props.templatesTree,
|
34
|
-
(newValue) => {
|
35
|
-
nodes.value = useDeepCopy(newValue)
|
36
|
-
},
|
37
|
-
{ deep: true, immediate: true }
|
38
|
-
)
|
31
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
39
32
|
|
40
33
|
const loading = ref<boolean>(false)
|
34
|
+
const nodes = ref<UI_I_TreeNode[]>([])
|
35
|
+
|
41
36
|
const getTree = async (): Promise<void> => {
|
42
37
|
loading.value = true
|
43
38
|
await $store.dispatch('inventory/A_GET_NODES', { name: 'vm' })
|
@@ -45,7 +40,15 @@ const getTree = async (): Promise<void> => {
|
|
45
40
|
}
|
46
41
|
getTree()
|
47
42
|
|
48
|
-
|
43
|
+
watch(
|
44
|
+
() => props.templatesTree,
|
45
|
+
(newValue) => {
|
46
|
+
nodes.value = useDeepCopy(newValue)
|
47
|
+
},
|
48
|
+
{ deep: true, immediate: true }
|
49
|
+
)
|
50
|
+
|
51
|
+
const onShowNodes = ({
|
49
52
|
node,
|
50
53
|
cb,
|
51
54
|
}: {
|
@@ -61,7 +64,8 @@ const showNodes = ({
|
|
61
64
|
|
62
65
|
cb()
|
63
66
|
}
|
64
|
-
|
67
|
+
|
68
|
+
const onSelectNode = (node: UI_I_TreeNode): void => {
|
65
69
|
$recursion.findAndActivate(
|
66
70
|
nodes.value,
|
67
71
|
[node.type, node.id],
|
@@ -73,16 +77,4 @@ const selectNode = (node: UI_I_TreeNode): void => {
|
|
73
77
|
}
|
74
78
|
</script>
|
75
79
|
|
76
|
-
<style scoped lang="scss">
|
77
|
-
.tree-view {
|
78
|
-
&__loading {
|
79
|
-
:deep(.spinner.spinner-inverse) {
|
80
|
-
position: static;
|
81
|
-
width: 45px;
|
82
|
-
height: 45px;
|
83
|
-
min-width: 45px;
|
84
|
-
min-height: 45px;
|
85
|
-
}
|
86
|
-
}
|
87
|
-
}
|
88
|
-
</style>
|
80
|
+
<style scoped lang="scss"></style>
|