mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-04-07 14:06:11 +08:00
Merge remote-tracking branch 'remotes/origin/develop' into feature/delete-all-files
# Conflicts: # CHANGELOG.md
This commit is contained in:
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,13 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
- php: delete all files
|
- delete all files
|
||||||
- java: delete all files
|
- nodejs: wopi formsubmit icon
|
||||||
- java-spring: delete all files
|
- php: handling conversion -9 error
|
||||||
- python: delete all files
|
- nodejs: tabs menu
|
||||||
- ruby: delete all files
|
|
||||||
- csharp: delete all files
|
|
||||||
- csharp-mvc: delete all files
|
|
||||||
- nodejs: delete all files
|
|
||||||
- change insert image
|
- change insert image
|
||||||
- nodejs: handling conversion -9 error
|
- nodejs: handling conversion -9 error
|
||||||
- different goback for users
|
- different goback for users
|
||||||
|
|||||||
10
Readme.md
10
Readme.md
@ -1,11 +1,11 @@
|
|||||||
## Integration examples
|
## Integration examples
|
||||||
|
|
||||||
Test examples are simple document management systems that can be built into your application for testing.
|
These test examples are simple document management systems that can be built into your application for testing.
|
||||||
Do NOT use these integration examples on your own server without proper code modifications!
|
Do NOT use these integration examples on your own server without proper code modifications!
|
||||||
In case you enabled any of the test examples, disable it before going for production.
|
In case you enabled any of the test examples, disable it before going for production.
|
||||||
|
|
||||||
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages.
|
These examples show the way to integrate [ONLYOFFICE Docs][2] into your own website or application using one of the programming languages.
|
||||||
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Node.js, PHP and Ruby.
|
The package contains examples written in .Net (C# MVC), .Net (C#), Java, Java Spring, Node.js, PHP, Python and Ruby.
|
||||||
|
|
||||||
You should change `http://documentserver` to your server address in these files:
|
You should change `http://documentserver` to your server address in these files:
|
||||||
* [.Net (C# MVC)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp-mvc) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
|
* [.Net (C# MVC)](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/csharp-mvc) - `web/documentserver-example/csharp-mvc/web.appsettings.config`
|
||||||
@ -13,9 +13,9 @@ You should change `http://documentserver` to your server address in these files:
|
|||||||
* [Java](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java) - `web/documentserver-example/java/src/main/resources/settings.properties`
|
* [Java](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java) - `web/documentserver-example/java/src/main/resources/settings.properties`
|
||||||
* [Java Spring](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java-spring) - `web/documentserver-example/java-spring/src/main/resources/application.properties`
|
* [Java Spring](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/java-spring) - `web/documentserver-example/java-spring/src/main/resources/application.properties`
|
||||||
* [Node.js](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/nodejs) - `web/documentserver-example/nodejs/config/default.json`
|
* [Node.js](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/nodejs) - `web/documentserver-example/nodejs/config/default.json`
|
||||||
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/config.json`
|
* [PHP](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/php) - `web/documentserver-example/php/src/configuration/ConfigurationManager.php`
|
||||||
* [Python](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/python) - `web/documentserver-example/python/config.py`
|
* [Python](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/python) - `web/documentserver-example/python/src/configuration/configuration.py`
|
||||||
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/config/application.rb`
|
* [Ruby](https://github.com/ONLYOFFICE/document-server-integration/tree/master/web/documentserver-example/ruby) - `web/documentserver-example/ruby/app/configuration/configuration.rb`
|
||||||
|
|
||||||
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")
|
More information on how to use these examples can be found here: [http://api.onlyoffice.com/editors/demopreview](http://api.onlyoffice.com/editors/demopreview "http://api.onlyoffice.com/editors/demopreview")
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,7 @@ using System.IO;
|
|||||||
using static OnlineEditorsExampleMVC.Models.FileUtility;
|
using static OnlineEditorsExampleMVC.Models.FileUtility;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Newtonsoft.Json.Converters;
|
||||||
|
|
||||||
namespace OnlineEditorsExampleMVC.Models
|
namespace OnlineEditorsExampleMVC.Models
|
||||||
{
|
{
|
||||||
@ -48,9 +49,21 @@ namespace OnlineEditorsExampleMVC.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class EmptyTolerantStringEnumConverter : StringEnumConverter
|
||||||
|
{
|
||||||
|
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||||
|
{
|
||||||
|
if (reader.TokenType == JsonToken.String && string.IsNullOrWhiteSpace(reader.Value.ToString()))
|
||||||
|
return Activator.CreateInstance(objectType);
|
||||||
|
|
||||||
|
return base.ReadJson(reader, objectType, existingValue, serializer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public class Format
|
public class Format
|
||||||
{
|
{
|
||||||
public string Name { get; }
|
public string Name { get; }
|
||||||
|
[JsonConverter(typeof(EmptyTolerantStringEnumConverter))]
|
||||||
public FileType Type { get; }
|
public FileType Type { get; }
|
||||||
public List<string> Actions { get; }
|
public List<string> Actions { get; }
|
||||||
public List<string> Convert { get; }
|
public List<string> Convert { get; }
|
||||||
|
|||||||
Submodule web/documentserver-example/csharp/assets/document-formats updated: fc7347f6f0...730e13c89d
@ -19,6 +19,7 @@
|
|||||||
package com.onlyoffice.integration.documentserver.util.service;
|
package com.onlyoffice.integration.documentserver.util.service;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
import com.onlyoffice.integration.documentserver.models.Format;
|
import com.onlyoffice.integration.documentserver.models.Format;
|
||||||
@ -41,6 +42,7 @@ public class DefaultFormatService implements FormatService {
|
|||||||
final ObjectMapper objectMapper
|
final ObjectMapper objectMapper
|
||||||
) {
|
) {
|
||||||
try {
|
try {
|
||||||
|
objectMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
|
||||||
File targetFile = resourceFile.getFile();
|
File targetFile = resourceFile.getFile();
|
||||||
this.formats = objectMapper.readValue(targetFile, new TypeReference<List<Format>>() { });
|
this.formats = objectMapper.readValue(targetFile, new TypeReference<List<Format>>() { });
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -29,6 +29,7 @@ import java.util.stream.Collectors;
|
|||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
|
import com.fasterxml.jackson.databind.DeserializationFeature;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
public final class FormatManager {
|
public final class FormatManager {
|
||||||
@ -93,6 +94,7 @@ public final class FormatManager {
|
|||||||
private List<Format> all() {
|
private List<Format> all() {
|
||||||
try {
|
try {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
objectMapper.configure(DeserializationFeature.ACCEPT_EMPTY_STRING_AS_NULL_OBJECT, true);
|
||||||
Path path = this.file();
|
Path path = this.file();
|
||||||
return objectMapper.readValue(Files.readAllBytes(path), new TypeReference<List<Format>>() { });
|
return objectMapper.readValue(Files.readAllBytes(path), new TypeReference<List<Format>>() { });
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@ -270,6 +270,18 @@ app.post('/create', (req, res) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
req.DocManager = new DocManager(req, res);
|
req.DocManager = new DocManager(req, res);
|
||||||
|
|
||||||
|
let host = siteUrl;
|
||||||
|
if (host.indexOf('/') === 0) {
|
||||||
|
host = req.DocManager.getServerHost();
|
||||||
|
}
|
||||||
|
if (urlModule.parse(fileUrl).host !== urlModule.parse(host).host) {
|
||||||
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
||||||
|
res.write(JSON.stringify({ error: 'File domain is incorrect' }));
|
||||||
|
res.end();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
req.DocManager.storagePath(''); // mkdir if not exist
|
req.DocManager.storagePath(''); // mkdir if not exist
|
||||||
|
|
||||||
const fileName = req.DocManager.getCorrectName(title);
|
const fileName = req.DocManager.getCorrectName(title);
|
||||||
@ -645,7 +657,7 @@ app.post('/track', async (req, res) => { // define a handler for tracking file c
|
|||||||
const zip = await urllib.request(downloadZip, { method: 'GET' });
|
const zip = await urllib.request(downloadZip, { method: 'GET' });
|
||||||
const statusZip = zip.status;
|
const statusZip = zip.status;
|
||||||
const dataZip = zip.data;
|
const dataZip = zip.data;
|
||||||
if (status === 200) {
|
if (statusZip === 200) {
|
||||||
fileSystem.writeFileSync(pathChanges, dataZip); // write the document version differences to the archive
|
fileSystem.writeFileSync(pathChanges, dataZip); // write the document version differences to the archive
|
||||||
} else {
|
} else {
|
||||||
emitWarning(`Document editing service returned status: ${statusZip}`);
|
emitWarning(`Document editing service returned status: ${statusZip}`);
|
||||||
@ -928,6 +940,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
|||||||
const { name } = user;
|
const { name } = user;
|
||||||
|
|
||||||
if (fileExt) {
|
if (fileExt) {
|
||||||
|
fileExt = fileUtility.getFileExtension(fileUtility.getFileName(fileExt), true);
|
||||||
// create demo document of a given extension
|
// create demo document of a given extension
|
||||||
const fName = req.DocManager.createDemo(!!req.query.sample, fileExt, userid, name, false);
|
const fName = req.DocManager.createDemo(!!req.query.sample, fileExt, userid, name, false);
|
||||||
|
|
||||||
@ -983,12 +996,19 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
|||||||
const { userInfoGroups } = user;
|
const { userInfoGroups } = user;
|
||||||
|
|
||||||
const usersInfo = [];
|
const usersInfo = [];
|
||||||
|
const usersForProtect = [];
|
||||||
if (user.id !== 'uid-0') {
|
if (user.id !== 'uid-0') {
|
||||||
users.getAllUsers().forEach((userInfo) => {
|
users.getAllUsers().forEach((userInfo) => {
|
||||||
const u = userInfo;
|
const u = userInfo;
|
||||||
u.image = userInfo.avatar ? `${req.DocManager.getServerUrl()}/images/${userInfo.id}.png` : null;
|
u.image = userInfo.avatar ? `${req.DocManager.getServerUrl()}/images/${userInfo.id}.png` : null;
|
||||||
usersInfo.push(u);
|
usersInfo.push(u);
|
||||||
}, usersInfo);
|
}, usersInfo);
|
||||||
|
|
||||||
|
users.getUsersForProtect(user.id).forEach((userInfo) => {
|
||||||
|
const u = userInfo;
|
||||||
|
u.image = userInfo.avatar ? `${req.DocManager.getServerUrl()}/images/${userInfo.id}.png` : null;
|
||||||
|
usersForProtect.push(u);
|
||||||
|
}, usersForProtect);
|
||||||
}
|
}
|
||||||
|
|
||||||
fileExt = fileUtility.getFileExtension(fileName);
|
fileExt = fileUtility.getFileExtension(fileName);
|
||||||
@ -1092,7 +1112,7 @@ app.get('/editor', (req, res) => { // define a handler for editing document
|
|||||||
directUrl: !userDirectUrl ? null : `${req.DocManager.getServerUrl()}/csv`,
|
directUrl: !userDirectUrl ? null : `${req.DocManager.getServerUrl()}/csv`,
|
||||||
},
|
},
|
||||||
usersForMentions: user.id !== 'uid-0' ? users.getUsersForMentions(user.id) : null,
|
usersForMentions: user.id !== 'uid-0' ? users.getUsersForMentions(user.id) : null,
|
||||||
usersForProtect: user.id !== 'uid-0' ? users.getUsersForProtect(user.id) : null,
|
usersForProtect,
|
||||||
usersInfo,
|
usersInfo,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ DocManager.prototype.createDirectory = function createDirectory(directory) {
|
|||||||
|
|
||||||
// get the language from the request
|
// get the language from the request
|
||||||
DocManager.prototype.getLang = function getLang() {
|
DocManager.prototype.getLang = function getLang() {
|
||||||
if (/^[a-z]{2}(-[A-z]{4})?(-[A-Z]{2})?$/.test(this.req.query.lang)) {
|
if (/^[a-z]{2}(-[a-zA-z]{4})?(-[A-Z]{2})?$/.test(this.req.query.lang)) {
|
||||||
return this.req.query.lang;
|
return this.req.query.lang;
|
||||||
} // the default language value is English
|
} // the default language value is English
|
||||||
return 'en';
|
return 'en';
|
||||||
|
|||||||
@ -180,10 +180,7 @@ users.getUsersForProtect = function getUsersForProtect(id) {
|
|||||||
const result = [];
|
const result = [];
|
||||||
this.forEach((user) => {
|
this.forEach((user) => {
|
||||||
if (user.id !== id && user.name != null) {
|
if (user.id !== id && user.name != null) {
|
||||||
result.push({
|
result.push(user);
|
||||||
id: user.id,
|
|
||||||
name: user.name,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@ -27,57 +27,67 @@ const siteUrl = configServer.get('siteUrl'); // the path to the editors installa
|
|||||||
|
|
||||||
let cache = null;
|
let cache = null;
|
||||||
|
|
||||||
const requestDiscovery = async function requestDiscovery(url) {
|
const requestDiscovery = async function requestDiscovery() {
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
const uri = siteUrl + configServer.get('wopi.discovery');
|
||||||
const actions = [];
|
const actions = [];
|
||||||
urllib.request(urlModule.parse(url + configServer.get('wopi.discovery')), { method: 'GET' }, (err, data) => {
|
|
||||||
if (data) {
|
// parse url to allow request by relative url after
|
||||||
// create the discovery XML file with the parameters from the response
|
// https://github.com/node-modules/urllib/pull/321/commits/514de1924bf17a38a6c2db2a22a6bc3494c0a959
|
||||||
const xmlParseOptions = {
|
urllib.request(
|
||||||
attributeNamePrefix: '',
|
urlModule.parse(uri),
|
||||||
ignoreAttributes: false,
|
{
|
||||||
parseAttributeValue: true,
|
method: 'GET',
|
||||||
attrValueProcessor: (val) => he.decode(val, { isAttributeValue: true }),
|
},
|
||||||
};
|
(err, data) => {
|
||||||
const parser = new xmlParser.XMLParser(xmlParseOptions);
|
if (data) {
|
||||||
// create the discovery XML file with the parameters from the response
|
// create the discovery XML file with the parameters from the response
|
||||||
const discovery = parser.parse(data.toString());
|
const xmlParseOptions = {
|
||||||
if (discovery['wopi-discovery']) {
|
attributeNamePrefix: '',
|
||||||
discovery['wopi-discovery']['net-zone'].app.forEach((app) => {
|
ignoreAttributes: false,
|
||||||
let appAction = app.action;
|
parseAttributeValue: true,
|
||||||
if (!Array.isArray(appAction)) {
|
attrValueProcessor: (val) => he.decode(val, { isAttributeValue: true }),
|
||||||
appAction = [appAction];
|
};
|
||||||
}
|
const parser = new xmlParser.XMLParser(xmlParseOptions);
|
||||||
appAction.forEach((action) => {
|
// create the discovery XML file with the parameters from the response
|
||||||
actions.push({ // write all the parameters to the actions element
|
const discovery = parser.parse(data.toString());
|
||||||
app: app.name,
|
if (discovery['wopi-discovery']) {
|
||||||
favIconUrl: app.favIconUrl,
|
discovery['wopi-discovery']['net-zone'].app.forEach((app) => {
|
||||||
checkLicense: app.checkLicense === 'true',
|
let appAction = app.action;
|
||||||
name: action.name,
|
if (!Array.isArray(appAction)) {
|
||||||
ext: action.ext || '',
|
appAction = [appAction];
|
||||||
progid: action.progid || '',
|
}
|
||||||
isDefault: !!action.default,
|
appAction.forEach((action) => {
|
||||||
urlsrc: action.urlsrc,
|
actions.push({ // write all the parameters to the actions element
|
||||||
requires: action.requires || '',
|
app: app.name,
|
||||||
|
favIconUrl: app.favIconUrl,
|
||||||
|
checkLicense: app.checkLicense === 'true',
|
||||||
|
name: action.name,
|
||||||
|
ext: action.ext || '',
|
||||||
|
progid: action.progid || '',
|
||||||
|
isDefault: !!action.default,
|
||||||
|
urlsrc: action.urlsrc,
|
||||||
|
requires: action.requires || '',
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
}
|
resolve(actions);
|
||||||
resolve(actions);
|
},
|
||||||
});
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// get the wopi discovery information
|
// get the wopi discovery information
|
||||||
const getDiscoveryInfo = async function getDiscoveryInfo(url) {
|
const getDiscoveryInfo = async function getDiscoveryInfo() {
|
||||||
let actions = [];
|
let actions = [];
|
||||||
|
|
||||||
if (cache) return cache;
|
if (cache) return cache;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
actions = await requestDiscovery(url);
|
actions = await requestDiscovery();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return actions;
|
return actions;
|
||||||
}
|
}
|
||||||
@ -91,16 +101,6 @@ const getDiscoveryInfo = async function getDiscoveryInfo(url) {
|
|||||||
return actions;
|
return actions;
|
||||||
};
|
};
|
||||||
|
|
||||||
const initWopi = async function initWopi(DocManager) {
|
|
||||||
let absSiteUrl = siteUrl;
|
|
||||||
if (absSiteUrl.indexOf('/') === 0) {
|
|
||||||
absSiteUrl = DocManager.getServerHost() + siteUrl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// get the wopi discovery information
|
|
||||||
await getDiscoveryInfo(absSiteUrl);
|
|
||||||
};
|
|
||||||
|
|
||||||
// get actions of the specified extension
|
// get actions of the specified extension
|
||||||
const getActions = async function getActions(ext) {
|
const getActions = async function getActions(ext) {
|
||||||
const actions = await getDiscoveryInfo(); // get the wopi discovery information
|
const actions = await getDiscoveryInfo(); // get the wopi discovery information
|
||||||
@ -149,7 +149,6 @@ const getActionUrl = function getActionUrl(host, userAddress, action, filename)
|
|||||||
return `${action.urlsrc.replace(/<.*&>/g, '')}WOPISrc=${encodeURIComponent(WOPISrc)}`;
|
return `${action.urlsrc.replace(/<.*&>/g, '')}WOPISrc=${encodeURIComponent(WOPISrc)}`;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.initWopi = initWopi;
|
|
||||||
exports.getDiscoveryInfo = getDiscoveryInfo;
|
exports.getDiscoveryInfo = getDiscoveryInfo;
|
||||||
exports.getAction = getAction;
|
exports.getAction = getAction;
|
||||||
exports.getActions = getActions;
|
exports.getActions = getActions;
|
||||||
|
|||||||
@ -45,8 +45,6 @@ exports.registerRoutes = function registerRoutes(app) {
|
|||||||
app.get('/wopi', async (req, res) => {
|
app.get('/wopi', async (req, res) => {
|
||||||
req.DocManager = new DocManager(req, res);
|
req.DocManager = new DocManager(req, res);
|
||||||
|
|
||||||
await utils.initWopi(req.DocManager);
|
|
||||||
|
|
||||||
// get the wopi discovery information
|
// get the wopi discovery information
|
||||||
const actions = await utils.getDiscoveryInfo();
|
const actions = await utils.getDiscoveryInfo();
|
||||||
const wopiEnable = actions.length !== 0;
|
const wopiEnable = actions.length !== 0;
|
||||||
@ -111,8 +109,6 @@ exports.registerRoutes = function registerRoutes(app) {
|
|||||||
try {
|
try {
|
||||||
req.DocManager = new DocManager(req, res);
|
req.DocManager = new DocManager(req, res);
|
||||||
|
|
||||||
await utils.initWopi(req.DocManager);
|
|
||||||
|
|
||||||
let fileName = req.DocManager.getCorrectName(req.params.id);
|
let fileName = req.DocManager.getCorrectName(req.params.id);
|
||||||
const fileExt = fileUtility.getFileExtension(fileName, true); // get the file extension from the request
|
const fileExt = fileUtility.getFileExtension(fileName, true); // get the file extension from the request
|
||||||
const user = users.getUser(req.query.userid); // get a user by the id
|
const user = users.getUser(req.query.userid); // get a user by the id
|
||||||
|
|||||||
8
web/documentserver-example/nodejs/public/images/home.svg
Normal file
8
web/documentserver-example/nodejs/public/images/home.svg
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg">
|
||||||
|
|
||||||
|
<g class="layer">
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<path d="m9.05,22.33l0,-5.9l5.9,0l0,5.9l5.9,0l0,-10.33l2.95,0l-11.8,-10.33l-11.8,10.33l2.95,0l0,10.33l5.9,0z" fill="#FF6F3D" id="svg_1"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 322 B |
@ -0,0 +1,4 @@
|
|||||||
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M6 16V13H7V11H5C4.44772 11 4 11.4477 4 12V17C4 17.5523 4.44772 18 5 18H19C19.5523 18 20 17.5523 20 17V12C20 11.4477 19.5523 11 19 11H17V13H18V16H6Z" fill="#444444"/>
|
||||||
|
<path d="M11 15H9V13L16 6H17V7H18V8L11 15Z" fill="#444444"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 379 B |
@ -144,7 +144,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scroll-table-body {
|
.scroll-table-body {
|
||||||
top: 31px;
|
top: 88px;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
@ -411,7 +411,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.scroll-table-body {
|
.scroll-table-body {
|
||||||
top: 31px;
|
top: 88px;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer table tr {
|
footer table tr {
|
||||||
|
|||||||
@ -331,24 +331,47 @@ label .checkbox {
|
|||||||
width: 192px;
|
width: 192px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.create-panel,
|
.create-panel {
|
||||||
.links-panel {
|
|
||||||
float: left;
|
float: left;
|
||||||
padding: 16px 0;
|
padding: 16px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.links-panel {
|
||||||
|
display: flex;
|
||||||
|
column-gap: 30px;
|
||||||
|
margin-bottom: 35px;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.links-panel-current {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.links-panel-current::after {
|
||||||
|
content: "";
|
||||||
|
background-color: #ff6f3d;
|
||||||
|
position: absolute;
|
||||||
|
left: -10%;
|
||||||
|
bottom: -8px;
|
||||||
|
width: 120%;
|
||||||
|
height: 2.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.links-panel a {
|
||||||
|
font-size: 14px;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.links-panel-home {
|
||||||
|
width: 22px;
|
||||||
|
}
|
||||||
|
|
||||||
.upload-panel,
|
.upload-panel,
|
||||||
.create-panel {
|
.create-panel {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid #D0D5DA;
|
border-bottom: 1px solid #D0D5DA;
|
||||||
}
|
}
|
||||||
|
|
||||||
.links-panel-border {
|
|
||||||
margin-top: 24px;
|
|
||||||
width: 100%;
|
|
||||||
border-top: 1px solid #D0D5DA;
|
|
||||||
}
|
|
||||||
|
|
||||||
#mainProgress {
|
#mainProgress {
|
||||||
color: #333333;
|
color: #333333;
|
||||||
display: none;
|
display: none;
|
||||||
@ -837,7 +860,7 @@ footer table tr td:first-child {
|
|||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 0;
|
right: 0;
|
||||||
top: 71px;
|
top: 130px;
|
||||||
scrollbar-color: #D0D5DA transparent;
|
scrollbar-color: #D0D5DA transparent;
|
||||||
scrollbar-width: thin;
|
scrollbar-width: thin;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -431,9 +431,11 @@
|
|||||||
if (window.addEventListener) {
|
if (window.addEventListener) {
|
||||||
window.addEventListener("load", connectEditor);
|
window.addEventListener("load", connectEditor);
|
||||||
window.addEventListener("resize", fixSize);
|
window.addEventListener("resize", fixSize);
|
||||||
|
window.addEventListener("orientationchange", fixSize);
|
||||||
} else if (window.attachEvent) {
|
} else if (window.attachEvent) {
|
||||||
window.attachEvent("onload", connectEditor);
|
window.attachEvent("onload", connectEditor);
|
||||||
window.attachEvent("onresize", fixSize);
|
window.attachEvent("onresize", fixSize);
|
||||||
|
window.attachEvent("orientationchange", fixSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -106,10 +106,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="links-panel links-panel-border clearFix">
|
|
||||||
<a href="wopi" class="">Go to WOPI page</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
@ -137,6 +133,12 @@
|
|||||||
<%if (storedFiles.length > 0)
|
<%if (storedFiles.length > 0)
|
||||||
{%>
|
{%>
|
||||||
<div class="stored-list">
|
<div class="stored-list">
|
||||||
|
<div class="links-panel">
|
||||||
|
<a href="./" class="links-panel-current">
|
||||||
|
<img src="images/home.svg" alt="Home" class="links-panel-home"/>
|
||||||
|
</a>
|
||||||
|
<a href="wopi">Wopi</a>
|
||||||
|
</div>
|
||||||
<div class="storedHeader">
|
<div class="storedHeader">
|
||||||
<div class="storedHeaderText">
|
<div class="storedHeaderText">
|
||||||
<span class="header-list">Your documents</span>
|
<span class="header-list">Your documents</span>
|
||||||
|
|||||||
@ -98,10 +98,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="links-panel links-panel-border clearFix">
|
|
||||||
<a href="./" class="">Go to Index page</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td class="section">
|
<td class="section">
|
||||||
@ -109,6 +105,12 @@
|
|||||||
<div id="portal-info" style="display: <%= storedFiles.length > 0 ? "none" : "table-cell" %>">
|
<div id="portal-info" style="display: <%= storedFiles.length > 0 ? "none" : "table-cell" %>">
|
||||||
<% if (!wopiEnable)
|
<% if (!wopiEnable)
|
||||||
{ %>
|
{ %>
|
||||||
|
<div class="links-panel">
|
||||||
|
<a href="./">
|
||||||
|
<img src="images/home.svg" alt="Home" class="links-panel-home"/>
|
||||||
|
</a>
|
||||||
|
<a href="wopi" class="links-panel-current">Wopi</a>
|
||||||
|
</div>
|
||||||
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
<span class="portal-name">ONLYOFFICE Document Editors – Welcome!</span>
|
||||||
<span class="portal-descr">
|
<span class="portal-descr">
|
||||||
Before you get started with a demo sample of ONLYOFFICE Docs, please enable the WOPI protocol.
|
Before you get started with a demo sample of ONLYOFFICE Docs, please enable the WOPI protocol.
|
||||||
@ -129,6 +131,12 @@
|
|||||||
<% if (storedFiles.length > 0)
|
<% if (storedFiles.length > 0)
|
||||||
{ %>
|
{ %>
|
||||||
<div class="stored-list">
|
<div class="stored-list">
|
||||||
|
<div class="links-panel">
|
||||||
|
<a href="./">
|
||||||
|
<img src="images/home.svg" alt="Home" class="links-panel-home"/>
|
||||||
|
</a>
|
||||||
|
<a href="wopi" class="links-panel-current">Wopi</a>
|
||||||
|
</div>
|
||||||
<div class="storedHeader">
|
<div class="storedHeader">
|
||||||
<div class="storedHeaderText">
|
<div class="storedHeaderText">
|
||||||
<span class="header-list">Your documents</span>
|
<span class="header-list">Your documents</span>
|
||||||
|
|||||||
@ -61,6 +61,12 @@ compose-prod: # Up containers in a production environment.
|
|||||||
@docker-compose build
|
@docker-compose build
|
||||||
@docker-compose up --detach
|
@docker-compose up --detach
|
||||||
|
|
||||||
|
.PHONY: restart
|
||||||
|
restart: # Restart containers replacing volume files.
|
||||||
|
@docker-compose rm --stop --force proxy example
|
||||||
|
@docker volume rm php_example
|
||||||
|
@docker compose up --detach --build
|
||||||
|
|
||||||
.PHONY: lint
|
.PHONY: lint
|
||||||
lint: # Lint the source code for the style.
|
lint: # Lint the source code for the style.
|
||||||
@./vendor/bin/phpcs src index.php
|
@./vendor/bin/phpcs src index.php
|
||||||
|
|||||||
@ -504,6 +504,17 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.buttonsMobile.indent {
|
||||||
|
margin-bottom: 0;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
}
|
||||||
|
.button.file-type:hover,
|
||||||
|
.button.file-type {
|
||||||
|
height: 28px;
|
||||||
|
width: 100px;
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
font-size: 9px;
|
||||||
|
}
|
||||||
.button.gray{
|
.button.gray{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -229,6 +229,33 @@ label .checkbox {
|
|||||||
color: #FF6F3D;
|
color: #FF6F3D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button.file-type {
|
||||||
|
font-size: 11px;
|
||||||
|
color: #FFFFFF;
|
||||||
|
padding: 8px 8px;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button.file-type.disable {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button.file-type.pale {
|
||||||
|
opacity: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button.file-type.document {
|
||||||
|
background: #446995;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button.file-type.spreadsheet {
|
||||||
|
background: #40865C;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button.file-type.presentation {
|
||||||
|
background: #AA5252;
|
||||||
|
}
|
||||||
|
|
||||||
.upload-panel {
|
.upload-panel {
|
||||||
float: left;
|
float: left;
|
||||||
padding: 24px 0;
|
padding: 24px 0;
|
||||||
@ -766,6 +793,16 @@ html {
|
|||||||
margin-left: 25px;
|
margin-left: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttonsMobile.indent{
|
||||||
|
padding-left: 35px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.invisible {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
.tooltip {
|
.tooltip {
|
||||||
background: #FFFFFF;
|
background: #FFFFFF;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
|||||||
Submodule web/documentserver-example/php/assets/document-formats updated: fc7347f6f0...730e13c89d
@ -97,7 +97,7 @@ if (typeof jQuery != "undefined") {
|
|||||||
});
|
});
|
||||||
|
|
||||||
var timer = null;
|
var timer = null;
|
||||||
var checkConvert = function (fileUri, filePass) {
|
var checkConvert = function (fileUri, filePass, fileExt) {
|
||||||
filePass = filePass ? filePass : null;
|
filePass = filePass ? filePass : null;
|
||||||
if (timer != null) {
|
if (timer != null) {
|
||||||
clearTimeout(timer);
|
clearTimeout(timer);
|
||||||
@ -132,7 +132,7 @@ if (typeof jQuery != "undefined") {
|
|||||||
contentType: "text/xml",
|
contentType: "text/xml",
|
||||||
type: "post",
|
type: "post",
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
data: JSON.stringify({filename : fileName, fileUri : fileUri || "", filePass: filePass}),
|
data: JSON.stringify({filename: fileName, fileUri: fileUri || "", filePass: filePass, fileExt: fileExt}),
|
||||||
url: requestAddress,
|
url: requestAddress,
|
||||||
complete: function (data) {
|
complete: function (data) {
|
||||||
var responseText = data.responseText;
|
var responseText = data.responseText;
|
||||||
@ -153,6 +153,12 @@ if (typeof jQuery != "undefined") {
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
if (response.error.includes("Error conversion output format")){
|
||||||
|
jq("#select-file-type").removeClass("invisible");
|
||||||
|
jq("#step2").removeClass("current");
|
||||||
|
jq("#hiddenFileName").attr("placeholder",filePass);
|
||||||
|
return;
|
||||||
|
}
|
||||||
jq(".current").removeClass("current");
|
jq(".current").removeClass("current");
|
||||||
jq(".step:not(.done)").addClass("error");
|
jq(".step:not(.done)").addClass("error");
|
||||||
jq("#mainProgress .error-message").show().find("span").text(response.error);
|
jq("#mainProgress .error-message").show().find("span").text(response.error);
|
||||||
@ -164,7 +170,7 @@ if (typeof jQuery != "undefined") {
|
|||||||
jq("#hiddenFileName").val(response.filename);
|
jq("#hiddenFileName").val(response.filename);
|
||||||
|
|
||||||
if (response.step < 100) {
|
if (response.step < 100) {
|
||||||
checkConvert(response.fileUri, filePass);
|
checkConvert(response.fileUri, filePass, fileExt);
|
||||||
} else {
|
} else {
|
||||||
jq("#step2").addClass("done").removeClass("current");
|
jq("#step2").addClass("done").removeClass("current");
|
||||||
loadScripts();
|
loadScripts();
|
||||||
@ -199,7 +205,7 @@ if (typeof jQuery != "undefined") {
|
|||||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||||
|
|
||||||
var fileName = jq("#hiddenFileName").val();
|
var fileName = jq("#hiddenFileName").val();
|
||||||
var posExt = fileName.lastIndexOf('.');
|
var posExt = fileName.lastIndexOf('.') + 1;
|
||||||
posExt = 0 <= posExt ? fileName.substring(posExt + 1).trim().toLowerCase() : '';
|
posExt = 0 <= posExt ? fileName.substring(posExt + 1).trim().toLowerCase() : '';
|
||||||
|
|
||||||
if (EditedExtList.indexOf(posExt) != -1 || FillFormsExtList.indexOf(posExt) != -1) {
|
if (EditedExtList.indexOf(posExt) != -1 || FillFormsExtList.indexOf(posExt) != -1) {
|
||||||
@ -228,6 +234,15 @@ if (typeof jQuery != "undefined") {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
jq(document).on("click", ".file-type:not(.disable)", function () {
|
||||||
|
const currentElement = jq(this);
|
||||||
|
var fileExt = currentElement.attr("data");
|
||||||
|
var filePass = jq("#hiddenFileName").attr("placeholder");
|
||||||
|
jq('.file-type').addClass(["disable", "pale"]);
|
||||||
|
currentElement.removeClass("pale");
|
||||||
|
checkConvert(null, filePass, fileExt);
|
||||||
|
});
|
||||||
|
|
||||||
jq(document).on("click", "#enterPass", function () {
|
jq(document).on("click", "#enterPass", function () {
|
||||||
var filePass = jq("#filePass").val();
|
var filePass = jq("#filePass").val();
|
||||||
if (filePass) {
|
if (filePass) {
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
document-server:
|
documentserver:
|
||||||
container_name: document-server
|
container_name: documentserver
|
||||||
image: onlyoffice/documentserver:7.5
|
image: onlyoffice/documentserver:8.0
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
environment:
|
environment:
|
||||||
@ -32,7 +32,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
target: proxy
|
target: proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
- document-server
|
- documentserver
|
||||||
- example
|
- example
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|||||||
@ -76,7 +76,7 @@ function routers()
|
|||||||
}
|
}
|
||||||
if (str_starts_with($path, '/convert')) {
|
if (str_starts_with($path, '/convert')) {
|
||||||
$response = convert();
|
$response = convert();
|
||||||
$response['status'] = 'success';
|
$response['status'] = isset($response['error']) ? 'error' : 'success';
|
||||||
echo json_encode($response);
|
echo json_encode($response);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,3 +11,5 @@ pm.start_servers = 2
|
|||||||
pm.min_spare_servers = 1
|
pm.min_spare_servers = 1
|
||||||
pm.max_spare_servers = 3
|
pm.max_spare_servers = 3
|
||||||
clear_env = no
|
clear_env = no
|
||||||
|
php_admin_value[upload_max_filesize] = 100M
|
||||||
|
php_admin_value[post_max_size] = 100M
|
||||||
@ -24,6 +24,14 @@ http {
|
|||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
fastcgi_pass example:80;
|
fastcgi_pass example:80;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_x_forwarded_host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +42,7 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
client_max_body_size 100m;
|
client_max_body_size 100m;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://document-server;
|
proxy_pass http://documentserver;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|||||||
@ -228,6 +228,7 @@ function convert()
|
|||||||
$lang = $_COOKIE["ulang"] ?? "";
|
$lang = $_COOKIE["ulang"] ?? "";
|
||||||
$extension = mb_strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
|
$extension = mb_strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
|
||||||
$internalExtension = "ooxml";
|
$internalExtension = "ooxml";
|
||||||
|
$conversionExtension = $post['fileExt'] ?? $internalExtension;
|
||||||
|
|
||||||
// check if the file with such an extension can be converted
|
// check if the file with such an extension can be converted
|
||||||
if (in_array($extension, $formatManager->convertibleExtensions()) &&
|
if (in_array($extension, $formatManager->convertibleExtensions()) &&
|
||||||
@ -245,7 +246,7 @@ function convert()
|
|||||||
$convertedData = getConvertedData(
|
$convertedData = getConvertedData(
|
||||||
$fileUri,
|
$fileUri,
|
||||||
$extension,
|
$extension,
|
||||||
$internalExtension,
|
$conversionExtension,
|
||||||
$key,
|
$key,
|
||||||
true,
|
true,
|
||||||
$newFileUri,
|
$newFileUri,
|
||||||
@ -540,7 +541,7 @@ function reference()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$link = $post["link"];
|
$link = $post["link"] ?? null;
|
||||||
if (!isset($filename) && isset($link)) {
|
if (!isset($filename) && isset($link)) {
|
||||||
if (strpos($link, serverPath()) === false) {
|
if (strpos($link, serverPath()) === false) {
|
||||||
return ["url" => $link, "directUrl"=> $link];
|
return ["url" => $link, "directUrl"=> $link];
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class ConfigurationManager
|
|||||||
|
|
||||||
public function documentServerPublicURL(): URL
|
public function documentServerPublicURL(): URL
|
||||||
{
|
{
|
||||||
$url = getenv('DOCUMENT_SERVER_PUBLIC_URL') ?: 'http://document-server';
|
$url = getenv('DOCUMENT_SERVER_PUBLIC_URL') ?: 'http://documentserver';
|
||||||
return new URL($url);
|
return new URL($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerAPIURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerAPIURL();
|
$url = $configManager->documentServerAPIURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/web-apps/apps/api/documents/api.js',
|
'http://documentserver/web-apps/apps/api/documents/api.js',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ final class ConfigurationManagerDocumentServerAPIURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerAPIURL();
|
$url = $configManager->documentServerAPIURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/api',
|
'http://documentserver/api',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerCommandURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerCommandURL();
|
$url = $configManager->documentServerCommandURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/coauthoring/CommandService.ashx',
|
'http://documentserver/coauthoring/CommandService.ashx',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ final class ConfigurationManagerDocumentServerCommandURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerCommandURL();
|
$url = $configManager->documentServerCommandURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/command',
|
'http://documentserver/command',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerConverterURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerConverterURL();
|
$url = $configManager->documentServerConverterURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/ConvertService.ashx',
|
'http://documentserver/ConvertService.ashx',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ final class ConfigurationManagerDocumentServerConverterURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerConverterURL();
|
$url = $configManager->documentServerConverterURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/converter',
|
'http://documentserver/converter',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@ final class ConfigurationManagerDocumentServerPreloaderURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerPreloaderURL();
|
$url = $configManager->documentServerPreloaderURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/web-apps/apps/api/documents/cache-scripts.html',
|
'http://documentserver/web-apps/apps/api/documents/cache-scripts.html',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ final class ConfigurationManagerDocumentServerPreloaderURLTests extends TestCase
|
|||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerPreloaderURL();
|
$url = $configManager->documentServerPreloaderURL();
|
||||||
$this->assertEquals(
|
$this->assertEquals(
|
||||||
'http://document-server/preloader',
|
'http://documentserver/preloader',
|
||||||
$url->string()
|
$url->string()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@ final class ConfigurationManagerDocumentServerPrivateURLTests extends TestCase
|
|||||||
{
|
{
|
||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerPrivateURL();
|
$url = $configManager->documentServerPrivateURL();
|
||||||
$this->assertEquals('http://document-server', $url->string());
|
$this->assertEquals('http://documentserver', $url->string());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAssignsAValueFromTheEnvironment()
|
public function testAssignsAValueFromTheEnvironment()
|
||||||
|
|||||||
@ -41,7 +41,7 @@ final class ConfigurationManagerDocumentServerPublicURLTests extends TestCase
|
|||||||
{
|
{
|
||||||
$configManager = new ConfigurationManager();
|
$configManager = new ConfigurationManager();
|
||||||
$url = $configManager->documentServerPublicURL();
|
$url = $configManager->documentServerPublicURL();
|
||||||
$this->assertEquals('http://document-server', $url->string());
|
$this->assertEquals('http://documentserver', $url->string());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAssignsAValueFromTheEnvironment()
|
public function testAssignsAValueFromTheEnvironment()
|
||||||
|
|||||||
@ -158,7 +158,7 @@ function getTemplateImageUrl($filename)
|
|||||||
{
|
{
|
||||||
$formatManager = new FormatManager();
|
$formatManager = new FormatManager();
|
||||||
$ext = mb_strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
$ext = mb_strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||||
$path = serverPath(true) . "/assets/images/";
|
$path = serverPath(false) . "/assets/images/";
|
||||||
|
|
||||||
foreach ($formatManager->all() as $format) {
|
foreach ($formatManager->all() as $format) {
|
||||||
if ($format->name === $ext) {
|
if ($format->name === $ext) {
|
||||||
@ -553,6 +553,9 @@ function processConvServResponceError($errorCode)
|
|||||||
|
|
||||||
// add the error message to the error message template depending on the error code
|
// add the error message to the error message template depending on the error code
|
||||||
switch ($errorCode) {
|
switch ($errorCode) {
|
||||||
|
case -9:
|
||||||
|
$errorMessage = $errorMessageTemplate . "Error conversion output format";
|
||||||
|
break;
|
||||||
case -8:
|
case -8:
|
||||||
$errorMessage = $errorMessageTemplate . "Error document VKey";
|
$errorMessage = $errorMessageTemplate . "Error document VKey";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -33,6 +33,7 @@ final class Users
|
|||||||
public ?array $userInfoGroups;
|
public ?array $userInfoGroups;
|
||||||
|
|
||||||
public ?bool $avatar;
|
public ?bool $avatar;
|
||||||
|
public ?string $image;
|
||||||
public ?array $goback;
|
public ?array $goback;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -48,7 +48,7 @@ final class DocEditorView extends View
|
|||||||
$jwtManager = new JwtManager();
|
$jwtManager = new JwtManager();
|
||||||
$userList = new ExampleUsers();
|
$userList = new ExampleUsers();
|
||||||
$fileId = $request["fileID"] ?? "";
|
$fileId = $request["fileID"] ?? "";
|
||||||
$user = $userList->getUser($request["user"]);
|
$user = $userList->getUser($request["user"] ?? null);
|
||||||
$isEnableDirectUrl = isset($request["directUrl"]) ? filter_var($request["directUrl"], FILTER_VALIDATE_BOOLEAN)
|
$isEnableDirectUrl = isset($request["directUrl"]) ? filter_var($request["directUrl"], FILTER_VALIDATE_BOOLEAN)
|
||||||
: false;
|
: false;
|
||||||
if (!empty($externalUrl)) {
|
if (!empty($externalUrl)) {
|
||||||
@ -165,7 +165,7 @@ final class DocEditorView extends View
|
|||||||
"id" => $user->id != "uid-0" ? $user->id : null,
|
"id" => $user->id != "uid-0" ? $user->id : null,
|
||||||
"name" => $user->name,
|
"name" => $user->name,
|
||||||
"group" => $user->group,
|
"group" => $user->group,
|
||||||
"image" => $user->avatar ? serverPath(true) . "/assets/images/" . $user->id . ".png" : null
|
"image" => $user->avatar ? serverPath(false) . "/assets/images/" . $user->id . ".png" : null
|
||||||
],
|
],
|
||||||
"embedded" => [ // the parameters for the embedded document type
|
"embedded" => [ // the parameters for the embedded document type
|
||||||
// the absolute URL that will allow the document to be saved onto the user personal computer
|
// the absolute URL that will allow the document to be saved onto the user personal computer
|
||||||
@ -230,7 +230,7 @@ final class DocEditorView extends View
|
|||||||
if ($user->id != 'uid-0') {
|
if ($user->id != 'uid-0') {
|
||||||
foreach ($userList->getAllUsers() as $userInfo) {
|
foreach ($userList->getAllUsers() as $userInfo) {
|
||||||
$u = $userInfo;
|
$u = $userInfo;
|
||||||
$u->image = $userInfo->avatar ? serverPath(true) . "/assets/images/" . $userInfo->id . ".png" : null;
|
$u->image = $userInfo->avatar ? serverPath(false) . "/assets/images/" . $userInfo->id . ".png" : null;
|
||||||
array_push($usersInfo, $u);
|
array_push($usersInfo, $u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -140,6 +140,15 @@
|
|||||||
<span id="step1" class="step">1. Loading the file.</span>
|
<span id="step1" class="step">1. Loading the file.</span>
|
||||||
<span class="step-descr">The loading speed depends on file size
|
<span class="step-descr">The loading speed depends on file size
|
||||||
and additional elements it contains.</span>
|
and additional elements it contains.</span>
|
||||||
|
<div id="select-file-type" class="invisible">
|
||||||
|
<br />
|
||||||
|
<span class="step">Please select the current document type</span>
|
||||||
|
<div class="buttonsMobile indent">
|
||||||
|
<div class="button file-type document" data="docx">Document</div>
|
||||||
|
<div class="button file-type spreadsheet" data="xlsx">Spreadsheet</div>
|
||||||
|
<div class="button file-type presentation" data="pptx">Presentation</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<span id="step2" class="step">2. Conversion.</span>
|
<span id="step2" class="step">2. Conversion.</span>
|
||||||
<span class="step-descr">The file is converted to OOXML so that you can edit it.</span>
|
<span class="step-descr">The file is converted to OOXML so that you can edit it.</span>
|
||||||
|
|||||||
Submodule web/documentserver-example/python/assets/document-formats updated: fc7347f6f0...730e13c89d
@ -1,9 +1,9 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
document-server:
|
documentserver:
|
||||||
container_name: document-server
|
container_name: documentserver
|
||||||
image: onlyoffice/documentserver:7.5
|
image: onlyoffice/documentserver:8.0
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
environment:
|
environment:
|
||||||
@ -29,7 +29,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
target: proxy
|
target: proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
- document-server
|
- documentserver
|
||||||
- example
|
- example
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|||||||
@ -15,6 +15,14 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://example;
|
proxy_pass http://example;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_x_forwarded_host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,7 +33,7 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
client_max_body_size 100m;
|
client_max_body_size 100m;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://document-server;
|
proxy_pass http://documentserver;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class ConfigurationManager:
|
|||||||
def document_server_public_url(self) -> ParseResult:
|
def document_server_public_url(self) -> ParseResult:
|
||||||
url = (
|
url = (
|
||||||
environ.get('DOCUMENT_SERVER_PUBLIC_URL') or
|
environ.get('DOCUMENT_SERVER_PUBLIC_URL') or
|
||||||
'http://document-server'
|
'http://documentserver'
|
||||||
)
|
)
|
||||||
return urlparse(url)
|
return urlparse(url)
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class ConfigurationManagerDocumentServerPublicURLTests(TestCase):
|
|||||||
def test_assigns_a_default_value(self):
|
def test_assigns_a_default_value(self):
|
||||||
config_manager = ConfigurationManager()
|
config_manager = ConfigurationManager()
|
||||||
url = config_manager.document_server_public_url()
|
url = config_manager.document_server_public_url()
|
||||||
self.assertEqual(url.geturl(), 'http://document-server')
|
self.assertEqual(url.geturl(), 'http://documentserver')
|
||||||
|
|
||||||
@patch.dict(environ, {
|
@patch.dict(environ, {
|
||||||
'DOCUMENT_SERVER_PUBLIC_URL': 'http://localhost'
|
'DOCUMENT_SERVER_PUBLIC_URL': 'http://localhost'
|
||||||
@ -61,7 +61,7 @@ class ConfigurationManagerDocumentServerPrivateURLTests(TestCase):
|
|||||||
def test_assigns_a_default_value(self):
|
def test_assigns_a_default_value(self):
|
||||||
config_manager = ConfigurationManager()
|
config_manager = ConfigurationManager()
|
||||||
url = config_manager.document_server_private_url()
|
url = config_manager.document_server_private_url()
|
||||||
self.assertEqual(url.geturl(), 'http://document-server')
|
self.assertEqual(url.geturl(), 'http://documentserver')
|
||||||
|
|
||||||
@patch.dict(environ, {
|
@patch.dict(environ, {
|
||||||
'DOCUMENT_SERVER_PRIVATE_URL': 'http://localhost'
|
'DOCUMENT_SERVER_PRIVATE_URL': 'http://localhost'
|
||||||
|
|||||||
@ -74,7 +74,7 @@ def getInternalExtension(fileType):
|
|||||||
|
|
||||||
# get image url for templates
|
# get image url for templates
|
||||||
def getTemplateImageUrl(fileType, request):
|
def getTemplateImageUrl(fileType, request):
|
||||||
path = getServerUrl(True, request) + '/static/images/'
|
path = getServerUrl(False, request) + '/static/images/'
|
||||||
mapping = {
|
mapping = {
|
||||||
'word': path + 'file_docx.svg',
|
'word': path + 'file_docx.svg',
|
||||||
'cell': path + 'file_xlsx.svg',
|
'cell': path + 'file_xlsx.svg',
|
||||||
|
|||||||
@ -239,7 +239,7 @@ def edit(request):
|
|||||||
if user.id != 'uid-0':
|
if user.id != 'uid-0':
|
||||||
for userInfo in users.getAllUsers():
|
for userInfo in users.getAllUsers():
|
||||||
u = userInfo
|
u = userInfo
|
||||||
u.image = docManager.getServerUrl(True, request) + f'/static/images/{u.id}.jpg' if user.avatar else None
|
u.image = docManager.getServerUrl(False, request) + f'/static/images/{u.id}.jpg' if user.avatar else None
|
||||||
usersInfo.append({"id": u.id, "name": u.name, "email": u.email, "image": u.image, "group": u.group,
|
usersInfo.append({"id": u.id, "name": u.name, "email": u.email, "image": u.image, "group": u.group,
|
||||||
"reviewGroups": u.reviewGroups, "commentGroups": u.commentGroups, "favorite": u.favorite,
|
"reviewGroups": u.reviewGroups, "commentGroups": u.commentGroups, "favorite": u.favorite,
|
||||||
"deniedPermissions": u.deniedPermissions, "descriptions": u.descriptions,
|
"deniedPermissions": u.deniedPermissions, "descriptions": u.descriptions,
|
||||||
@ -310,7 +310,7 @@ def edit(request):
|
|||||||
'id': user.id if user.id != 'uid-0' else None,
|
'id': user.id if user.id != 'uid-0' else None,
|
||||||
'name': user.name,
|
'name': user.name,
|
||||||
'group': user.group,
|
'group': user.group,
|
||||||
'image': docManager.getServerUrl(True, request) + f'/static/images/{user.id}.jpg' if user.avatar
|
'image': docManager.getServerUrl(False, request) + f'/static/images/{user.id}.jpg' if user.avatar
|
||||||
else None
|
else None
|
||||||
},
|
},
|
||||||
'embedded': { # the parameters for the embedded document type
|
'embedded': { # the parameters for the embedded document type
|
||||||
|
|||||||
@ -8,73 +8,73 @@ GIT
|
|||||||
GEM
|
GEM
|
||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
actioncable (7.0.8)
|
actioncable (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (7.0.8)
|
actionmailbox (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
activejob (= 7.0.8)
|
activejob (= 7.0.8.1)
|
||||||
activerecord (= 7.0.8)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 7.0.8)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
actionmailer (7.0.8)
|
actionmailer (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
actionview (= 7.0.8)
|
actionview (= 7.0.8.1)
|
||||||
activejob (= 7.0.8)
|
activejob (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
net-imap
|
net-imap
|
||||||
net-pop
|
net-pop
|
||||||
net-smtp
|
net-smtp
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (7.0.8)
|
actionpack (7.0.8.1)
|
||||||
actionview (= 7.0.8)
|
actionview (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
rack (~> 2.0, >= 2.2.4)
|
rack (~> 2.0, >= 2.2.4)
|
||||||
rack-test (>= 0.6.3)
|
rack-test (>= 0.6.3)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (7.0.8)
|
actiontext (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
activerecord (= 7.0.8)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 7.0.8)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
globalid (>= 0.6.0)
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.14.3)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (7.0.8)
|
actionview (7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
builder (~> 3.1)
|
builder (~> 3.1)
|
||||||
erubi (~> 1.4)
|
erubi (~> 1.4)
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
activejob (7.0.8)
|
activejob (7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (7.0.8)
|
activemodel (7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
activerecord (7.0.8)
|
activerecord (7.0.8.1)
|
||||||
activemodel (= 7.0.8)
|
activemodel (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
activestorage (7.0.8)
|
activestorage (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
activejob (= 7.0.8)
|
activejob (= 7.0.8.1)
|
||||||
activerecord (= 7.0.8)
|
activerecord (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (7.0.8)
|
activesupport (7.0.8.1)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
base64 (0.1.1)
|
base64 (0.2.0)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
byebug (11.1.3)
|
byebug (11.1.3)
|
||||||
@ -85,14 +85,14 @@ GEM
|
|||||||
coffee-script-source
|
coffee-script-source
|
||||||
execjs
|
execjs
|
||||||
coffee-script-source (1.12.2)
|
coffee-script-source (1.12.2)
|
||||||
concurrent-ruby (1.2.2)
|
concurrent-ruby (1.2.3)
|
||||||
crass (1.0.6)
|
crass (1.0.6)
|
||||||
dalli (3.2.6)
|
dalli (3.2.8)
|
||||||
date (3.3.3)
|
date (3.3.4)
|
||||||
erubi (1.12.0)
|
erubi (1.12.0)
|
||||||
execjs (2.9.1)
|
execjs (2.9.1)
|
||||||
ffi (1.16.2)
|
ffi (1.16.3)
|
||||||
ffi (1.16.2-x64-mingw-ucrt)
|
ffi (1.16.3-x64-mingw-ucrt)
|
||||||
globalid (1.2.1)
|
globalid (1.2.1)
|
||||||
activesupport (>= 6.1)
|
activesupport (>= 6.1)
|
||||||
i18n (1.14.1)
|
i18n (1.14.1)
|
||||||
@ -104,12 +104,13 @@ GEM
|
|||||||
rails-dom-testing (>= 1, < 3)
|
rails-dom-testing (>= 1, < 3)
|
||||||
railties (>= 4.2.0)
|
railties (>= 4.2.0)
|
||||||
thor (>= 0.14, < 2.0)
|
thor (>= 0.14, < 2.0)
|
||||||
json (2.6.3)
|
json (2.7.1)
|
||||||
jwt (2.7.1)
|
jwt (2.8.0)
|
||||||
|
base64
|
||||||
language_server-protocol (3.17.0.3)
|
language_server-protocol (3.17.0.3)
|
||||||
loofah (2.21.3)
|
loofah (2.22.0)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.14.3)
|
nokogiri (>= 1.12.0)
|
||||||
macaddr (1.7.2)
|
macaddr (1.7.2)
|
||||||
systemu (~> 2.6.5)
|
systemu (~> 2.6.5)
|
||||||
mail (2.8.1)
|
mail (2.8.1)
|
||||||
@ -120,89 +121,94 @@ GEM
|
|||||||
marcel (1.0.2)
|
marcel (1.0.2)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
mini_mime (1.1.5)
|
mini_mime (1.1.5)
|
||||||
minitest (5.20.0)
|
minitest (5.22.2)
|
||||||
net-imap (0.3.7)
|
net-imap (0.4.10)
|
||||||
date
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
net-protocol
|
net-protocol
|
||||||
net-protocol (0.2.1)
|
net-protocol (0.2.2)
|
||||||
timeout
|
timeout
|
||||||
net-smtp (0.4.0)
|
net-smtp (0.4.0.1)
|
||||||
net-protocol
|
net-protocol
|
||||||
netrc (0.11.0)
|
netrc (0.11.0)
|
||||||
nio4r (2.5.9)
|
nio4r (2.7.0)
|
||||||
nokogiri (1.15.4-arm64-darwin)
|
nokogiri (1.16.2-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.15.4-x64-mingw-ucrt)
|
nokogiri (1.16.2-x64-mingw-ucrt)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.15.4-x86_64-linux)
|
nokogiri (1.16.2-x86_64-linux)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
parallel (1.23.0)
|
parallel (1.24.0)
|
||||||
parser (3.2.2.3)
|
parser (3.3.0.5)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
racc
|
racc
|
||||||
power_assert (2.0.3)
|
power_assert (2.0.3)
|
||||||
prettier_print (1.2.1)
|
prettier_print (1.2.1)
|
||||||
psych (5.1.0)
|
prism (0.24.0)
|
||||||
|
psych (5.1.2)
|
||||||
stringio
|
stringio
|
||||||
racc (1.7.1)
|
racc (1.7.3)
|
||||||
rack (2.2.8)
|
rack (2.2.8.1)
|
||||||
rack-cors (2.0.1)
|
rack-cors (2.0.1)
|
||||||
rack (>= 2.0.0)
|
rack (>= 2.0.0)
|
||||||
rack-test (2.1.0)
|
rack-test (2.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rails (7.0.8)
|
rails (7.0.8.1)
|
||||||
actioncable (= 7.0.8)
|
actioncable (= 7.0.8.1)
|
||||||
actionmailbox (= 7.0.8)
|
actionmailbox (= 7.0.8.1)
|
||||||
actionmailer (= 7.0.8)
|
actionmailer (= 7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
actiontext (= 7.0.8)
|
actiontext (= 7.0.8.1)
|
||||||
actionview (= 7.0.8)
|
actionview (= 7.0.8.1)
|
||||||
activejob (= 7.0.8)
|
activejob (= 7.0.8.1)
|
||||||
activemodel (= 7.0.8)
|
activemodel (= 7.0.8.1)
|
||||||
activerecord (= 7.0.8)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 7.0.8)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 7.0.8)
|
railties (= 7.0.8.1)
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
nokogiri (>= 1.14.3)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.6.0)
|
rails-html-sanitizer (1.6.0)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (~> 1.14.3)
|
nokogiri (~> 1.14)
|
||||||
railties (7.0.8)
|
railties (7.0.8.1)
|
||||||
actionpack (= 7.0.8)
|
actionpack (= 7.0.8.1)
|
||||||
activesupport (= 7.0.8)
|
activesupport (= 7.0.8.1)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
zeitwerk (~> 2.5)
|
zeitwerk (~> 2.5)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.0.6)
|
rake (13.1.0)
|
||||||
rbi (0.1.1)
|
rbi (0.1.9)
|
||||||
|
prism (>= 0.18.0, < 0.25)
|
||||||
sorbet-runtime (>= 0.5.9204)
|
sorbet-runtime (>= 0.5.9204)
|
||||||
yarp (>= 0.11.0)
|
rdoc (6.6.2)
|
||||||
rdoc (6.5.0)
|
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
regexp_parser (2.8.1)
|
regexp_parser (2.9.0)
|
||||||
rexml (3.2.6)
|
rexml (3.2.6)
|
||||||
rubocop (1.56.3)
|
rubocop (1.60.2)
|
||||||
base64 (~> 0.1.1)
|
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
language_server-protocol (>= 3.17.0)
|
language_server-protocol (>= 3.17.0)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.2.2.3)
|
parser (>= 3.3.0.2)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rexml (>= 3.2.5, < 4.0)
|
||||||
rubocop-ast (>= 1.28.1, < 2.0)
|
rubocop-ast (>= 1.30.0, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 2.4.0, < 3.0)
|
unicode-display_width (>= 2.4.0, < 3.0)
|
||||||
rubocop-ast (1.29.0)
|
rubocop-ast (1.30.0)
|
||||||
parser (>= 3.2.1.0)
|
parser (>= 3.2.1.0)
|
||||||
|
rubocop-rails (2.23.1)
|
||||||
|
activesupport (>= 4.2.0)
|
||||||
|
rack (>= 1.1)
|
||||||
|
rubocop (>= 1.33.0, < 2.0)
|
||||||
|
rubocop-ast (>= 1.30.0, < 2.0)
|
||||||
ruby-progressbar (1.13.0)
|
ruby-progressbar (1.13.0)
|
||||||
sass-rails (6.0.0)
|
sass-rails (6.0.0)
|
||||||
sassc-rails (~> 2.1, >= 2.1.1)
|
sassc-rails (~> 2.1, >= 2.1.1)
|
||||||
@ -216,14 +222,14 @@ GEM
|
|||||||
tilt
|
tilt
|
||||||
sdoc (2.6.1)
|
sdoc (2.6.1)
|
||||||
rdoc (>= 5.0)
|
rdoc (>= 5.0)
|
||||||
sorbet (0.5.11048)
|
sorbet (0.5.11274)
|
||||||
sorbet-static (= 0.5.11048)
|
sorbet-static (= 0.5.11274)
|
||||||
sorbet-runtime (0.5.11048)
|
sorbet-runtime (0.5.11274)
|
||||||
sorbet-static (0.5.11048-universal-darwin)
|
sorbet-static (0.5.11274-universal-darwin)
|
||||||
sorbet-static (0.5.11048-x86_64-linux)
|
sorbet-static (0.5.11274-x86_64-linux)
|
||||||
sorbet-static-and-runtime (0.5.11048)
|
sorbet-static-and-runtime (0.5.11274)
|
||||||
sorbet (= 0.5.11048)
|
sorbet (= 0.5.11274)
|
||||||
sorbet-runtime (= 0.5.11048)
|
sorbet-runtime (= 0.5.11274)
|
||||||
spoom (1.2.4)
|
spoom (1.2.4)
|
||||||
erubi (>= 1.10.0)
|
erubi (>= 1.10.0)
|
||||||
sorbet-static-and-runtime (>= 0.5.10187)
|
sorbet-static-and-runtime (>= 0.5.10187)
|
||||||
@ -236,34 +242,34 @@ GEM
|
|||||||
actionpack (>= 5.2)
|
actionpack (>= 5.2)
|
||||||
activesupport (>= 5.2)
|
activesupport (>= 5.2)
|
||||||
sprockets (>= 3.0.0)
|
sprockets (>= 3.0.0)
|
||||||
stringio (3.0.8)
|
stringio (3.1.0)
|
||||||
syntax_tree (6.2.0)
|
syntax_tree (6.2.0)
|
||||||
prettier_print (>= 1.2.0)
|
prettier_print (>= 1.2.0)
|
||||||
systemu (2.6.5)
|
systemu (2.6.5)
|
||||||
tapioca (0.11.9)
|
tapioca (0.11.17)
|
||||||
bundler (>= 2.2.25)
|
bundler (>= 2.2.25)
|
||||||
netrc (>= 0.11.0)
|
netrc (>= 0.11.0)
|
||||||
parallel (>= 1.21.0)
|
parallel (>= 1.21.0)
|
||||||
rbi (~> 0.1.0, >= 0.1.0)
|
rbi (>= 0.1.4, < 0.2)
|
||||||
sorbet-static-and-runtime (>= 0.5.10187)
|
sorbet-static-and-runtime (>= 0.5.10820)
|
||||||
spoom (~> 1.2.0, >= 1.2.0)
|
spoom (~> 1.2.0, >= 1.2.0)
|
||||||
thor (>= 1.2.0)
|
thor (>= 1.2.0)
|
||||||
yard-sorbet
|
yard-sorbet
|
||||||
test-unit (3.6.1)
|
test-unit (3.6.2)
|
||||||
power_assert
|
power_assert
|
||||||
thor (1.2.2)
|
thor (1.3.1)
|
||||||
tilt (2.3.0)
|
tilt (2.3.0)
|
||||||
timeout (0.4.0)
|
timeout (0.4.1)
|
||||||
turbolinks (5.2.1)
|
turbolinks (5.2.1)
|
||||||
turbolinks-source (~> 5.2)
|
turbolinks-source (~> 5.2)
|
||||||
turbolinks-source (5.2.0)
|
turbolinks-source (5.2.0)
|
||||||
tzinfo (2.0.6)
|
tzinfo (2.0.6)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
tzinfo-data (1.2023.3)
|
tzinfo-data (1.2024.1)
|
||||||
tzinfo (>= 1.0.0)
|
tzinfo (>= 1.0.0)
|
||||||
uglifier (4.2.0)
|
uglifier (4.2.0)
|
||||||
execjs (>= 0.3.0, < 3)
|
execjs (>= 0.3.0, < 3)
|
||||||
unicode-display_width (2.4.2)
|
unicode-display_width (2.5.0)
|
||||||
uuid (2.3.9)
|
uuid (2.3.9)
|
||||||
macaddr (~> 1.0)
|
macaddr (~> 1.0)
|
||||||
web-console (4.2.1)
|
web-console (4.2.1)
|
||||||
@ -279,8 +285,7 @@ GEM
|
|||||||
yard-sorbet (0.8.1)
|
yard-sorbet (0.8.1)
|
||||||
sorbet-runtime (>= 0.5)
|
sorbet-runtime (>= 0.5)
|
||||||
yard (>= 0.9)
|
yard (>= 0.9)
|
||||||
yarp (0.12.0)
|
zeitwerk (2.6.13)
|
||||||
zeitwerk (2.6.12)
|
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
arm64-darwin-22
|
arm64-darwin-22
|
||||||
@ -298,6 +303,7 @@ DEPENDENCIES
|
|||||||
rack-cors (~> 2.0)
|
rack-cors (~> 2.0)
|
||||||
rails (~> 7.0.8)
|
rails (~> 7.0.8)
|
||||||
rubocop (~> 1.52)
|
rubocop (~> 1.52)
|
||||||
|
rubocop-rails (~> 2.20)
|
||||||
sass-rails (~> 6.0)
|
sass-rails (~> 6.0)
|
||||||
sdoc (~> 2.6)
|
sdoc (~> 2.6)
|
||||||
sorbet (~> 0.5.10871)
|
sorbet (~> 0.5.10871)
|
||||||
|
|||||||
@ -44,7 +44,7 @@ class ConfigurationManager
|
|||||||
|
|
||||||
sig { returns(URI::Generic) }
|
sig { returns(URI::Generic) }
|
||||||
def document_server_public_uri
|
def document_server_public_uri
|
||||||
url = ENV['DOCUMENT_SERVER_PUBLIC_URL'] || 'http://document-server'
|
url = ENV['DOCUMENT_SERVER_PUBLIC_URL'] || 'http://documentserver'
|
||||||
URI(url)
|
URI(url)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class ConfigurationManagerDocumentServerPublicURITests < Test::Unit::TestCase
|
|||||||
def test_assigns_a_default_value
|
def test_assigns_a_default_value
|
||||||
config_manager = ConfigurationManager.new
|
config_manager = ConfigurationManager.new
|
||||||
uri = config_manager.document_server_public_uri
|
uri = config_manager.document_server_public_uri
|
||||||
assert_equal(uri.to_s, 'http://document-server')
|
assert_equal(uri.to_s, 'http://documentserver')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_assigns_a_value_from_the_environment
|
def test_assigns_a_value_from_the_environment
|
||||||
@ -83,7 +83,7 @@ class ConfigurationManagerDocumentServerPrivateURITests < Test::Unit::TestCase
|
|||||||
def test_assigns_a_default_value
|
def test_assigns_a_default_value
|
||||||
config_manager = ConfigurationManager.new
|
config_manager = ConfigurationManager.new
|
||||||
uri = config_manager.document_server_private_uri
|
uri = config_manager.document_server_private_uri
|
||||||
assert_equal(uri.to_s, 'http://document-server')
|
assert_equal(uri.to_s, 'http://documentserver')
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_assigns_a_value_from_the_environment
|
def test_assigns_a_value_from_the_environment
|
||||||
@ -103,7 +103,7 @@ class ConfigurationManagerDocumentServerAPIURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_api_uri
|
uri = config_manager.document_server_api_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/web-apps/apps/api/documents/api.js'
|
'http://documentserver/web-apps/apps/api/documents/api.js'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ class ConfigurationManagerDocumentServerAPIURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_api_uri
|
uri = config_manager.document_server_api_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/api'
|
'http://documentserver/api'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -127,7 +127,7 @@ class ConfigurationManagerDocumentServerPreloaderURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_preloader_uri
|
uri = config_manager.document_server_preloader_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/web-apps/apps/api/documents/cache-scripts.html'
|
'http://documentserver/web-apps/apps/api/documents/cache-scripts.html'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ class ConfigurationManagerDocumentServerPreloaderURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_preloader_uri
|
uri = config_manager.document_server_preloader_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/preloader'
|
'http://documentserver/preloader'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -151,7 +151,7 @@ class ConfigurationManagerDocumentServerCommandURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_command_uri
|
uri = config_manager.document_server_command_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/coauthoring/CommandService.ashx'
|
'http://documentserver/coauthoring/CommandService.ashx'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ class ConfigurationManagerDocumentServerCommandURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_command_uri
|
uri = config_manager.document_server_command_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/command'
|
'http://documentserver/command'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -175,7 +175,7 @@ class ConfigurationManagerDocumentServerConverterURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_converter_uri
|
uri = config_manager.document_server_converter_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/ConvertService.ashx'
|
'http://documentserver/ConvertService.ashx'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ class ConfigurationManagerDocumentServerConverterURITests < Test::Unit::TestCase
|
|||||||
uri = config_manager.document_server_converter_uri
|
uri = config_manager.document_server_converter_uri
|
||||||
assert_equal(
|
assert_equal(
|
||||||
uri.to_s,
|
uri.to_s,
|
||||||
'http://document-server/converter'
|
'http://documentserver/converter'
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -169,7 +169,7 @@ class HomeController < ApplicationController
|
|||||||
action_data: file_data['action_data'],
|
action_data: file_data['action_data'],
|
||||||
direct_url: file_data['direct_url']
|
direct_url: file_data['direct_url']
|
||||||
)
|
)
|
||||||
history = file.get_history
|
history = file.history
|
||||||
render(json: history)
|
render(json: history)
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
render(json: '{ "error": "File not found"}')
|
render(json: '{ "error": "File not found"}')
|
||||||
@ -349,7 +349,10 @@ class HomeController < ApplicationController
|
|||||||
# Save Copy as...
|
# Save Copy as...
|
||||||
def saveas
|
def saveas
|
||||||
body = JSON.parse(request.body.read)
|
body = JSON.parse(request.body.read)
|
||||||
file_url = body['url']
|
file_url = body['url'].sub(
|
||||||
|
HomeController.config_manager.document_server_public_uri.to_s,
|
||||||
|
HomeController.config_manager.document_server_private_uri.to_s
|
||||||
|
)
|
||||||
title = body['title']
|
title = body['title']
|
||||||
file_name = DocumentHelper.get_correct_name(title, nil)
|
file_name = DocumentHelper.get_correct_name(title, nil)
|
||||||
extension = File.extname(file_name).downcase
|
extension = File.extname(file_name).downcase
|
||||||
@ -384,7 +387,7 @@ class HomeController < ApplicationController
|
|||||||
render(plain: "{\"file\" : \"#{file_name}\"}")
|
render(plain: "{\"file\" : \"#{file_name}\"}")
|
||||||
nil
|
nil
|
||||||
rescue StandardError => e
|
rescue StandardError => e
|
||||||
render(plain: "{\"error\":1, \"message\": \"#{e.message}\"}")
|
render(plain: JSON.generate({ error: 1, message: e.message }))
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -269,7 +269,7 @@ class DocumentHelper
|
|||||||
|
|
||||||
# get image url for templates
|
# get image url for templates
|
||||||
def self.get_template_image_url(file_type)
|
def self.get_template_image_url(file_type)
|
||||||
path = "#{get_server_url(true)}/assets/"
|
path = "#{get_server_url(false)}/assets/"
|
||||||
case file_type
|
case file_type
|
||||||
when 'word' # for word type
|
when 'word' # for word type
|
||||||
"#{path}file_docx.svg"
|
"#{path}file_docx.svg"
|
||||||
|
|||||||
@ -183,7 +183,7 @@ class FileModel
|
|||||||
id: @user.id.eql?('uid-0') ? nil : @user.id,
|
id: @user.id.eql?('uid-0') ? nil : @user.id,
|
||||||
name: @user.name,
|
name: @user.name,
|
||||||
group: @user.group,
|
group: @user.group,
|
||||||
image: @user.avatar ? "#{DocumentHelper.get_server_url(true)}/assets/#{@user.id}.png" : nil
|
image: @user.avatar ? "#{DocumentHelper.get_server_url(false)}/assets/#{@user.id}.png" : nil
|
||||||
},
|
},
|
||||||
embedded: { # the parameters for the embedded document type
|
embedded: { # the parameters for the embedded document type
|
||||||
# the absolute URL that will allow the document to be saved onto the user personal computer
|
# the absolute URL that will allow the document to be saved onto the user personal computer
|
||||||
@ -262,8 +262,7 @@ class FileModel
|
|||||||
data_obj['url'] =
|
data_obj['url'] =
|
||||||
if i == cur_ver
|
if i == cur_ver
|
||||||
DocumentHelper.get_download_url(
|
DocumentHelper.get_download_url(
|
||||||
file_name,
|
file_name
|
||||||
true
|
|
||||||
)
|
)
|
||||||
else
|
else
|
||||||
DocumentHelper.get_historypath_uri(
|
DocumentHelper.get_historypath_uri(
|
||||||
@ -304,22 +303,20 @@ class FileModel
|
|||||||
|
|
||||||
prev = hist_data[(i - 2).to_s] # get the history data from the previous file version
|
prev = hist_data[(i - 2).to_s] # get the history data from the previous file version
|
||||||
# write key and url information about previous file version with optional direct url
|
# write key and url information about previous file version with optional direct url
|
||||||
data(
|
data_obj['previous'] = if enable_direct_url? == true
|
||||||
obj['previous'] = if enable_direct_url? == true
|
{ # write key and url information about previous file version with optional directUrl
|
||||||
{ # write key and url information about previous file version with optional directUrl
|
fileType: prev['fileType'],
|
||||||
fileType: prev['fileType'],
|
key: prev['key'],
|
||||||
key: prev['key'],
|
url: prev['url'],
|
||||||
url: prev['url'],
|
directUrl: prev['directUrl']
|
||||||
directUrl: prev['directUrl']
|
}
|
||||||
}
|
else
|
||||||
else
|
{
|
||||||
{
|
fileType: prev['fileType'],
|
||||||
fileType: prev['fileType'],
|
key: prev['key'],
|
||||||
key: prev['key'],
|
url: prev['url']
|
||||||
url: prev['url']
|
}
|
||||||
}
|
end
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
diff_path = [hist_dir, (i - 1).to_s, 'diff.zip'].join(File::SEPARATOR)
|
diff_path = [hist_dir, (i - 1).to_s, 'diff.zip'].join(File::SEPARATOR)
|
||||||
if File.exist?(diff_path)
|
if File.exist?(diff_path)
|
||||||
@ -457,7 +454,7 @@ class FileModel
|
|||||||
templates: user_info.templates,
|
templates: user_info.templates,
|
||||||
avatar: user_info.avatar
|
avatar: user_info.avatar
|
||||||
}
|
}
|
||||||
u['image'] = user_info.avatar ? "#{DocumentHelper.get_server_url(true)}/assets/#{user_info.id}.png" : nil
|
u['image'] = user_info.avatar ? "#{DocumentHelper.get_server_url(false)}/assets/#{user_info.id}.png" : nil
|
||||||
users_info.push(u)
|
users_info.push(u)
|
||||||
end
|
end
|
||||||
users_info
|
users_info
|
||||||
|
|||||||
@ -165,7 +165,13 @@ class ServiceConverter
|
|||||||
|
|
||||||
percent_element = file_result['percent'] # get the percentage value
|
percent_element = file_result['percent'] # get the percentage value
|
||||||
|
|
||||||
result_percent = Integer(percent_element, 10) unless percent_element.nil?
|
result_percent = unless percent_element.nil?
|
||||||
|
if percent_element.is_a?(String)
|
||||||
|
Integer(percent_element, 10)
|
||||||
|
else
|
||||||
|
Integer(percent_element)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
result_percent = 99 if result_percent >= 100
|
result_percent = 99 if result_percent >= 100
|
||||||
|
|
||||||
|
|||||||
Submodule web/documentserver-example/ruby/assets/document-formats updated: fc7347f6f0...730e13c89d
@ -1,9 +1,9 @@
|
|||||||
version: "3.8"
|
version: "3.8"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
document-server:
|
documentserver:
|
||||||
container_name: document-server
|
container_name: documentserver
|
||||||
image: onlyoffice/documentserver:7.5
|
image: onlyoffice/documentserver:8.0
|
||||||
expose:
|
expose:
|
||||||
- "80"
|
- "80"
|
||||||
environment:
|
environment:
|
||||||
@ -30,7 +30,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
target: proxy
|
target: proxy
|
||||||
depends_on:
|
depends_on:
|
||||||
- document-server
|
- documentserver
|
||||||
- example
|
- example
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
|
|||||||
@ -6,6 +6,7 @@ events {
|
|||||||
|
|
||||||
http {
|
http {
|
||||||
include /etc/nginx/mime.types;
|
include /etc/nginx/mime.types;
|
||||||
|
client_max_body_size 100M;
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
@ -14,6 +15,14 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://example;
|
proxy_pass http://example;
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Host $http_x_forwarded_host;
|
||||||
|
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -24,7 +33,7 @@ http {
|
|||||||
location / {
|
location / {
|
||||||
client_max_body_size 100m;
|
client_max_body_size 100m;
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_pass http://document-server;
|
proxy_pass http://documentserver;
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
proxy_set_header Connection "upgrade";
|
proxy_set_header Connection "upgrade";
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
|||||||
Reference in New Issue
Block a user