From 01a11fb685d938cc9301a01bad0d853870b11fed Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Thu, 8 Jan 2026 16:14:15 -0500 Subject: [PATCH] Add UI support to clone disk and network offering --- ui/public/locales/en.json | 6 + ui/src/components/CheckBoxSelectPair.vue | 7 + ui/src/config/section/offering.js | 16 + ui/src/views/offering/CloneDiskOffering.vue | 721 ++++++++++ .../views/offering/CloneNetworkOffering.vue | 1224 +++++++++++++++++ 5 files changed, 1974 insertions(+) create mode 100644 ui/src/views/offering/CloneDiskOffering.vue create mode 100644 ui/src/views/offering/CloneNetworkOffering.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 78fd636443d..ebd052d820c 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -256,6 +256,7 @@ "label.activate.project": "Activate project", "label.activeviewersessions": "Active sessions", "label.add": "Add", +"label.addservices": "Add Services", "label.add.account": "Add Account", "label.add.acl.rule": "Add rule", "label.add.acl": "Add ACL", @@ -573,6 +574,8 @@ "label.clear.notification": "Clear notification", "label.clientid": "Provider Client ID", "label.clone.compute.offering": "Clone Compute Offering", +"label.clone.disk.offering": "Clone Disk Offering", +"label.clone.network.offering": "Clone Network Offering", "label.clone.system.service.offering": "Clone System Service Offering", "label.close": "Close", "label.cloud.managed": "CloudManaged", @@ -949,6 +952,7 @@ "label.domains": "Domains", "label.done": "Done", "label.down": "Down", +"label.dropservices": "Drop Services", "label.download": "Download", "label.download.csv": "Download CSV", "label.download.kubeconfig.cluster": "Download kubeconfig for the cluster

The kubectl command-line tool uses kubeconfig files to find the information it needs to choose a cluster and communicate with the API server of a cluster.", @@ -3387,6 +3391,8 @@ "message.disable.webhook.ssl.verification": "Disabling SSL verification is not recommended", "message.discovering.feature": "Discovering features, please wait...", "message.disk.offering.created": "Disk offering created:", +"message.success.clone.disk.offering": "Successfully cloned disk offering:", +"message.success.clone.network.offering": "Successfully cloned network offering:", "message.disk.usage.info.data.points": "Each data point represents the difference in read/write data since the last data point.", "message.disk.usage.info.sum.of.disks": "The disk usage shown is made up of the sum of read/write data from all the disks in the Instance.", "message.download.volume": "Please click the link to download the volume:

00000", diff --git a/ui/src/components/CheckBoxSelectPair.vue b/ui/src/components/CheckBoxSelectPair.vue index 480e515be29..a874144458a 100644 --- a/ui/src/components/CheckBoxSelectPair.vue +++ b/ui/src/components/CheckBoxSelectPair.vue @@ -74,6 +74,10 @@ export default { type: Boolean, default: false }, + defaultSelectValue: { + type: String, + default: null + }, selectOptions: { type: Array, required: true @@ -100,6 +104,9 @@ export default { }, created () { this.checked = this.defaultCheckBoxValue + if (this.defaultSelectValue) { + this.selectedOption = this.defaultSelectValue + } }, watch: { selectOptions () { diff --git a/ui/src/config/section/offering.js b/ui/src/config/section/offering.js index 8e6444e0632..bac0e994995 100644 --- a/ui/src/config/section/offering.js +++ b/ui/src/config/section/offering.js @@ -349,6 +349,14 @@ export default { }, show: (record) => { return record.state === 'Active' }, groupMap: (selection) => { return selection.map(x => { return { id: x, state: 'Inactive' } }) } + }, { + api: 'cloneDiskOffering', + icon: 'copy-outlined', + label: 'label.clone.disk.offering', + docHelp: 'adminguide/service_offerings.html#creating-a-new-disk-offering', + dataView: true, + popup: true, + component: shallowRef(defineAsyncComponent(() => import('@/views/offering/CloneDiskOffering.vue'))) }] }, { @@ -504,6 +512,14 @@ export default { dataView: true, popup: true, component: shallowRef(defineAsyncComponent(() => import('@/views/offering/UpdateOfferingAccess.vue'))) + }, { + api: 'cloneNetworkOffering', + icon: 'copy-outlined', + label: 'label.clone.network.offering', + docHelp: 'adminguide/networking.html#creating-a-new-network-offering', + dataView: true, + popup: true, + component: shallowRef(defineAsyncComponent(() => import('@/views/offering/CloneNetworkOffering.vue'))) }, { api: 'deleteNetworkOffering', icon: 'delete-outlined', diff --git a/ui/src/views/offering/CloneDiskOffering.vue b/ui/src/views/offering/CloneDiskOffering.vue new file mode 100644 index 00000000000..8b12817e779 --- /dev/null +++ b/ui/src/views/offering/CloneDiskOffering.vue @@ -0,0 +1,721 @@ +// 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. + + + + + + diff --git a/ui/src/views/offering/CloneNetworkOffering.vue b/ui/src/views/offering/CloneNetworkOffering.vue new file mode 100644 index 00000000000..67370e1cafc --- /dev/null +++ b/ui/src/views/offering/CloneNetworkOffering.vue @@ -0,0 +1,1224 @@ +// 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. + + + + + +