mirror of
https://github.com/jumpserver/lina.git
synced 2025-11-27 18:49:50 +00:00
Compare commits
2 Commits
pr@dev@ope
...
pr@dev@fea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee4f47a53a | ||
|
|
b11f99345f |
@@ -62,6 +62,7 @@ import Dialog from '@/components/Dialog/index.vue'
|
||||
import PasswordHistoryDialog from './PasswordHistoryDialog.vue'
|
||||
import { SecretViewerFormatter } from '@/components/Table/TableFormatters'
|
||||
import { encryptPassword } from '@/utils/secure'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'ShowSecretInfo',
|
||||
@@ -111,6 +112,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
publicSettings: 'publicSettings'
|
||||
}),
|
||||
secretTypeLabel() {
|
||||
return this.account['secret_type'].label || 'Password'
|
||||
},
|
||||
@@ -146,7 +150,11 @@ export default {
|
||||
})
|
||||
},
|
||||
showSecretDialog() {
|
||||
return this.$axios.get(this.url, { disableFlashErrorMsg: true }).then((res) => {
|
||||
if (!this.publicSettings.SECURITY_ACCOUNT_SECRET_READ) {
|
||||
this.$message.warning(this.$tc('AccountSecretReadDisabled'))
|
||||
return
|
||||
}
|
||||
return this.$axios.get(this.url).then((res) => {
|
||||
this.secretInfo = res
|
||||
this.sshKeyFingerprint = res?.spec_info?.ssh_key_fingerprint || '-'
|
||||
this.showSecret = true
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<script>
|
||||
import { copy, downloadText } from '@/utils/common/index'
|
||||
import BaseFormatter from '@/components/Table/TableFormatters/base.vue'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'SecretViewerFormatter',
|
||||
@@ -69,6 +70,9 @@ export default {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
publicSettings: 'publicSettings'
|
||||
}),
|
||||
hasShow: function() {
|
||||
return this.formatterArgs.hasShow
|
||||
},
|
||||
@@ -140,6 +144,10 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
async getAccountSecret() {
|
||||
if (!this.publicSettings.SECURITY_ACCOUNT_SECRET_READ) {
|
||||
this.$message.warning(this.$tc('AccountSecretReadDisabled'))
|
||||
return
|
||||
}
|
||||
if (this.formatterArgs.secretFrom === 'cellValue' || this.getIt) {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user