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
return
}
this.form.userdataid = id
this.userDataParams = []
api('listUserData', { id: id }).then(json => {
const resp = json?.listuserdataresponse?.userdata || []
if (resp[0]) {
var params = resp[0].params
if (params) {
var dataParams = params.split(',')
}
var that = this
dataParams.forEach(function (val, index) {
that.userDataParams.push({
const params = resp[0].params
const dataParams = params ? params.split(',') : []
dataParams.forEach((val, index) => {
this.userDataParams.push({
id: index,
key: val
})

View File

@ -30,6 +30,7 @@
:rowKey="record => record.id"
:pagination="false"
:rowSelection="rowSelection"
:customRow="onClickRow"
size="middle"
:scroll="{ y: 225 }">
<template #headerCell="{ column }">
@ -197,6 +198,14 @@ export default {
this.options.page = page
this.options.pageSize = pageSize
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 }"
>
<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 === 'domain'"><block-outlined /> {{ $t('label.domain') }}</template>
</template>
@ -78,6 +79,7 @@ export default {
filter: '',
columns: [
{
key: 'name',
dataIndex: 'name',
title: this.$t('label.userdata'),
width: '40%'
@ -181,15 +183,13 @@ export default {
},
onClickRow (record) {
return {
on: {
click: () => {
onClick: () => {
this.selectedRowKeys = [record.key]
this.$emit('select-user-data-item', record.key)
}
}
}
}
}
}
</script>