Skip to content

Commit 574367b

Browse files
fix userdata form selection
1 parent 8f63660 commit 574367b

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-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/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)