mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
ui: show zones and offerings to users (#7557)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
This commit is contained in:
parent
5e71cea2c5
commit
2b3e2e48a0
@ -1 +1 @@
|
|||||||
CS_URL=http://primate-qa.cloudstack.cloud:8080
|
CS_URL=https://qa.cloudstack.cloud/
|
||||||
|
|||||||
@ -26,7 +26,7 @@
|
|||||||
@click="showUploadModal(true)"
|
@click="showUploadModal(true)"
|
||||||
v-clipboard:copy="name" >
|
v-clipboard:copy="name" >
|
||||||
<upload-resource-icon v-if="'uploadResourceIcon' in $store.getters.apis" :visible="showUpload" :resource="resource" @handle-close="showUpload(false)"/>
|
<upload-resource-icon v-if="'uploadResourceIcon' in $store.getters.apis" :visible="showUpload" :resource="resource" @handle-close="showUpload(false)"/>
|
||||||
<div class="ant-upload-preview" v-if="$showIcon()">
|
<div class="ant-upload-preview" v-if="$showIcon() && !$route.path.includes('zones')">
|
||||||
<camera-outlined class="upload-icon"/>
|
<camera-outlined class="upload-icon"/>
|
||||||
</div>
|
</div>
|
||||||
<slot name="avatar">
|
<slot name="avatar">
|
||||||
|
|||||||
@ -34,6 +34,7 @@ import account from '@/config/section/account'
|
|||||||
import domain from '@/config/section/domain'
|
import domain from '@/config/section/domain'
|
||||||
import role from '@/config/section/role'
|
import role from '@/config/section/role'
|
||||||
import infra from '@/config/section/infra'
|
import infra from '@/config/section/infra'
|
||||||
|
import zone from '@/config/section/zone'
|
||||||
import offering from '@/config/section/offering'
|
import offering from '@/config/section/offering'
|
||||||
import config from '@/config/section/config'
|
import config from '@/config/section/config'
|
||||||
import tools from '@/config/section/tools'
|
import tools from '@/config/section/tools'
|
||||||
@ -44,7 +45,7 @@ function generateRouterMap (section) {
|
|||||||
var map = {
|
var map = {
|
||||||
name: section.name,
|
name: section.name,
|
||||||
path: '/' + section.name,
|
path: '/' + section.name,
|
||||||
hidden: section.hidden,
|
hidden: 'show' in section ? !section.show() : section.hidden,
|
||||||
meta: {
|
meta: {
|
||||||
title: section.title,
|
title: section.title,
|
||||||
icon: section.icon,
|
icon: section.icon,
|
||||||
@ -235,6 +236,7 @@ export function asyncRouterMap () {
|
|||||||
generateRouterMap(account),
|
generateRouterMap(account),
|
||||||
generateRouterMap(domain),
|
generateRouterMap(domain),
|
||||||
generateRouterMap(infra),
|
generateRouterMap(infra),
|
||||||
|
generateRouterMap(zone),
|
||||||
generateRouterMap(offering),
|
generateRouterMap(offering),
|
||||||
generateRouterMap(config),
|
generateRouterMap(config),
|
||||||
generateRouterMap(tools),
|
generateRouterMap(tools),
|
||||||
|
|||||||
@ -21,15 +21,21 @@ export default {
|
|||||||
name: 'offering',
|
name: 'offering',
|
||||||
title: 'label.menu.service.offerings',
|
title: 'label.menu.service.offerings',
|
||||||
icon: 'shopping-outlined',
|
icon: 'shopping-outlined',
|
||||||
permission: ['listServiceOfferings', 'listDiskOfferings', 'listDomains'],
|
permission: ['listServiceOfferings', 'listDiskOfferings'],
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
name: 'computeoffering',
|
name: 'computeoffering',
|
||||||
title: 'label.compute.offerings',
|
title: 'label.compute.offerings',
|
||||||
docHelp: 'adminguide/service_offerings.html#compute-and-disk-service-offerings',
|
docHelp: 'adminguide/service_offerings.html#compute-and-disk-service-offerings',
|
||||||
icon: 'cloud-outlined',
|
icon: 'cloud-outlined',
|
||||||
permission: ['listServiceOfferings', 'listDomains'],
|
permission: ['listServiceOfferings'],
|
||||||
params: { isrecursive: 'true' },
|
params: () => {
|
||||||
|
var params = {}
|
||||||
|
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
|
||||||
|
params = { isrecursive: 'true' }
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
},
|
||||||
columns: ['name', 'displaytext', 'cpunumber', 'cpuspeed', 'memory', 'domain', 'zone', 'order'],
|
columns: ['name', 'displaytext', 'cpunumber', 'cpuspeed', 'memory', 'domain', 'zone', 'order'],
|
||||||
details: () => {
|
details: () => {
|
||||||
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot']
|
var fields = ['name', 'id', 'displaytext', 'offerha', 'provisioningtype', 'storagetype', 'iscustomized', 'iscustomizediops', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'hosttags', 'tags', 'storagetags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness', 'encryptroot']
|
||||||
@ -51,7 +57,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'comments',
|
name: 'comments',
|
||||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
|
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
|
||||||
|
show: (record, route, user) => { return ['Admin', 'DomainAdmin'].includes(user.roletype) }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
related: [{
|
related: [{
|
||||||
@ -138,8 +145,14 @@ export default {
|
|||||||
title: 'label.disk.offerings',
|
title: 'label.disk.offerings',
|
||||||
icon: 'hdd-outlined',
|
icon: 'hdd-outlined',
|
||||||
docHelp: 'adminguide/service_offerings.html#compute-and-disk-service-offerings',
|
docHelp: 'adminguide/service_offerings.html#compute-and-disk-service-offerings',
|
||||||
permission: ['listDiskOfferings', 'listDomains'],
|
permission: ['listDiskOfferings'],
|
||||||
params: { isrecursive: 'true' },
|
params: () => {
|
||||||
|
var params = {}
|
||||||
|
if (['Admin', 'DomainAdmin'].includes(store.getters.userInfo.roletype)) {
|
||||||
|
params = { isrecursive: 'true' }
|
||||||
|
}
|
||||||
|
return params
|
||||||
|
},
|
||||||
columns: ['name', 'displaytext', 'disksize', 'domain', 'zone', 'order'],
|
columns: ['name', 'displaytext', 'disksize', 'domain', 'zone', 'order'],
|
||||||
details: () => {
|
details: () => {
|
||||||
var fields = ['name', 'id', 'displaytext', 'disksize', 'provisioningtype', 'storagetype', 'iscustomized', 'disksizestrictness', 'iscustomizediops', 'tags', 'domain', 'zone', 'created', 'encrypt']
|
var fields = ['name', 'id', 'displaytext', 'disksize', 'provisioningtype', 'storagetype', 'iscustomized', 'disksizestrictness', 'iscustomizediops', 'tags', 'domain', 'zone', 'created', 'encrypt']
|
||||||
@ -157,7 +170,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'comments',
|
name: 'comments',
|
||||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
|
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
|
||||||
|
show: (record, route, user) => { return ['Admin', 'DomainAdmin'].includes(user.roletype) }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
related: [{
|
related: [{
|
||||||
@ -205,7 +219,7 @@ export default {
|
|||||||
title: 'label.backup.offerings',
|
title: 'label.backup.offerings',
|
||||||
icon: 'cloud-upload-outlined',
|
icon: 'cloud-upload-outlined',
|
||||||
docHelp: 'adminguide/virtual_machines.html#backup-offerings',
|
docHelp: 'adminguide/virtual_machines.html#backup-offerings',
|
||||||
permission: ['listBackupOfferings', 'listInfrastructure'],
|
permission: ['listBackupOfferings'],
|
||||||
columns: ['name', 'description', 'zonename'],
|
columns: ['name', 'description', 'zonename'],
|
||||||
details: ['name', 'id', 'description', 'externalid', 'zone', 'allowuserdrivenbackups', 'created'],
|
details: ['name', 'id', 'description', 'externalid', 'zone', 'allowuserdrivenbackups', 'created'],
|
||||||
related: [{
|
related: [{
|
||||||
@ -246,7 +260,7 @@ export default {
|
|||||||
title: 'label.network.offerings',
|
title: 'label.network.offerings',
|
||||||
icon: 'wifi-outlined',
|
icon: 'wifi-outlined',
|
||||||
docHelp: 'adminguide/networking.html#network-offerings',
|
docHelp: 'adminguide/networking.html#network-offerings',
|
||||||
permission: ['listNetworkOfferings', 'listInfrastructure'],
|
permission: ['listNetworkOfferings'],
|
||||||
columns: ['name', 'state', 'guestiptype', 'traffictype', 'networkrate', 'domain', 'zone', 'order'],
|
columns: ['name', 'state', 'guestiptype', 'traffictype', 'networkrate', 'domain', 'zone', 'order'],
|
||||||
details: ['name', 'id', 'displaytext', 'guestiptype', 'traffictype', 'internetprotocol', 'networkrate', 'ispersistent', 'egressdefaultpolicy', 'availability', 'conservemode', 'specifyvlan', 'specifyipranges', 'supportspublicaccess', 'supportsstrechedl2subnet', 'service', 'tags', 'domain', 'zone'],
|
details: ['name', 'id', 'displaytext', 'guestiptype', 'traffictype', 'internetprotocol', 'networkrate', 'ispersistent', 'egressdefaultpolicy', 'availability', 'conservemode', 'specifyvlan', 'specifyipranges', 'supportspublicaccess', 'supportsstrechedl2subnet', 'service', 'tags', 'domain', 'zone'],
|
||||||
resourceType: 'NetworkOffering',
|
resourceType: 'NetworkOffering',
|
||||||
@ -257,7 +271,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'comments',
|
name: 'comments',
|
||||||
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
|
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
|
||||||
|
show: (record, route, user) => { return ['Admin', 'DomainAdmin'].includes(user.roletype) }
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
actions: [{
|
actions: [{
|
||||||
@ -337,7 +352,7 @@ export default {
|
|||||||
title: 'label.vpc.offerings',
|
title: 'label.vpc.offerings',
|
||||||
icon: 'deployment-unit-outlined',
|
icon: 'deployment-unit-outlined',
|
||||||
docHelp: 'plugins/nuage-plugin.html?#vpc-offerings',
|
docHelp: 'plugins/nuage-plugin.html?#vpc-offerings',
|
||||||
permission: ['listVPCOfferings', 'listInfrastructure'],
|
permission: ['listVPCOfferings'],
|
||||||
resourceType: 'VpcOffering',
|
resourceType: 'VpcOffering',
|
||||||
columns: ['name', 'state', 'displaytext', 'domain', 'zone', 'order'],
|
columns: ['name', 'state', 'displaytext', 'domain', 'zone', 'order'],
|
||||||
details: ['name', 'id', 'displaytext', 'internetprotocol', 'distributedvpcrouter', 'tags', 'service', 'domain', 'zone', 'created'],
|
details: ['name', 'id', 'displaytext', 'internetprotocol', 'distributedvpcrouter', 'tags', 'service', 'domain', 'zone', 'created'],
|
||||||
|
|||||||
45
ui/src/config/section/zone.js
Normal file
45
ui/src/config/section/zone.js
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
import { shallowRef, defineAsyncComponent } from 'vue'
|
||||||
|
import store from '@/store'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'zones',
|
||||||
|
title: 'label.zones',
|
||||||
|
icon: 'global-outlined',
|
||||||
|
permission: ['listZones'],
|
||||||
|
params: { showicon: true },
|
||||||
|
show: () => {
|
||||||
|
return ['DomainAdmin', 'User'].includes(store.getters.userInfo.roletype)
|
||||||
|
},
|
||||||
|
columns: () => {
|
||||||
|
const fields = ['name', 'allocationstate', 'type', 'networktype']
|
||||||
|
return fields
|
||||||
|
},
|
||||||
|
details: ['name', 'id', 'allocationstate', 'type', 'networktype', 'guestcidraddress', 'localstorageenabled', 'securitygroupsenabled', 'dns1', 'dns2', 'internaldns1', 'internaldns2'],
|
||||||
|
related: [{
|
||||||
|
name: 'vm',
|
||||||
|
title: 'label.vms',
|
||||||
|
param: 'zoneid'
|
||||||
|
}],
|
||||||
|
resourceType: 'Zone',
|
||||||
|
tabs: [{
|
||||||
|
name: 'details',
|
||||||
|
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
|
||||||
|
}]
|
||||||
|
}
|
||||||
@ -345,7 +345,7 @@ export const showIconPlugin = {
|
|||||||
if (resource) {
|
if (resource) {
|
||||||
resourceType = resource
|
resourceType = resource
|
||||||
}
|
}
|
||||||
if (['zone', 'template', 'iso', 'account', 'accountuser', 'vm', 'domain', 'project', 'vpc', 'guestnetwork'].includes(resourceType)) {
|
if (['zone', 'zones', 'template', 'iso', 'account', 'accountuser', 'vm', 'domain', 'project', 'vpc', 'guestnetwork'].includes(resourceType)) {
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user