2 |
<head> |
<head> |
3 |
<head> |
<head> |
4 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
5 |
|
|
6 |
|
<link rel="stylesheet" href="webjars/jquery-ui/1.11.4/jquery-ui.css" /> |
7 |
|
|
8 |
<link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" /> |
<link rel="stylesheet" href="webjars/bootstrap/3.3.5/css/bootstrap.min.css" /> |
9 |
|
|
10 |
<link rel="stylesheet" href="webjars/bootstrap-fileinput/4.2.7/css/fileinput.min.css" /> |
<link rel="stylesheet" href="webjars/bootstrap-fileinput/4.2.7/css/fileinput.min.css" /> |
11 |
|
|
12 |
|
<style> |
13 |
|
|
14 |
|
@media (min-width: 1300px) { |
15 |
|
.container { |
16 |
|
width: 1300px; /*default 1170px*/ |
17 |
|
} |
18 |
|
.panel-actions { |
19 |
|
margin-top: -20px; |
20 |
|
margin-bottom: 0; |
21 |
|
text-align: right; |
22 |
|
} |
23 |
|
.panel-actions a { |
24 |
|
color:#333; |
25 |
|
} |
26 |
|
.panel-fullscreen { |
27 |
|
display: block; |
28 |
|
z-index: 9999; |
29 |
|
position: fixed; |
30 |
|
width: 100%; |
31 |
|
height: 100%; |
32 |
|
top: 0; |
33 |
|
right: 0; |
34 |
|
left: 0; |
35 |
|
bottom: 0; |
36 |
|
overflow: auto; |
37 |
|
} |
38 |
|
|
39 |
|
} |
40 |
|
</style> |
41 |
|
|
42 |
<!-- use webjars for dependencies --> |
<!-- use webjars for dependencies --> |
43 |
<script src="webjars/jquery/2.1.4/jquery.js"></script> |
<script src="webjars/jquery/2.1.4/jquery.js"></script> |
44 |
|
<script src="webjars/jquery-ui/1.11.4/jquery-ui.js"></script> |
45 |
<script src="webjars/bootstrap/3.3.5/js/bootstrap.min.js"></script> |
<script src="webjars/bootstrap/3.3.5/js/bootstrap.min.js"></script> |
46 |
|
|
47 |
<script src="webjars/bootstrap-fileinput/4.2.7/js/fileinput.min.js"></script> |
<script src="webjars/bootstrap-fileinput/4.2.7/js/fileinput.min.js"></script> |
52 |
|
|
53 |
|
|
54 |
function loadTasks() { |
function loadTasks() { |
55 |
$.get("TaskServlet", function(data) { |
$.get("rest/tasks/list", function(data) { |
56 |
//console.log(data); |
//console.log(data); |
57 |
|
|
58 |
|
|
74 |
|
|
75 |
|
|
76 |
html += "<div class='panel " + pclass + "'>"; |
html += "<div class='panel " + pclass + "'>"; |
77 |
html += "<div class='panel-heading'><h4 class='panel-title'>" + entry.description + "</h4></div>"; |
html += "<div class='panel-heading'>"; |
78 |
|
if (entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED" || entry.state == "STATE_QUEUED") { |
79 |
|
html += "<button type='button' class='close removetask' aria-label='Close' taskid='" + entry.id+ "'><span aria-hidden='true'>×</span></button>"; |
80 |
|
} |
81 |
|
html += "<h4 class='panel-title'>" + entry.description + "</h4>"; |
82 |
|
html += "</div>"; |
83 |
|
html += " <div class='panel-body'>"; |
84 |
|
|
85 |
html += entry.detail; |
html += entry.detail; |
86 |
|
|
87 |
html += "<br/><div style='font-size: 8px; margin: 7px;'>" + entry.state + "</div>"; |
if (entry.state == "STATE_ABORTED") |
88 |
|
html += "<br><div style='color: red'>" + entry.errorMessage + "</div>"; |
89 |
|
|
90 |
|
if (entry.state == "STATE_RUNNING") { |
91 |
|
if (entry.percentCompleted >= 0) { |
92 |
|
var percent = entry.percentCompleted.toFixed(2); |
93 |
|
html += "<div class='progress'>"; |
94 |
|
html += "<div class='progress-bar' role='progressbar' aria-valuenow='" + percent + "' aria-valuemin='0' aria-valuemax='100' style='width:" + percent + "%'> " ; |
95 |
|
html += percent + "%"; |
96 |
|
html += " </div>"; |
97 |
|
html += "</div>"; |
98 |
|
} |
99 |
|
} |
100 |
|
|
101 |
|
var viewlog = ""; |
102 |
|
if (entry.state == "STATE_RUNNING" || entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") { |
103 |
|
viewlog = "<span style='float: right'><a href='#' class='viewlog' taskid='" + entry.id+ "'>Log</a></span>"; |
104 |
|
} |
105 |
|
|
106 |
html += "</div>"; |
html += " <div style='font-size: 8px; '>" + entry.state + viewlog + "</div>"; |
107 |
|
|
108 |
|
html += " </div>"; //panel-body |
109 |
|
html += "</div>"; //panel |
110 |
|
|
111 |
}); |
}); |
112 |
if (html == "") { |
if (html == "") { |
132 |
|
|
133 |
$(document).ready( function() { |
$(document).ready( function() { |
134 |
loadTasks(); |
loadTasks(); |
135 |
setInterval(loadTasks, 2500); |
setInterval(loadTasks, 5000); |
136 |
|
|
137 |
|
$("#center").resizable({ |
138 |
|
handles: 'e, w' |
139 |
|
}); |
140 |
|
|
141 |
|
|
142 |
|
$(document).on('click', '.viewlog', function(event) { // Bind future elements |
143 |
|
var taskid = $(this).attr('taskid'); |
144 |
|
$("#logview").load('rest/tasks/log/' + taskid); |
145 |
|
|
146 |
|
}); |
147 |
|
|
148 |
|
$(document).on('click', '.removetask', function(event) { // Bind future elements |
149 |
|
var taskid = $(this).attr('taskid'); |
150 |
|
$.get('rest/tasks/remove/' + taskid, function() { |
151 |
|
loadTasks(); |
152 |
|
}); |
153 |
|
}); |
154 |
|
|
155 |
$("#file").fileinput({ |
$("#file").fileinput({ |
156 |
//'showUpload':false, |
//'showUpload':false, |
176 |
$('#file').fileinput('upload'); |
$('#file').fileinput('upload'); |
177 |
}); |
}); |
178 |
|
|
179 |
|
|
180 |
|
|
181 |
|
|
182 |
|
$("#afstandBtn").click( function(){ |
183 |
|
var dist = $("#afstand_distributor").val(); |
184 |
|
if (dist == "") { |
185 |
|
alert("Du skal vælge distributør"); |
186 |
|
return; |
187 |
|
} |
188 |
|
var type = $("#afstand_type").val(); |
189 |
|
var url = "rest/commands/distancecalculation/" + dist + "/" + type; |
190 |
|
|
191 |
|
|
192 |
|
$.get(url, function() { |
193 |
|
loadTasks(); //Force reload of tasks immediately |
194 |
|
} ); |
195 |
|
|
196 |
|
}); |
197 |
|
|
198 |
|
$("#dawaBtn").click( function(){ |
199 |
|
|
200 |
|
var url = "rest/commands/dawa"; |
201 |
|
|
202 |
|
|
203 |
|
$.get(url, function() { |
204 |
|
loadTasks(); //Force reload of tasks immediately |
205 |
|
} ); |
206 |
|
|
207 |
|
}); |
208 |
|
|
209 |
|
//Toggle fullscreen |
210 |
|
$("#panel-fullscreen").click(function (e) { |
211 |
|
e.preventDefault(); |
212 |
|
|
213 |
|
var $this = $(this); |
214 |
|
|
215 |
|
if ($this.children('i').hasClass('glyphicon-resize-full')) |
216 |
|
{ |
217 |
|
$this.children('i').removeClass('glyphicon-resize-full'); |
218 |
|
$this.children('i').addClass('glyphicon-resize-small'); |
219 |
|
} |
220 |
|
else if ($this.children('i').hasClass('glyphicon-resize-small')) |
221 |
|
{ |
222 |
|
$this.children('i').removeClass('glyphicon-resize-small'); |
223 |
|
$this.children('i').addClass('glyphicon-resize-full'); |
224 |
|
} |
225 |
|
$(this).closest('.panel').toggleClass('panel-fullscreen'); |
226 |
|
}); |
227 |
|
|
228 |
|
|
229 |
}); |
}); |
230 |
|
|
231 |
</script> |
</script> |
238 |
<h1>Dao Adresse Vedligehold</h1> |
<h1>Dao Adresse Vedligehold</h1> |
239 |
</div> |
</div> |
240 |
<div id="body"> |
<div id="body"> |
241 |
<div class="row"> |
<div class="row"> |
242 |
<div class="col-sm-3" id="leftCol" > |
<div class="col-sm-3" id="leftCol" > |
243 |
<div class="panel panel-primary"> |
<div class="panel panel-primary"> |
244 |
<div class="panel-heading"> |
<div class="panel-heading"> |
252 |
</div> |
</div> |
253 |
</div> |
</div> |
254 |
|
|
255 |
<div class="col-sm-6" id="center" > |
<div class="col-sm-6" id="center"> |
256 |
b |
<div class="panel panel-primary"> |
257 |
|
<div class="panel-heading"> |
258 |
|
<h3 class="panel-title">Log</h3> |
259 |
|
<ul class="list-inline panel-actions"> |
260 |
|
|
261 |
|
<li><a href="#" id="panel-fullscreen" role="button" title="Toggle fullscreen"><i class="glyphicon glyphicon-resize-full"></i></a></li> |
262 |
|
|
263 |
|
</ul> |
264 |
|
</div> |
265 |
|
<div class="panel-body"> |
266 |
|
<pre id="logview"> |
267 |
|
</pre> |
268 |
|
</div> |
269 |
|
</div> |
270 |
</div> |
</div> |
271 |
|
|
272 |
<div class="col-sm-3" id="rightCol" > |
<div class="col-sm-3" id="rightCol" > |
273 |
<div class="panel panel-primary"> |
<div class="panel panel-primary"> |
274 |
<div class="panel-heading"> |
<div class="panel-heading"> |
275 |
<h3 class="panel-title">Actions</h3> |
<h3 class="panel-title">Upload File</h3> |
276 |
</div> |
</div> |
277 |
<div class="panel-body"> |
<div class="panel-body"> |
278 |
|
|
281 |
<select class="form-control" id="distributor" name="distributor"> |
<select class="form-control" id="distributor" name="distributor"> |
282 |
<option></option> |
<option></option> |
283 |
<option>BK</option> |
<option>BK</option> |
|
<!-- |
|
284 |
<option>DAO</option> |
<option>DAO</option> |
285 |
<option>FD</option> |
<option>FD</option> |
286 |
<option>NS</option> |
<option>NS</option> |
|
--> |
|
287 |
</select> |
</select> |
288 |
|
|
289 |
<label for="writeback">Write-back:</label> |
<label for="writeback">Write-back:</label> |
303 |
|
|
304 |
|
|
305 |
</div> |
</div> |
306 |
</div> |
</div> <!-- upload panel --> |
307 |
</div> |
|
308 |
</div> |
<div class="panel panel-primary"> |
309 |
|
<div class="panel-heading"> |
310 |
|
<h3 class="panel-title">Afstand anden rute</h3> |
311 |
|
</div> |
312 |
|
<div class="panel-body"> |
313 |
|
|
314 |
|
|
315 |
|
<label for="distributor">Distributør:</label> |
316 |
|
<select class="form-control" id="afstand_distributor" name="afstand_distributor"> |
317 |
|
<option></option> |
318 |
|
<option>BK</option> |
319 |
|
<option>DAO</option> |
320 |
|
</select> |
321 |
|
|
322 |
|
|
323 |
|
<label for="type">Type:</label> |
324 |
|
<select class="form-control" id="afstand_type" name="afstand_type"> |
325 |
|
<option>Incremental</option> |
326 |
|
<option>Full</option> |
327 |
|
</select> |
328 |
|
<br> |
329 |
|
|
330 |
|
|
331 |
|
<button class="btn btn-primary" id="afstandBtn">Beregn</button> |
332 |
|
|
333 |
|
|
334 |
|
</div> |
335 |
|
</div><!-- Afstand-andenrute panel --> |
336 |
|
|
337 |
|
<div class="panel panel-primary"> |
338 |
|
<div class="panel-heading"> |
339 |
|
<h3 class="panel-title">Dawa Indlæsning</h3> |
340 |
|
</div> |
341 |
|
<div class="panel-body"> |
342 |
|
|
343 |
|
<button class="btn btn-primary" id="dawaBtn">Beregn</button> |
344 |
|
|
345 |
|
</div> |
346 |
|
</div> <!-- DAWA --> |
347 |
|
|
348 |
|
|
349 |
|
</div><!-- rightcol --> |
350 |
|
</div> <!-- row --> |
351 |
|
|
352 |
</div> |
</div><!-- body --> |
353 |
|
|
354 |
|
|
355 |
</div> |
</div> |
356 |
|
|
357 |
|
|