Browse Source

add aisetting

master
godo 7 months ago
parent
commit
41bed7b76a
  1. 2
      frontend/src/components/ai/DownAddbox.vue
  2. 6
      frontend/src/components/ai/aisetting.vue
  3. 2
      frontend/src/hook/useAi.ts
  4. 3
      frontend/src/system/config.ts

2
frontend/src/components/ai/DownAddbox.vue

@ -71,7 +71,7 @@ function setLocalInfo() {
}
modelData = toRaw(modelData);
const urls: any = [];
const url = `http://${formData.value.ip}:56711/server?path=`;
const url = `http://${formData.value.ip}:56780/server?path=`;
modelData.paths.forEach((item: any) => {
urls.push(url + item);
});

6
frontend/src/components/ai/aisetting.vue

@ -67,10 +67,10 @@ const saveConfig = async () => {
value: config.value.dataDir.trim(),
})
}
if (config.value.IpList.trim() != "") {
if (config.value.ollamaUrl.trim() != "") {
postData.push({
name: "dataDir",
value: config.value.IpList.trim().split("\n").map((line: string) => line.trim()),
name: "ollamaUrl",
value: config.value.ollamaUrl.trim(),
})
}
if (postData.length > 0) {

2
frontend/src/hook/useAi.ts

@ -0,0 +1,2 @@
import { getSystemConfig,fetchGet, fetchPost } from "@/system/config";
import { useAssistantStore } from '@/stores/assistant';

3
frontend/src/system/config.ts

@ -148,6 +148,9 @@ export const getSystemConfig = (ifset = false) => {
'fourthEnd': '254'
}
}
if(!config.ollamaUrl) {
config.ollamaUrl = 'http://localhost:11434'
}
// 初始化桌面快捷方式列表,若本地存储中已存在则不进行覆盖
if (!config.desktopList) {
config.desktopList = [];

Loading…
Cancel
Save