feat: Bot发布增加外链聊天界面
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from 'vue';
|
||||
import {onMounted, ref} from 'vue';
|
||||
|
||||
import { $t } from '@easyflow/locales';
|
||||
import {$t} from '@easyflow/locales';
|
||||
|
||||
import {
|
||||
ElAlert,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
ElSelect,
|
||||
} from 'element-plus';
|
||||
|
||||
import { api } from '#/api/request.js';
|
||||
import {api} from '#/api/request.js';
|
||||
import providerList from '#/views/ai/model/modelUtils/providerList.json';
|
||||
|
||||
interface ProviderOptionExtra {
|
||||
@@ -45,6 +45,7 @@ interface SettingsEntity {
|
||||
chatgpt_chatPath: string;
|
||||
chatgpt_endpoint: string;
|
||||
chatgpt_model_name: string;
|
||||
chat_publish_base_url: string;
|
||||
model_of_chat: string;
|
||||
}
|
||||
|
||||
@@ -64,11 +65,14 @@ function getBrands() {
|
||||
function getOptions() {
|
||||
api
|
||||
.get(
|
||||
'/api/v1/sysOption/list?keys=model_of_chat&keys=chatgpt_endpoint&keys=chatgpt_chatPath&keys=chatgpt_api_key&keys=chatgpt_model_name',
|
||||
'/api/v1/sysOption/list?keys=model_of_chat&keys=chatgpt_endpoint&keys=chatgpt_chatPath&keys=chatgpt_api_key&keys=chatgpt_model_name&keys=chat_publish_base_url',
|
||||
)
|
||||
.then((res) => {
|
||||
if (res.errorCode === 0) {
|
||||
entity.value = res.data;
|
||||
entity.value = {
|
||||
...entity.value,
|
||||
...res.data,
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -83,6 +87,7 @@ const entity = ref<SettingsEntity>({
|
||||
chatgpt_chatPath: '',
|
||||
chatgpt_endpoint: '',
|
||||
chatgpt_model_name: '',
|
||||
chat_publish_base_url: '',
|
||||
});
|
||||
|
||||
function formatLlmList(data: ModelProvider[]): LlmOption[] {
|
||||
@@ -150,6 +155,13 @@ function handleSave() {
|
||||
<ElFormItem label="ApiKey">
|
||||
<ElInput v-model="entity.chatgpt_api_key" clearable />
|
||||
</ElFormItem>
|
||||
<ElFormItem :label="$t('settingsConfig.chatPublishBaseUrl')">
|
||||
<ElInput
|
||||
v-model="entity.chat_publish_base_url"
|
||||
clearable
|
||||
:placeholder="$t('settingsConfig.chatPublishBaseUrlPlaceholder')"
|
||||
/>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
<div class="settings-button-container">
|
||||
<ElButton type="primary" @click="handleSave">
|
||||
|
||||
Reference in New Issue
Block a user