From 45e68005013938ba5d62ade51027499c3ecaeb8a Mon Sep 17 00:00:00 2001 From: Pearl Dsilva Date: Thu, 18 Mar 2021 13:11:32 +0530 Subject: [PATCH 1/5] ui: Fix route to ISO From VM's Info Card / Detail View (#4839) * ui: Correct route to ISO on Info Card * Change label based on template/iso Co-authored-by: Pearl Dsilva --- ui/src/components/view/InfoCard.vue | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ui/src/components/view/InfoCard.vue b/ui/src/components/view/InfoCard.vue index 2229f8ee976..a1d87da07a6 100644 --- a/ui/src/components/view/InfoCard.vue +++ b/ui/src/components/view/InfoCard.vue @@ -395,10 +395,15 @@
-
{{ $t('label.templatename') }}
+
{{ resource.isoid ? $t('label.iso') : $t('label.templatename') }}
- {{ resource.templatename || resource.templateid }} +
+ {{ resource.isoname || resource.isoid }} +
+
+ {{ resource.templatename || resource.templateid }} +
From b658cf12d0bb15e5ef468b727d15e3a1194a10af Mon Sep 17 00:00:00 2001 From: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> Date: Thu, 18 Mar 2021 13:13:08 +0530 Subject: [PATCH 2/5] ui: Added info / tooltip for add role and import role dialogs in the UI (#4836) --- .../api/command/admin/acl/CreateRoleCmd.java | 2 +- ui/public/locales/en.json | 2 + ui/src/views/iam/CreateRole.vue | 40 ++++++++++++++++--- ui/src/views/iam/ImportRole.vue | 40 ++++++++++++++++--- 4 files changed, 73 insertions(+), 11 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java b/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java index 82cdcbd1d41..e4ff3e3666c 100644 --- a/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/command/admin/acl/CreateRoleCmd.java @@ -42,7 +42,7 @@ public class CreateRoleCmd extends RoleCmd { ///////////////////////////////////////////////////// @Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, - description = "creates a role with this unique name", validations = {ApiArgValidator.NotNullOrEmpty}) + description = "Creates a role with this unique name", validations = {ApiArgValidator.NotNullOrEmpty}) private String roleName; @Parameter(name = ApiConstants.ROLE_ID, type = CommandType.UUID, entityType = RoleResponse.class, diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 88b236ceb18..a00357755a1 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -479,6 +479,7 @@ "label.baremetalmac": "Host MAC", "label.baremetalmemory": "Memory (in MB)", "label.based.on": "Based on", +"label.based.on.role.id.or.type": "Creates a role based on either role id or type", "label.basic": "Basic", "label.basic.mode": "Basic Mode", "label.basicsetup": "Basic setup", @@ -1827,6 +1828,7 @@ "label.rule.number": "Rule Number", "label.rules": "Rules", "label.rules.file": "Rules File", +"label.rules.file.to.import": "Rule defintions CSV file to import", "label.rules.file.import.description": "Click or drag rule defintions CSV file to import", "label.run.proxy.locally": "Run proxy locally", "label.running": "Running VMs", diff --git a/ui/src/views/iam/CreateRole.vue b/ui/src/views/iam/CreateRole.vue index 38156f84d48..6e4bb35f83c 100644 --- a/ui/src/views/iam/CreateRole.vue +++ b/ui/src/views/iam/CreateRole.vue @@ -22,7 +22,13 @@ :form="form" @submit="handleSubmit" layout="vertical"> - + + + {{ $t('label.name') }} + + + + - + + + {{ $t('label.description') }} + + + + - + + + {{ $t('label.based.on') }} + + + + + + + {{ $t('label.type') }} + + + + + + + {{ $t('label.role') }} + + + + - + + + {{ $t('label.rules.file') }} + + + + - + + + {{ $t('label.name') }} + + + + - + + + {{ $t('label.description') }} + + + + - + + + {{ $t('label.type') }} + + + + + + + {{ $t('label.forced') }} + + + + - {{ networkOffering.name }} + {{ networkOffering.displaytext || networkOffering.name || networkOffering.description }} diff --git a/ui/src/views/network/CreateIsolatedNetworkForm.vue b/ui/src/views/network/CreateIsolatedNetworkForm.vue index b40c241b5c1..136e1a59867 100644 --- a/ui/src/views/network/CreateIsolatedNetworkForm.vue +++ b/ui/src/views/network/CreateIsolatedNetworkForm.vue @@ -125,7 +125,7 @@ :placeholder="this.$t('label.networkofferingid')" @change="val => { this.handleNetworkOfferingChange(this.networkOfferings[val]) }"> - {{ opt.name || opt.description }} + {{ opt.displaytext || opt.name || opt.description }} diff --git a/ui/src/views/network/CreateL2NetworkForm.vue b/ui/src/views/network/CreateL2NetworkForm.vue index b21bce0b1f8..9d48a80186f 100644 --- a/ui/src/views/network/CreateL2NetworkForm.vue +++ b/ui/src/views/network/CreateL2NetworkForm.vue @@ -125,7 +125,7 @@ :placeholder="this.$t('label.networkofferingid')" @change="val => { this.handleNetworkOfferingChange(this.networkOfferings[val]) }"> - {{ opt.name || opt.description }} + {{ opt.displaytext || opt.name || opt.description }} diff --git a/ui/src/views/network/CreateNetwork.vue b/ui/src/views/network/CreateNetwork.vue index 0c62041ec34..29a1c151379 100644 --- a/ui/src/views/network/CreateNetwork.vue +++ b/ui/src/views/network/CreateNetwork.vue @@ -74,11 +74,6 @@ export default { actionZoneLoading: false } }, - watch: { - resource (newItem, oldItem) { - this.fetchData() - } - }, created () { const promises = [] promises.push(this.fetchActionZoneData()) @@ -113,7 +108,6 @@ export default { }) }, handleRefresh () { - this.fetchData() }, refreshParent () { this.$emit('refresh-data') diff --git a/ui/src/views/network/CreateSharedNetworkForm.vue b/ui/src/views/network/CreateSharedNetworkForm.vue index e91a5631c4a..9b020c18c5c 100644 --- a/ui/src/views/network/CreateSharedNetworkForm.vue +++ b/ui/src/views/network/CreateSharedNetworkForm.vue @@ -284,7 +284,7 @@ :placeholder="this.$t('label.networkofferingid')" @change="val => { this.handleNetworkOfferingChange(this.networkOfferings[val]) }"> - {{ opt.name || opt.description }} + {{ opt.displaytext || opt.name || opt.description }} diff --git a/ui/src/views/network/VpcTiersTab.vue b/ui/src/views/network/VpcTiersTab.vue index ae67a8f87a2..08a4533d2bb 100644 --- a/ui/src/views/network/VpcTiersTab.vue +++ b/ui/src/views/network/VpcTiersTab.vue @@ -170,7 +170,7 @@ - {{ item.name }} + {{ item.displaytext || item.name || item.description }} From 6836a94b0ef913471e0911d6486419d94fc642bf Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 18 Mar 2021 14:43:31 +0700 Subject: [PATCH 4/5] ui: create a new component and display the instance group as autocomplete (#4820) --- ui/src/config/section/compute.js | 5 +- ui/src/views/compute/EditVM.vue | 231 +++++++++++++++++++++++++++++++ 2 files changed, 234 insertions(+), 2 deletions(-) create mode 100644 ui/src/views/compute/EditVM.vue diff --git a/ui/src/config/section/compute.js b/ui/src/config/section/compute.js index 34ec9c1767b..39271c44d8a 100644 --- a/ui/src/config/section/compute.js +++ b/ui/src/config/section/compute.js @@ -87,8 +87,9 @@ export default { label: 'label.action.edit.instance', docHelp: 'adminguide/virtual_machines.html#changing-the-vm-name-os-or-group', dataView: true, - args: ['name', 'displayname', 'ostypeid', 'isdynamicallyscalable', 'haenable', 'group'], - show: (record) => { return ['Stopped'].includes(record.state) } + popup: true, + show: (record) => { return ['Stopped'].includes(record.state) }, + component: () => import('@/views/compute/EditVM.vue') }, { api: 'startVirtualMachine', diff --git a/ui/src/views/compute/EditVM.vue b/ui/src/views/compute/EditVM.vue new file mode 100644 index 00000000000..ece9061f19e --- /dev/null +++ b/ui/src/views/compute/EditVM.vue @@ -0,0 +1,231 @@ +// 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 faf27e2b390e0ee60c49562385027bf72e3097ea Mon Sep 17 00:00:00 2001 From: Hoang Nguyen Date: Thu, 18 Mar 2021 14:48:38 +0700 Subject: [PATCH 5/5] listview: goto account info instead of list account (#4767) --- ui/src/components/view/ListView.vue | 4 ++-- ui/src/config/router.js | 2 +- ui/src/views/AutogenView.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/src/components/view/ListView.vue b/ui/src/components/view/ListView.vue index 35f68b55066..1f56dc1027c 100644 --- a/ui/src/components/view/ListView.vue +++ b/ui/src/components/view/ListView.vue @@ -196,7 +196,7 @@ {{ item.account + '(' + item.user + ')' }} - {{ item.account }} + {{ item.account }} {{ item.user ? item.account + '(' + item.user + ')' : item.account }} @@ -207,7 +207,7 @@ v-if="'quota' in record && $router.resolve(`${$route.path}/${record.account}`) !== '404'" :to="{ path: `${$route.path}/${record.account}`, query: { account: record.account, domainid: record.domainid, quota: true } }">{{ text }} {{ text }} - {{ text }} + {{ text }} {{ text }} diff --git a/ui/src/config/router.js b/ui/src/config/router.js index 43a2da5b6e8..1b1ad0c2a06 100644 --- a/ui/src/config/router.js +++ b/ui/src/config/router.js @@ -131,7 +131,7 @@ function generateRouterMap (section) { map.meta.actions = section.actions map.meta.filters = section.filters map.meta.treeView = section.treeView ? section.treeView : false - map.meta.tabs = section.treeView ? section.tabs : {} + map.meta.tabs = section.tabs map.children = [{ path: '/' + section.name + '/:id', diff --git a/ui/src/views/AutogenView.vue b/ui/src/views/AutogenView.vue index ecb5c702119..0b8fa23e7f6 100644 --- a/ui/src/views/AutogenView.vue +++ b/ui/src/views/AutogenView.vue @@ -528,7 +528,7 @@ export default { this.projectView = Boolean(store.getters.project && store.getters.project.id) - if (this.$route && this.$route.params && this.$route.params.id) { + if ((this.$route && this.$route.params && this.$route.params.id) || this.$route.query.dataView) { this.dataView = true if (!refreshed) { this.resource = {}