perf: 修改账号创建

This commit is contained in:
ibuler
2022-08-15 18:32:13 +08:00
parent d311884ec0
commit 1bfe5eed15
2 changed files with 7 additions and 14 deletions

View File

@@ -1,5 +1,7 @@
<template>
<AutoDataForm v-bind="$data" @submit="confirm" />
<div>
<AutoDataForm v-bind="$data" @submit="confirm" />
</div>
</template>
<script>
@@ -27,20 +29,12 @@ export default {
data() {
return {
url: '/api/v1/assets/accounts/',
form: this.account || { protocol: this.protocols[0] },
form: this.account || { },
fields: [
'type', 'username', 'password',
'private_key', 'passphrase', 'comment'
'username', 'password', 'private_key', 'passphrase',
'privileged', 'comment'
],
fieldsMeta: {
protocol: {
type: 'radio-group',
label: this.$t('assets.Protocol'),
default: this.protocols[0].name,
options: this.protocols.map((item) => {
return { label: item.name.toUpperCase(), value: item.name }
})
},
password: {
component: UpdateToken
},

View File

@@ -2,7 +2,6 @@
<div class="accounts">
<el-table :data="accounts" style="width: 100%">
<el-table-column prop="username" label="用户名" width="180" />
<el-table-column prop="protocol" label="协议" />
<el-table-column prop="type" label="类型" />
<el-table-column fixed="right" align="right" label="操作" width="135" class-name="buttons">
<template slot-scope="scope">
@@ -43,7 +42,7 @@ export default {
props: {
protocols: {
type: Array,
default: () => ['ssh']
default: () => []
},
value: {
type: [Array],