From a4d4d302dfd4319b808e82da7afe3350544976b4 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Fri, 28 Feb 2025 12:06:48 -0500 Subject: [PATCH 1/3] UI: Show Host OOBM parameter in form if configured --- ui/public/locales/en.json | 1 + ui/src/config/section/infra/hosts.js | 12 +- ui/src/views/infra/ConfigureHostOOBM.vue | 171 +++++++++++++++++++++++ 3 files changed, 174 insertions(+), 10 deletions(-) create mode 100644 ui/src/views/infra/ConfigureHostOOBM.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 666d2a31e39b..29e10e519354 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3066,6 +3066,7 @@ "message.no.description": "No description entered.", "message.offering.internet.protocol.warning": "WARNING: IPv6 supported Networks use static routing and will require upstream routes to be configured manually.", "message.offering.ipv6.warning": "Please refer documentation for creating IPv6 enabled Network/VPC offering IPv6 support in CloudStack - Isolated Networks and VPC Network Tiers", +"message.oobm.configured": "Successfully configured Out of Band Management for host", "message.ovf.configurations": "OVF configurations available for the selected appliance. Please select the desired value. Incompatible compute offerings will get disabled.", "message.path.description": "NFS: exported path from the server. VMFS: /datacenter name/datastore name. SharedMountPoint: path where primary storage is mounted, such as /mnt/primary.", "message.please.confirm.remove.ssh.key.pair": "Please confirm that you want to remove this SSH key pair.", diff --git a/ui/src/config/section/infra/hosts.js b/ui/src/config/section/infra/hosts.js index f13029b61ca0..79ec40287fb7 100644 --- a/ui/src/config/section/infra/hosts.js +++ b/ui/src/config/section/infra/hosts.js @@ -150,16 +150,8 @@ export default { message: 'label.outofbandmanagement.configure', docHelp: 'adminguide/hosts.html#out-of-band-management', dataView: true, - post: true, - args: ['hostid', 'address', 'port', 'username', 'password', 'driver'], - mapping: { - hostid: { - value: (record) => { return record.id } - }, - driver: { - options: ['ipmitool', 'nestedcloudstack', 'redfish'] - } - } + popup: true, + component: shallowRef(defineAsyncComponent(() => import('@/views/infra/ConfigureHostOOBM'))) }, { api: 'enableOutOfBandManagementForHost', diff --git a/ui/src/views/infra/ConfigureHostOOBM.vue b/ui/src/views/infra/ConfigureHostOOBM.vue new file mode 100644 index 000000000000..60712ce32e83 --- /dev/null +++ b/ui/src/views/infra/ConfigureHostOOBM.vue @@ -0,0 +1,171 @@ +// 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. + + + + + + From d730c42d9f8c236da38a91b10de6bf58ce1edfbc Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Fri, 28 Feb 2025 12:14:28 -0500 Subject: [PATCH 2/3] remove password display --- ui/src/views/infra/ConfigureHostOOBM.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/views/infra/ConfigureHostOOBM.vue b/ui/src/views/infra/ConfigureHostOOBM.vue index 60712ce32e83..695568ac9b34 100644 --- a/ui/src/views/infra/ConfigureHostOOBM.vue +++ b/ui/src/views/infra/ConfigureHostOOBM.vue @@ -121,7 +121,8 @@ export default { address: this.resource.outofbandmanagement.address || '', port: this.resource.outofbandmanagement.port || '', username: this.resource.outofbandmanagement.username || '', - password: this.resource.outofbandmanagement.password || '' + password: '', + driver: this.resource.outofbandmanagement.driver || '' }) this.rules = reactive({ address: [{ required: true, message: this.$t('message.error.required.input') }], From af7a443256509c96df6c2a3f71ba15c5ceab68b1 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Mon, 3 Mar 2025 11:07:24 -0500 Subject: [PATCH 3/3] address comments --- ui/public/locales/en.json | 2 +- ui/src/views/infra/ConfigureHostOOBM.vue | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 29e10e519354..5e74bdccbe5f 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -3066,7 +3066,7 @@ "message.no.description": "No description entered.", "message.offering.internet.protocol.warning": "WARNING: IPv6 supported Networks use static routing and will require upstream routes to be configured manually.", "message.offering.ipv6.warning": "Please refer documentation for creating IPv6 enabled Network/VPC offering IPv6 support in CloudStack - Isolated Networks and VPC Network Tiers", -"message.oobm.configured": "Successfully configured Out of Band Management for host", +"message.oobm.configured": "Successfully configured out-of-band management for host", "message.ovf.configurations": "OVF configurations available for the selected appliance. Please select the desired value. Incompatible compute offerings will get disabled.", "message.path.description": "NFS: exported path from the server. VMFS: /datacenter name/datastore name. SharedMountPoint: path where primary storage is mounted, such as /mnt/primary.", "message.please.confirm.remove.ssh.key.pair": "Please confirm that you want to remove this SSH key pair.", diff --git a/ui/src/views/infra/ConfigureHostOOBM.vue b/ui/src/views/infra/ConfigureHostOOBM.vue index 695568ac9b34..d80ac68fc067 100644 --- a/ui/src/views/infra/ConfigureHostOOBM.vue +++ b/ui/src/views/infra/ConfigureHostOOBM.vue @@ -81,7 +81,7 @@
- {{ $t('label.cancel') }} + {{ $t('label.cancel') }} {{ $t('label.ok') }}
@@ -136,7 +136,7 @@ export default { e.preventDefault() this.formRef.value.validate().then(() => { const values = toRaw(this.form) - var params = { + const params = { hostid: this.resource.id, address: values.address, port: values.port, @@ -146,22 +146,22 @@ export default { } api('configureOutOfBandManagement', {}, 'POST', params).then(_ => { - this.$message.success(`${this.$t('message.oobm.configured')}`) - this.$emit('close-action') + this.$message.success(this.$t('message.oobm.configured')) + this.$emit('refresh-data') + this.onCloseAction() }).catch(error => { this.$notifyError(error) }) }) + }, + onCloseAction () { + this.$emit('close-action') } } }