mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
UI: Fix userdata and load balancer selection (#10016)
This commit is contained in:
parent
5ee61c226a
commit
9960e40030
@ -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
|
||||||
})
|
})
|
||||||
|
|||||||
@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,8 +183,7 @@ 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)
|
||||||
}
|
}
|
||||||
@ -190,7 +191,6 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user