commit
fa2a5d3e35
|
@ -5,6 +5,14 @@
|
||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||||
<#include "*/commonHeader.ftl">
|
<#include "*/commonHeader.ftl">
|
||||||
|
<script src="js/base64.min.js" type="text/javascript"></script>
|
||||||
|
<#if currentUrl?contains("http://") || currentUrl?contains("https://") || currentUrl?contains("file://")>
|
||||||
|
<#assign finalUrl="${currentUrl}">
|
||||||
|
<#elseif currentUrl?contains("ftp://") >
|
||||||
|
<#assign finalUrl="${currentUrl}">
|
||||||
|
<#else>
|
||||||
|
<#assign finalUrl="${baseUrl}${currentUrl}">
|
||||||
|
</#if>
|
||||||
<style>
|
<style>
|
||||||
html, body, #diagram {
|
html, body, #diagram {
|
||||||
height: 100%
|
height: 100%
|
||||||
|
@ -33,12 +41,16 @@
|
||||||
const viewer = new BpmnJS({
|
const viewer = new BpmnJS({
|
||||||
container: '#diagram'
|
container: '#diagram'
|
||||||
});
|
});
|
||||||
|
var url = '${finalUrl}';
|
||||||
|
var baseUrl = '${baseUrl}'.endsWith('/') ? '${baseUrl}' : '${baseUrl}' + '/';
|
||||||
|
if (!url.startsWith(baseUrl)) {
|
||||||
|
url = baseUrl + 'getCorsFile?urlPath=' + encodeURIComponent(Base64.encode(url));
|
||||||
|
}
|
||||||
async function showDiagram(diagramXML) {
|
async function showDiagram(diagramXML) {
|
||||||
await viewer.importXML(diagramXML);
|
await viewer.importXML(diagramXML);
|
||||||
}
|
}
|
||||||
// load + show diagram
|
// load + show diagram
|
||||||
$.get('${currentUrl}', showDiagram, 'text');
|
$.get(url, showDiagram, 'text');
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue