diff --git a/build/linux/nginx.conf b/build/linux/nginx.conf
new file mode 100644
index 0000000000000000000000000000000000000000..88e643a996b6946b4c48cdc75ae97af2b9461a02
--- /dev/null
+++ b/build/linux/nginx.conf
@@ -0,0 +1,101 @@
+server {
+ listen 9888;
+ server_name localhost;
+ charset utf-8;
+
+ client_body_buffer_size 5120M;
+ client_max_body_size 5120M;
+ client_body_timeout 600s;
+ client_header_timeout 600s;
+ proxy_send_timeout 600s;
+ proxy_read_timeout 600s;
+
+ add_header X-XSS-Protection "1; mode=block";
+ add_header Referrer-Policy "no-referrer";
+ add_header X-Content-Type-Options nosniff;
+ add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: base64;";
+ add_header Cache-Control "no-cache";
+
+ # 允许所有标准HTTP方法,包括OPTIONS(预检请求)
+ if ($request_method !~ ^(GET|HEAD|POST|PUT|DELETE|OPTIONS)$) {
+ return 444;
+ }
+
+ # 允许预检请求(OPTIONS方法)
+ location ~ ^/witchaind/api/ {
+ # 统一处理跨域头,避免重复设置
+ add_header Access-Control-Allow-Origin '*' always;
+ add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS, PUT, DELETE' always;
+ add_header Access-Control-Allow-Headers 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization' always;
+
+ if ($request_method = 'OPTIONS') {
+ add_header Access-Control-Max-Age 1728000;
+ add_header Content-Type 'text/plain charset=UTF-8';
+ add_header Content-Length 0;
+ return 204;
+ }
+ }
+
+ location ~ /\. {
+ deny all;
+ return 404;
+ }
+
+ # 静态资源匹配
+ location ~ ^/witchaind/(.*\.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot))$ {
+ alias /usr/share/witchaind-web/$1;
+ expires 30d;
+ add_header Cache-Control "public, no-transform";
+ }
+
+ # API路径通用配置
+ location ^~ /witchaind/api/ {
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Forwarded-Proto $scheme;
+ proxy_set_header X-Forwarded-Host $host;
+ proxy_set_header X-Forwarded-Port $server_port;
+
+ # 优化代理缓冲设置
+ proxy_buffering on; # 启用响应缓冲
+ proxy_request_buffering on; # 启用请求缓冲
+ proxy_buffer_size 128k; # 设置合适的缓冲区大小
+ proxy_buffers 4 256k; # 设置缓冲区数量和大小
+
+ # 保持HTTP/1.1兼容性
+ proxy_http_version 1.1;
+ proxy_set_header Connection $connection; # 正确设置连接头
+
+ # 其他代理设置保持不变...
+
+ proxy_pass http://127.0.0.1:9988/;
+ }
+
+ # 健康检查
+ location = /witchaind/api/health_check {
+ deny all;
+ return 404;
+ }
+
+ # 根路径匹配
+ location ~ ^/witchaind(/|$) {
+ alias /usr/share/witchaind-web/;
+ try_files $uri $uri/ /index.html =404;
+ }
+
+ error_page 401 402 403 405 406 407 413 414 /error.html;
+ error_page 404 /404.html;
+ error_page 500 501 502 503 504 505 /error.html;
+
+ location = /witchaind/404.html {
+ root /usr/share/witchaind-web;
+ internal;
+ }
+
+ location = /witchaind/error.html {
+ root /usr/share/witchaind-web;
+ internal;
+ }
+}
+
\ No newline at end of file
diff --git a/package.json b/package.json
index 4389f87203f81cafc73ec8b63bfa36d204f03f9a..fcd67a7d74a494cb7f0d85c29b6798c393ebfbea 100644
--- a/package.json
+++ b/package.json
@@ -52,15 +52,17 @@
"codemirror-editor-vue3": "^2.7.0",
"color": "^4.2.3",
"crypto-js": "^4.2.0",
- "echarts": "^5.5.1",
+ "echarts": "^5.6.0",
"element-plus": "^2.8.0",
"exceljs": "^4.4.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
+ "monaco-editor": "^0.52.2",
"nprogress": "^0.2.0",
"path-browserify": "^1.0.1",
"path-to-regexp": "^6.2.2",
"pinia": "^2.2.2",
+ "pinia-plugin-persistedstate": "^4.2.0",
"qs": "^6.13.0",
"sortablejs": "^1.15.2",
"uuid": "^10.0.0",
@@ -125,6 +127,6 @@
},
"license": "MIT",
"engines": {
- "node": ">=18.18.2"
+ "node": ">=22.14.0"
}
}
diff --git a/src/App.vue b/src/App.vue
index 53f6461c72c4968ded4d3d8a1f9a0490258c3e4b..6836af562538706692e22268aff037d293e32e97 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,7 @@
+
@@ -8,49 +9,65 @@
import { useAppStore } from '@/store/modules/app';
import { useI18n } from 'vue-i18n';
import { computed, ref } from 'vue';
-import AuthAPI from '@/api/auth';
import '@/styles/app.scss';
import router from './router';
+import CustomLoading from '@/components/CustomLoading/index.vue';
+
-const appStore = useAppStore();
const { locale } = useI18n();
const locales = computed(() => appStore.locale);
+const appStore = useAppStore();
+const {downLoading} = storeToRefs(appStore);
// 新增路由状态标记
const isManualNavigation = ref(false);
const handleMessage = (e: MessageEvent) => {
- if(e.data?.type !== 'changeLanguage') {
- return;
- }
- const langObj = {
- CN: 'zh',
- EN: 'en',
- };
- let lang = langObj[e.data.lang as keyof typeof langObj] ?? 'zh';
+ if(e.data?.type === 'changeLanguage') {
+ const langObj = {
+ 'zh_cn': 'zh',
+ 'en': 'en',
+ };
+ let lang = langObj[e.data.lang as keyof typeof langObj] ?? 'zh';
- // 更新 vue-i18n locale
- locale.value = lang;
-
- // 更新 store 中的语言设置
- appStore.changeLanguage(lang);
+ // 更新 vue-i18n locale
+ locale.value = lang;
+
+ // 更新 store 中的语言设置
+ appStore.changeLanguage(lang);
- // 更新用户信息
- const userInfoStr = localStorage.getItem('userInfo');
- if (userInfoStr) {
- const userInfo = JSON.parse(userInfoStr);
- localStorage.setItem('userInfo', JSON.stringify({ ...userInfo, language: lang }));
- AuthAPI.userUpdate({
- language: lang,
- });
+ // 保存语言设置
+ localStorage.setItem('language', lang);
+ }else if(e.data?.type === 'parentToken') {
+ const token = e.data.parentToken;
+ if(token){
+ localStorage.setItem('ECSESSION', token)
+ }else{
+ ElMessage({
+ message: '未获取到token数据!',
+ type: 'warning',
+ customClass: 'o-message--warning',
+ })
+ }
+ }else if(e.data?.type === 'changeTheme') {
+ const theme = e.data.theme;
+ if(theme) {
+ document.body.setAttribute('theme', theme);
+ localStorage.setItem('theme-witchiand', theme);
+ } else {
+ ElMessage({
+ message: '未获取到主题数据!',
+ type: 'warning',
+ customClass: 'o-message--warning',
+ });
+ }
}
- // 保存语言设置
- localStorage.setItem('language', lang);
};
onMounted(() => {
+ document.body.setAttribute('theme', localStorage.getItem('theme') || 'light');
// 监听手动导航
router.beforeEach((to, from, next) => {
- if (from.name === undefined && to.name !== 'root') {
+ if (from.name === undefined && to.name) {
isManualNavigation.value = true;
}
next();
@@ -79,6 +96,14 @@ onMounted(() => {
window.addEventListener('message', handleMessage);
});
onUnmounted(() => window.removeEventListener('message', handleMessage));
+
+// 页面加载时应用存储的主题
+document.addEventListener('DOMContentLoaded', () => {
+ const savedTheme = localStorage.getItem('theme-witchiand') || 'light';
+ if (savedTheme) {
+ document.body.setAttribute('theme', savedTheme);
+ }
+});
\ No newline at end of file
diff --git a/src/api/apiType.ts b/src/api/apiType.ts
index 06e5773811ed8338412eb5de46361c95954bf868..8fc4a640b5695a3deba6b2ab541525f0706ea686 100644
--- a/src/api/apiType.ts
+++ b/src/api/apiType.ts
@@ -1,21 +1,21 @@
export interface CreateKbRequest {
- default_chunk_size: number;
- default_parser_method: string;
+ defaultChunkSize: number;
+ defaultParseMethod: string;
description: string;
- document_type_list: string[];
- embedding_model: string;
- name: string;
+ docTypes: any[];
+ embeddingModel: string;
+ kbName: string;
[property: string]: any;
}
export interface UpdateKbRequest {
- default_chunk_size: number;
- default_parser_method: string;
+ defaultChunkSize: number;
+ defaultParseMethod: string;
description: string;
- document_type_list: object[];
- embedding_model: string;
- id: string;
- name: string;
+ docTypes: object[];
+ embeddingModel: string;
+ teamId?: string;
+ kbName: string;
[property: string]: any;
}
@@ -23,8 +23,8 @@ export interface QueryKbRequest {
created_time_order?: string;
document_count_order?: string;
name?: string;
- page_number: number;
- page_size: number;
+ page: number;
+ pageSize: number;
[property: string]: any;
}
@@ -32,19 +32,19 @@ export interface DocListRequest {
chunk_size_order?: string;
created_time_order?: string;
document_type?: string;
- kb_id: string;
+ kbId: string;
name?: string;
- page_number: number;
- page_size: number;
+ page: number;
+ pageSize: number;
parse_status?: string;
[property: string]: any;
}
export interface DocRenameRequest {
- chunk_size: number;
- document_type: object;
- id: string;
- name: string;
+ chunkSize?: number;
+ docTypeId?: string;
+ docId?: string;
+ docName?: string;
[property: string]: any;
}
@@ -54,9 +54,10 @@ export interface DocDownload {
}
export interface ChunkRequest {
- document_id: string;
- page_number: number;
- page_size: number;
+ docId: string;
+ page: number;
+ pageSize: number;
text?: string;
+ type?: string;
[property: string]: any;
}
diff --git a/src/api/dataSet.ts b/src/api/dataSet.ts
new file mode 100644
index 0000000000000000000000000000000000000000..d667da7ee91822cd36df53b97d14735234a198bc
--- /dev/null
+++ b/src/api/dataSet.ts
@@ -0,0 +1,147 @@
+import request from '@/utils/request';
+import qs from 'qs';
+
+class dataSetAPI {
+ // 获取数据集管理数据
+ static queryDataSetList(data: any) {
+ return request({
+ url: `/dataset/list`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 创建数据集管理 */
+ static createDataSet(data: any) {
+ return request({
+ url: `/dataset`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 删除数据集管理*/
+ static delDataSet(data: string[]) {
+ return request({
+ url: `/dataset`,
+ method: 'delete',
+ data,
+ });
+ }
+
+ /**更新数据集管理 */
+ static updateDataSet(
+ params: { databaseId: string },
+ data: { datasetName?: string; description?: string }
+ ) {
+ return request({
+ url: `/dataset`,
+ method: 'put',
+ params,
+ data,
+ });
+ }
+
+ /**获取单个数据集的详情数据 */
+ static querySingleDataSetInfo(data: any) {
+ return request({
+ url: `/dataset/data`,
+ method: 'post',
+ data,
+ });
+ }
+ /**更新数据集内的详情数据 */
+ static updateDataSetInfo(params: { dataId: string }, data: { answer: string; question: string }) {
+ return request({
+ url: `/dataset/data`,
+ method: 'put',
+ params,
+ data,
+ });
+ }
+ /**删除数据集内的问答数据 */
+ static deleteDataInfo(data: any) {
+ return request({
+ url: `/dataset/data`,
+ method: 'delete',
+ data,
+ });
+ }
+
+ /**获取数据集任务状态 */
+ static queryDataSetTask() {
+ return request({
+ url: `/dataset/task`,
+ method: 'get',
+ });
+ }
+
+ /** 下载数据集 */
+ static downloadDataSet(taskId: string) {
+ return request({
+ url: `/dataset/download`,
+ method: 'get',
+ data: { taskId },
+ });
+ }
+
+ /**生成数据集 */
+ static generateDataSet(data: any) {
+ return request({
+ url: `/dataset/generate`,
+ method: 'post',
+ params: data,
+ });
+ }
+
+ /**导入数据集 */
+ static importDataSet(payload: { data: any; params: any }, options: any) {
+ return request({
+ url: `/dataset/import?kbId=${payload.params.kbId}`,
+ method: 'post',
+ data: payload.data,
+ headers: {
+ 'Content-Type': 'multipart/form-data',
+ },
+ onUploadProgress(e) {
+ const rate = Math.floor((e.loaded / (e.total as number)) * 100);
+ if (rate < 100) {
+ options.onProgress(rate);
+ }
+ },
+ });
+ }
+
+ /** 导出数据集*/
+ static saveDataSet(datasetIds: string[], options: any) {
+ return request({
+ url: `/dataset/export`,
+ method: 'post',
+ params: { datasetIds },
+ paramsSerializer: (params) => qs.stringify(params, { indices: false }),
+ onUploadProgress(e) {
+ const rate = Math.floor((e.loaded / (e.total as number)) * 100);
+ if (rate < 100) {
+ options.onProgress(rate);
+ }
+ },
+ });
+ }
+
+ static queryLlmData() {
+ return request({
+ url: `/other/llm`,
+ method: 'get',
+ });
+ }
+
+ static isHaveTesting(params: { datasetId: string }) {
+ return request({
+ url: '/dataset/testing/exist',
+ method: 'get',
+ params,
+ });
+ }
+}
+
+export default dataSetAPI;
diff --git a/src/api/evaluate.ts b/src/api/evaluate.ts
new file mode 100644
index 0000000000000000000000000000000000000000..066761e31238fa0d57bb47dbbd7b72a862765b1e
--- /dev/null
+++ b/src/api/evaluate.ts
@@ -0,0 +1,60 @@
+import request from '@/utils/request';
+
+class EvaluateAPI {
+ /** 评测列表接口*/
+ static testingList(data: any) {
+ return request({
+ url: `/testing/list`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 新建评测接口*/
+ static createTesting(data: any) {
+ return request({
+ url: `/testing`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 更新评测信息接口*/
+ static updateTesting(params: any, data: any) {
+ return request({
+ url: `/testing`,
+ method: 'put',
+ params,
+ data,
+ });
+ }
+
+ /** 删除评测接口*/
+ static deleteTesting(data: string[]) {
+ return request({
+ url: `/testing`,
+ method: 'delete',
+ data: data,
+ });
+ }
+
+ /** 评测用例详情接口*/
+ static testingCase(data: { testingId: string; page: number; pageSize: number }) {
+ return request({
+ url: `/testing/testcase`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 重启测试接口*/
+ static runTesting(data: { testingId: string; run: boolean }) {
+ return request({
+ url: `/testing/run`,
+ method: 'post',
+ params: data,
+ });
+ }
+}
+
+export default EvaluateAPI;
diff --git a/src/api/group.ts b/src/api/group.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0968bb8c74dbcdd0347c75d7fe18d282b4484fa8
--- /dev/null
+++ b/src/api/group.ts
@@ -0,0 +1,42 @@
+import request from '@/utils/request';
+
+class GroupAPI {
+ /** 团队列表接口*/
+ static teamList(data: any) {
+ return request({
+ url: `/team/list`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 新建团队接口*/
+ static createTeam(data: any) {
+ return request({
+ url: `/team`,
+ method: 'post',
+ data,
+ });
+ }
+
+ /** 更新团队信息接口*/
+ static updateTeam(params: any, data: any) {
+ return request({
+ url: `/team`,
+ method: 'put',
+ params,
+ data,
+ });
+ }
+
+ /** 解散团队接口*/
+ static deleteTeam(data: { teamId: string }) {
+ return request({
+ url: `/team`,
+ method: 'delete',
+ params: data,
+ });
+ }
+}
+
+export default GroupAPI;
diff --git a/src/api/kbApp.ts b/src/api/kbApp.ts
index 2a2822f8dd7d959baf90ec9c59ba77d88ba5367c..2bb90b5c7c711990a1df243a74f6380be455ddad 100644
--- a/src/api/kbApp.ts
+++ b/src/api/kbApp.ts
@@ -1,67 +1,102 @@
import request from '@/utils/request';
import { CreateKbRequest, QueryKbRequest, UpdateKbRequest } from './apiType';
import { ModelForm } from '@/components/UserHeaderBar/modelConfig';
-
+import qs from 'qs';
+
+export type ITaskType =
+ | 'doc_parse'
+ | 'kb_export'
+ | 'kb_import'
+ | 'dataset_export'
+ | 'dataset_import'
+ | 'dataset_generate'
+ | 'tetsing_run';
class KbAppAPI {
/** 获取用户所有知识库*/
static getKbLibrary(data: QueryKbRequest) {
return request({
- url: `/kb/list`,
+ url: `/kb/team`,
method: 'post',
data: data,
});
}
/** 删除用户知识库*/
- static delKbLibrary(data: { id: string; task_id: string }) {
+ static delKbLibrary(data: string[]) {
return request({
- url: `/kb/rm`,
- method: 'post',
+ url: `/kb`,
+ method: 'delete',
data: data,
});
}
/** 创建用户知识库*/
- static createKbLibrary(data: CreateKbRequest) {
+ static createKbLibrary(params: { teamId: string }, data: CreateKbRequest) {
return request({
- url: `/kb/create`,
+ url: `/kb`,
method: 'post',
data: data,
+ params,
});
}
/**更新资产库 */
- static updateKbLibrary(data: UpdateKbRequest) {
+ static updateKbLibrary(params: { kbId: string }, data: UpdateKbRequest) {
return request({
- url: `/kb/update`,
- method: 'post',
+ url: `/kb`,
+ method: 'put',
data: data,
+ params,
});
}
- /** 获取导入知识库状态*/
- static queryKbTaskList(data: { types: any[]; page_size: number; page_number: number }) {
+ /** 获取导入/导出任务列表*/
+ static queryTaskList(data: {
+ teamId: string;
+ taskType: ITaskType;
+ pageSize: number;
+ page: number;
+ }) {
return request({
- url: `/kb/task/list`,
+ url: `/task`,
method: 'post',
data: data,
});
}
- static stopKbTaskList(data: { task_id?: string; types?: any[] }) {
+ static stopKbTaskList(params: { taskId?: string; taskType?: ITaskType }, data: string[]) {
return request({
- url: `/kb/task/rm`,
- method: 'post',
+ url: `/task`,
+ method: 'delete',
+ params,
data: data,
});
}
+ /** 删除任务列表一条任务 */
+ static stopOneTaskList(params: { taskId: string }) {
+ return request({
+ url: `/task/one`,
+ method: 'delete',
+ params,
+ });
+ }
+ /** 删除任务列表所有任务 */
+ static stopAllTaskList(params: { teamId: string; taskType: ITaskType }) {
+ return request({
+ url: `/task/all`,
+ method: 'delete',
+ params,
+ });
+ }
+
/**导入资产库 */
- static importKbLibrary(payload: { data: any }, options: any) {
+ static importKbLibrary(payload: { data: any; params: any }, options: any) {
return request({
url: `/kb/import`,
method: 'post',
data: payload.data,
+ params: payload.params,
headers: {
'Content-Type': 'multipart/form-data',
},
@@ -76,12 +111,13 @@ class KbAppAPI {
/**打包资产库 */
- static savebLibrary(id: string, options: any) {
+ static savebLibrary(kbIds: string[], options: any) {
return request({
url: `/kb/export`,
- data: {
- id,
+ params: {
+ kbIds,
},
+ paramsSerializer: (params) => qs.stringify(params, { indices: false }),
method: 'post',
onUploadProgress(e) {
const rate = Math.floor((e.loaded / (e.total as number)) * 100);
@@ -105,14 +141,14 @@ class KbAppAPI {
static queryLanguageList() {
return request({
- url: `/kb/language`,
+ url: `/other/tokenizer`,
method: 'get',
});
}
static queryEmbeddingModelList() {
return request({
- url: `/other/embedding_model`,
+ url: `/other/embedding`,
method: 'get',
});
}
@@ -124,6 +160,13 @@ class KbAppAPI {
});
}
+ static querySearchMethodList() {
+ return request({
+ url: `/other/search_method`,
+ method: 'get',
+ });
+ }
+
/** 是否启用文件*/
static addUserModel(data: ModelForm) {
return request({
diff --git a/src/api/kfApp.ts b/src/api/kfApp.ts
index f94c938d19ef7f7f8fafe6bc56ef3c30d81a9759..ed85159d1f48b6e7568dc8de06bdda2586de6bb7 100644
--- a/src/api/kfApp.ts
+++ b/src/api/kfApp.ts
@@ -11,46 +11,40 @@ class KfAppAPI {
});
}
/** 修改资产库里的文件*/
- static updateLibraryFile(data: DocRenameRequest) {
+ static updateLibraryFile(params: { docId: string }, data: DocRenameRequest) {
return request({
- url: `/doc/update`,
- method: 'post',
- data: data,
- });
- }
-
- /** 是否启用文件*/
- static switchLibraryFile(data: { enabled: boolean; id: string }) {
- return request({
- url: `/doc/switch`,
- method: 'post',
+ url: `/doc`,
+ method: 'put',
+ params,
data: data,
});
}
/** 是否删除文件*/
- static delLibraryFile(data: { ids: any[] }) {
+ static delLibraryFile(data: string[]) {
return request({
- url: `/doc/rm`,
- method: 'post',
+ url: `/doc`,
+ method: 'delete',
data: data,
});
}
/** 是否重启/取消文件*/
- static runLibraryFile(data: { ids: string[]; run: string }) {
+ static runLibraryFile(params: { parse: boolean }, data: string[]) {
return request({
- url: `/doc/run`,
+ url: `/doc/parse`,
method: 'post',
- data: data,
+ params,
+ data,
});
}
/**导入资产库文档 */
static importKbLibraryFile(payload: { data: any; params: any }, options: any) {
return request({
- url: `/doc/upload?kb_id=${payload.params.kb_id}`,
+ url: `/doc`,
method: 'post',
+ params: payload.params,
data: payload.data,
headers: {
'Content-Type': 'multipart/form-data',
@@ -99,14 +93,37 @@ class KfAppAPI {
});
}
- /** 是否启用文件*/
- static switchLibraryFileSection(data: { enabled: boolean; ids: string[]; document_id: string }) {
+ /** 更新文本块内容 */
+ static updateFileSection(
+ params: { chunkId: string },
+ data: { enabled?: boolean; text?: string }
+ ) {
+ return request({
+ url: `/chunk`,
+ method: 'put',
+ params,
+ data: data,
+ });
+ }
+
+ /** 批量启用文本块内容 */
+ static switchFileSection(params: { enabled: boolean }, data: string[]) {
return request({
url: `/chunk/switch`,
- method: 'post',
+ method: 'put',
+ params,
data: data,
});
}
+
+ /** 查询文档日志*/
+ static getDocumentLog(data: { docId: string }) {
+ return request({
+ url: `/doc/report`,
+ method: 'get',
+ params: data,
+ });
+ }
}
export default KfAppAPI;
diff --git a/src/assets/images/dark_bg.webp b/src/assets/images/dark_bg.webp
new file mode 100644
index 0000000000000000000000000000000000000000..671c9df36fd79cf4f2ea99be5288420af253045e
Binary files /dev/null and b/src/assets/images/dark_bg.webp differ
diff --git a/src/assets/images/date_time.svg b/src/assets/images/date_time.svg
new file mode 100644
index 0000000000000000000000000000000000000000..90b2f93e9a6244da2d053e85847dea531f2cb301
--- /dev/null
+++ b/src/assets/images/date_time.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/images/empty_failed.svg b/src/assets/images/empty_failed.svg
new file mode 100644
index 0000000000000000000000000000000000000000..374225ec44fa650a8c9149a3024a6381e5a91258
--- /dev/null
+++ b/src/assets/images/empty_failed.svg
@@ -0,0 +1,46 @@
+
diff --git a/src/assets/images/empty_failed_dark.svg b/src/assets/images/empty_failed_dark.svg
new file mode 100644
index 0000000000000000000000000000000000000000..67bd878fdb9170f24efd786ec76090102eac50e1
--- /dev/null
+++ b/src/assets/images/empty_failed_dark.svg
@@ -0,0 +1,48 @@
+
diff --git a/src/assets/images/empty_pending.svg b/src/assets/images/empty_pending.svg
new file mode 100644
index 0000000000000000000000000000000000000000..7e8824e46a784c02628fc2243f1b0be031c665ca
--- /dev/null
+++ b/src/assets/images/empty_pending.svg
@@ -0,0 +1,62 @@
+
diff --git a/src/assets/images/empty_pending_dark.svg b/src/assets/images/empty_pending_dark.svg
new file mode 100644
index 0000000000000000000000000000000000000000..26c979ec5c07620e0753002fe94cc8be46c21bed
--- /dev/null
+++ b/src/assets/images/empty_pending_dark.svg
@@ -0,0 +1,61 @@
+
diff --git a/src/assets/images/empty_running.svg b/src/assets/images/empty_running.svg
new file mode 100644
index 0000000000000000000000000000000000000000..02d0c7e754e07eabdd22c4e22861aa1f840ddf30
--- /dev/null
+++ b/src/assets/images/empty_running.svg
@@ -0,0 +1,49 @@
+
diff --git a/src/assets/images/empty_running_dark.svg b/src/assets/images/empty_running_dark.svg
new file mode 100644
index 0000000000000000000000000000000000000000..603291ce98af0a6f6dd5e1d7a91a7c41f6dcfece
--- /dev/null
+++ b/src/assets/images/empty_running_dark.svg
@@ -0,0 +1,47 @@
+
diff --git a/src/assets/images/file_count.svg b/src/assets/images/file_count.svg
new file mode 100644
index 0000000000000000000000000000000000000000..f12f3b47a139f36ad69a4a76f0c0e32500754de0
--- /dev/null
+++ b/src/assets/images/file_count.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/images/file_size.svg b/src/assets/images/file_size.svg
new file mode 100644
index 0000000000000000000000000000000000000000..bab846b3b2704cabc72199bb904ada823213e03b
--- /dev/null
+++ b/src/assets/images/file_size.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/images/light_bg.webp b/src/assets/images/light_bg.webp
new file mode 100644
index 0000000000000000000000000000000000000000..c0f0983f820c9ef4b99f92d0181da3864ec19daa
Binary files /dev/null and b/src/assets/images/light_bg.webp differ
diff --git a/src/assets/images/login-background-light.webp b/src/assets/images/login-background-light.webp
deleted file mode 100644
index 4a7f7719b05608234e8895d51f1818734a90eb2f..0000000000000000000000000000000000000000
Binary files a/src/assets/images/login-background-light.webp and /dev/null differ
diff --git a/src/assets/images/member_count.svg b/src/assets/images/member_count.svg
new file mode 100644
index 0000000000000000000000000000000000000000..60878dc542f308cfcc0d6cbaf80e5c7a0734da0e
--- /dev/null
+++ b/src/assets/images/member_count.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/dark_taskList.svg b/src/assets/svg/dark_taskList.svg
new file mode 100644
index 0000000000000000000000000000000000000000..132f9c5d9afd44779af810af86722ef52a1a9132
--- /dev/null
+++ b/src/assets/svg/dark_taskList.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/dark_taskScore.svg b/src/assets/svg/dark_taskScore.svg
new file mode 100644
index 0000000000000000000000000000000000000000..4db57cc45785bfe95629d4765e0d2b6882f5e5c5
--- /dev/null
+++ b/src/assets/svg/dark_taskScore.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/fail.svg b/src/assets/svg/fail.svg
new file mode 100644
index 0000000000000000000000000000000000000000..483ea68b87f8575c0b173cbd898e8afc20f0d888
--- /dev/null
+++ b/src/assets/svg/fail.svg
@@ -0,0 +1,9 @@
+
diff --git a/src/assets/svg/light_taskList.svg b/src/assets/svg/light_taskList.svg
new file mode 100644
index 0000000000000000000000000000000000000000..ff887a1f7b793bec0d17e19dbb0b2e569f00d006
--- /dev/null
+++ b/src/assets/svg/light_taskList.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/light_taskScore.svg b/src/assets/svg/light_taskScore.svg
new file mode 100644
index 0000000000000000000000000000000000000000..0c4e3246710b9daa1634f64f662acc10baa0eb21
--- /dev/null
+++ b/src/assets/svg/light_taskScore.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/more.svg b/src/assets/svg/more.svg
new file mode 100644
index 0000000000000000000000000000000000000000..69e80d3ccf78421b48d0a44d9317a1af8c67788d
--- /dev/null
+++ b/src/assets/svg/more.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/more_active.svg b/src/assets/svg/more_active.svg
new file mode 100644
index 0000000000000000000000000000000000000000..4158d0bf3994ca35cedd0d8f594dc6636784344a
--- /dev/null
+++ b/src/assets/svg/more_active.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/more_hover.svg b/src/assets/svg/more_hover.svg
new file mode 100644
index 0000000000000000000000000000000000000000..46cc8e87d64f938caaf0bd77212e6e6d75c2b9e0
--- /dev/null
+++ b/src/assets/svg/more_hover.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/succes.svg b/src/assets/svg/succes.svg
new file mode 100644
index 0000000000000000000000000000000000000000..c2d95a2ee35a3ccdc89d4377b4c1247747edeafa
--- /dev/null
+++ b/src/assets/svg/succes.svg
@@ -0,0 +1,10 @@
+
diff --git a/src/assets/svg/taskEmpty.svg b/src/assets/svg/taskEmpty.svg
new file mode 100644
index 0000000000000000000000000000000000000000..5fc27046e095beafcacb3a880403b4b0417e202f
--- /dev/null
+++ b/src/assets/svg/taskEmpty.svg
@@ -0,0 +1,61 @@
+
diff --git a/src/assets/svg/taskFailed.svg b/src/assets/svg/taskFailed.svg
new file mode 100644
index 0000000000000000000000000000000000000000..d604e8828d034041fab95e43a16a8666158ac0a5
--- /dev/null
+++ b/src/assets/svg/taskFailed.svg
@@ -0,0 +1,46 @@
+
diff --git a/src/assets/svg/taskList.svg b/src/assets/svg/taskList.svg
new file mode 100644
index 0000000000000000000000000000000000000000..7246b5e576c180ae0765264fda8e871e3b4c16cd
--- /dev/null
+++ b/src/assets/svg/taskList.svg
@@ -0,0 +1,13 @@
+
diff --git a/src/assets/svg/taskLoading.svg b/src/assets/svg/taskLoading.svg
new file mode 100644
index 0000000000000000000000000000000000000000..183bad2d2e9be87dfbb3b486b1d665cb44bdefec
--- /dev/null
+++ b/src/assets/svg/taskLoading.svg
@@ -0,0 +1,49 @@
+
diff --git a/src/assets/svg/taskScore.svg b/src/assets/svg/taskScore.svg
new file mode 100644
index 0000000000000000000000000000000000000000..07964681f5d76ec8565a38c2081ac1771308170b
--- /dev/null
+++ b/src/assets/svg/taskScore.svg
@@ -0,0 +1,7 @@
+
diff --git a/src/components/CustomLoading/index.vue b/src/components/CustomLoading/index.vue
index 1f50b219fc27ac4d7d5a2f86123539352a9ca6a8..f5067e504f652ffa761637d1172d7974f753e2f5 100644
--- a/src/components/CustomLoading/index.vue
+++ b/src/components/CustomLoading/index.vue
@@ -4,7 +4,7 @@
v-loading="loading"
:class="loading ? 'customLoading' : 'loadingNone'"
:element-loading-text="loadingText || `${$t('pageTipText.Loading')}...`"
- element-loading-background="rgba(122, 122, 122, 0.5)">
+ :element-loading-background="backgroundColor">
diff --git a/src/components/EmptyStatus/index.vue b/src/components/EmptyStatus/index.vue
new file mode 100644
index 0000000000000000000000000000000000000000..e1a39a14a3285427fb62cfe5f595725826b15bc9
--- /dev/null
+++ b/src/components/EmptyStatus/index.vue
@@ -0,0 +1,56 @@
+
+
+
+
{{ description }}
+
+ {{ buttonText }}
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/GroupLayout/index.vue b/src/components/GroupLayout/index.vue
new file mode 100644
index 0000000000000000000000000000000000000000..a26addbbe2b53d008cf2d1a56f5f160d8e563af1
--- /dev/null
+++ b/src/components/GroupLayout/index.vue
@@ -0,0 +1,104 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/KnowledgeForm/index.vue b/src/components/KnowledgeForm/index.vue
index e1d6586e7d9d562f805e03f17338ee2b341e7471..1a38938fd01b0627d9ee44a64564eb6fe8c59c58 100644
--- a/src/components/KnowledgeForm/index.vue
+++ b/src/components/KnowledgeForm/index.vue
@@ -1,7 +1,6 @@
+ prop="kbName">
+ prop="tokenizer">
+ prop="embeddingModel">
{{ $t('assetLibrary.embeddedModel') }}
+ prop="defaultParseMethod">
@@ -110,7 +109,7 @@
+ prop="defaultChunkSize">
{{ $t('assetLibrary.fileChunkSize') }}
- (512~1024)
+ (128~1024)
+
+
+
+ {{ $t('assetLibrary.numberUpperLimit') }}
+
+
+
+
+
+
+
+ (128~1024)
+
+
+
+ {{ $t('assetLibrary.sizeUpperLimit') }}
+
+
+
+
+
+
+
+ (128M~2048M)
{{ $t('btnText.add') }}
@@ -152,12 +195,13 @@
();
const createLoading = ref(false);
const isSubmitDisabled = ref(true);
const ruleForm = ref({
- name: '',
- language: '',
- default_chunk_size: 1024,
- embedding_model: '',
- default_parser_method: '',
- document_type_list: [],
+ kbName: '',
+ tokenizer: '',
+ defaultChunkSize: 512,
+ embeddingModel: '',
+ defaultParseMethod: '',
+ docTypes: [],
description: '',
+ uploadSizeLimit: 512,
+ uploadCountLimit: 128,
});
const languageOptions = ref();
const emBeddingModelOptions = ref();
@@ -264,20 +313,19 @@ onMounted(() => {
? JSON.parse(
JSON.stringify({
...props.formData,
- document_type_list: props.formData?.document_type_list.filter(
- (item: any) => item?.type?.length
+ docTypes: props.formData?.docTypes.filter(
+ (item: any) => item?.docTypeName?.length
),
- default_chunk_size: props.formData.default_chunk_size || 1024,
+ defaultChunkSize: props.formData.defaultChunkSize || 512,
+ uploadSizeLimit: props.formData?.uploadSizeLimit || 512,
+ uploadCountLimit: props.formData?.uploadCountLimit || 128,
} as RuleForm)
)
: ruleForm.value;
KbAppAPI.queryLanguageList().then((res: any) => {
languageOptions.value = res?.map((item: any) => {
- if (item === 'English') {
- return { label: item, value: 'en' };
- }
- return { label: item, value: 'zh' };
+ return { label: item, value: item };
});
});
@@ -318,7 +366,7 @@ const rules = reactive>({
required: true,
},
],
- name: [
+ kbName: [
{
required: true,
message: t('assetLibrary.message.name'),
@@ -330,34 +378,36 @@ const rules = reactive>({
trigger: ['blur', 'change'],
},
],
- language: [
+ tokenizer: [
{
required: true,
message: t('assetLibrary.message.languagePlace'),
- trigger: ['blur', 'chanblurge'],
+ trigger: ['blur', 'change'],
},
],
- embedding_model: [
+ embeddingModel: [
{
required: true,
message: t('assetLibrary.message.modelPlace'),
trigger: ['blur', 'change'],
},
],
- default_parser_method: [
+ defaultParseMethod: [
{
required: true,
message: t('assetLibrary.message.analyticMethodPlace'),
trigger: ['blur', 'change'],
},
],
- default_chunk_size: [
+ defaultChunkSize: [
{
message: t('assetLibrary.message.pleasePlace'),
trigger: ['blur', 'change'],
required: true,
},
],
+ uploadSizeLimit:[ { required: true } ],
+ uploadCountLimit:[ { required: true } ],
});
const handleCopyTextToclipboard = (text: string) => {
@@ -385,27 +435,27 @@ onMounted(() => {
}
});
});
-
const submitForm = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
await formEl.validate((valid) => {
let payload = {
- name: ruleForm.value.name,
- language: ruleForm.value?.language?.toLocaleLowerCase(),
+ kbName: ruleForm.value.kbName,
+ tokenizer: ruleForm.value?.tokenizer?.toLocaleLowerCase(),
description: ruleForm.value.description,
- embedding_model: ruleForm.value.embedding_model,
- default_parser_method: ruleForm.value.default_parser_method,
- default_chunk_size: ruleForm.value.default_chunk_size,
- document_type_list: ruleForm.value.document_type_list.filter((item) => item.type.length > 0),
+ embeddingModel: ruleForm.value.embeddingModel,
+ defaultParseMethod: ruleForm.value.defaultParseMethod,
+ defaultChunkSize: ruleForm.value.defaultChunkSize,
+ uploadCountLimit: ruleForm.value.uploadCountLimit,
+ uploadSizeLimit: ruleForm.value.uploadSizeLimit,
+ docTypes: ruleForm.value.docTypes.filter((item) => item.docTypeName.length > 0),
};
if (valid) {
loading.visible.value = true;
createLoading.value = true;
- if (ruleForm.value?.id) {
+ if (ruleForm.value?.kbId) {
KbAppAPI.updateKbLibrary({
- id: ruleForm.value.id,
- ...payload,
- })
+ kbId: ruleForm.value.kbId,
+ },payload)
.then((res) => {
props.handleOpsKbForm();
if (props.configInfo) {
@@ -418,16 +468,23 @@ const submitForm = async (formEl: FormInstance | undefined) => {
customClass: 'o-message--success',
duration: 3000,
});
- ruleForm.value.document_type_list = (res as any).document_type_list;
+ ruleForm.value.docTypes = (res as any).docTypes;
})
.finally(() => {
loading.visible.value = false;
createLoading.value = false;
});
} else {
- KbAppAPI.createKbLibrary({
+ let docArr:any = []
+ ruleForm.value.docTypes.map((item) => {
+ docArr.push({
+ docTypeId:item.docTypeId,
+ docTypeName:item.docTypeName
+ })
+ } )
+ KbAppAPI.createKbLibrary({teamId:route.query.id?.toString() ?? ''},{
...payload,
- document_type_list: ruleForm.value.document_type_list.map((item) => item.type),
+ docTypes: docArr
})
.then(() => {
props.handleOpsKbForm();
@@ -449,17 +506,17 @@ const handleCancelForm = () => {
};
const handleRemoveDocType = (index: number) => {
- ruleForm.value.document_type_list.splice(index, 1);
+ ruleForm.value.docTypes.splice(index, 1);
};
const handleRemoveAllDocType = () => {
- ruleForm.value.document_type_list.splice(0);
+ ruleForm.value.docTypes.splice(0);
};
const handleAddDocType = () => {
- ruleForm.value.document_type_list.push({
- id: uuidv4(),
- type: '',
+ ruleForm.value.docTypes.push({
+ docTypeId: uuidv4(),
+ docTypeName: '',
});
};
diff --git a/src/components/TableFilter/index.vue b/src/components/TableFilter/index.vue
index 9624007089dce32b9c1b54ef658ce7b2cb7c6949..05429a29deea2f4580b177f51668e77766ce0394 100644
--- a/src/components/TableFilter/index.vue
+++ b/src/components/TableFilter/index.vue
@@ -51,7 +51,7 @@
{
-
diff --git a/src/components/UserHeaderBar/index.vue b/src/components/UserHeaderBar/index.vue
index 29b434185919e47e811c81bdeec5729dbc6da108..68f3985f61d50dbcd6cc390bdd3697af5c61a604 100644
--- a/src/components/UserHeaderBar/index.vue
+++ b/src/components/UserHeaderBar/index.vue
@@ -1,6 +1,6 @@