mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
Merge remote-tracking branch 'origin/4.15' into main
This commit is contained in:
commit
c6cb30d1ea
@ -2128,7 +2128,7 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
}
|
||||
}
|
||||
|
||||
final Filter searchFilter = new Filter(IPAddressVO.class, "address", false, cmd.getStartIndex(), cmd.getPageSizeVal());
|
||||
final Filter searchFilter = new Filter(IPAddressVO.class, "address", false, null, null);
|
||||
final SearchBuilder<IPAddressVO> sb = _publicIpAddressDao.createSearchBuilder();
|
||||
Long domainId = null;
|
||||
Boolean isRecursive = null;
|
||||
@ -2214,7 +2214,10 @@ public class ManagementServerImpl extends ManagerBase implements ManagementServe
|
||||
sc2.setParameters("ids", freeAddrIds.toArray());
|
||||
addrs.addAll(_publicIpAddressDao.search(sc2, searchFilter)); // Allocated + Free
|
||||
}
|
||||
|
||||
List<? extends IpAddress> wPagination = com.cloud.utils.StringUtils.applyPagination(addrs, cmd.getStartIndex(), cmd.getPageSizeVal());
|
||||
if (wPagination != null) {
|
||||
return new Pair<List<? extends IpAddress>, Integer>(wPagination, addrs.size());
|
||||
}
|
||||
return new Pair<>(addrs, addrs.size());
|
||||
}
|
||||
|
||||
|
||||
@ -659,7 +659,7 @@
|
||||
"label.credit": "Credit",
|
||||
"label.crosszones": "Cross Zones",
|
||||
"label.currency": "Currency",
|
||||
"label.current": "isCurrent",
|
||||
"label.current": "Current",
|
||||
"label.currentpassword": "Current Password",
|
||||
"label.custom": "Custom",
|
||||
"label.custom.disk.offering": "Custom Disk Offering",
|
||||
|
||||
@ -232,6 +232,9 @@
|
||||
<a slot="readonly" slot-scope="text, record">
|
||||
<status :text="record.readonly ? 'ReadOnly' : 'ReadWrite'" displayText />
|
||||
</a>
|
||||
<span slot="current" slot-scope="text, record">
|
||||
<status :text="record.current ? record.current.toString() : 'false'" />
|
||||
</span>
|
||||
<span slot="created" slot-scope="text">
|
||||
{{ $toLocaleDate(text) }}
|
||||
</span>
|
||||
|
||||
@ -103,6 +103,7 @@ export default {
|
||||
case 'Successfully Installed':
|
||||
case 'ReadWrite':
|
||||
case 'True':
|
||||
case 'true':
|
||||
case 'Up':
|
||||
case 'enabled':
|
||||
case 'PowerOn':
|
||||
@ -116,6 +117,7 @@ export default {
|
||||
case 'Down':
|
||||
case 'Error':
|
||||
case 'False':
|
||||
case 'false':
|
||||
case 'Stopped':
|
||||
case 'PowerOff':
|
||||
case 'failed':
|
||||
|
||||
@ -23,7 +23,7 @@ function filterNumber (value) {
|
||||
}
|
||||
|
||||
function stringComparator (a, b) {
|
||||
return a.localeCompare(b)
|
||||
return a.toString().localeCompare(b.toString())
|
||||
}
|
||||
|
||||
function numericComparator (a, b) {
|
||||
|
||||
@ -1208,15 +1208,15 @@ export default {
|
||||
if (param.name !== key) {
|
||||
continue
|
||||
}
|
||||
if (!input === undefined || input === null ||
|
||||
if (input === undefined || input === null ||
|
||||
(input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork', 'updateDiskOffering', 'updateNetworkOffering'].includes(action.api))) {
|
||||
if (param.type === 'boolean') {
|
||||
params[key] = false
|
||||
}
|
||||
break
|
||||
}
|
||||
if (!input && input !== 0 && !['tags'].includes(key)) {
|
||||
continue
|
||||
if (input === '' && !['tags'].includes(key)) {
|
||||
break
|
||||
}
|
||||
if (action.mapping && key in action.mapping && action.mapping[key].options) {
|
||||
params[key] = action.mapping[key].options[input]
|
||||
|
||||
@ -73,7 +73,7 @@
|
||||
:filterOption="(input, option) => {
|
||||
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
||||
}"
|
||||
:loading="zoneLoading"
|
||||
:loading="formPhysicalNetworkLoading"
|
||||
:placeholder="this.$t('label.physicalnetworkid')"
|
||||
@change="val => { this.handlePhysicalNetworkChange(this.formPhysicalNetworks[val]) }">
|
||||
<a-select-option v-for="(opt, optIndex) in this.formPhysicalNetworks" :key="optIndex">
|
||||
@ -469,57 +469,67 @@ export default {
|
||||
this.fetchPhysicalNetworkData()
|
||||
},
|
||||
fetchPhysicalNetworkData () {
|
||||
this.formSelectedPhysicalNetwork = {}
|
||||
this.formPhysicalNetworks = []
|
||||
if (this.physicalNetworks != null) {
|
||||
this.formPhysicalNetworks = this.physicalNetworks
|
||||
if (this.arrayHasItems(this.formPhysicalNetworks)) {
|
||||
this.form.setFieldsValue({
|
||||
physicalnetworkid: 0
|
||||
})
|
||||
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
|
||||
}
|
||||
this.selectFirstPhysicalNetwork()
|
||||
} else {
|
||||
if (this.selectedZone === null || this.selectedZone === undefined) {
|
||||
return
|
||||
}
|
||||
const params = {}
|
||||
params.zoneid = this.selectedZone.id
|
||||
this.formPhysicalNetworksLoading = true
|
||||
const promises = []
|
||||
const params = {
|
||||
zoneid: this.selectedZone.id
|
||||
}
|
||||
this.formPhysicalNetworkLoading = true
|
||||
api('listPhysicalNetworks', params).then(json => {
|
||||
this.formPhysicalNetworks = []
|
||||
var networks = json.listphysicalnetworksresponse.physicalnetwork
|
||||
if (this.arrayHasItems(networks)) {
|
||||
for (const i in networks) {
|
||||
this.addPhysicalNetworkForGuestTrafficType(networks[i])
|
||||
for (const network of networks) {
|
||||
promises.push(this.addPhysicalNetworkForGuestTrafficType(network))
|
||||
}
|
||||
} else {
|
||||
this.formPhysicalNetworkLoading = false
|
||||
}
|
||||
}).finally(() => {
|
||||
if (this.arrayHasItems(promises)) {
|
||||
Promise.all(promises).catch(error => {
|
||||
this.$notifyError(error)
|
||||
}).finally(() => {
|
||||
this.formPhysicalNetworkLoading = false
|
||||
this.selectFirstPhysicalNetwork()
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
selectFirstPhysicalNetwork () {
|
||||
if (this.arrayHasItems(this.formPhysicalNetworks)) {
|
||||
this.form.setFieldsValue({
|
||||
physicalnetworkid: 0
|
||||
})
|
||||
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
|
||||
}
|
||||
},
|
||||
addPhysicalNetworkForGuestTrafficType (physicalNetwork) {
|
||||
const params = {}
|
||||
params.physicalnetworkid = physicalNetwork.id
|
||||
api('listTrafficTypes', params).then(json => {
|
||||
var trafficTypes = json.listtraffictypesresponse.traffictype
|
||||
if (this.arrayHasItems(trafficTypes)) {
|
||||
for (const i in trafficTypes) {
|
||||
if (trafficTypes[i].traffictype === 'Guest') {
|
||||
this.formPhysicalNetworks.push(physicalNetwork)
|
||||
break
|
||||
return new Promise((resolve, reject) => {
|
||||
api('listTrafficTypes', params).then(json => {
|
||||
var trafficTypes = json.listtraffictypesresponse.traffictype
|
||||
if (this.arrayHasItems(trafficTypes)) {
|
||||
for (const type of trafficTypes) {
|
||||
if (type.traffictype === 'Guest') {
|
||||
this.formPhysicalNetworks.push(physicalNetwork)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.formPhysicalNetworkLoading = false
|
||||
}
|
||||
}).finally(() => {
|
||||
if (this.formPhysicalNetworks.length > 0 && this.isObjectEmpty(this.formSelectedPhysicalNetwork)) {
|
||||
this.form.setFieldsValue({
|
||||
physicalnetworkid: 0
|
||||
})
|
||||
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
|
||||
}
|
||||
resolve()
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
handlePhysicalNetworkChange (physicalNet) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user