diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js
index a1e727ac12f..053acae87b7 100644
--- a/ui/src/config/section/compute.js
+++ b/ui/src/config/section/compute.js
@@ -292,21 +292,12 @@ export default {
{
api: 'scaleVirtualMachine',
icon: 'arrows-alt',
- // label: label.change.service.offering
label: 'Scale VM',
docHelp: 'adminguide/virtual_machines.html#how-to-dynamically-scale-cpu-and-ram',
dataView: true,
- args: ['serviceofferingid', 'details'],
- show: (record) => { return ['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC' }
- },
- {
- api: 'changeServiceForVirtualMachine',
- icon: 'sliders',
- label: 'label.change.service.offering',
- docHelp: 'adminguide/virtual_machines.html#changing-the-service-offering-for-a-vm',
- dataView: true,
- args: ['serviceofferingid'],
- show: (record) => { return ['Stopped'].includes(record.state) || (['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC') }
+ show: (record) => { return ['Stopped'].includes(record.state) || (['Running'].includes(record.state) && record.hypervisor !== 'KVM' && record.hypervisor !== 'LXC') },
+ popup: true,
+ component: () => import('@/views/compute/ScaleVM.vue')
},
{
api: 'migrateVirtualMachine',
diff --git a/ui/src/views/compute/ScaleVM.vue b/ui/src/views/compute/ScaleVM.vue
new file mode 100644
index 00000000000..1bff1101479
--- /dev/null
+++ b/ui/src/views/compute/ScaleVM.vue
@@ -0,0 +1,233 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+
+
+
+
+
+
+ updateComputeOffering($event)"
+ @handle-search-filter="($event) => fetchData($event)" />
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/src/views/compute/wizard/ComputeOfferingSelection.vue b/ui/src/views/compute/wizard/ComputeOfferingSelection.vue
index 6d72af76f64..432fdb1aa7a 100644
--- a/ui/src/views/compute/wizard/ComputeOfferingSelection.vue
+++ b/ui/src/views/compute/wizard/ComputeOfferingSelection.vue
@@ -152,6 +152,9 @@ export default {
},
loading () {
if (!this.loading) {
+ if (!this.preFillContent) {
+ return
+ }
if (this.preFillContent.computeofferingid) {
this.selectedRowKeys = [this.preFillContent.computeofferingid]
this.$emit('select-compute-item', this.preFillContent.computeofferingid)
diff --git a/ui/src/views/compute/wizard/ComputeSelection.vue b/ui/src/views/compute/wizard/ComputeSelection.vue
index 358099c02b8..c70193f889e 100644
--- a/ui/src/views/compute/wizard/ComputeSelection.vue
+++ b/ui/src/views/compute/wizard/ComputeSelection.vue
@@ -170,6 +170,9 @@ export default {
},
methods: {
fillValue () {
+ if (!this.preFillContent) {
+ return
+ }
if (this.preFillContent.cpunumber) {
this.cpuNumberInputValue = this.preFillContent.cpunumber
}