mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-13 19:35:24 +00:00
pref: 修改查看 account
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
|
||||
<script>
|
||||
import { ActionsFormatter, DetailFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from '../AccountListTable/ShowSecretInfo'
|
||||
import ShowSecretInfo from '../AccountListTable/ViewSecret'
|
||||
import { GenericListPage } from '@/layout/components'
|
||||
|
||||
export default {
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
<AccountCreateUpdateForm
|
||||
v-if="!loading"
|
||||
:platform="platform"
|
||||
:protocols="protocols"
|
||||
:account="account"
|
||||
@add="addAccount"
|
||||
@edit="editAccount"
|
||||
@@ -41,11 +40,7 @@ export default {
|
||||
},
|
||||
account: {
|
||||
type: Object,
|
||||
default: () => ({
|
||||
name: '',
|
||||
username: '',
|
||||
secret: ''
|
||||
})
|
||||
default: () => ({})
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<Dialog
|
||||
width="50"
|
||||
:title="this.$t('assets.UpdateAssetUserToken')"
|
||||
:title="this.$tc('assets.UpdateAssetUserToken')"
|
||||
:visible.sync="visible"
|
||||
:destroy-on-close="true"
|
||||
@confirm="handleConfirm()"
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
>
|
||||
<div>
|
||||
<el-form label-position="right" label-width="80px" :model="authInfo">
|
||||
<el-form-item :label="this.$t('assets.Name')">
|
||||
<el-input v-model="account['asset_name']" readonly />
|
||||
<el-form-item :label="this.$tc('assets.Name')">
|
||||
<el-input v-model="account['name']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Username')">
|
||||
<el-form-item :label="this.$tc('assets.Username')">
|
||||
<el-input v-model="account['username']" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('assets.Password')">
|
||||
<el-input v-model="authInfo.password" type="password" show-password />
|
||||
<el-form-item v-if="account['secret_type'] === 'password'" :label="this.$tc('assets.Password')">
|
||||
<el-input v-model="authInfo.secret" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item :label="this.$t('users.SSHKey')">
|
||||
<el-input v-model="authInfo['private_key']" class="item-textarea" type="textarea" show-password />
|
||||
<el-form-item v-else :label="this.$tc('assets.Key')">
|
||||
<el-input v-model="authInfo.secret" type="textarea" :rows="10" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -56,7 +56,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dialogTitle: this.$t('common.ViewSecret'),
|
||||
dialogTitle: this.$tc('common.ViewSecret'),
|
||||
authInfo: {},
|
||||
showAuthInfo: false,
|
||||
url: `/api/v1/assets/account-secrets/${this.account.id}/`
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div>
|
||||
<ListTable ref="ListTable" :table-config="tableConfig" :header-actions="headerActions" />
|
||||
<ShowSecretInfo v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
<ViewSecret v-if="showViewSecretDialog" :visible.sync="showViewSecretDialog" :account="account" />
|
||||
<UpdateSecretInfo
|
||||
v-if="showUpdateSecretDialog"
|
||||
:visible.sync="showUpdateSecretDialog"
|
||||
@@ -21,7 +21,7 @@
|
||||
<script>
|
||||
import ListTable from '@/components/ListTable/index'
|
||||
import { ActionsFormatter } from '@/components/TableFormatters'
|
||||
import ShowSecretInfo from './ShowSecretInfo'
|
||||
import ViewSecret from './ViewSecret'
|
||||
import UpdateSecretInfo from './UpdateSecretInfo'
|
||||
import AddAccount from './AddAccount'
|
||||
import { connectivityMeta } from './const'
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
components: {
|
||||
ListTable,
|
||||
UpdateSecretInfo,
|
||||
ShowSecretInfo,
|
||||
ViewSecret,
|
||||
AddAccount
|
||||
},
|
||||
props: {
|
||||
@@ -130,7 +130,7 @@ export default {
|
||||
{
|
||||
name: 'View',
|
||||
title: this.$t('common.View'),
|
||||
can: this.$hasPerm('assets.view_assetaccountsecret'),
|
||||
can: this.$hasPerm('assets.view_accountsecret'),
|
||||
type: 'primary',
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
@@ -168,7 +168,7 @@ export default {
|
||||
{
|
||||
name: 'Update',
|
||||
title: this.$t('common.Update'),
|
||||
can: this.$hasPerm('assets.change_assetaccountsecret') && !this.$store.getters.currentOrgIsRoot,
|
||||
can: this.$hasPerm('assets.change_account') && !this.$store.getters.currentOrgIsRoot,
|
||||
callback: ({ row }) => {
|
||||
vm.account = row
|
||||
vm.showAddDialog = false
|
||||
@@ -233,6 +233,8 @@ export default {
|
||||
actionColumn.formatterArgs.extraActions.push(item)
|
||||
}
|
||||
}
|
||||
|
||||
console.log('Has perm: ', this.$hasPerm('assets.change_account'))
|
||||
},
|
||||
methods: {
|
||||
onUpdateAuthDone(account) {
|
||||
|
||||
Reference in New Issue
Block a user