From ae62e1dd5e0fc9560a22b2bff29faa8d5cef4fef Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 30 Dec 2021 15:53:51 +0700 Subject: [PATCH 01/14] fixes cannot add new port forwarding rules after auto select VM next time (#5690) --- ui/src/views/network/PortForwarding.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/views/network/PortForwarding.vue b/ui/src/views/network/PortForwarding.vue index 361708ed531..9eb6e52034a 100644 --- a/ui/src/views/network/PortForwarding.vue +++ b/ui/src/views/network/PortForwarding.vue @@ -331,7 +331,7 @@ export default { inject: ['parentFetchData', 'parentToggleLoading'], data () { return { - checked: true, + checked: false, selectedRowKeys: [], showGroupActionModal: false, selectedItems: [], @@ -639,6 +639,7 @@ export default { this.addVmModalNicLoading = false this.showConfirmationAction = false this.nics = [] + this.checked = false this.resetTagInputs() }, openTagsModal (id) { From 9a5a0738b0c916bd446831a0725a8ba62585fbe2 Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Thu, 30 Dec 2021 15:01:24 +0530 Subject: [PATCH 02/14] ui: Fix configure Sticky policy form (#5814) --- ui/src/views/network/LoadBalancing.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ui/src/views/network/LoadBalancing.vue b/ui/src/views/network/LoadBalancing.vue index b86c91ee569..ed6e3f2538c 100644 --- a/ui/src/views/network/LoadBalancing.vue +++ b/ui/src/views/network/LoadBalancing.vue @@ -207,7 +207,7 @@ {{ $t('label.cancel') }} - {{ $t('label.ok') }} + {{ $t('label.ok') }} @@ -890,6 +890,8 @@ export default { }) }).catch(error => { this.$notifyError(error) + }).finally(() => { + this.closeModal() }) }, handleDeleteStickinessPolicy () { @@ -962,6 +964,7 @@ export default { }) }, handleStickinessMethodSelectChange (e) { + this.stickinessPolicyForm.resetFields() this.stickinessPolicyMethod = e }, handleDeleteInstanceFromRule (instance, rule, ip) { From 6728b696cd0c17ca71fea666f8e51becafed28b1 Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Thu, 30 Dec 2021 15:19:32 +0530 Subject: [PATCH 03/14] kvm: don't always force scsi controller for aarch64 VMs (#5802) * kvm: don't force scsi controller for aarch64 VMs This would allow use of virtio disk controller with Ceph, etc or as defined in the VM's root disk controller setting, rather than always enforce SCSI. Signed-off-by: Rohit Yadav * remove test that doesn't apply now Signed-off-by: Rohit Yadav * address review comment Signed-off-by: Rohit Yadav --- .../kvm/resource/LibvirtComputingResource.java | 10 ++-------- .../kvm/resource/LibvirtComputingResourceTest.java | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java index 9684b7e2245..60d8e0865b2 100644 --- a/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java +++ b/plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java @@ -3715,10 +3715,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv return null; } - if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) { - return DiskDef.DiskBus.SCSI; - } - String rootDiskController = details.get(VmDetailConstants.ROOT_DISK_CONTROLLER); if (StringUtils.isNotBlank(rootDiskController)) { s_logger.debug("Passed custom disk controller for ROOT disk " + rootDiskController); @@ -3752,10 +3748,6 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv } private DiskDef.DiskBus getGuestDiskModel(final String platformEmulator, boolean isUefiEnabled) { - if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) { - return DiskDef.DiskBus.SCSI; - } - if (platformEmulator == null) { return DiskDef.DiskBus.IDE; } else if (platformEmulator.startsWith("Other PV Virtio-SCSI")) { @@ -3766,6 +3758,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements Serv return DiskDef.DiskBus.VIRTIO; } else if (isUefiEnabled && org.apache.commons.lang3.StringUtils.startsWithAny(platformEmulator, "Windows", "Other")) { return DiskDef.DiskBus.SATA; + } else if (_guestCpuArch != null && _guestCpuArch.equals("aarch64")) { + return DiskDef.DiskBus.SCSI; } else { return DiskDef.DiskBus.IDE; } diff --git a/plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java b/plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java index c744299b345..4106cc05799 100644 --- a/plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java +++ b/plugins/hypervisors/kvm/src/test/java/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java @@ -420,7 +420,7 @@ public class LibvirtComputingResourceTest { public void testCreateDevicesWithSCSIDisk() { VirtualMachineTO to = createDefaultVM(false); to.setDetails(new HashMap<>()); - libvirtComputingResourceSpy._guestCpuArch = "aarch64"; + to.setPlatformEmulator("Other PV Virtio-SCSI"); GuestDef guest = new GuestDef(); guest.setGuestType(GuestType.KVM); From d13057ace593eedaf66cc2a5299e04a29e18513f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 30 Dec 2021 15:20:37 +0530 Subject: [PATCH 04/14] ui: show tags only for supported resources (#5798) * ui: prevent incorrect tags displa for primary storage Tags in info card of the UI are related to tags functionality(create/delete/lsitTags API) UI was incorrectly showing storage tags as these tags in the UI. Signed-off-by: Abhishek Kumar * remove logging Signed-off-by: Abhishek Kumar * ui: show tags only for supported resources Signed-off-by: Abhishek Kumar --- ui/src/components/view/InfoCard.vue | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index fadead44684..6347c4c3a89 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -651,7 +651,7 @@ - @@ -97,5 +100,25 @@ export default { margin-bottom: 1rem; } } + + &-footer { + display: flex; + flex-direction: column; + position: absolute; + bottom: 20px; + text-align: center; + width: 100%; + + @media (max-height: 600px) { + position: relative; + margin-top: 50px; + } + + label { + width: 368px; + font-weight: 500; + margin: 0 auto; + } + } } From eb04a465413b41c96111f9608684c7143ce62b55 Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 30 Dec 2021 17:54:17 +0700 Subject: [PATCH 11/14] ui: Add clear all notification button (#5549) * add clear all notification button * change position set count notify * get notification count * set label transliteration * add margin for notification * change position of clear notification button --- ui/public/locales/en.json | 1 + ui/src/components/header/UserMenu.vue | 13 +++- ui/src/components/page/GlobalLayout.vue | 20 +++++- ui/src/components/view/DetailSettings.vue | 3 +- ui/src/components/view/ListView.vue | 3 +- ui/src/components/view/ResourceLimitTab.vue | 3 +- ui/src/components/view/SettingsTab.vue | 3 +- ui/src/components/view/UploadResourceIcon.vue | 12 ++-- ui/src/config/section/compute.js | 6 +- ui/src/layouts/UserLayout.vue | 22 ++++++- ui/src/permission.js | 11 +++- ui/src/store/getters.js | 3 +- ui/src/store/modules/user.js | 6 +- ui/src/style/dark-mode.less | 4 ++ ui/src/style/vars.less | 7 +++ ui/src/utils/plugins.js | 62 ++++++++++++++++++- ui/src/utils/request.js | 57 +++++++++++++++-- ui/src/views/AutogenView.vue | 3 +- ui/src/views/compute/AssignInstance.vue | 3 +- ui/src/views/compute/ChangeAffinity.vue | 3 +- ui/src/views/compute/CreateSSHKeyPair.vue | 3 +- ui/src/views/compute/CreateSnapshotWizard.vue | 3 +- ui/src/views/compute/DeployVM.vue | 24 ++++--- ui/src/views/compute/KubernetesServiceTab.vue | 3 +- ui/src/views/compute/MigrateWizard.vue | 3 +- ui/src/views/compute/ScaleVM.vue | 3 +- ui/src/views/compute/StartVirtualMachine.vue | 9 ++- .../views/compute/backup/BackupSchedule.vue | 3 +- ui/src/views/compute/backup/FormSchedule.vue | 3 +- ui/src/views/iam/AddAccount.vue | 15 +++-- ui/src/views/iam/AddLdapAccount.vue | 6 +- ui/src/views/iam/AddUser.vue | 18 ++++-- ui/src/views/iam/ChangeUserPassword.vue | 3 +- ui/src/views/iam/ConfigureSamlSsoAuth.vue | 6 +- ui/src/views/iam/CreateRole.vue | 3 +- ui/src/views/iam/DomainActionForm.vue | 6 +- ui/src/views/iam/DomainView.vue | 3 +- ui/src/views/iam/EditUser.vue | 6 +- ui/src/views/iam/ImportRole.vue | 6 +- ui/src/views/image/IsoZones.vue | 3 +- ui/src/views/image/RegisterOrUploadIso.vue | 15 +++-- .../views/image/RegisterOrUploadTemplate.vue | 12 ++-- ui/src/views/image/TemplateZones.vue | 3 +- .../image/UpdateTemplateIsoPermissions.vue | 3 +- ui/src/views/infra/AddPrimaryStorage.vue | 3 +- ui/src/views/infra/AddSecondaryStorage.vue | 3 +- ui/src/views/infra/ClusterAdd.vue | 9 ++- ui/src/views/infra/HostAdd.vue | 6 +- ui/src/views/infra/InfraSummary.vue | 6 +- ui/src/views/infra/MigrateData.vue | 6 +- ui/src/views/infra/PodAdd.vue | 6 +- .../views/infra/network/DedicatedVLANTab.vue | 3 +- .../views/infra/network/EditTrafficLabel.vue | 3 +- .../views/infra/network/IpRangesTabPublic.vue | 15 +++-- .../infra/network/ServiceProvidersTab.vue | 6 +- .../network/providers/AddF5LoadBalancer.vue | 3 +- .../providers/AddNetscalerLoadBalancer.vue | 3 +- .../network/providers/AddNiciraNvpDevice.vue | 3 +- .../network/providers/AddPaloAltoFirewall.vue | 3 +- .../network/providers/AddSrxFirewall.vue | 3 +- .../infra/network/providers/ProviderItem.vue | 3 +- .../network/providers/ProviderListView.vue | 6 +- .../views/infra/zone/ZoneWizardLaunchZone.vue | 3 +- ui/src/views/network/AclListRulesTab.vue | 3 +- .../network/CreateIsolatedNetworkForm.vue | 3 +- ui/src/views/network/CreateL2NetworkForm.vue | 3 +- .../views/network/CreateSharedNetworkForm.vue | 6 +- ui/src/views/network/CreateVlanIpRange.vue | 6 +- .../views/network/InternalLBAssignVmForm.vue | 3 +- ui/src/views/network/IpAddressesTab.vue | 6 +- ui/src/views/network/VpcTiersTab.vue | 3 +- ui/src/views/network/VpnDetails.vue | 3 +- .../views/offering/UpdateOfferingAccess.vue | 3 +- .../plugins/quota/EditTariffValueWizard.vue | 3 +- ui/src/views/project/iam/ProjectRoleTab.vue | 9 ++- ui/src/views/storage/FormSchedule.vue | 3 +- ui/src/views/storage/ResizeVolume.vue | 3 +- ui/src/views/storage/ScheduledSnapshots.vue | 3 +- ui/src/views/storage/UploadLocalVolume.vue | 9 ++- .../views/tools/ImportUnmanagedInstance.vue | 21 ++++--- ui/tests/unit/views/AutogenView.spec.js | 36 +++++------ .../unit/views/compute/MigrateWizard.spec.js | 9 ++- 82 files changed, 467 insertions(+), 168 deletions(-) diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 5ec55093da4..135630e8167 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -577,6 +577,7 @@ "label.cks.cluster.size": "Cluster size (Worker nodes)", "label.cleanup": "Clean up", "label.clear": "Clear", +"label.clear.notification": "Clear notification", "label.clear.list": "Clear list", "label.close": "Close", "label.cloud.console": "Cloud Management Console", diff --git a/ui/src/components/header/UserMenu.vue b/ui/src/components/header/UserMenu.vue index 782fab45c56..24b63ead5d4 100644 --- a/ui/src/components/header/UserMenu.vue +++ b/ui/src/components/header/UserMenu.vue @@ -84,7 +84,8 @@ export default { }, data () { return { - image: '' + image: '', + countNotify: 0 } }, created () { @@ -92,6 +93,12 @@ export default { eventBus.$on('refresh-header', () => { this.getIcon() }) + this.$store.watch( + (state, getters) => getters.countNotify, + (newValue, oldValue) => { + this.countNotify = newValue + } + ) }, watch: { image () { @@ -137,6 +144,10 @@ export default { description: err.message }) }) + }, + clearAllNotify () { + this.$store.commit('SET_COUNT_NOTIFY', 0) + this.$notification.destroy() } } } diff --git a/ui/src/components/page/GlobalLayout.vue b/ui/src/components/page/GlobalLayout.vue index 3eac55a109c..87c5ef8ebfb 100644 --- a/ui/src/components/page/GlobalLayout.vue +++ b/ui/src/components/page/GlobalLayout.vue @@ -91,6 +91,13 @@ /> + {{ $t('label.clear.notification') }} + @@ -128,7 +135,8 @@ export default { return { collapsed: false, menus: [], - showSetting: false + showSetting: false, + showClear: false } }, computed: { @@ -161,6 +169,12 @@ export default { } else { document.body.classList.remove('dark-mode') } + }, + '$store.getters.countNotify' (countNotify) { + this.showClear = false + if (countNotify && countNotify > 0) { + this.showClear = true + } } }, provide: function () { @@ -212,6 +226,10 @@ export default { }, toggleSetting (showSetting) { this.showSetting = showSetting + }, + onClearNotification () { + this.$notification.destroy() + this.$store.commit('SET_COUNT_NOTIFY', 0) } } } diff --git a/ui/src/components/view/DetailSettings.vue b/ui/src/components/view/DetailSettings.vue index 2588c11fb2e..07f0a49cefd 100644 --- a/ui/src/components/view/DetailSettings.vue +++ b/ui/src/components/view/DetailSettings.vue @@ -219,7 +219,8 @@ export default { apiName = 'updateTemplate' } if (!(apiName in this.$store.getters.apis)) { - this.$notification.error({ + this.$showNotification({ + type: 'error', message: this.$t('error.execute.api.failed') + ' ' + apiName, description: this.$t('message.user.not.permitted.api') }) diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index 7ea3e39a13d..0918dd688f6 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -514,7 +514,8 @@ export default { json.updateconfigurationresponse.configuration && !json.updateconfigurationresponse.configuration.isdynamic && ['Admin'].includes(this.$store.getters.userInfo.roletype)) { - this.$notification.warning({ + this.$showNotification({ + type: 'warning', message: this.$t('label.status'), description: this.$t('message.restart.mgmt.server') }) diff --git a/ui/src/components/view/ResourceLimitTab.vue b/ui/src/components/view/ResourceLimitTab.vue index 93cce68fd7b..2bf9619322b 100644 --- a/ui/src/components/view/ResourceLimitTab.vue +++ b/ui/src/components/view/ResourceLimitTab.vue @@ -107,7 +107,8 @@ export default { this.dataResource = await this.listResourceLimits(params) this.formLoading = false } catch (e) { - this.$notification.error({ + this.$showNotification({ + type: 'error', message: this.$t('message.request.failed'), description: e }) diff --git a/ui/src/components/view/SettingsTab.vue b/ui/src/components/view/SettingsTab.vue index 349d51691dd..4f71e1957f3 100644 --- a/ui/src/components/view/SettingsTab.vue +++ b/ui/src/components/view/SettingsTab.vue @@ -164,7 +164,8 @@ export default { }).catch(error => { console.error(error) this.$message.error(this.$t('message.error.save.setting')) - this.$notification.error({ + this.$showNotification({ + type: 'error', message: this.$t('label.error'), description: this.$t('message.error.try.save.setting') }) diff --git a/ui/src/components/view/UploadResourceIcon.vue b/ui/src/components/view/UploadResourceIcon.vue index ecf6d6668e0..cd8eb2f8902 100644 --- a/ui/src/components/view/UploadResourceIcon.vue +++ b/ui/src/components/view/UploadResourceIcon.vue @@ -234,13 +234,15 @@ export default { }).then(json => { console.log(this.resource) if (json?.uploadresourceiconresponse?.success) { - this.$notification.success({ + this.$showNotification({ + type: 'success', message: this.$t('label.upload.icon'), description: `${this.$t('message.success.upload.icon')} ${resourceType}: ` + (this.resource.name || this.resource.username || resourceid) }) } }).catch((error) => { - this.$notification.error({ + this.$showNotification({ + type: 'error', message: this.$t('label.upload.icon'), description: error?.response?.data?.uploadresourceiconresponse?.errortext || '', duration: 0 @@ -264,13 +266,15 @@ export default { resourceids: resourceid }).then(json => { if (json?.deleteresourceiconresponse?.success) { - this.$notification.success({ + this.$showNotification({ + type: 'success', message: this.$t('label.delete.icon'), description: `${this.$t('message.success.delete.icon')} ${resourceType}: ` + (this.resource.name || this.resource.username || resourceid) }) } }).catch((error) => { - this.$notification.error({ + this.$showNotification({ + type: 'error', message: this.$t('label.delete.icon'), description: error?.response?.data?.deleteresourceiconresponse?.errortext || '', duration: 0 diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 835923d9f07..416fa985082 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -152,7 +152,8 @@ export default { const vm = result.jobresult.virtualmachine || {} if (result.jobstatus === 1 && vm.password) { const name = vm.displayname || vm.name || vm.id - obj.$notification.success({ + obj.$showNotification({ + type: 'success', message: `${obj.$t('label.reinstall.vm')}: ` + name, description: `${obj.$t('label.password.reset.confirm')}: ` + vm.password, duration: 0 @@ -361,7 +362,8 @@ export default { const vm = result.jobresult.virtualmachine || {} if (result.jobstatus === 1 && vm.password) { const name = vm.displayname || vm.name || vm.id - obj.$notification.success({ + obj.$showNotification({ + type: 'success', message: `${obj.$t('label.reset.ssh.key.pair.on.vm')}: ` + name, description: `${obj.$t('label.password.reset.confirm')}: ` + vm.password, duration: 0 diff --git a/ui/src/layouts/UserLayout.vue b/ui/src/layouts/UserLayout.vue index 97faff1b446..782291d21d2 100644 --- a/ui/src/layouts/UserLayout.vue +++ b/ui/src/layouts/UserLayout.vue @@ -17,6 +17,12 @@