From aea002bbc0b6d85f49ac8a9ae6b030e21ec801fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=81=A5=E8=BE=89?= Date: Thu, 15 Aug 2019 16:20:09 +0800 Subject: [PATCH] dtable media_url (#3988) --- frontend/src/view-file-dtable.js | 3 ++- seahub/dtable/views.py | 3 ++- seahub/templates/dtable_file_view_react.html | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/view-file-dtable.js b/frontend/src/view-file-dtable.js index aa5c651e86..a5786cd4d0 100644 --- a/frontend/src/view-file-dtable.js +++ b/frontend/src/view-file-dtable.js @@ -4,7 +4,7 @@ import { seafileAPI } from './utils/seafile-api'; import ViewFileDtable from '@seafile/dtable/es'; import './css/view-file-dtable.css'; -const { server, workspaceID, username, userNickName, contactEmail, fileName, filePath, dtableUuid, dtableServer, dtableSocket } = window.app.pageOptions; +const { server, workspaceID, username, userNickName, contactEmail, fileName, filePath, dtableUuid, dtableServer, dtableSocket, mediaUrl } = window.app.pageOptions; window.dtable = {}; window.dtable = { workspaceID: workspaceID, @@ -17,6 +17,7 @@ window.dtable = { filePath: filePath, fileName: fileName, dtableUuid: dtableUuid, + mediaUrl: mediaUrl, accessToken: '' }; diff --git a/seahub/dtable/views.py b/seahub/dtable/views.py index 1506fa07ad..81eab413a7 100644 --- a/seahub/dtable/views.py +++ b/seahub/dtable/views.py @@ -11,7 +11,7 @@ from seahub.utils import normalize_file_path, render_error, render_permission_er gen_file_get_url, get_file_type_and_ext, IMAGE from seahub.auth.decorators import login_required from seahub.settings import SHARE_LINK_EXPIRE_DAYS_MIN, SHARE_LINK_EXPIRE_DAYS_MAX, \ - SHARE_LINK_EXPIRE_DAYS_DEFAULT, DTABLE_SERVER_URL, SEAFILE_COLLAB_SERVER + SHARE_LINK_EXPIRE_DAYS_DEFAULT, DTABLE_SERVER_URL, SEAFILE_COLLAB_SERVER, MEDIA_URL from seahub.dtable.utils import check_dtable_share_permission, check_dtable_permission from seahub.constants import PERMISSION_ADMIN, PERMISSION_READ_WRITE @@ -66,6 +66,7 @@ def dtable_file_view(request, workspace_id, name): 'filetype': 'dtable', 'workspace_id': workspace_id, 'dtable_uuid': dtable.uuid.hex, + 'media_url': MEDIA_URL, 'dtable_server': DTABLE_SERVER_URL, 'dtable_socket': SEAFILE_COLLAB_SERVER } diff --git a/seahub/templates/dtable_file_view_react.html b/seahub/templates/dtable_file_view_react.html index eb7bd5eabe..bbe91e1bf9 100644 --- a/seahub/templates/dtable_file_view_react.html +++ b/seahub/templates/dtable_file_view_react.html @@ -9,6 +9,7 @@ {% block extra_data %} workspaceID: '{{ workspace_id }}', dtableUuid: '{{ dtable_uuid }}', + mediaUrl: '{{ media_url }}', dtableServer: '{{ dtable_server }}', dtableSocket: '{{ dtable_socket }}' {% endblock %}