UI: Fix userdata and load balancer selection (#10016)

This commit is contained in:
Bernardo De Marco Gonçalves 2024-12-04 09:04:50 -03:00 committed by GitHub
parent 5ee61c226a
commit 9960e40030
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 12 deletions

View File

@ -1940,18 +1940,16 @@ export default {
this.form.userdataid = undefined this.form.userdataid = undefined
return return
} }
this.form.userdataid = id this.form.userdataid = id
this.userDataParams = [] this.userDataParams = []
api('listUserData', { id: id }).then(json => { api('listUserData', { id: id }).then(json => {
const resp = json?.listuserdataresponse?.userdata || [] const resp = json?.listuserdataresponse?.userdata || []
if (resp[0]) { if (resp[0]) {
var params = resp[0].params const params = resp[0].params
if (params) { const dataParams = params ? params.split(',') : []
var dataParams = params.split(',') dataParams.forEach((val, index) => {
} this.userDataParams.push({
var that = this
dataParams.forEach(function (val, index) {
that.userDataParams.push({
id: index, id: index,
key: val key: val
}) })

View File

@ -30,6 +30,7 @@
:rowKey="record => record.id" :rowKey="record => record.id"
:pagination="false" :pagination="false"
:rowSelection="rowSelection" :rowSelection="rowSelection"
:customRow="onClickRow"
size="middle" size="middle"
:scroll="{ y: 225 }"> :scroll="{ y: 225 }">
<template #headerCell="{ column }"> <template #headerCell="{ column }">
@ -197,6 +198,14 @@ export default {
this.options.page = page this.options.page = page
this.options.pageSize = pageSize this.options.pageSize = pageSize
this.$emit('handle-search-filter', this.options) this.$emit('handle-search-filter', this.options)
},
onClickRow (record) {
return {
onClick: () => {
this.selectedRowKeys = [record.id]
this.$emit('select-load-balancer-item', record.id)
}
}
} }
} }
} }

View File

@ -33,6 +33,7 @@
:scroll="{ y: 225 }" :scroll="{ y: 225 }"
> >
<template #headerCell="{ column }"> <template #headerCell="{ column }">
<template v-if="column.key === 'name'"><solution-outlined /> {{ $t('label.userdata') }}</template>
<template v-if="column.key === 'account'"><user-outlined /> {{ $t('label.account') }}</template> <template v-if="column.key === 'account'"><user-outlined /> {{ $t('label.account') }}</template>
<template v-if="column.key === 'domain'"><block-outlined /> {{ $t('label.domain') }}</template> <template v-if="column.key === 'domain'"><block-outlined /> {{ $t('label.domain') }}</template>
</template> </template>
@ -78,6 +79,7 @@ export default {
filter: '', filter: '',
columns: [ columns: [
{ {
key: 'name',
dataIndex: 'name', dataIndex: 'name',
title: this.$t('label.userdata'), title: this.$t('label.userdata'),
width: '40%' width: '40%'
@ -181,15 +183,13 @@ export default {
}, },
onClickRow (record) { onClickRow (record) {
return { return {
on: { onClick: () => {
click: () => {
this.selectedRowKeys = [record.key] this.selectedRowKeys = [record.key]
this.$emit('select-user-data-item', record.key) this.$emit('select-user-data-item', record.key)
} }
} }
} }
} }
}
} }
</script> </script>