优化drawio路径
This commit is contained in:
parent
6f35fe9936
commit
a99588c766
@ -17,9 +17,8 @@
|
|||||||
<meta name="mobile-web-app-capable" content="yes">
|
<meta name="mobile-web-app-capable" content="yes">
|
||||||
<meta name="theme-color" content="#d89000">
|
<meta name="theme-color" content="#d89000">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
window.EXPORT_URL = window.location.origin + "/api/drawio/export";
|
window.EXPORT_URL = window.location.origin + "/drawio/export/";
|
||||||
window.PLANT_URL = window.location.origin + "/api/drawio/plant";
|
window.DRAWIO_LIGHTBOX_URL = window.location.origin + "/drawio/webapp";
|
||||||
window.DRAWIO_LIGHTBOX_URL = window.location.origin + "/drawio";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* URL Parameters and protocol description are here:
|
* URL Parameters and protocol description are here:
|
||||||
|
@ -112,11 +112,11 @@ server {
|
|||||||
proxy_pass http://office/;
|
proxy_pass http://office/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /drawio/ {
|
location /drawio/webapp/ {
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Real-PORT $remote_port;
|
proxy_set_header X-Real-PORT $remote_port;
|
||||||
proxy_set_header X-Forwarded-Host $the_host/drawio;
|
proxy_set_header X-Forwarded-Host $the_host/drawio/webapp;
|
||||||
proxy_set_header X-Forwarded-Proto $the_scheme;
|
proxy_set_header X-Forwarded-Proto $the_scheme;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
@ -129,6 +129,24 @@ server {
|
|||||||
proxy_set_header Connection $connection_upgrade;
|
proxy_set_header Connection $connection_upgrade;
|
||||||
proxy_pass http://drawio-webapp:8080/;
|
proxy_pass http://drawio-webapp:8080/;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /drawio/export/ {
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Real-PORT $remote_port;
|
||||||
|
proxy_set_header X-Forwarded-Host $the_host/drawio/export;
|
||||||
|
proxy_set_header X-Forwarded-Proto $the_scheme;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
proxy_set_header Scheme $scheme;
|
||||||
|
proxy_set_header Server-Protocol $server_protocol;
|
||||||
|
proxy_set_header Server-Name $server_name;
|
||||||
|
proxy_set_header Server-Addr $server_addr;
|
||||||
|
proxy_set_header Server-Port $server_port;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection $connection_upgrade;
|
||||||
|
proxy_pass http://drawio-export:8000/;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
include /etc/nginx/conf.d/conf.d/*.conf;
|
include /etc/nginx/conf.d/conf.d/*.conf;
|
||||||
|
@ -20,7 +20,7 @@ function cloneDrawio(systemInfo) {
|
|||||||
child_process.spawnSync("git", ["submodule", "update", "--quiet", "--init", "--depth=1"], {stdio: "inherit"});
|
child_process.spawnSync("git", ["submodule", "update", "--quiet", "--init", "--depth=1"], {stdio: "inherit"});
|
||||||
const drawioSrcDir = path.resolve(__dirname, "../resources/drawio/src/main/webapp");
|
const drawioSrcDir = path.resolve(__dirname, "../resources/drawio/src/main/webapp");
|
||||||
const drawioCoverDir = path.resolve(__dirname, "../docker/drawio/webapp");
|
const drawioCoverDir = path.resolve(__dirname, "../docker/drawio/webapp");
|
||||||
const drawioDestDir = path.resolve(electronDir, "drawio");
|
const drawioDestDir = path.resolve(electronDir, "drawio/webapp");
|
||||||
fse.copySync(drawioSrcDir, drawioDestDir)
|
fse.copySync(drawioSrcDir, drawioDestDir)
|
||||||
fse.copySync(drawioCoverDir, drawioDestDir)
|
fse.copySync(drawioCoverDir, drawioDestDir)
|
||||||
//
|
//
|
||||||
|
@ -5,9 +5,7 @@ if (window.cacheServerUrl) {
|
|||||||
window.systemInfo.apiUrl = window.cacheServerUrl
|
window.systemInfo.apiUrl = window.cacheServerUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
window.EXPORT_URL = window.systemInfo.apiUrl + "drawio/export";
|
window.EXPORT_URL = window.systemInfo.apiUrl + "../drawio/export/";
|
||||||
window.PLANT_URL = window.systemInfo.apiUrl + "drawio/plant";
|
window.DRAWIO_LIGHTBOX_URL = window.systemInfo.apiUrl + "../drawio/webapp";
|
||||||
window.DRAWIO_LIGHTBOX_URL = window.systemInfo.apiUrl + "../drawio";
|
while (window.EXPORT_URL.indexOf("/../") !== -1) {window.EXPORT_URL = window.EXPORT_URL.replace(/\/(((?!\/).)*)\/\.\.\//, "/")}
|
||||||
while (window.DRAWIO_LIGHTBOX_URL.indexOf("/../") !== -1) {
|
while (window.DRAWIO_LIGHTBOX_URL.indexOf("/../") !== -1) {window.DRAWIO_LIGHTBOX_URL = window.DRAWIO_LIGHTBOX_URL.replace(/\/(((?!\/).)*)\/\.\.\//, "/")}
|
||||||
window.DRAWIO_LIGHTBOX_URL = window.DRAWIO_LIGHTBOX_URL.replace(/\/(((?!\/).)*)\/\.\.\//, "/")
|
|
||||||
}
|
|
||||||
|
@ -72,9 +72,9 @@ export default {
|
|||||||
let theme = this.themeIsDark ? 'dark' : 'kennedy';
|
let theme = this.themeIsDark ? 'dark' : 'kennedy';
|
||||||
let query = `?chrome=${chrome}&lightbox=${lightbox}&ui=${theme}&lang=${language}&embed=1&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&spin=1&proto=json`;
|
let query = `?chrome=${chrome}&lightbox=${lightbox}&ui=${theme}&lang=${language}&embed=1&noLangIcon=1&noExitBtn=1&noSaveBtn=1&saveAndExit=0&spin=1&proto=json`;
|
||||||
if (this.$Electron) {
|
if (this.$Electron) {
|
||||||
this.url = $A.originUrl(`drawio/index.html${query}`);
|
this.url = $A.originUrl(`drawio/webapp/index.html${query}`);
|
||||||
} else {
|
} else {
|
||||||
this.url = $A.apiUrl(`../drawio/${query}`);
|
this.url = $A.apiUrl(`../drawio/webapp/${query}`);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user