bfg-common 1.5.64 → 1.5.66
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 +11 -2
- package/assets/localization/local_en.json +11 -2
- package/assets/localization/local_hy.json +11 -2
- package/assets/localization/local_kk.json +11 -2
- package/assets/localization/local_ru.json +11 -2
- package/assets/localization/local_zh.json +11 -2
- package/components/common/accordion/Recursion.vue +6 -6
- package/components/common/monitor/advanced/tools/chartOptionsModal/actions/lib/utils/optionsActions.ts +5 -1
- package/components/common/monitor/advanced/tools/lib/config/advancedToolbar.ts +21 -5
- package/components/common/vm/actions/add/Add.vue +205 -194
- package/components/common/vm/actions/add/New.vue +485 -0
- package/components/common/vm/actions/add/Old.vue +371 -0
- package/components/common/vm/actions/add/{FolderTreeView.vue → folderTreeView/FolderTreeView.vue} +16 -27
- package/components/common/vm/actions/add/folderTreeView/New.vue +40 -0
- package/components/common/vm/actions/add/folderTreeView/Old.vue +50 -0
- package/components/common/vm/actions/add/lib/config/steps.ts +19 -3
- package/components/common/vm/actions/clone/toTemplate/ToTemplate.vue +29 -37
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +5 -5
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +3 -3
- package/components/common/vm/actions/common/select/compatibility/Compatibility.vue +21 -83
- package/components/common/vm/actions/common/select/compatibility/New.vue +165 -0
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -0
- package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +45 -75
- package/components/common/vm/actions/common/select/computeResource/New.vue +141 -0
- package/components/common/vm/actions/common/select/computeResource/Old.vue +99 -0
- package/components/common/vm/actions/common/select/computeResource/treeView/New.vue +44 -0
- package/components/common/vm/actions/common/select/computeResource/treeView/Old.vue +48 -0
- package/components/common/vm/actions/common/select/computeResource/{TreeView.vue → treeView/TreeView.vue} +28 -34
- package/components/common/vm/actions/common/select/createType/CreateType.vue +15 -51
- package/components/common/vm/actions/common/select/createType/New.vue +84 -0
- package/components/common/vm/actions/common/select/createType/Old.vue +70 -0
- package/components/common/vm/actions/common/select/createType/lib/config/items.ts +24 -4
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -0
- package/components/common/vm/actions/common/select/name/Name.vue +24 -93
- package/components/common/vm/actions/common/select/name/New.vue +246 -0
- package/components/common/vm/actions/common/select/name/Old.vue +119 -0
- package/components/common/vm/actions/common/select/storage/new/New.vue +116 -86
- package/components/common/vm/actions/common/select/storage/new/lib/config/table.ts +156 -3
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +6 -0
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -0
- package/components/common/vm/actions/common/select/template/Template.vue +2 -3
- package/components/common/vm/actions/common/select/template/TemplateTreeView.vue +1 -1
- package/package.json +1 -1
- /package/components/common/vm/actions/common/select/storage/{StorageOld.vue → Old.vue} +0 -0
|
@@ -1,49 +1,36 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
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
|
-
<div class="compatibility-message flex-align-center">
|
|
35
|
-
<template v-if="compatibilityText[1]">
|
|
36
|
-
<atoms-the-icon
|
|
37
|
-
v-show="!compatibilityText[0]"
|
|
38
|
-
width="20"
|
|
39
|
-
name="exclamation-circle"
|
|
40
|
-
/>
|
|
41
|
-
<div v-show="compatibilityText[0]" class="icon-status-ok" />
|
|
42
|
-
<span>{{ compatibilityText[1] }}</span>
|
|
43
|
-
</template>
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
2
|
+
<common-vm-actions-common-select-compute-resource-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="selectedNode"
|
|
5
|
+
:data-center="props.dataCenter"
|
|
6
|
+
:compute-resource="props.computeResource"
|
|
7
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
8
|
+
:errors="errors"
|
|
9
|
+
:compatibility-text="compatibilityText"
|
|
10
|
+
@get-compute-resource-tree="emits('get-compute-resource-tree', $event)"
|
|
11
|
+
@show-compute-resource-tree="emits('show-compute-resource-tree', $event)"
|
|
12
|
+
@select-compute-resource-tree="
|
|
13
|
+
emits('select-compute-resource-tree', $event)
|
|
14
|
+
"
|
|
15
|
+
@clear-compute-resource-tree="emits('clear-compute-resource-tree')"
|
|
16
|
+
@remove-validation-errors="onRemoveValidationErrors"
|
|
17
|
+
/>
|
|
18
|
+
<common-vm-actions-common-select-compute-resource-old
|
|
19
|
+
v-else
|
|
20
|
+
v-model="selectedNode"
|
|
21
|
+
:data-center="props.dataCenter"
|
|
22
|
+
:compute-resource="props.computeResource"
|
|
23
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
24
|
+
:errors="errors"
|
|
25
|
+
:compatibility-text="compatibilityText"
|
|
26
|
+
@get-compute-resource-tree="emits('get-compute-resource-tree', $event)"
|
|
27
|
+
@show-compute-resource-tree="emits('show-compute-resource-tree', $event)"
|
|
28
|
+
@select-compute-resource-tree="
|
|
29
|
+
emits('select-compute-resource-tree', $event)
|
|
30
|
+
"
|
|
31
|
+
@clear-compute-resource-tree="emits('clear-compute-resource-tree')"
|
|
32
|
+
@remove-validation-errors="onRemoveValidationErrors"
|
|
33
|
+
/>
|
|
47
34
|
</template>
|
|
48
35
|
|
|
49
36
|
<script setup lang="ts">
|
|
@@ -55,12 +42,10 @@ const props = defineProps<{
|
|
|
55
42
|
dataCenter: UI_I_TreeNode | null
|
|
56
43
|
computeResource: UI_I_TreeNode
|
|
57
44
|
computeResourceTree: UI_I_TreeNode[]
|
|
58
|
-
modelValue: UI_I_TreeNode | null
|
|
59
45
|
}>()
|
|
60
46
|
|
|
61
47
|
const emits = defineEmits<{
|
|
62
48
|
(event: 'submit', value: UI_I_TreeNode): void
|
|
63
|
-
(event: 'update:model-value', value: UI_I_TreeNode | null): void
|
|
64
49
|
(
|
|
65
50
|
event: 'get-compute-resource-tree',
|
|
66
51
|
value: { id: string | number; cb: () => void }
|
|
@@ -70,6 +55,9 @@ const emits = defineEmits<{
|
|
|
70
55
|
(event: 'clear-compute-resource-tree'): void
|
|
71
56
|
}>()
|
|
72
57
|
|
|
58
|
+
const { $store }: any = useNuxtApp()
|
|
59
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
60
|
+
|
|
73
61
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
74
62
|
|
|
75
63
|
watch(
|
|
@@ -81,7 +69,8 @@ watch(
|
|
|
81
69
|
const submit = (cb: Function): void => {
|
|
82
70
|
if (
|
|
83
71
|
!selectedNode.value ||
|
|
84
|
-
!compatibilityText.value[1] ||
|
|
72
|
+
// !compatibilityText.value[1] ||
|
|
73
|
+
!compatibilityText.value[0] ||
|
|
85
74
|
selectedNode.value.type === 'datacenter' ||
|
|
86
75
|
selectedNode.value.type === 'folder' ||
|
|
87
76
|
(selectedNode.value.type === 'cluster' && !selectedNode.value.nodes.length)
|
|
@@ -93,7 +82,7 @@ const submit = (cb: Function): void => {
|
|
|
93
82
|
return
|
|
94
83
|
}
|
|
95
84
|
|
|
96
|
-
|
|
85
|
+
onRemoveValidationErrors()
|
|
97
86
|
emits('submit', selectedNode.value)
|
|
98
87
|
cb(true)
|
|
99
88
|
}
|
|
@@ -102,11 +91,11 @@ const errors = ref<string[]>([])
|
|
|
102
91
|
const showValidationErrors = (text: string): void => {
|
|
103
92
|
errors.value = [text]
|
|
104
93
|
}
|
|
105
|
-
const
|
|
94
|
+
const onRemoveValidationErrors = (): void => {
|
|
106
95
|
errors.value = []
|
|
107
96
|
}
|
|
108
97
|
|
|
109
|
-
const selectedNode = defineModel<UI_I_TreeNode | null>('
|
|
98
|
+
const selectedNode = defineModel<UI_I_TreeNode | null>('modelValue')
|
|
110
99
|
|
|
111
100
|
const compatibilityText = computed<[boolean, string]>(() => {
|
|
112
101
|
let res: [boolean, string] = [
|
|
@@ -131,7 +120,10 @@ const compatibilityText = computed<[boolean, string]>(() => {
|
|
|
131
120
|
if (selectedNode.value?.type === 'host') {
|
|
132
121
|
if (selectedNode.value.state === 'Error') {
|
|
133
122
|
// TODO check Maintenance Mode
|
|
134
|
-
res = [
|
|
123
|
+
res = [
|
|
124
|
+
false,
|
|
125
|
+
localization.value.common.selectedHostDisconnectedMaintenanceMode,
|
|
126
|
+
]
|
|
135
127
|
}
|
|
136
128
|
}
|
|
137
129
|
|
|
@@ -139,26 +131,4 @@ const compatibilityText = computed<[boolean, string]>(() => {
|
|
|
139
131
|
})
|
|
140
132
|
</script>
|
|
141
133
|
|
|
142
|
-
<style scoped lang="scss">
|
|
143
|
-
.select-compute-resource {
|
|
144
|
-
.tree-view-wrap {
|
|
145
|
-
max-height: 300px;
|
|
146
|
-
min-height: 200px;
|
|
147
|
-
position: relative;
|
|
148
|
-
border: 1px solid #000;
|
|
149
|
-
padding: 5px 0 0 5px;
|
|
150
|
-
overflow: auto;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
.compatibility-wrap {
|
|
154
|
-
padding-top: 10px;
|
|
155
|
-
|
|
156
|
-
.compatibility-message {
|
|
157
|
-
border: 1px solid #000;
|
|
158
|
-
padding-top: 5px;
|
|
159
|
-
padding-left: 5px;
|
|
160
|
-
overflow: auto;
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
</style>
|
|
134
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-compute-resource">
|
|
3
|
+
<Teleport to="#compute-resource-alert-wrapper">
|
|
4
|
+
<ui-alert
|
|
5
|
+
v-show="props.errors.length"
|
|
6
|
+
status="alert-danger"
|
|
7
|
+
:messages="props.errors"
|
|
8
|
+
test-id="computed-resource-alert"
|
|
9
|
+
class="errors-alert"
|
|
10
|
+
@remove="emits('remove-validation-errors')"
|
|
11
|
+
/>
|
|
12
|
+
</Teleport>
|
|
13
|
+
|
|
14
|
+
<div class="tree-view-wrap">
|
|
15
|
+
<common-vm-actions-common-select-compute-resource-tree-view
|
|
16
|
+
v-model="selectedNode"
|
|
17
|
+
:data-center="props.dataCenter"
|
|
18
|
+
:compute-resource="props.computeResource"
|
|
19
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
20
|
+
@get-compute-resource-tree="emits('get-compute-resource-tree', $event)"
|
|
21
|
+
@show-compute-resource-tree="
|
|
22
|
+
emits('show-compute-resource-tree', $event)
|
|
23
|
+
"
|
|
24
|
+
@select-compute-resource-tree="
|
|
25
|
+
emits('select-compute-resource-tree', $event)
|
|
26
|
+
"
|
|
27
|
+
@clear-compute-resource-tree="emits('clear-compute-resource-tree')"
|
|
28
|
+
/>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div class="compatibility-wrap">
|
|
32
|
+
<p class="compatibility">
|
|
33
|
+
{{ localization.inventorySummary.compatibility }}
|
|
34
|
+
</p>
|
|
35
|
+
<div class="compatibility-message flex-align-center">
|
|
36
|
+
<ui-skeleton-item v-if="!selectedNode" width="160px" height="16px" />
|
|
37
|
+
<template v-else-if="props.compatibilityText[1]">
|
|
38
|
+
<ui-icon
|
|
39
|
+
v-show="!props.compatibilityText[0]"
|
|
40
|
+
name="error"
|
|
41
|
+
width="16"
|
|
42
|
+
height="16"
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<ui-icon
|
|
46
|
+
v-show="props.compatibilityText[0]"
|
|
47
|
+
name="success-fill"
|
|
48
|
+
width="16"
|
|
49
|
+
height="16"
|
|
50
|
+
/>
|
|
51
|
+
<span class="compatibility-message-description">{{
|
|
52
|
+
props.compatibilityText[1]
|
|
53
|
+
}}</span>
|
|
54
|
+
</template>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script setup lang="ts">
|
|
61
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
62
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
63
|
+
|
|
64
|
+
const selectedNode = defineModel<UI_I_TreeNode>('modelValue', {
|
|
65
|
+
required: true,
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const props = defineProps<{
|
|
69
|
+
dataCenter: UI_I_TreeNode | null
|
|
70
|
+
computeResource: UI_I_TreeNode
|
|
71
|
+
computeResourceTree: UI_I_TreeNode[]
|
|
72
|
+
errors: string[]
|
|
73
|
+
compatibilityText: [boolean, string]
|
|
74
|
+
}>()
|
|
75
|
+
|
|
76
|
+
const emits = defineEmits<{
|
|
77
|
+
(
|
|
78
|
+
event: 'get-compute-resource-tree',
|
|
79
|
+
value: { id: string | number; cb: () => void }
|
|
80
|
+
): void
|
|
81
|
+
(event: 'show-compute-resource-tree', value: UI_I_TreeNode): void
|
|
82
|
+
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void
|
|
83
|
+
(event: 'clear-compute-resource-tree'): void
|
|
84
|
+
(event: 'remove-validation-errors'): void
|
|
85
|
+
}>()
|
|
86
|
+
|
|
87
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
88
|
+
</script>
|
|
89
|
+
|
|
90
|
+
<style>
|
|
91
|
+
:root {
|
|
92
|
+
--select-compute-resource-border-color: #e9ebed;
|
|
93
|
+
--select-compute-resource-location-bg-color: #ffffff;
|
|
94
|
+
--select-compute-resource-compatibility-title-color: #4d5d69;
|
|
95
|
+
--select-compute-resource-compatibility-description-color: #4d5d69;
|
|
96
|
+
}
|
|
97
|
+
:root.dark-theme {
|
|
98
|
+
--select-compute-resource-border-color: #e9ebed1f;
|
|
99
|
+
--select-compute-resource-location-bg-color: transparent;
|
|
100
|
+
--select-compute-resource-compatibility-title-color: #e9eaec;
|
|
101
|
+
--select-compute-resource-compatibility-description-color: #9da6ad;
|
|
102
|
+
}
|
|
103
|
+
</style>
|
|
104
|
+
<style scoped lang="scss">
|
|
105
|
+
.select-compute-resource {
|
|
106
|
+
.tree-view-wrap {
|
|
107
|
+
height: 170px;
|
|
108
|
+
border-radius: 8px;
|
|
109
|
+
border: 1px solid var(--select-compute-resource-border-color);
|
|
110
|
+
padding: 12px;
|
|
111
|
+
background-color: var(--select-compute-resource-location-bg-color);
|
|
112
|
+
margin: 16px 0 24px;
|
|
113
|
+
overflow: auto;
|
|
114
|
+
|
|
115
|
+
:deep(.tree-content) {
|
|
116
|
+
padding: 0 !important;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.compatibility-wrap {
|
|
121
|
+
.compatibility {
|
|
122
|
+
font-size: 16px;
|
|
123
|
+
font-weight: 500;
|
|
124
|
+
color: var(--select-compute-resource-compatibility-title-color);
|
|
125
|
+
margin-bottom: 16px;
|
|
126
|
+
}
|
|
127
|
+
.compatibility-message {
|
|
128
|
+
border-radius: 8px;
|
|
129
|
+
border: 1px solid var(--select-compute-resource-border-color);
|
|
130
|
+
padding: 12px;
|
|
131
|
+
background-color: var(--select-compute-resource-location-bg-color);
|
|
132
|
+
gap: 12px;
|
|
133
|
+
|
|
134
|
+
.compatibility-message-description {
|
|
135
|
+
font-size: 13px;
|
|
136
|
+
color: var(--select-compute-resource-compatibility-description-color);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
</style>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="select-compute-resource">
|
|
3
|
+
<atoms-alert
|
|
4
|
+
v-show="props.errors.length"
|
|
5
|
+
status="alert-danger"
|
|
6
|
+
test-id="computed-resource-alert"
|
|
7
|
+
:items="props.errors"
|
|
8
|
+
@remove="emits('remove-validation-errors')"
|
|
9
|
+
/>
|
|
10
|
+
|
|
11
|
+
<div class="tree-view-wrap mt-1">
|
|
12
|
+
<common-vm-actions-common-select-compute-resource-tree-view
|
|
13
|
+
v-model="selectedNode"
|
|
14
|
+
:data-center="props.dataCenter"
|
|
15
|
+
:compute-resource="props.computeResource"
|
|
16
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
17
|
+
@get-compute-resource-tree="emits('get-compute-resource-tree', $event)"
|
|
18
|
+
@show-compute-resource-tree="
|
|
19
|
+
emits('show-compute-resource-tree', $event)
|
|
20
|
+
"
|
|
21
|
+
@select-compute-resource-tree="
|
|
22
|
+
emits('select-compute-resource-tree', $event)
|
|
23
|
+
"
|
|
24
|
+
@clear-compute-resource-tree="emits('clear-compute-resource-tree')"
|
|
25
|
+
/>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="compatibility-wrap">
|
|
29
|
+
<p class="compatibility">
|
|
30
|
+
{{ localization.inventorySummary.compatibility }}
|
|
31
|
+
</p>
|
|
32
|
+
<div class="compatibility-message flex-align-center">
|
|
33
|
+
<template v-if="props.compatibilityText[1]">
|
|
34
|
+
<atoms-the-icon
|
|
35
|
+
v-show="!props.compatibilityText[0]"
|
|
36
|
+
width="20"
|
|
37
|
+
name="exclamation-circle"
|
|
38
|
+
/>
|
|
39
|
+
<div v-show="props.compatibilityText[0]" class="icon-status-ok" />
|
|
40
|
+
<span>{{ props.compatibilityText[1] }}</span>
|
|
41
|
+
</template>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</template>
|
|
46
|
+
|
|
47
|
+
<script setup lang="ts">
|
|
48
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
49
|
+
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
50
|
+
|
|
51
|
+
const selectedNode = defineModel<UI_I_TreeNode>('modelValue', {
|
|
52
|
+
required: true,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const props = defineProps<{
|
|
56
|
+
dataCenter: UI_I_TreeNode | null
|
|
57
|
+
computeResource: UI_I_TreeNode
|
|
58
|
+
computeResourceTree: UI_I_TreeNode[]
|
|
59
|
+
errors: string[]
|
|
60
|
+
compatibilityText: [boolean, string]
|
|
61
|
+
}>()
|
|
62
|
+
|
|
63
|
+
const emits = defineEmits<{
|
|
64
|
+
(
|
|
65
|
+
event: 'get-compute-resource-tree',
|
|
66
|
+
value: { id: string | number; cb: () => void }
|
|
67
|
+
): void
|
|
68
|
+
(event: 'show-compute-resource-tree', value: UI_I_TreeNode): void
|
|
69
|
+
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void
|
|
70
|
+
(event: 'clear-compute-resource-tree'): void
|
|
71
|
+
(event: 'remove-validation-errors'): void
|
|
72
|
+
}>()
|
|
73
|
+
|
|
74
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<style scoped lang="scss">
|
|
78
|
+
.select-compute-resource {
|
|
79
|
+
.tree-view-wrap {
|
|
80
|
+
max-height: 300px;
|
|
81
|
+
min-height: 200px;
|
|
82
|
+
position: relative;
|
|
83
|
+
border: 1px solid #000;
|
|
84
|
+
padding: 5px 0 0 5px;
|
|
85
|
+
overflow: auto;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.compatibility-wrap {
|
|
89
|
+
padding-top: 10px;
|
|
90
|
+
|
|
91
|
+
.compatibility-message {
|
|
92
|
+
border: 1px solid #000;
|
|
93
|
+
padding-top: 5px;
|
|
94
|
+
padding-left: 5px;
|
|
95
|
+
overflow: auto;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
</style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tree-view">
|
|
3
|
+
<ui-tree
|
|
4
|
+
:nodes="props.computeResourceTree"
|
|
5
|
+
:expand-all="false"
|
|
6
|
+
:is-loading="props.loading"
|
|
7
|
+
@toggle-node="onShowNodes"
|
|
8
|
+
@select-node="emits('select-node', $event)"
|
|
9
|
+
>
|
|
10
|
+
<template #content="{ node }">
|
|
11
|
+
<div class="flex-align-center">
|
|
12
|
+
<span :class="['node-icon', node.iconClassName]"></span>
|
|
13
|
+
<span class="node-name">{{ node.name }}</span>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
</ui-tree>
|
|
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
|
+
computeResourceTree: UI_I_TreeNode[]
|
|
25
|
+
loading: boolean
|
|
26
|
+
}>()
|
|
27
|
+
|
|
28
|
+
const emits = defineEmits<{
|
|
29
|
+
(
|
|
30
|
+
event: 'show-nodes',
|
|
31
|
+
value: {
|
|
32
|
+
node: UI_I_TreeNode
|
|
33
|
+
cb: () => void
|
|
34
|
+
}
|
|
35
|
+
): void
|
|
36
|
+
(event: 'select-node', value: UI_I_TreeNode): void
|
|
37
|
+
}>()
|
|
38
|
+
|
|
39
|
+
const onShowNodes = (node: UI_I_TreeNode) => {
|
|
40
|
+
emits('show-nodes', { node, cb: (): void => {} })
|
|
41
|
+
}
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tree-view">
|
|
3
|
+
<atoms-loader-pre-loader
|
|
4
|
+
v-show="props.loading"
|
|
5
|
+
id="loader"
|
|
6
|
+
class="absolute-center tree-view__loading"
|
|
7
|
+
:show="true"
|
|
8
|
+
/>
|
|
9
|
+
<common-recursion-tree
|
|
10
|
+
:nodes="props.computeResourceTree"
|
|
11
|
+
class="recursion-tree"
|
|
12
|
+
@get-nodes="emits('show-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
|
+
computeResourceTree: UI_I_TreeNode[]
|
|
24
|
+
loading: boolean
|
|
25
|
+
}>()
|
|
26
|
+
|
|
27
|
+
const emits = defineEmits<{
|
|
28
|
+
(event: 'show-nodes', value: {
|
|
29
|
+
node: UI_I_TreeNode
|
|
30
|
+
cb: () => void
|
|
31
|
+
}): void
|
|
32
|
+
(event: 'select-node', value: UI_I_TreeNode): void
|
|
33
|
+
}>()
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<style scoped lang="scss">
|
|
37
|
+
.tree-view {
|
|
38
|
+
&__loading {
|
|
39
|
+
:deep(.spinner.spinner-inverse) {
|
|
40
|
+
position: static;
|
|
41
|
+
width: 45px;
|
|
42
|
+
height: 45px;
|
|
43
|
+
min-width: 45px;
|
|
44
|
+
min-height: 45px;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -1,39 +1,44 @@
|
|
|
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-compute-resource-tree-view-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
5
|
+
:loading="loading"
|
|
6
|
+
@show-nodes="onShowNodes"
|
|
7
|
+
@select-node="onSelectNode"
|
|
8
|
+
/>
|
|
9
|
+
<common-vm-actions-common-select-compute-resource-tree-view-old
|
|
10
|
+
v-else
|
|
11
|
+
:compute-resource-tree="props.computeResourceTree"
|
|
12
|
+
:loading="loading"
|
|
13
|
+
@show-nodes="onShowNodes"
|
|
14
|
+
@select-node="onSelectNode"
|
|
15
|
+
/>
|
|
17
16
|
</template>
|
|
18
17
|
|
|
19
18
|
<script setup lang="ts">
|
|
20
19
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
|
21
20
|
|
|
21
|
+
const model = defineModel<UI_I_TreeNode>('modelValue', { required: true })
|
|
22
|
+
|
|
22
23
|
const props = defineProps<{
|
|
23
24
|
dataCenter: UI_I_TreeNode | null
|
|
24
25
|
computeResource: UI_I_TreeNode
|
|
25
|
-
modelValue: UI_I_TreeNode | null
|
|
26
26
|
computeResourceTree: UI_I_TreeNode[]
|
|
27
27
|
}>()
|
|
28
28
|
|
|
29
29
|
const emits = defineEmits<{
|
|
30
|
-
(
|
|
31
|
-
|
|
30
|
+
(
|
|
31
|
+
event: 'get-compute-resource-tree',
|
|
32
|
+
value: { id: string | number; cb: () => void }
|
|
33
|
+
): void
|
|
32
34
|
(event: 'show-compute-resource-tree', value: UI_I_TreeNode): void
|
|
33
35
|
(event: 'select-compute-resource-tree', value: UI_I_TreeNode): void
|
|
34
36
|
(event: 'clear-compute-resource-tree'): void
|
|
35
37
|
}>()
|
|
36
38
|
|
|
39
|
+
const { $store }: any = useNuxtApp()
|
|
40
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
41
|
+
|
|
37
42
|
const loading = ref<boolean>(false)
|
|
38
43
|
watch(
|
|
39
44
|
() => props.dataCenter,
|
|
@@ -44,7 +49,7 @@ watch(
|
|
|
44
49
|
emits('get-compute-resource-tree', {
|
|
45
50
|
id: props.dataCenter.id,
|
|
46
51
|
cb: () => {
|
|
47
|
-
let node =
|
|
52
|
+
let node = model.value
|
|
48
53
|
let hasNode = checkHasNodeRecursion(
|
|
49
54
|
props.computeResourceTree[0].nodes,
|
|
50
55
|
node
|
|
@@ -65,7 +70,8 @@ watch(
|
|
|
65
70
|
onSelectNode(node)
|
|
66
71
|
},
|
|
67
72
|
})
|
|
68
|
-
}
|
|
73
|
+
},
|
|
74
|
+
{ immediate: true, deep: true }
|
|
69
75
|
)
|
|
70
76
|
const checkHasNodeRecursion = (
|
|
71
77
|
nodes: UI_I_TreeNode[],
|
|
@@ -101,7 +107,7 @@ const onShowNodes = ({
|
|
|
101
107
|
const onSelectNode = (node: UI_I_TreeNode): void => {
|
|
102
108
|
emits('select-compute-resource-tree', node)
|
|
103
109
|
|
|
104
|
-
|
|
110
|
+
model.value = node
|
|
105
111
|
}
|
|
106
112
|
|
|
107
113
|
onUnmounted(() => {
|
|
@@ -109,16 +115,4 @@ onUnmounted(() => {
|
|
|
109
115
|
})
|
|
110
116
|
</script>
|
|
111
117
|
|
|
112
|
-
<style scoped lang="scss">
|
|
113
|
-
.tree-view {
|
|
114
|
-
&__loading {
|
|
115
|
-
:deep(.spinner.spinner-inverse) {
|
|
116
|
-
position: static;
|
|
117
|
-
width: 45px;
|
|
118
|
-
height: 45px;
|
|
119
|
-
min-width: 45px;
|
|
120
|
-
min-height: 45px;
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
</style>
|
|
118
|
+
<style scoped lang="scss"></style>
|