Skip to content

Commit c339f6e

Browse files
authored
ui: Fix bulk deletion of ssh key pairs (#6286)
1 parent 4313c3d commit c339f6e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

ui/src/config/section/compute.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,9 @@ export default {
622622
popup: true,
623623
groupMap: (selection, values, record) => {
624624
return selection.map(x => {
625-
const data = record.filter(y => { return y.name === x })
625+
const data = record.filter(y => { return y.id === x })
626626
return {
627-
name: x, account: data[0].account, domainid: data[0].domainid
627+
name: data[0].name, account: data[0].account, domainid: data[0].domainid
628628
}
629629
})
630630
}

ui/src/views/AutogenView.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ export default {
590590
if (this.$route.path.includes('/template') || this.$route.path.includes('/iso')) {
591591
objIndex = selectedItems.findIndex(obj => (obj.zoneid === tempResource[r]))
592592
} else {
593-
objIndex = selectedItems.findIndex(obj => (obj.id === tempResource[r] || obj.username === tempResource[r]))
593+
objIndex = selectedItems.findIndex(obj => (obj.id === tempResource[r] || obj.username === tempResource[r] || obj.name === tempResource[r]))
594594
}
595595
if (state && objIndex !== -1) {
596596
this.selectedItems[objIndex].status = state
@@ -1261,7 +1261,7 @@ export default {
12611261
this.items.map(x => {
12621262
itemsNameMap[x.id] = x.name || x.displaytext || x.id
12631263
})
1264-
const paramsList = this.currentAction.groupMap(this.selectedRowKeys, values)
1264+
const paramsList = this.currentAction.groupMap(this.selectedRowKeys, values, this.items)
12651265
for (const params of paramsList) {
12661266
var resourceName = itemsNameMap[params.id]
12671267
// Using a method for this since it's an async call and don't want wrong prarms to be passed

0 commit comments

Comments
 (0)