mirror of
				https://github.com/apache/cloudstack.git
				synced 2025-11-04 00:02:37 +01:00 
			
		
		
		
	api/ui: add specifyvlan to network response (#10236)
This commit is contained in:
		
							parent
							
								
									ee0dc5b2d6
								
							
						
					
					
						commit
						0f544c9a3b
					
				@ -187,6 +187,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
 | 
			
		||||
    @Param(description = "true network requires restart")
 | 
			
		||||
    private Boolean restartRequired;
 | 
			
		||||
 | 
			
		||||
    @SerializedName(ApiConstants.SPECIFY_VLAN)
 | 
			
		||||
    @Param(description = "true if network supports specifying vlan, false otherwise")
 | 
			
		||||
    private Boolean specifyVlan;
 | 
			
		||||
 | 
			
		||||
    @SerializedName(ApiConstants.SPECIFY_IP_RANGES)
 | 
			
		||||
    @Param(description = "true if network supports specifying ip ranges, false otherwise")
 | 
			
		||||
    private Boolean specifyIpRanges;
 | 
			
		||||
@ -487,6 +491,10 @@ public class NetworkResponse extends BaseResponseWithAssociatedNetwork implement
 | 
			
		||||
        this.restartRequired = restartRequired;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSpecifyVlan(Boolean specifyVlan) {
 | 
			
		||||
        this.specifyVlan = specifyVlan;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setSpecifyIpRanges(Boolean specifyIpRanges) {
 | 
			
		||||
        this.specifyIpRanges = specifyIpRanges;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@ -2504,6 +2504,7 @@ public class ApiResponseHelper implements ResponseGenerator {
 | 
			
		||||
            response.setIsSystem(networkOffering.isSystemOnly());
 | 
			
		||||
            response.setNetworkOfferingAvailability(networkOffering.getAvailability().toString());
 | 
			
		||||
            response.setIsPersistent(networkOffering.isPersistent());
 | 
			
		||||
            response.setSpecifyVlan(networkOffering.isSpecifyVlan());
 | 
			
		||||
            if (Network.GuestType.Isolated.equals(network.getGuestType()) && network.getVpcId() == null) {
 | 
			
		||||
                response.setEgressDefaultPolicy(networkOffering.isEgressDefaultPolicy());
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
@ -141,7 +141,8 @@ export default {
 | 
			
		||||
          label: 'label.update.network',
 | 
			
		||||
          dataView: true,
 | 
			
		||||
          disabled: (record, user) => {
 | 
			
		||||
            return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))
 | 
			
		||||
            return (!record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))) ||
 | 
			
		||||
              (record.type === 'Shared' && record.specifyvlan && !['Admin'].includes(user.userInfo.roletype))
 | 
			
		||||
          },
 | 
			
		||||
          popup: true,
 | 
			
		||||
          component: shallowRef(defineAsyncComponent(() => import('@/views/network/UpdateNetwork.vue')))
 | 
			
		||||
@ -153,7 +154,8 @@ export default {
 | 
			
		||||
          message: 'message.restart.network',
 | 
			
		||||
          dataView: true,
 | 
			
		||||
          disabled: (record, user) => {
 | 
			
		||||
            return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))
 | 
			
		||||
            return (!record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))) ||
 | 
			
		||||
              (record.type === 'Shared' && record.specifyvlan && !['Admin'].includes(user.userInfo.roletype))
 | 
			
		||||
          },
 | 
			
		||||
          args: (record, store, isGroupAction) => {
 | 
			
		||||
            var fields = []
 | 
			
		||||
@ -194,7 +196,8 @@ export default {
 | 
			
		||||
          message: 'message.action.delete.network',
 | 
			
		||||
          dataView: true,
 | 
			
		||||
          disabled: (record, user) => {
 | 
			
		||||
            return !record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))
 | 
			
		||||
            return (!record.projectid && (record.account !== user.userInfo.account && !['Admin', 'DomainAdmin'].includes(user.userInfo.roletype))) ||
 | 
			
		||||
              (record.type === 'Shared' && record.specifyvlan && !['Admin'].includes(user.userInfo.roletype))
 | 
			
		||||
          },
 | 
			
		||||
          groupAction: true,
 | 
			
		||||
          popup: true,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user