forked from 1Panel-dev/MaxKB
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 6a734cd Merge: 45205e2 d2d35b6 Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Fri May 10 14:57:47 2024 +0800 Merge pull request 1Panel-dev#415 from 1Panel-dev/pr@main@fix-bug fix: 文档设置相似度问题修复 commit d2d35b6 Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Fri May 10 14:55:47 2024 +0800 fix: 文档设置相似度问题修复 commit 45205e2 Merge: d724a54 19057b1 Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Fri May 10 14:15:32 2024 +0800 Merge pull request 1Panel-dev#414 from 1Panel-dev/pr@main@peaf-login perf: 优化登录页面 commit 19057b1 Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Fri May 10 14:13:44 2024 +0800 perf: 优化登录页面 commit d724a54 Merge: 18861b4 61a0b2c Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Fri May 10 11:06:37 2024 +0800 Merge pull request 1Panel-dev#411 from 1Panel-dev/pr@main@fix-bug fix: 修复版本号翻译问题 commit 61a0b2c Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Fri May 10 11:05:04 2024 +0800 fix: 修复版本号翻译问题 commit 18861b4 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu May 9 20:45:14 2024 +0800 fix: 修复上传文档懒加载无法加载第二页 (1Panel-dev#407) commit b123f0f Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu May 9 19:54:25 2024 +0800 perf: 优化文档分段前端懒加载 (1Panel-dev#406) commit cf4ce7e Merge: 7f30d03 8038385 Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Thu May 9 18:02:47 2024 +0800 Merge pull request 1Panel-dev#405 from 1Panel-dev/pr@main@perf-cross_domain 跨域地址过滤空行 commit 8038385 Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Thu May 9 17:58:21 2024 +0800 perf: 跨域地址过滤空行 commit 5838a4f Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Thu May 9 17:46:57 2024 +0800 perf: 分段预览懒加载 commit 7f30d03 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Thu May 9 15:55:35 2024 +0800 fix: 修复分词超过数据库最大限制 (1Panel-dev#401) commit 8159fef Merge: 3fb6192 61819fd Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Thu May 9 10:27:17 2024 +0800 Merge pull request 1Panel-dev#397 from 1Panel-dev/pr@main@fix-bug fix: 修复批量迁移问题 commit 61819fd Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Thu May 9 10:24:38 2024 +0800 fix: 修复批量迁移问题 commit 3fb6192 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed May 8 18:46:58 2024 +0800 fix: 跨域失效 (1Panel-dev#394) commit 69e39f5 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed May 8 17:40:01 2024 +0800 feat: 导入时支持设置分段标题为关联问题(1Panel-dev#177) (1Panel-dev#392) commit 4da8b1b Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed May 8 17:31:56 2024 +0800 feat: 直接回答支持设置相似度值(1Panel-dev#371) commit 267be44 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed May 8 17:13:13 2024 +0800 feat: 跨域设置(1Panel-dev#276) commit d4e742f Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Wed May 8 10:40:15 2024 +0800 feat: 分段管理支持批量迁移,删除分段 1Panel-dev#113,1Panel-dev#103 commit 8204d5f Merge: 48496bc 23ed472 Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Tue May 7 17:09:20 2024 +0800 Merge pull request 1Panel-dev#381 from 1Panel-dev/pr@main@fix-bugs fix: 修复快捷修改组件问题和优化支持一键清空输入内容 commit 23ed472 Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Tue May 7 17:06:39 2024 +0800 fix: 修复快捷修改组件问题和优化可一键删除输入内容 commit 48496bc Merge: 7a08f03 1e67f39 Author: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Tue May 7 16:34:43 2024 +0800 Merge pull request 1Panel-dev#380 from 1Panel-dev/pr@main@perf-migrate perf: 优化迁移文档过滤知识库选项 commit 1e67f39 Author: wangdan-fit2cloud <dan.wang@fit2cloud.com> Date: Tue May 7 16:30:10 2024 +0800 perf: 优化迁移文档过滤知识库选项 commit 7a08f03 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue May 7 13:54:13 2024 +0800 fix: 创建新用户时用户名含有 0 时校验不通过 1Panel-dev#358 (1Panel-dev#375) commit 77d71f9 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue May 7 13:50:39 2024 +0800 fix: 修改文档向量化重试,文档状态处理 (1Panel-dev#373) commit c1b6ec6 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue May 7 12:18:03 2024 +0800 fix: 导入文档中含有特殊字符时,导入失败。 1Panel-dev#363 (1Panel-dev#372) commit 7d62842 Author: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue May 7 10:34:38 2024 +0800 fix: ui文件打包报错 1Panel-dev#348 (1Panel-dev#368)
- Loading branch information
1 parent
0945911
commit 7ebe9fa
Showing
45 changed files
with
1,286 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
apps/application/migrations/0006_applicationapikey_allow_cross_domain_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.1.13 on 2024-05-08 13:57 | ||
|
||
import django.contrib.postgres.fields | ||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('application', '0005_alter_chat_abstract_alter_chatrecord_answer_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='applicationapikey', | ||
name='allow_cross_domain', | ||
field=models.BooleanField(default=False, verbose_name='是否允许跨域'), | ||
), | ||
migrations.AddField( | ||
model_name='applicationapikey', | ||
name='cross_domain_list', | ||
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(blank=True, max_length=128), default=list, size=None, verbose_name='跨域列表'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# coding=utf-8 | ||
""" | ||
@project: maxkb | ||
@Author:虎 | ||
@file: cross_domain_middleware.py | ||
@date:2024/5/8 13:36 | ||
@desc: | ||
""" | ||
from django.db.models import QuerySet | ||
from django.http import HttpResponse | ||
from django.utils.deprecation import MiddlewareMixin | ||
|
||
from application.models.api_key_model import ApplicationApiKey | ||
|
||
|
||
class CrossDomainMiddleware(MiddlewareMixin): | ||
|
||
def process_request(self, request): | ||
if request.method == 'OPTIONS': | ||
return HttpResponse(status=200, | ||
headers={ | ||
"Access-Control-Allow-Origin": "*", | ||
"Access-Control-Allow-Methods": "GET,POST,DELETE,PUT", | ||
"Access-Control-Allow-Headers": "Origin,X-Requested-With,Content-Type,Accept,Authorization,token"}) | ||
|
||
def process_response(self, request, response): | ||
auth = request.META.get('HTTP_AUTHORIZATION') | ||
origin = request.META.get('HTTP_ORIGIN') | ||
if auth is not None and str(auth).startswith("application-") and origin is not None: | ||
application_api_key = QuerySet(ApplicationApiKey).filter(secret_key=auth).first() | ||
if application_api_key.allow_cross_domain: | ||
response['Access-Control-Allow-Methods'] = 'GET,POST,DELETE,PUT' | ||
response[ | ||
'Access-Control-Allow-Headers'] = "Origin,X-Requested-With,Content-Type,Accept,Authorization,token" | ||
if application_api_key.cross_domain_list is None or len(application_api_key.cross_domain_list) == 0: | ||
response['Access-Control-Allow-Origin'] = "*" | ||
elif application_api_key.cross_domain_list.__contains__(origin): | ||
response['Access-Control-Allow-Origin'] = origin | ||
return response |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
apps/dataset/migrations/0004_document_directly_return_similarity.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Generated by Django 4.1.13 on 2024-05-08 16:43 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('dataset', '0003_document_hit_handling_method'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='document', | ||
name='directly_return_similarity', | ||
field=models.FloatField(default=0.9, verbose_name='直接回答相似度'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.