From d988c3f0cbb28698b1aed33ded92dfed81bd078b Mon Sep 17 00:00:00 2001 From: zhouwenxuan Date: Thu, 17 Apr 2025 16:53:42 +0800 Subject: [PATCH] optimize --- frontend/src/components/dialog/lib-settings.js | 2 +- seahub/base/context_processors.py | 4 ++-- seahub/settings.py | 2 +- seahub/templates/base_for_react.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/dialog/lib-settings.js b/frontend/src/components/dialog/lib-settings.js index cda19d9a34..1078cc0d3b 100644 --- a/frontend/src/components/dialog/lib-settings.js +++ b/frontend/src/components/dialog/lib-settings.js @@ -17,7 +17,7 @@ import { useMetadataStatus } from '../../hooks'; import '../../css/lib-settings.css'; -const { enableSeafileAI, enableOCR: enableSeafileOCR } = window.app.config; +const { enableSeafileAI, enableSeafileOCR } = window.app.config; const propTypes = { toggleDialog: PropTypes.func.isRequired, diff --git a/seahub/base/context_processors.py b/seahub/base/context_processors.py index b7d32678a6..d2a11ff54d 100644 --- a/seahub/base/context_processors.py +++ b/seahub/base/context_processors.py @@ -26,7 +26,7 @@ from seahub.settings import SEAFILE_VERSION, SITE_DESCRIPTION, \ CUSTOM_LOGIN_BG_PATH, ENABLE_SHARE_LINK_REPORT_ABUSE, \ PRIVACY_POLICY_LINK, TERMS_OF_SERVICE_LINK, ENABLE_SEADOC, THUMBNAIL_SIZE_FOR_GRID, \ FILE_SERVER_ROOT, ENABLE_WHITEBOARD, ENABLE_SEAFILE_AI, ENABLE_EXCALIDRAW, \ - NOTIFICATION_SERVER_URL, ENABLE_OCR + NOTIFICATION_SERVER_URL, ENABLE_SEAFILE_OCR from seahub.organizations.models import OrgAdminSettings from seahub.organizations.settings import ORG_ENABLE_ADMIN_CUSTOM_LOGO @@ -184,7 +184,7 @@ def base(request): 'enable_whiteboard': ENABLE_WHITEBOARD, 'enable_excalidraw': ENABLE_EXCALIDRAW, 'notification_server_url': NOTIFICATION_SERVER_URL, - 'enable_ocr': ENABLE_OCR, + 'enable_seafile_ocr': ENABLE_SEAFILE_OCR, } if request.user.is_staff: diff --git a/seahub/settings.py b/seahub/settings.py index 5def7536e6..cb8a107d80 100644 --- a/seahub/settings.py +++ b/seahub/settings.py @@ -1070,7 +1070,7 @@ SEAFILE_AI_SERVER_URL = '' SEAFILE_AI_SECRET_KEY = '' ENABLE_SEAFILE_AI = False -ENABLE_OCR = False +ENABLE_SEAFILE_OCR = False d = os.path.dirname EVENTS_CONFIG_FILE = os.environ.get( diff --git a/seahub/templates/base_for_react.html b/seahub/templates/base_for_react.html index f06f6d0696..a3c9cff995 100644 --- a/seahub/templates/base_for_react.html +++ b/seahub/templates/base_for_react.html @@ -58,7 +58,7 @@ cloudMode: {% if cloud_mode %} true {% else %} false {% endif %}, isOrgContext: {% if org is not None %} true {% else %} false {% endif %}, enableSeafileAI: {% if enable_seafile_ai %} true {% else %} false {% endif %}, - enableOCR: {% if enable_ocr %} true {% else %} false {% endif %}, + enableSeafileOCR: {% if enable_seafile_ocr %} true {% else %} false {% endif %}, notificationServerUrl: '{{ notification_server_url }}' }, pageOptions: {