mirror of
https://github.com/jumpserver/lina.git
synced 2026-01-29 21:28:52 +00:00
perf: 修改 chatgpt 支持
This commit is contained in:
@@ -55,7 +55,7 @@ export default {
|
||||
protocols: [
|
||||
{
|
||||
name: 'ssh',
|
||||
secret_types: ['password', 'ssh_key', 'token', 'access_key']
|
||||
secret_types: ['password', 'ssh_key', 'token', 'access_key', 'api_key']
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -67,8 +67,8 @@ export default {
|
||||
[this.$t('accounts.AccountTemplate'), ['template']],
|
||||
[this.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from', 'su_from_username']],
|
||||
[this.$t('assets.Secret'), [
|
||||
'secret_type', 'secret', 'ssh_key',
|
||||
'token', 'access_key', 'passphrase'
|
||||
'secret_type', 'secret', 'ssh_key', 'token',
|
||||
'access_key', 'passphrase', 'api_key'
|
||||
]],
|
||||
[this.$t('common.Other'), ['push_now', 'params', 'on_invalid', 'is_active', 'comment']]
|
||||
],
|
||||
@@ -199,6 +199,12 @@ export default {
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'access_key' || this.addTemplate
|
||||
},
|
||||
api_key: {
|
||||
id: 'access_key',
|
||||
label: this.$t('assets.ApiKey'),
|
||||
component: UploadSecret,
|
||||
hidden: (formValue) => formValue.secret_type !== 'api_key' || this.addTemplate
|
||||
},
|
||||
secret_type: {
|
||||
type: 'radio-group',
|
||||
options: [],
|
||||
@@ -276,6 +282,10 @@ export default {
|
||||
{
|
||||
label: this.$t('assets.AccessKey'),
|
||||
value: 'access_key'
|
||||
},
|
||||
{
|
||||
label: this.$t('assets.ApiKey'),
|
||||
value: 'api_key'
|
||||
}
|
||||
]
|
||||
const secretTypes = []
|
||||
|
||||
@@ -25,7 +25,7 @@ export default {
|
||||
},
|
||||
cleanFormValue(value) {
|
||||
Object.keys(value).forEach((item, index, arr) => {
|
||||
if (['ssh_key', 'token', 'access_key'].includes(item)) {
|
||||
if (['ssh_key', 'token', 'access_key', 'api_key'].includes(item)) {
|
||||
value['secret'] = value[item]
|
||||
delete value[item]
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<Dialog
|
||||
v-if="iVisible"
|
||||
:visible.sync="iVisible"
|
||||
:title="$tc('accounts.UpdateSecret')"
|
||||
width="50%"
|
||||
:destroy-on-close="true"
|
||||
:show-cancel="false"
|
||||
:show-confirm="false"
|
||||
:destroy-on-close="true"
|
||||
:title="$tc('accounts.UpdateSecret')"
|
||||
:visible.sync="iVisible"
|
||||
width="50%"
|
||||
>
|
||||
<AutoDataForm
|
||||
:form="form"
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
fields: [
|
||||
['', [
|
||||
'secret_type', 'secret', 'ssh_key', 'token',
|
||||
'access_key', 'passphrase'
|
||||
'access_key', 'passphrase', 'api_key'
|
||||
]]
|
||||
],
|
||||
fieldsMeta: {
|
||||
|
||||
@@ -7,7 +7,7 @@ export const templateFields = (vm) => {
|
||||
[vm.$t('common.Basic'), ['name', 'username', 'privileged', 'su_from']],
|
||||
[vm.$t('assets.Secret'), [
|
||||
'secret_type', 'secret', 'ssh_key', 'token',
|
||||
'access_key', 'passphrase'
|
||||
'access_key', 'passphrase', 'api_key'
|
||||
]],
|
||||
[vm.$t('common.Other'), ['comment']]
|
||||
]
|
||||
|
||||
@@ -57,7 +57,7 @@ export default {
|
||||
component: () => import('@/views/assets/Asset/AssetList/WebList.vue')
|
||||
},
|
||||
{
|
||||
icon: 'fa-globe',
|
||||
icon: 'fa-comment',
|
||||
name: 'gpt',
|
||||
hidden: true,
|
||||
component: () => import('@/views/assets/Asset/AssetList/GPTList.vue')
|
||||
|
||||
Reference in New Issue
Block a user