diff --git a/apps/maxkb/conf.py b/apps/maxkb/conf.py index da060f95511..d5303db5c02 100644 --- a/apps/maxkb/conf.py +++ b/apps/maxkb/conf.py @@ -115,6 +115,10 @@ def get_admin_path(self): def get_chat_path(self): return self.get('CHAT_PATH', '/chat') + def get_default_execute_condition(self): + val = self.get('DEFAULT_EXECUTE_CONDITION', 'AND') + return 'OR' if val.upper() == 'OR' else 'AND' + def get_session_timeout(self): return int(self.get('SESSION_TIMEOUT', 28800)) diff --git a/apps/maxkb/urls/web.py b/apps/maxkb/urls/web.py index fb043d56a64..3e479f41446 100644 --- a/apps/maxkb/urls/web.py +++ b/apps/maxkb/urls/web.py @@ -130,8 +130,10 @@ def page_not_found(request, exception): if not os.path.exists(index_path): return HttpResponse("页面不存在", status=404) content = get_index_html(index_path) - content = content.replace("prefix: '/admin'", f"prefix: '{CONFIG.get_admin_path()}'").replace( - "chatPrefix: '/chat'", f"chatPrefix: '{CONFIG.get_chat_path()}'") + content = content.replace( + "prefix: '/admin'", f"prefix: '{CONFIG.get_admin_path()}'").replace( + "chatPrefix: '/chat'", f"chatPrefix: '{CONFIG.get_chat_path()}'").replace( + "defaultExecuteCondition: 'AND'", f"defaultExecuteCondition: '{CONFIG.get_default_execute_condition()}'") return HttpResponse(content, status=200) else: return HttpResponseRedirect(admin_ui_prefix + '/') diff --git a/ui/admin.html b/ui/admin.html index 2ed8675c3f1..a9514a3ed32 100644 --- a/ui/admin.html +++ b/ui/admin.html @@ -15,6 +15,7 @@ window.MaxKB = { prefix: '/admin', chatPrefix: '/chat', + defaultExecuteCondition: 'AND', } })() diff --git a/ui/env.d.ts b/ui/env.d.ts index 9e940bf8210..e39e9d04e74 100644 --- a/ui/env.d.ts +++ b/ui/env.d.ts @@ -6,5 +6,6 @@ interface Window { MaxKB: { prefix: string chatPrefix: string + defaultExecuteCondition: string } } diff --git a/ui/src/workflow/common/NodeContainer.vue b/ui/src/workflow/common/NodeContainer.vue index 86cf69a6df6..a3d5c139df2 100644 --- a/ui/src/workflow/common/NodeContainer.vue +++ b/ui/src/workflow/common/NodeContainer.vue @@ -41,15 +41,15 @@ placement="bottom-start" > - - + +