Skip to content

Commit c6cb30d

Browse files
committed
Merge remote-tracking branch 'origin/4.15' into main
2 parents 0c6b8fe + 6540d99 commit c6cb30d

File tree

7 files changed

+55
-37
lines changed

7 files changed

+55
-37
lines changed

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,7 @@ public Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(final ListP
21282128
}
21292129
}
21302130

2131-
final Filter searchFilter = new Filter(IPAddressVO.class, "address", false, cmd.getStartIndex(), cmd.getPageSizeVal());
2131+
final Filter searchFilter = new Filter(IPAddressVO.class, "address", false, null, null);
21322132
final SearchBuilder<IPAddressVO> sb = _publicIpAddressDao.createSearchBuilder();
21332133
Long domainId = null;
21342134
Boolean isRecursive = null;
@@ -2214,7 +2214,10 @@ public Pair<List<? extends IpAddress>, Integer> searchForIPAddresses(final ListP
22142214
sc2.setParameters("ids", freeAddrIds.toArray());
22152215
addrs.addAll(_publicIpAddressDao.search(sc2, searchFilter)); // Allocated + Free
22162216
}
2217-
2217+
List<? extends IpAddress> wPagination = com.cloud.utils.StringUtils.applyPagination(addrs, cmd.getStartIndex(), cmd.getPageSizeVal());
2218+
if (wPagination != null) {
2219+
return new Pair<List<? extends IpAddress>, Integer>(wPagination, addrs.size());
2220+
}
22182221
return new Pair<>(addrs, addrs.size());
22192222
}
22202223

ui/public/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -659,7 +659,7 @@
659659
"label.credit": "Credit",
660660
"label.crosszones": "Cross Zones",
661661
"label.currency": "Currency",
662-
"label.current": "isCurrent",
662+
"label.current": "Current",
663663
"label.currentpassword": "Current Password",
664664
"label.custom": "Custom",
665665
"label.custom.disk.offering": "Custom Disk Offering",

ui/src/components/view/ListView.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,9 @@
232232
<a slot="readonly" slot-scope="text, record">
233233
<status :text="record.readonly ? 'ReadOnly' : 'ReadWrite'" displayText />
234234
</a>
235+
<span slot="current" slot-scope="text, record">
236+
<status :text="record.current ? record.current.toString() : 'false'" />
237+
</span>
235238
<span slot="created" slot-scope="text">
236239
{{ $toLocaleDate(text) }}
237240
</span>

ui/src/components/widgets/Status.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export default {
103103
case 'Successfully Installed':
104104
case 'ReadWrite':
105105
case 'True':
106+
case 'true':
106107
case 'Up':
107108
case 'enabled':
108109
case 'PowerOn':
@@ -116,6 +117,7 @@ export default {
116117
case 'Down':
117118
case 'Error':
118119
case 'False':
120+
case 'false':
119121
case 'Stopped':
120122
case 'PowerOff':
121123
case 'failed':

ui/src/utils/sort.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function filterNumber (value) {
2323
}
2424

2525
function stringComparator (a, b) {
26-
return a.localeCompare(b)
26+
return a.toString().localeCompare(b.toString())
2727
}
2828

2929
function numericComparator (a, b) {

ui/src/views/AutogenView.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,15 +1208,15 @@ export default {
12081208
if (param.name !== key) {
12091209
continue
12101210
}
1211-
if (!input === undefined || input === null ||
1211+
if (input === undefined || input === null ||
12121212
(input === '' && !['updateStoragePool', 'updateHost', 'updatePhysicalNetwork', 'updateDiskOffering', 'updateNetworkOffering'].includes(action.api))) {
12131213
if (param.type === 'boolean') {
12141214
params[key] = false
12151215
}
12161216
break
12171217
}
1218-
if (!input && input !== 0 && !['tags'].includes(key)) {
1219-
continue
1218+
if (input === '' && !['tags'].includes(key)) {
1219+
break
12201220
}
12211221
if (action.mapping && key in action.mapping && action.mapping[key].options) {
12221222
params[key] = action.mapping[key].options[input]

ui/src/views/network/CreateSharedNetworkForm.vue

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
:filterOption="(input, option) => {
7474
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
7575
}"
76-
:loading="zoneLoading"
76+
:loading="formPhysicalNetworkLoading"
7777
:placeholder="this.$t('label.physicalnetworkid')"
7878
@change="val => { this.handlePhysicalNetworkChange(this.formPhysicalNetworks[val]) }">
7979
<a-select-option v-for="(opt, optIndex) in this.formPhysicalNetworks" :key="optIndex">
@@ -469,57 +469,67 @@ export default {
469469
this.fetchPhysicalNetworkData()
470470
},
471471
fetchPhysicalNetworkData () {
472+
this.formSelectedPhysicalNetwork = {}
473+
this.formPhysicalNetworks = []
472474
if (this.physicalNetworks != null) {
473475
this.formPhysicalNetworks = this.physicalNetworks
474-
if (this.arrayHasItems(this.formPhysicalNetworks)) {
475-
this.form.setFieldsValue({
476-
physicalnetworkid: 0
477-
})
478-
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
479-
}
476+
this.selectFirstPhysicalNetwork()
480477
} else {
481478
if (this.selectedZone === null || this.selectedZone === undefined) {
482479
return
483480
}
484-
const params = {}
485-
params.zoneid = this.selectedZone.id
486-
this.formPhysicalNetworksLoading = true
481+
const promises = []
482+
const params = {
483+
zoneid: this.selectedZone.id
484+
}
485+
this.formPhysicalNetworkLoading = true
487486
api('listPhysicalNetworks', params).then(json => {
488-
this.formPhysicalNetworks = []
489487
var networks = json.listphysicalnetworksresponse.physicalnetwork
490488
if (this.arrayHasItems(networks)) {
491-
for (const i in networks) {
492-
this.addPhysicalNetworkForGuestTrafficType(networks[i])
489+
for (const network of networks) {
490+
promises.push(this.addPhysicalNetworkForGuestTrafficType(network))
493491
}
494492
} else {
495493
this.formPhysicalNetworkLoading = false
496494
}
497495
}).finally(() => {
496+
if (this.arrayHasItems(promises)) {
497+
Promise.all(promises).catch(error => {
498+
this.$notifyError(error)
499+
}).finally(() => {
500+
this.formPhysicalNetworkLoading = false
501+
this.selectFirstPhysicalNetwork()
502+
})
503+
}
504+
})
505+
}
506+
},
507+
selectFirstPhysicalNetwork () {
508+
if (this.arrayHasItems(this.formPhysicalNetworks)) {
509+
this.form.setFieldsValue({
510+
physicalnetworkid: 0
498511
})
512+
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
499513
}
500514
},
501515
addPhysicalNetworkForGuestTrafficType (physicalNetwork) {
502516
const params = {}
503517
params.physicalnetworkid = physicalNetwork.id
504-
api('listTrafficTypes', params).then(json => {
505-
var trafficTypes = json.listtraffictypesresponse.traffictype
506-
if (this.arrayHasItems(trafficTypes)) {
507-
for (const i in trafficTypes) {
508-
if (trafficTypes[i].traffictype === 'Guest') {
509-
this.formPhysicalNetworks.push(physicalNetwork)
510-
break
518+
return new Promise((resolve, reject) => {
519+
api('listTrafficTypes', params).then(json => {
520+
var trafficTypes = json.listtraffictypesresponse.traffictype
521+
if (this.arrayHasItems(trafficTypes)) {
522+
for (const type of trafficTypes) {
523+
if (type.traffictype === 'Guest') {
524+
this.formPhysicalNetworks.push(physicalNetwork)
525+
break
526+
}
511527
}
512528
}
513-
} else {
514-
this.formPhysicalNetworkLoading = false
515-
}
516-
}).finally(() => {
517-
if (this.formPhysicalNetworks.length > 0 && this.isObjectEmpty(this.formSelectedPhysicalNetwork)) {
518-
this.form.setFieldsValue({
519-
physicalnetworkid: 0
520-
})
521-
this.handlePhysicalNetworkChange(this.formPhysicalNetworks[0])
522-
}
529+
resolve()
530+
}).catch(error => {
531+
reject(error)
532+
})
523533
})
524534
},
525535
handlePhysicalNetworkChange (physicalNet) {

0 commit comments

Comments
 (0)