UI Fixes: allow filtering on alertype in UI & add events tab (#8630)

This commit is contained in:
Vishesh 2024-04-04 17:21:56 +05:30 committed by GitHub
parent b8f8321f0f
commit c25264bada
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
30 changed files with 448 additions and 2 deletions

View File

@ -91,6 +91,10 @@ public interface AlertService {
return null;
}
public static Set<AlertType> getAlertTypes() {
return defaultAlertTypes;
}
@Override
public String toString() {
return String.valueOf(this.getType());

View File

@ -20,6 +20,7 @@ package org.apache.cloudstack.api.command.admin.acl.project;
import org.apache.cloudstack.acl.ProjectRole;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -70,4 +71,13 @@ public class CreateProjectRoleCmd extends ProjectRoleCmd {
return Account.ACCOUNT_ID_SYSTEM;
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -22,6 +22,7 @@ import org.apache.cloudstack.acl.ProjectRolePermission;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.Parameter;
@ -96,4 +97,14 @@ public class CreateProjectRolePermissionCmd extends BaseRolePermissionCmd {
response.setObjectName("projectrolepermission");
setResponseObject(response);
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -21,6 +21,7 @@ import org.apache.cloudstack.acl.ProjectRole;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -79,4 +80,14 @@ public class DeleteProjectRoleCmd extends BaseCmd {
public long getEntityOwnerId() {
return CallContext.current().getCallingAccountId();
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -21,6 +21,7 @@ import org.apache.cloudstack.acl.ProjectRolePermission;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -80,4 +81,14 @@ public class DeleteProjectRolePermissionCmd extends BaseCmd {
public long getEntityOwnerId() {
return CallContext.current().getCallingAccountId();
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -21,6 +21,7 @@ import org.apache.cloudstack.acl.ProjectRole;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -76,4 +77,14 @@ public class UpdateProjectRoleCmd extends ProjectRoleCmd {
public long getEntityOwnerId() {
return 0;
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -26,6 +26,7 @@ import org.apache.cloudstack.acl.ProjectRolePermission;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -154,4 +155,14 @@ public class UpdateProjectRolePermissionCmd extends BaseCmd {
public long getEntityOwnerId() {
return CallContext.current().getCallingAccountId();
}
@Override
public Long getApiResourceId() {
return getProjectId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Project;
}
}

View File

@ -26,6 +26,7 @@ import com.cloud.host.Host;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -102,4 +103,14 @@ public class ChangeOutOfBandManagementPasswordCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "change out-of-band management password for host: " + getHostId();
}
@Override
public Long getApiResourceId() {
return getHostId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Host;
}
}

View File

@ -26,6 +26,7 @@ import com.google.common.collect.ImmutableMap;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseCmd;
@ -112,4 +113,14 @@ public class ConfigureOutOfBandManagementCmd extends BaseCmd {
builder.put(option, value);
}
}
@Override
public Long getApiResourceId() {
return getHostId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Host;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.org.Cluster;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -94,4 +95,14 @@ public class DisableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "disable out-of-band management password for cluster: " + getClusterId();
}
@Override
public Long getApiResourceId() {
return getClusterId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Cluster;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.host.Host;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -95,4 +96,14 @@ public class DisableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "disable out-of-band management password for host: " + getHostId();
}
@Override
public Long getApiResourceId() {
return getHostId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Host;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.exception.ResourceUnavailableException;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -94,4 +95,14 @@ public class DisableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "disable out-of-band management password for zone: " + getZoneId();
}
@Override
public Long getApiResourceId() {
return getZoneId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Zone;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.org.Cluster;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -94,4 +95,14 @@ public class EnableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "enable out-of-band management password for cluster: " + getClusterId();
}
@Override
public Long getApiResourceId() {
return getClusterId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Cluster;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.host.Host;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -95,4 +96,14 @@ public class EnableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "enable out-of-band management password for host: " + getHostId();
}
@Override
public Long getApiResourceId() {
return getHostId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Host;
}
}

View File

@ -27,6 +27,7 @@ import com.cloud.exception.ResourceUnavailableException;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiArgValidator;
import org.apache.cloudstack.api.ApiCommandResourceType;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.ApiErrorCode;
import org.apache.cloudstack.api.BaseAsyncCmd;
@ -94,4 +95,14 @@ public class EnableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
public String getEventDescription() {
return "enable out-of-band management password for zone: " + getZoneId();
}
@Override
public Long getApiResourceId() {
return getZoneId();
}
@Override
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Zone;
}
}

View File

@ -114,4 +114,9 @@ public class IssueOutOfBandManagementPowerActionCmd extends BaseAsyncCmd {
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.Host;
}
@Override
public Long getApiResourceId() {
return getHostId();
}
}

View File

@ -0,0 +1,54 @@
// 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.
package org.apache.cloudstack.api.command.admin.resource;
import com.cloud.user.Account;
import org.apache.cloudstack.alert.AlertService;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.BaseCmd;
import org.apache.cloudstack.api.response.AlertResponse;
import org.apache.cloudstack.api.response.AlertTypeResponse;
import org.apache.cloudstack.api.response.ListResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
@APICommand(name = "listAlertTypes", description = "Lists all alerts types", responseObject = AlertResponse.class,
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ListAlertTypesCmd extends BaseCmd {
@Override
public long getEntityOwnerId() {
return Account.ACCOUNT_ID_SYSTEM;
}
@Override
public void execute() {
Set<AlertService.AlertType> result = AlertService.AlertType.getAlertTypes();
ListResponse<AlertTypeResponse> response = new ListResponse<>();
List<AlertTypeResponse> typeResponseList = new ArrayList<>();
for (AlertService.AlertType alertType : result) {
AlertTypeResponse alertResponse = new AlertTypeResponse(alertType.getType(), alertType.getName());
alertResponse.setObjectName("alerttype");
typeResponseList.add(alertResponse);
}
response.setResponses(typeResponseList, result.size());
response.setResponseName(getCommandName());
this.setResponseObject(response);
}
}

View File

@ -138,4 +138,10 @@ public class CreateVMSnapshotCmd extends BaseAsyncCreateCmd {
public ApiCommandResourceType getApiResourceType() {
return ApiCommandResourceType.VmSnapshot;
}
@Override
public Long getApiResourceId() {
return getEntityId();
}
}

View File

@ -0,0 +1,55 @@
// 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.
package org.apache.cloudstack.api.response;
import com.cloud.serializer.Param;
import com.google.gson.annotations.SerializedName;
import org.apache.cloudstack.api.ApiConstants;
import org.apache.cloudstack.api.BaseResponse;
public class AlertTypeResponse extends BaseResponse {
@SerializedName("alerttypeid")
@Param(description = "alert type")
private short alertType;
@SerializedName(ApiConstants.NAME)
@Param(description = "description of alert type")
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public short getUsageType() {
return alertType;
}
public void setUsageType(short alertType) {
this.alertType = alertType;
}
public AlertTypeResponse(short alertType, String name) {
this.alertType = alertType;
this.name = name;
setObjectName("alerttype");
}
}

View File

@ -185,6 +185,7 @@ import org.apache.cloudstack.api.command.admin.region.UpdateRegionCmd;
import org.apache.cloudstack.api.command.admin.resource.ArchiveAlertsCmd;
import org.apache.cloudstack.api.command.admin.resource.CleanVMReservationsCmd;
import org.apache.cloudstack.api.command.admin.resource.DeleteAlertsCmd;
import org.apache.cloudstack.api.command.admin.resource.ListAlertTypesCmd;
import org.apache.cloudstack.api.command.admin.resource.ListAlertsCmd;
import org.apache.cloudstack.api.command.admin.resource.ListCapacityCmd;
import org.apache.cloudstack.api.command.admin.resource.StartRollingMaintenanceCmd;
@ -3468,6 +3469,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
cmdList.add(RemoveRegionCmd.class);
cmdList.add(UpdateRegionCmd.class);
cmdList.add(ListAlertsCmd.class);
cmdList.add(ListAlertTypesCmd.class);
cmdList.add(ListCapacityCmd.class);
cmdList.add(UpdatePodManagementNetworkIpRangeCmd.class);
cmdList.add(UploadCustomCertificateCmd.class);

View File

@ -186,7 +186,8 @@ export default {
inputKey: null,
inputValue: null,
fieldValues: {},
isFiltered: false
isFiltered: false,
alertTypes: []
}
},
created () {
@ -347,6 +348,7 @@ export default {
},
async fetchDynamicFieldData (arrayField, searchKeyword) {
const promises = []
let typeIndex = -1
let zoneIndex = -1
let domainIndex = -1
let imageStoreIndex = -1
@ -355,6 +357,14 @@ export default {
let clusterIndex = -1
let groupIndex = -1
if (arrayField.includes('type')) {
if (this.$route.path === '/alert') {
typeIndex = this.fields.findIndex(item => item.name === 'type')
this.fields[typeIndex].loading = true
promises.push(await this.fetchAlertTypes())
}
}
if (arrayField.includes('zoneid')) {
zoneIndex = this.fields.findIndex(item => item.name === 'zoneid')
this.fields[zoneIndex].loading = true
@ -398,6 +408,12 @@ export default {
}
Promise.all(promises).then(response => {
if (typeIndex > -1) {
const types = response.filter(item => item.type === 'type')
if (types && types.length > 0) {
this.fields[typeIndex].opts = this.sortArray(types[0].data)
}
}
if (zoneIndex > -1) {
const zones = response.filter(item => item.type === 'zoneid')
if (zones && zones.length > 0) {
@ -441,6 +457,9 @@ export default {
}
}
}).finally(() => {
if (typeIndex > -1) {
this.fields[typeIndex].loading = false
}
if (zoneIndex > -1) {
this.fields[zoneIndex].loading = false
}
@ -585,6 +604,29 @@ export default {
})
})
},
fetchAlertTypes () {
if (this.alertTypes.length > 0) {
return new Promise((resolve, reject) => {
resolve({
type: 'type',
data: this.alertTypes
})
})
} else {
return new Promise((resolve, reject) => {
api('listAlertTypes').then(json => {
const alerttypes = json.listalerttypesresponse.alerttype.map(a => { return { id: a.alerttypeid, name: a.name } })
this.alertTypes = alerttypes
resolve({
type: 'type',
data: alerttypes
})
}).catch(error => {
reject(error.response.headers['x-description'])
})
})
}
},
fetchGuestNetworkTypes () {
const types = []
if (this.apiName.indexOf('listNetworks') > -1) {

View File

@ -483,6 +483,12 @@ export default {
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'VmSnapshot',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))
@ -990,6 +996,18 @@ export default {
title: 'label.instances',
param: 'affinitygroupid'
}],
tabs: [
{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'AffinityGroup',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}
],
actions: [
{
api: 'createAffinityGroup',

View File

@ -79,6 +79,7 @@ export default {
permission: ['listAlerts'],
columns: ['name', 'description', 'type', 'sent'],
details: ['name', 'id', 'type', 'sent', 'description'],
searchFilters: ['type'],
actions: [
{
api: 'archiveAlerts',

View File

@ -44,6 +44,11 @@ export default {
tabs: [{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
}, {
name: 'events',
resourceType: 'Host',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}, {
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))

View File

@ -16,6 +16,8 @@
// under the License.
import { shallowRef, defineAsyncComponent } from 'vue'
import store from '@/store'
export default {
name: 'ilbvm',
title: 'label.internal.lb',
@ -25,6 +27,15 @@ export default {
params: { projectid: '-1' },
columns: ['name', 'state', 'publicip', 'guestnetworkname', 'vpcname', 'version', 'softwareversion', 'hostname', 'account', 'zonename', 'requiresupgrade'],
details: ['name', 'id', 'version', 'softwareversion', 'requiresupgrade', 'guestnetworkname', 'vpcname', 'publicip', 'guestipaddress', 'linklocalip', 'serviceofferingname', 'networkdomain', 'isredundantrouter', 'redundantstate', 'hostname', 'account', 'zonename', 'created', 'hostcontrolstate'],
tabs: [{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
}, {
name: 'events',
resourceType: 'InternalLbVm',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}],
actions: [
{
api: 'startInternalLoadBalancerVM',

View File

@ -1046,6 +1046,11 @@ export default {
name: 'loadbalancerinstance',
component: shallowRef(defineAsyncComponent(() => import('@/views/network/InternalLBAssignedVmTab.vue'))),
show: () => true
}, {
name: 'events',
resourceType: 'LoadBalancerRule',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}],
actions: [
{
@ -1162,6 +1167,12 @@ export default {
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'VpnCustomerGateway',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue')))

View File

@ -56,6 +56,12 @@ export default {
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'ServiceOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
@ -130,6 +136,24 @@ export default {
columns: ['name', 'state', 'systemvmtype', 'cpunumber', 'cpuspeed', 'memory', 'storagetype', 'order'],
filters: ['active', 'inactive'],
details: ['name', 'id', 'displaytext', 'systemvmtype', 'provisioningtype', 'storagetype', 'iscustomized', 'limitcpuuse', 'cpunumber', 'cpuspeed', 'memory', 'storagetags', 'hosttags', 'tags', 'domain', 'zone', 'created', 'dynamicscalingenabled', 'diskofferingstrictness'],
resourceType: 'ServiceOffering',
tabs: [
{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'ServiceOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
show: (record, route, user) => { return ['Admin', 'DomainAdmin'].includes(user.roletype) }
}
],
actions: [{
api: 'createServiceOffering',
icon: 'plus-outlined',
@ -207,6 +231,12 @@ export default {
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'DiskOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
@ -284,6 +314,18 @@ export default {
title: 'label.instances',
param: 'backupofferingid'
}],
tabs: [
{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'BackupOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}
],
actions: [{
api: 'importBackupOffering',
icon: 'plus-outlined',
@ -326,6 +368,12 @@ export default {
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'NetworkOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
},
{
name: 'comments',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/AnnotationsTab.vue'))),
@ -418,6 +466,18 @@ export default {
title: 'label.vpc',
param: 'vpcofferingid'
}],
tabs: [
{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'VpcOffering',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}
],
actions: [{
api: 'createVPCOffering',
icon: 'plus-outlined',

View File

@ -16,6 +16,8 @@
// under the License.
import { shallowRef, defineAsyncComponent } from 'vue'
import store from '@/store'
export default {
name: 'role',
title: 'label.roles',
@ -30,6 +32,11 @@ export default {
}, {
name: 'rules',
component: shallowRef(defineAsyncComponent(() => import('@/views/iam/RolePermissionTab.vue')))
}, {
name: 'events',
resourceType: 'Role',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in store.getters.apis }
}],
actions: [
{

View File

@ -25,7 +25,7 @@ export default {
docHelp: 'adminguide/accounts.html#users',
hidden: true,
permission: ['listUsers'],
columns: ['username', 'state', 'firstname', 'lastname', 'email', 'account'],
columns: ['username', 'state', 'firstname', 'lastname', 'email', 'account', 'domain'],
details: ['username', 'id', 'firstname', 'lastname', 'email', 'usersource', 'timezone', 'rolename', 'roletype', 'is2faenabled', 'account', 'domain', 'created'],
tabs: [
{

View File

@ -66,10 +66,22 @@ export default {
tabs: [{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'IpAddress',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in this.$store.getters.apis }
}],
defaultTabs: [{
name: 'details',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/DetailsTab.vue')))
},
{
name: 'events',
resourceType: 'IpAddress',
component: shallowRef(defineAsyncComponent(() => import('@/components/view/EventsTab.vue'))),
show: () => { return 'listEvents' in this.$store.getters.apis }
}],
activeTab: ''
}