Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions src/views/settings/Feature/Vault/OpenBao.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<template>
<BaseKV :config="$data" :title="$tc('OpenBao')" />
</template>

<script>
import BaseKV from './Base.vue'

export default {
name: 'OpenBaoKV',
components: {
BaseKV
},
data() {
const vm = this

Check failure on line 14 in src/views/settings/Feature/Vault/OpenBao.vue

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not assign `this` to `vm`.

See more on https://sonarcloud.io/project/issues?id=jumpserver_lina&issues=AZ9aUDLbq7e8N5mNMIlX&open=AZ9aUDLbq7e8N5mNMIlX&pullRequest=5454
return {
url: `/api/v1/settings/setting/?category=openbao`,
hasDetailInMsg: false,
visible: false,
moreButtons: [
{
title: this.$t('Test'),
loading: false,
callback: function (value, form, btn) {
btn.loading = true
vm.$axios
.post('/api/v1/settings/vault/openbao/testing/', value)
.then((res) => {
vm.$message.success(res['msg'])
})
.catch(() => {
vm.$log.error('err occur')
})
.finally(() => {
btn.loading = false
})
}
}
],
encryptedFields: ['VAULT_OPENBAO_TOKEN'],
fields: [
[
this.$t('AccountStorage'),
[
'VAULT_OPENBAO_ADDR',
'VAULT_OPENBAO_TOKEN',
'VAULT_OPENBAO_MOUNT_POINT',
'VAULT_OPENBAO_TIMEOUT'
]
]
],
fieldsMeta: {
VAULT_OPENBAO_ADDR: {
helpText: this.$t('VaultOpenBaoAddr'),
helpTextAsTip: true
},
VAULT_OPENBAO_MOUNT_POINT: {
helpText: this.$t('VaultOpenBaoMountPoint'),
helpTextAsTip: true
}
},
submitMethod() {
return 'patch'
}
}
},
computed: {},
methods: {}
}
</script>

<style scoped></style>

Check warning on line 71 in src/views/settings/Feature/Vault/OpenBao.vue

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Empty source

See more on https://sonarcloud.io/project/issues?id=jumpserver_lina&issues=AZ9aUDLbq7e8N5mNMIlY&open=AZ9aUDLbq7e8N5mNMIlY&pullRequest=5454
10 changes: 9 additions & 1 deletion src/views/settings/Feature/Vault/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { GenericCreateUpdateForm } from '@/layout/components'
import IBox from '@/components/Common/IBox/index.vue'
import { openTaskPage } from '@/utils/jms/index'
import store from '@/store'
import OpenBaoKV from './OpenBao.vue'
import HashiCorpKV from './HCP.vue'
import AzureKV from './Azure.vue'
import AwsSM from './Aws.vue'
Expand Down Expand Up @@ -54,7 +55,7 @@ export default {
],
fields: [
[this.$t('Basic'), ['VAULT_ENABLED', 'VAULT_BACKEND', 'HISTORY_ACCOUNT_CLEAN_LIMIT']],
[this.$t('Provider'), ['HCP', 'AZURE', 'AWS']]
[this.$t('Provider'), ['OPENBAO', 'HCP', 'AZURE', 'AWS']]
],
fieldsMeta: {
HISTORY_ACCOUNT_CLEAN_LIMIT: {
Expand All @@ -72,6 +73,13 @@ export default {
},
disabled: true
},
OPENBAO: {
label: this.$t('OpenBao'),
component: OpenBaoKV,
hidden: (formValue) => {
return !formValue.VAULT_ENABLED || formValue['VAULT_BACKEND'] !== 'openbao'
}
},
HCP: {
label: this.$t('HashicorpVault'),
component: HashiCorpKV,
Expand Down
Loading