Merge branch '4.16' into main

This commit is contained in:
Suresh Kumar Anaparti 2022-01-13 12:47:08 +05:30
commit 42a941cc70
No known key found for this signature in database
GPG Key ID: D7CEAE3A9E71D0AA
8 changed files with 38 additions and 11 deletions

View File

@ -2639,7 +2639,7 @@ public class NetworkOrchestrator extends ManagerBase implements NetworkOrchestra
&& !_networkModel.areServicesSupportedByNetworkOffering(ntwkOff.getId(), Service.SourceNat)));
if (cidr == null && ip6Cidr == null && cidrRequired) {
if (ntwkOff.getGuestType() == GuestType.Shared) {
throw new InvalidParameterValueException("StartIp/endIp/gateway/netmask are required when create network of" + " type " + Network.GuestType.Shared);
throw new InvalidParameterValueException(String.format("Gateway/netmask are required when creating %s networks.", Network.GuestType.Shared));
} else {
throw new InvalidParameterValueException("gateway/netmask are required when create network of" + " type " + GuestType.Isolated + " with service " + Service.SourceNat.getName() + " disabled");
}

View File

@ -1249,8 +1249,8 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
}
}
boolean ipv4 = true, ipv6 = false;
if (startIP != null) {
boolean ipv4 = false, ipv6 = false;
if (org.apache.commons.lang3.StringUtils.isNoneBlank(gateway, netmask)) {
ipv4 = true;
}
if (StringUtils.isNoneBlank(ip6Cidr, ip6Gateway)) {
@ -1294,14 +1294,10 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
} else if (!NetUtils.isValidIp4(endIP)) {
throw new InvalidParameterValueException("Invalid format for the endIp parameter");
}
}
if (startIP != null && endIP != null) {
if (!(gateway != null && netmask != null)) {
throw new InvalidParameterValueException("gateway and netmask should be defined when startIP/endIP are passed in");
}
}
if (gateway != null && netmask != null) {
if (NetUtils.isNetworkorBroadcastIP(gateway, netmask)) {
if (s_logger.isDebugEnabled()) {
@ -1335,6 +1331,10 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService, C
if(StringUtils.isAllBlank(zone.getIp6Dns1(), zone.getIp6Dns2())) {
throw new InvalidParameterValueException("Can only create IPv6 network if the zone has IPv6 DNS! Please configure the zone IPv6 DNS1 and/or IPv6 DNS2.");
}
if (!ipv4 && ntwkOff.getGuestType() == GuestType.Shared && _networkModel.isProviderForNetworkOffering(Provider.VirtualRouter, networkOfferingId)) {
throw new InvalidParameterValueException("Currently IPv6-only Shared network with Virtual Router provider is not supported.");
}
}
validateRouterIps(routerIp, routerIpv6, startIP, endIP, gateway, netmask, startIPv6, endIPv6, ip6Cidr);

View File

@ -2654,6 +2654,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
Map<String, String> customParameters = new HashMap<>();
customParameters.put(VmDetailConstants.CPU_NUMBER, String.valueOf(newCpu));
customParameters.put(VmDetailConstants.MEMORY, String.valueOf(newMemory));
customParameters.put(VmDetailConstants.CPU_SPEED, details.get(VmDetailConstants.CPU_SPEED));
validateCustomParameters(svcOffering, customParameters);
}
if (VirtualMachineManager.ResourceCountRunningVMsonly.value()) {

View File

@ -30,6 +30,7 @@ const getters = {
userInfo: state => state.user.info,
addRouters: state => state.permission.addRouters,
multiTab: state => state.app.multiTab,
listAllProjects: state => state.app.listAllProjects,
headerNotices: state => state.user.headerNotices,
isLdapEnabled: state => state.user.isLdapEnabled,
cloudian: state => state.user.cloudian,

View File

@ -46,6 +46,7 @@ const app = {
inverted: true,
multiTab: true,
metrics: false,
listAllProjects: false,
server: ''
},
mutations: {
@ -99,6 +100,9 @@ const app = {
SET_METRICS: (state, bool) => {
state.metrics = bool
},
SET_LIST_ALL_PROJECTS: (state, bool) => {
state.listAllProjects = bool
},
SET_USE_BROWSER_TIMEZONE: (state, bool) => {
Vue.ls.set(USE_BROWSER_TIMEZONE, bool)
state.usebrowsertimezone = bool
@ -151,6 +155,9 @@ const app = {
SetMetrics ({ commit }, bool) {
commit('SET_METRICS', bool)
},
SetListAllProjects ({ commit }, bool) {
commit('SET_LIST_ALL_PROJECTS', bool)
},
SetUseBrowserTimezone ({ commit }, bool) {
commit('SET_USE_BROWSER_TIMEZONE', bool)
},

View File

@ -39,6 +39,13 @@
:un-checked-children="$t('label.metrics')"
:checked="$store.getters.metrics"
@change="(checked, event) => { $store.dispatch('SetMetrics', checked) }"/>
<a-switch
v-if="!projectView && hasProjectId"
style="margin-left: 8px"
:checked-children="$t('label.projects')"
:un-checked-children="$t('label.projects')"
:checked="$store.getters.listAllProjects"
@change="(checked, event) => { $store.dispatch('SetListAllProjects', checked) }"/>
<a-tooltip placement="right">
<template slot="title">
{{ $t('label.filterby') }}
@ -504,6 +511,7 @@ export default {
showAction: false,
dataView: false,
projectView: false,
hasProjectId: false,
selectedFilter: '',
filters: [],
searchFilters: [],
@ -634,6 +642,9 @@ export default {
},
'$store.getters.metrics' (oldVal, newVal) {
this.fetchData()
},
'$store.getters.listAllProjects' (oldVal, newVal) {
this.fetchData()
}
},
computed: {
@ -740,6 +751,7 @@ export default {
}
this.projectView = Boolean(store.getters.project && store.getters.project.id)
this.hasProjectId = ['vm', 'vmgroup', 'ssh', 'affinitygroup', 'volume', 'snapshot', 'vmsnapshot', 'guestnetwork', 'vpc', 'securitygroups', 'publicip', 'vpncustomergateway', 'template', 'iso', 'event'].includes(this.$route.name)
if ((this.$route && this.$route.params && this.$route.params.id) || this.$route.query.dataView) {
this.dataView = true
@ -831,6 +843,10 @@ export default {
}
}
if (this.$store.getters.listAllProjects && !this.projectView) {
params.projectid = '-1'
}
params.page = this.page
params.pagesize = this.pageSize
@ -1009,7 +1025,7 @@ export default {
this.showAction = true
for (const param of this.currentAction.paramFields) {
if (param.type === 'list' && ['tags', 'hosttags', 'storagetags'].includes(param.name)) {
if (param.type === 'list' && ['tags', 'hosttags', 'storagetags', 'files'].includes(param.name)) {
param.type = 'string'
}
if (param.type === 'uuid' || param.type === 'list' || param.name === 'account' || (this.currentAction.mapping && param.name in this.currentAction.mapping)) {

View File

@ -59,7 +59,7 @@
v-decorator="['isdynamicallyscalable']"
:disabled="!canDynamicScalingEnabled()" />
</a-form-item>
<a-form-item>
<a-form-item v-if="serviceOffering ? serviceOffering.offerha : false">
<tooltip-label slot="label" :title="$t('label.haenable')" :tooltip="apiParams.haenable.description"/>
<a-switch
:default-checked="resource.haenable"

View File

@ -87,7 +87,7 @@
size="small"
:current="page"
:pageSize="pageSize"
:total="vmsList.length"
:total="vmCount"
:showTotal="total => `${$t('label.total')} ${total} ${$t('label.items')}`"
:pageSizeOptions="['10', '20', '40', '80', '100']"
@change="changePage"
@ -162,7 +162,8 @@ export default {
vpcTiers: [],
selectedVpcTier: null,
page: 1,
pageSize: 10
pageSize: 10,
vmCount: 0
}
},
created () {
@ -186,6 +187,7 @@ export default {
domainid: this.resource.domainid,
keyword: this.searchQuery
}).then(response => {
this.vmCount = response.listvirtualmachinesresponse.count
this.vmsList = response.listvirtualmachinesresponse.virtualmachine || []
}).catch(error => {
this.$notifyError(error)