fix: 修复资产账号、账号备份、上传ssh密钥组件翻译问题

1、替换了改密计划-资产改密,密码框组件
This commit is contained in:
“怀磊”
2022-01-19 11:18:37 +08:00
committed by 老广
parent c1ddc0f8e0
commit 537887553d
5 changed files with 15 additions and 16 deletions

View File

@@ -8,7 +8,7 @@
@cancel="handleCancel()"
v-on="$listeners"
>
<el-form label-position="right" label-width="80px">
<el-form label-position="right" label-width="90px">
<el-form-item :label="this.$t('assets.Hostname')">
<el-input v-model="account.hostname" readonly />
</el-form-item>
@@ -18,8 +18,8 @@
<el-form-item :label="this.$t('assets.Password')">
<el-input v-model="authInfo.password" type="password" />
</el-form-item>
<el-form-item :label="this.$t('assets.SSHKey')">
<input type="file" @change="onPrivateKeyLoaded">
<el-form-item :label="this.$t('assets.SSHSecretKey')">
<UploadKey @input="getFile" />
</el-form-item>
<el-form-item :label="this.$t('assets.Passphrase')">
<el-input v-model="authInfo.passphrase" type="password" />
@@ -30,10 +30,12 @@
<script>
import Dialog from '@/components/Dialog'
import { UploadKey } from '@/components'
export default {
name: 'UpdateSecretInfo',
components: {
Dialog
Dialog,
UploadKey
},
props: {
account: {
@@ -78,16 +80,8 @@ export default {
handleCancel() {
this.$emit('update:visible', false)
},
onPrivateKeyLoaded(e) {
const vm = this
// TODO 校验文件类型
const reader = new FileReader()
reader.onload = function() {
vm.authInfo.private_key = this.result
}
reader.readAsText(
e.target.files[0]
)
getFile(file) {
this.authInfo.private_key = file
}
}
}

View File

@@ -224,7 +224,7 @@
"sshKeyFingerprint": "SSH 指纹",
"ip": "IP",
"sshkey": "sshkey",
"SSHKey": "SSH 密钥",
"SSHSecretKey": "SSH 密钥",
"GroupsHelpMessage": "请输入用户组,多个用户组使用逗号分隔(需填写已存在的用户组)",
"HomeHelpMessage": "默认家目录 /home/系统用户名: /home/username",
"Home": "家目录",

View File

@@ -219,6 +219,7 @@
"sshKeyFingerprint": "SSH fingerprint",
"ip": "IP",
"sshkey": "sshkey",
"SSHSecretKey": "SSh key",
"GroupsHelpMessage": "Please fill in user groups, separated by commas if there are multiple user groups(Please fill in the existing user groups)",
"HomeHelpMessage": "Default home directory: /home/system username",
"Home": "Home",

View File

@@ -10,6 +10,8 @@ var validatorInterval = (rule, value, callback) => {
function getFields() {
const recipients = {
label: i18n.t('xpack.ChangeAuthPlan.Addressee'),
helpText: i18n.t('xpack.ChangeAuthPlan.OnlyMailSend'),
el: {
value: [],
ajax: {

View File

@@ -1,6 +1,6 @@
import i18n from '@/i18n/i18n'
import { AssetSelect, CronTab, UploadKey } from '@/components'
import { Select2 } from '@/components/FormFields/Select2'
import { Select2, UpdateToken } from '@/components/FormFields'
import { Required } from '@/components/DataForm/rules'
var validatorInterval = (rule, value, callback) => {
@@ -104,6 +104,8 @@ function getFields() {
}
const passphrase = {
label: i18n.t('assets.Passphrase'),
component: UpdateToken,
hidden: (formValue) => {
return formValue.is_ssh_key === false
}