From efdc9f30d24d880df68663b432e75d67b5d6f6c7 Mon Sep 17 00:00:00 2001 From: teukkk Date: Tue, 16 Apr 2024 10:17:19 +0800 Subject: [PATCH 01/22] =?UTF-8?q?style:=20=E7=AE=80=E5=8C=96=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/template/component/CreateModelDialog.vue | 6 ++---- ui/src/views/template/component/EditModel.vue | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/ui/src/views/template/component/CreateModelDialog.vue b/ui/src/views/template/component/CreateModelDialog.vue index bce8fa09d..880291ddf 100644 --- a/ui/src/views/template/component/CreateModelDialog.vue +++ b/ui/src/views/template/component/CreateModelDialog.vue @@ -44,9 +44,8 @@ Date: Tue, 16 Apr 2024 14:08:30 +0800 Subject: [PATCH 02/22] fix: typos --- .../component/APIKeyDialog.vue | 0 .../component/EmbedDialog.vue | 0 .../component/LimitDialog.vue | 0 .../component/StatisticsCharts.vue | 0 .../{applicaiton-overview => application-overview}/index.vue | 0 5 files changed, 0 insertions(+), 0 deletions(-) rename ui/src/views/{applicaiton-overview => application-overview}/component/APIKeyDialog.vue (100%) rename ui/src/views/{applicaiton-overview => application-overview}/component/EmbedDialog.vue (100%) rename ui/src/views/{applicaiton-overview => application-overview}/component/LimitDialog.vue (100%) rename ui/src/views/{applicaiton-overview => application-overview}/component/StatisticsCharts.vue (100%) rename ui/src/views/{applicaiton-overview => application-overview}/index.vue (100%) diff --git a/ui/src/views/applicaiton-overview/component/APIKeyDialog.vue b/ui/src/views/application-overview/component/APIKeyDialog.vue similarity index 100% rename from ui/src/views/applicaiton-overview/component/APIKeyDialog.vue rename to ui/src/views/application-overview/component/APIKeyDialog.vue diff --git a/ui/src/views/applicaiton-overview/component/EmbedDialog.vue b/ui/src/views/application-overview/component/EmbedDialog.vue similarity index 100% rename from ui/src/views/applicaiton-overview/component/EmbedDialog.vue rename to ui/src/views/application-overview/component/EmbedDialog.vue diff --git a/ui/src/views/applicaiton-overview/component/LimitDialog.vue b/ui/src/views/application-overview/component/LimitDialog.vue similarity index 100% rename from ui/src/views/applicaiton-overview/component/LimitDialog.vue rename to ui/src/views/application-overview/component/LimitDialog.vue diff --git a/ui/src/views/applicaiton-overview/component/StatisticsCharts.vue b/ui/src/views/application-overview/component/StatisticsCharts.vue similarity index 100% rename from ui/src/views/applicaiton-overview/component/StatisticsCharts.vue rename to ui/src/views/application-overview/component/StatisticsCharts.vue diff --git a/ui/src/views/applicaiton-overview/index.vue b/ui/src/views/application-overview/index.vue similarity index 100% rename from ui/src/views/applicaiton-overview/index.vue rename to ui/src/views/application-overview/index.vue From 9cd15a88944baf8aae5299be7cc38ab63f2174d1 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:56:19 +0800 Subject: [PATCH 03/22] =?UTF-8?q?fix:=20=E3=80=90=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E3=80=91=E9=97=AE=E7=AD=94=E9=A1=B5=E9=9D=A2=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8F=90=E9=97=AE=E6=97=B6=EF=BC=8C=E5=8F=AA=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E7=A9=BA=E6=A0=BC=E4=B8=8D=E8=83=BD=E5=8F=91=E9=80=81=20(#121)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/components/ai-chat/index.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ui/src/components/ai-chat/index.vue b/ui/src/components/ai-chat/index.vue index 4ace004bc..b716686b9 100644 --- a/ui/src/components/ai-chat/index.vue +++ b/ui/src/components/ai-chat/index.vue @@ -217,7 +217,7 @@ const chartOpenId = ref('') const chatList = ref([]) const isDisabledChart = computed( - () => !(inputValue.value && (props.appId || (props.data?.name && props.data?.model_id))) + () => !(inputValue.value.trim() && (props.appId || (props.data?.name && props.data?.model_id))) ) const isMdArray = (val: string) => val.match(/^-\s.*/m) const prologueList = computed(() => { @@ -286,7 +286,9 @@ function sendChatHandle(event: any) { // 如果没有按下组合键ctrl,则会阻止默认事件 event.preventDefault() if (!isDisabledChart.value && !loading.value && !event.isComposing) { - chatMessage() + if (inputValue.value.trim()) { + chatMessage() + } } } else { // 如果同时按下ctrl+回车键,则会换行 @@ -423,7 +425,7 @@ function chatMessage(chat?: any, problem?: string, re_chat?: boolean) { if (!chat) { chat = reactive({ id: randomId(), - problem_text: problem ? problem : inputValue.value, + problem_text: problem ? problem : inputValue.value.trim(), answer_text: '', buffer: [], write_ed: false, From 5b7ae292ec1de526353dc4bb1dab1f90c1ecb828 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Tue, 16 Apr 2024 18:44:54 +0800 Subject: [PATCH 04/22] =?UTF-8?q?fix:=20=E3=80=90=E7=9F=A5=E8=AF=86?= =?UTF-8?q?=E5=BA=93=E3=80=91=E5=BD=93=E6=96=87=E6=A1=A3=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=85=B3=E8=81=94=E5=88=86=E6=AE=B5=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E5=A4=8D=20(#124)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/views/problem/component/RelateProblemDialog.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/src/views/problem/component/RelateProblemDialog.vue b/ui/src/views/problem/component/RelateProblemDialog.vue index 0ac461bbb..61b903d05 100644 --- a/ui/src/views/problem/component/RelateProblemDialog.vue +++ b/ui/src/views/problem/component/RelateProblemDialog.vue @@ -157,7 +157,7 @@ function associationClick(item: any) { function searchHandle() { paginationConfig.current_page = 1 paragraphList.value = [] - getParagraphList(currentDocument.value) + currentDocument.value && getParagraphList(currentDocument.value) } function clickDocumentHandle(item: any) { From 5e499e6afa141486fee0c7180337e79737cfa13b Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Tue, 16 Apr 2024 20:59:27 +0800 Subject: [PATCH 05/22] =?UTF-8?q?fix:=20PDF=E4=B8=8A=E4=BC=A0=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=BA=93=E5=BC=80=E5=A7=8B=E5=AF=BC=E5=85=A5=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=8A=A5=E9=94=99=20#122=20(#125)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/common/util/split_model.py | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/common/util/split_model.py b/apps/common/util/split_model.py index 16945e0ec..19b265fc6 100644 --- a/apps/common/util/split_model.py +++ b/apps/common/util/split_model.py @@ -336,6 +336,7 @@ class SplitModel: :return: 解析后数据 {content:段落数据,keywords:[‘段落关键词’],parent_chain:['段落父级链路']} """ text = text.replace('\r', '\n') + text = text.replace("\0", '') result_tree = self.parse_to_tree(text, 0) result = result_tree_to_paragraph(result_tree, [], []) return [item for item in [self.post_reset_paragraph(row) for row in result] if From 11f0a82e683054fb56019aec48c3ec68aaee52ba Mon Sep 17 00:00:00 2001 From: feng626 <57284900+feng626@users.noreply.github.com> Date: Tue, 16 Apr 2024 22:55:34 +0800 Subject: [PATCH 06/22] perf: Optimize the writing method of getting HTTP_AUTHORIZATION (#114) --- apps/application/serializers/application_serializers.py | 2 +- apps/common/auth/authenticate.py | 3 +-- apps/users/views/user.py | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/apps/application/serializers/application_serializers.py b/apps/application/serializers/application_serializers.py index 6ae7cc463..3b20a1b39 100644 --- a/apps/application/serializers/application_serializers.py +++ b/apps/application/serializers/application_serializers.py @@ -196,7 +196,7 @@ class ApplicationSerializer(serializers.Serializer): access_token = serializers.CharField(required=True, error_messages=ErrMessage.char("access_token")) def auth(self, request, with_valid=True): - token = request.META.get('HTTP_AUTHORIZATION', None) + token = request.META.get('HTTP_AUTHORIZATION') token_details = None try: # 校验token diff --git a/apps/common/auth/authenticate.py b/apps/common/auth/authenticate.py index de1499e70..3d2a2258e 100644 --- a/apps/common/auth/authenticate.py +++ b/apps/common/auth/authenticate.py @@ -47,8 +47,7 @@ class TokenDetails: class TokenAuth(TokenAuthentication): # 重新 authenticate 方法,自定义认证规则 def authenticate(self, request): - auth = request.META.get('HTTP_AUTHORIZATION', None - ) + auth = request.META.get('HTTP_AUTHORIZATION') # 未认证 if auth is None: raise AppAuthenticationFailed(1003, '未登录,请先登录') diff --git a/apps/users/views/user.py b/apps/users/views/user.py index a6fa856f1..e691ff4b9 100644 --- a/apps/users/views/user.py +++ b/apps/users/views/user.py @@ -88,8 +88,7 @@ class ResetCurrentUserPasswordView(APIView): data.update(request.data) serializer_obj = RePasswordSerializer(data=data) if serializer_obj.reset_password(): - token_cache.delete(request.META.get('HTTP_AUTHORIZATION', None - )) + token_cache.delete(request.META.get('HTTP_AUTHORIZATION')) return result.success(True) return result.error("修改密码失败") @@ -119,8 +118,7 @@ class Logout(APIView): responses=SendEmailSerializer().get_response_body_api(), tags=['用户']) def post(self, request: Request): - token_cache.delete(request.META.get('HTTP_AUTHORIZATION', None - )) + token_cache.delete(request.META.get('HTTP_AUTHORIZATION')) return result.success(True) From 80ff9c5eae93cc86cce1c4aa550437aacafee4b4 Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud <79562285+wangdan-fit2cloud@users.noreply.github.com> Date: Wed, 17 Apr 2024 10:43:57 +0800 Subject: [PATCH 07/22] =?UTF-8?q?fix:=E3=80=90=E9=97=AE=E9=A2=98=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E3=80=91=E6=B7=BB=E5=8A=A0=E5=85=B3=E8=81=94=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E6=97=B6=EF=BC=8C=E9=97=AE=E9=A2=98=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E4=B8=8B=E6=8B=89=E7=BB=84=E4=BB=B6=E6=A0=B7=E5=BC=8F=E4=BC=98?= =?UTF-8?q?=E5=8C=96(#80)=20(#129)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ui/src/styles/element-plus.scss | 5 +++++ ui/src/views/paragraph/component/ProblemComponent.vue | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ui/src/styles/element-plus.scss b/ui/src/styles/element-plus.scss index a9f8a9061..21ace0feb 100644 --- a/ui/src/styles/element-plus.scss +++ b/ui/src/styles/element-plus.scss @@ -319,3 +319,8 @@ padding-left: 12px !important; padding-right: 12px !important; } + +// select下拉框 +.select-popper { + max-width: 300px; +} diff --git a/ui/src/views/paragraph/component/ProblemComponent.vue b/ui/src/views/paragraph/component/ProblemComponent.vue index 6284f3285..04e3819d5 100644 --- a/ui/src/views/paragraph/component/ProblemComponent.vue +++ b/ui/src/views/paragraph/component/ProblemComponent.vue @@ -25,13 +25,17 @@ @change="addProblemHandle" @blur="isAddProblem = false" class="mb-16" + popper-class="select-popper" + :popper-append-to-body="false" > + > + {{ item.content }} +