Skip to content

Commit 9960e40

Browse files
UI: Fix userdata and load balancer selection (#10016)
1 parent 5ee61c2 commit 9960e40

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

ui/src/views/compute/DeployVM.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1940,18 +1940,16 @@ export default {
19401940
this.form.userdataid = undefined
19411941
return
19421942
}
1943+
19431944
this.form.userdataid = id
19441945
this.userDataParams = []
19451946
api('listUserData', { id: id }).then(json => {
19461947
const resp = json?.listuserdataresponse?.userdata || []
19471948
if (resp[0]) {
1948-
var params = resp[0].params
1949-
if (params) {
1950-
var dataParams = params.split(',')
1951-
}
1952-
var that = this
1953-
dataParams.forEach(function (val, index) {
1954-
that.userDataParams.push({
1949+
const params = resp[0].params
1950+
const dataParams = params ? params.split(',') : []
1951+
dataParams.forEach((val, index) => {
1952+
this.userDataParams.push({
19551953
id: index,
19561954
key: val
19571955
})

ui/src/views/compute/wizard/LoadBalancerSelection.vue

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
:rowKey="record => record.id"
3131
:pagination="false"
3232
:rowSelection="rowSelection"
33+
:customRow="onClickRow"
3334
size="middle"
3435
:scroll="{ y: 225 }">
3536
<template #headerCell="{ column }">
@@ -197,6 +198,14 @@ export default {
197198
this.options.page = page
198199
this.options.pageSize = pageSize
199200
this.$emit('handle-search-filter', this.options)
201+
},
202+
onClickRow (record) {
203+
return {
204+
onClick: () => {
205+
this.selectedRowKeys = [record.id]
206+
this.$emit('select-load-balancer-item', record.id)
207+
}
208+
}
200209
}
201210
}
202211
}

ui/src/views/compute/wizard/UserDataSelection.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
:scroll="{ y: 225 }"
3434
>
3535
<template #headerCell="{ column }">
36+
<template v-if="column.key === 'name'"><solution-outlined /> {{ $t('label.userdata') }}</template>
3637
<template v-if="column.key === 'account'"><user-outlined /> {{ $t('label.account') }}</template>
3738
<template v-if="column.key === 'domain'"><block-outlined /> {{ $t('label.domain') }}</template>
3839
</template>
@@ -78,6 +79,7 @@ export default {
7879
filter: '',
7980
columns: [
8081
{
82+
key: 'name',
8183
dataIndex: 'name',
8284
title: this.$t('label.userdata'),
8385
width: '40%'
@@ -181,11 +183,9 @@ export default {
181183
},
182184
onClickRow (record) {
183185
return {
184-
on: {
185-
click: () => {
186-
this.selectedRowKeys = [record.key]
187-
this.$emit('select-user-data-item', record.key)
188-
}
186+
onClick: () => {
187+
this.selectedRowKeys = [record.key]
188+
this.$emit('select-user-data-item', record.key)
189189
}
190190
}
191191
}

0 commit comments

Comments
 (0)