Skip to content

Commit 5b7543f

Browse files
author
Mark Robinson
committed
Add download link and svg image to page
1 parent 0363bf1 commit 5b7543f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/resources/static/js/workflow.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ requirejs.config({
4040
require(['jquery', 'bootstrap.modal', 'svg-pan-zoom'],
4141
function ($, modal, svgPanZoom) {
4242
// Enable svg-pan-zoom on the graph
43-
svgPanZoom('svg', {
43+
svgPanZoom('#graph', {
4444
zoomEnabled: true,
4545
controlIconsEnabled: true
4646
});

src/main/resources/templates/workflow.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,16 +121,17 @@ <h2>Workflow: <span th:text="${workflow.label}">Workflow Name</span></h2>
121121
<a id="download-link-graph" href="" download="workflow.png"></a>
122122
<strong>Graph: </strong>
123123
<button id="view-dot" class="btn btn-primary" type="button" data-toggle="modal" data-target="#dotGraph">View DOT</button>
124-
<button id="download-graph" class="btn btn-primary" type="button">Download Image</button>
124+
<a id="download-graph" class="btn btn-primary" type="button" th:href="@{'/workflows/' + ${workflow.id} + '/graph/svg'}" download="graph.svg">Download Image</a>
125125
</div>
126126
</div>
127127
</div>
128128
<div class="row">
129129
<div class="col-md-12">
130130
<div id="visualisation" class="jumbotron">
131131
<div id="loading">
132-
<img src="../static/img/loading.svg" th:src="@{/img/loading.svg}" />
133-
<span>Drawing Workflow...</span>
132+
<object id="graph" th:data="@{'/workflows/' + ${workflow.id} + '/graph/svg'}" type="image/svg+xml">
133+
<img th:src="@{'/workflows/' + ${workflow.id} + '/graph/png'}" alt="workflow graph" />
134+
</object>
134135
</div>
135136
<div id="graph"></div>
136137
</div>

0 commit comments

Comments
 (0)