From 9a706c7ac5b4af2b2d2ec5aaab897a037bab462f Mon Sep 17 00:00:00 2001 From: shaohuzhang1 <80892890+shaohuzhang1@users.noreply.github.com> Date: Fri, 25 Jul 2025 16:38:15 +0800 Subject: [PATCH] fix: Dialogue prefix (#3746) --- apps/maxkb/urls.py | 2 +- ui/src/views/application-overview/index.vue | 120 ++++++++++++++------ 2 files changed, 88 insertions(+), 34 deletions(-) diff --git a/apps/maxkb/urls.py b/apps/maxkb/urls.py index f758637c0..cc5884a2b 100644 --- a/apps/maxkb/urls.py +++ b/apps/maxkb/urls.py @@ -111,7 +111,7 @@ def page_not_found(request, exception): return HttpResponseRedirect(a) index_path = os.path.join(PROJECT_DIR, 'apps', "static", 'chat', 'index.html') content = get_index_html(index_path) - content.replace("prefix: '/chat'", f"prefix: {CONFIG.get_chat_path()}") + content = content.replace("prefix: '/chat'", f"prefix: {CONFIG.get_chat_path()}") if not os.path.exists(index_path): return HttpResponse("页面不存在", status=404) return HttpResponse(content, status=200) diff --git a/ui/src/views/application-overview/index.vue b/ui/src/views/application-overview/index.vue index bdec10b66..e00551bb7 100644 --- a/ui/src/views/application-overview/index.vue +++ b/ui/src/views/application-overview/index.vue @@ -21,12 +21,18 @@
- {{ $t('views.applicationOverview.appInfo.publicAccessLink') }} + {{ $t('views.applicationOverview.appInfo.publicAccessLink') }} - + :before-change="() => changeState(accessToken.is_active)" + />
@@ -39,7 +45,12 @@ - + @@ -47,8 +58,13 @@
- + {{ $t('views.application.operation.toChat') }} @@ -56,8 +72,11 @@ {{ $t('views.application.operation.toChat') }} - + {{ $t('views.applicationOverview.appInfo.embedInWebsite') }} @@ -69,7 +88,10 @@ {{ $t('views.applicationOverview.appInfo.accessControl') }} - + @@ -79,13 +101,19 @@
- {{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }} + {{ $t('views.applicationOverview.appInfo.apiAccessCredentials') }}
API {{ $t('common.fileUpload.document') }}: - + {{ apiUrl }}
@@ -96,7 +124,7 @@ {{ baseUrl + id - }} + }} @@ -105,7 +133,10 @@
- + @@ -121,13 +152,29 @@ {{ $t('views.applicationOverview.monitor.monitoringStatistics') }}
- - + + - + :end-placeholder="$t('views.applicationOverview.monitor.endDatePlaceholder')" + format="YYYY-MM-DD" + value-format="YYYY-MM-DD" + @change="changeDayRangeHandle" + />
@@ -136,7 +183,11 @@
- + @@ -197,7 +248,10 @@ const urlParams = computed(() => mapToUrlParams(apiInputParams.value) ? '?' + mapToUrlParams(apiInputParams.value) : '', ) const shareUrl = computed( - () => `${window.location.origin}/chat/` + accessToken.value?.access_token + urlParams.value, + () => + `${window.location.origin}${window.MaxKB.chatPrefix}/` + + accessToken.value?.access_token + + urlParams.value, ) const dayOptions = [ @@ -322,7 +376,7 @@ function refreshAccessToken() { const str = t('views.applicationOverview.appInfo.refreshToken.refreshSuccess') updateAccessToken(obj, str) }) - .catch(() => { }) + .catch(() => {}) } async function changeState(bool: boolean) { @@ -368,20 +422,20 @@ function getDetail() { .map((v: any) => { apiInputParams.value = v.properties.api_input_field_list ? v.properties.api_input_field_list.map((v: any) => { - return { - name: v.variable, - value: v.default_value, - } - }) + return { + name: v.variable, + value: v.default_value, + } + }) : v.properties.input_field_list ? v.properties.input_field_list - .filter((v: any) => v.assignment_method === 'api_input') - .map((v: any) => { - return { - name: v.variable, - value: v.default_value, - } - }) + .filter((v: any) => v.assignment_method === 'api_input') + .map((v: any) => { + return { + name: v.variable, + value: v.default_value, + } + }) : [] }) })