mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge branch 'develop' into feature/jwtHistoryFiles
This commit is contained in:
Submodule web/documentserver-example/python/assets updated: 589266f57f...d66cdf5b05
@ -1,6 +1,6 @@
|
||||
import os
|
||||
|
||||
VERSION = '1.0.0'
|
||||
VERSION = '1.1.0'
|
||||
|
||||
FILE_SIZE_MAX = 5242880
|
||||
STORAGE_PATH = 'app_data'
|
||||
|
||||
@ -45,13 +45,14 @@ See the detailed guide to learn how to install Document Server [for Windows](htt
|
||||
nano config.py
|
||||
```
|
||||
|
||||
Edit the following line:
|
||||
Edit the following lines:
|
||||
|
||||
```
|
||||
STORAGE_PATH = 'app_data'
|
||||
DOC_SERV_SITE_URL = 'https://documentserver/'
|
||||
```
|
||||
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed.
|
||||
where the **documentserver** is the name of the server with the ONLYOFFICE Document Server installed and the **STORAGE_PATH** is the path where files will be created and stored. You can set an absolute path. For example, *D:\\\\folder*. Please note that on Windows OS the double backslash must be used as a separator.
|
||||
|
||||
6. Run the **Python** server:
|
||||
|
||||
|
||||
@ -164,7 +164,7 @@ def getRootFolder(req):
|
||||
else:
|
||||
curAdr = req.META['REMOTE_ADDR']
|
||||
|
||||
directory = os.path.join(config.STORAGE_PATH, curAdr)
|
||||
directory = config.STORAGE_PATH if os.path.isabs(config.STORAGE_PATH) else os.path.join(config.STORAGE_PATH, curAdr)
|
||||
|
||||
if not os.path.exists(directory): # if such a directory does not exist, make it
|
||||
os.makedirs(directory)
|
||||
|
||||
@ -79,7 +79,7 @@ descr_user_0 = [
|
||||
|
||||
USERS = [
|
||||
User('uid-1', 'John Smith', 'smith@example.com',
|
||||
None, None, {},
|
||||
'', None, {},
|
||||
None, [], descr_user_1, True),
|
||||
User('uid-2', 'Mark Pottato', 'pottato@example.com',
|
||||
'group-2', ['group-2', ''], {
|
||||
@ -96,7 +96,7 @@ USERS = [
|
||||
},
|
||||
False, ["copy", "download", "print"], descr_user_3, False),
|
||||
User('uid-0', None, None,
|
||||
None, None, {},
|
||||
'', None, {},
|
||||
None, [], descr_user_0, False)
|
||||
]
|
||||
|
||||
|
||||
@ -154,7 +154,7 @@ def edit(request):
|
||||
ext = fileUtils.getFileExt(filename)
|
||||
|
||||
fileUri = docManager.getFileUri(filename, True, request)
|
||||
fileUriUser = docManager.getFileUri(filename, False, request)
|
||||
fileUriUser = docManager.getDownloadUrl(filename, request) + "&dmode=emb" if os.path.isabs(config.STORAGE_PATH) else docManager.getFileUri(filename, False, request)
|
||||
docKey = docManager.generateFileKey(filename, request)
|
||||
fileType = fileUtils.getFileType(filename)
|
||||
user = users.getUserFromReq(request) # get user
|
||||
@ -361,8 +361,9 @@ def download(request):
|
||||
try:
|
||||
fileName = fileUtils.getFileName(request.GET['fileName']) # get the file name
|
||||
userAddress = request.GET.get('userAddress') if request.GET.get('userAddress') else request
|
||||
isEmbedded = request.GET.get('dmode')
|
||||
|
||||
if (jwtManager.isEnabled()):
|
||||
if (jwtManager.isEnabled() and isEmbedded == None):
|
||||
jwtHeader = 'Authorization' if config.DOC_SERV_JWT_HEADER is None or config.DOC_SERV_JWT_HEADER == '' else config.DOC_SERV_JWT_HEADER
|
||||
token = request.headers.get(jwtHeader)
|
||||
if token:
|
||||
|
||||
@ -87,10 +87,6 @@
|
||||
}
|
||||
|
||||
@media (max-width: 1008px) {
|
||||
#portal-info {
|
||||
width: 65vw;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
margin-left: 0;
|
||||
}
|
||||
@ -312,6 +308,10 @@
|
||||
.tableRow td:first-child {
|
||||
max-width: 17%;
|
||||
}
|
||||
|
||||
#portal-info {
|
||||
max-width: 60vw;
|
||||
}
|
||||
}
|
||||
|
||||
.downloadContentCellShift:after {
|
||||
|
||||
@ -30,6 +30,7 @@ html {
|
||||
}
|
||||
|
||||
body {
|
||||
display: inline-table;
|
||||
background: #FFFFFF;
|
||||
color: #333333;
|
||||
font-family: Open Sans;
|
||||
@ -79,6 +80,7 @@ header img {
|
||||
}
|
||||
|
||||
.main{
|
||||
display: table;
|
||||
height: calc(100% - 112px);
|
||||
min-height: 536px;
|
||||
}
|
||||
@ -105,6 +107,10 @@ header img {
|
||||
width: 896px;
|
||||
}
|
||||
|
||||
#portal-info {
|
||||
max-width: 65vw;
|
||||
}
|
||||
|
||||
.portal-name {
|
||||
color: #FF6F3D;
|
||||
font-size: 24px;
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
{% if files %}
|
||||
<div id="portal-info" style="display: none">
|
||||
{% else %}
|
||||
<div id="portal-info" style="display: block">
|
||||
<div id="portal-info" style="display: table-cell">
|
||||
{% endif %}
|
||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||
<span class="portal-descr">
|
||||
@ -185,9 +185,6 @@
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
{% if file.type == 'slide' %}
|
||||
<td class="contentCells contentCells-icon contentCellsEmpty"></td>
|
||||
{% endif %}
|
||||
{% if file.type == 'word' %}
|
||||
<td class="contentCells contentCells-icon">
|
||||
<a href="edit?filename={{ file.title }}&type=desktop&mode=blockcontent" target="_blank">
|
||||
|
||||
Reference in New Issue
Block a user