--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/01/24 21:48:55 2838 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/03 22:32:05 2910 @@ -19,7 +19,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -42,12 +42,33 @@ html += "
"; html += "

" + entry.description + "

"; + html += "
"; html += entry.detail; - html += "
" + entry.state + "
"; + if (entry.state == "STATE_ABORTED") + html += "
" + entry.errorMessage + "
"; + + if (entry.state == "STATE_RUNNING") { + if (entry.percentCompleted >= 0) { + var percent = entry.percentCompleted.toFixed(2); + html += "
"; + html += "
" ; + html += percent + "%"; + html += "
"; + html += "
"; + } + } + + var viewlog = ""; + if (entry.state == "STATE_RUNNING" || entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") { + viewlog = "Log"; + } + + html += "
" + entry.state + viewlog + "
"; - html += "
"; + html += "
"; //panel-body + html += ""; //panel }); if (html == "") { @@ -73,9 +94,15 @@ $(document).ready( function() { loadTasks(); - setInterval(loadTasks, 2500); + setInterval(loadTasks, 5000); + $(document).on('click', '.viewlog', function(event) { // Bind future elements + var taskid = $(this).attr('taskid'); + $("#logview").load('rest/tasks/log/' + taskid); + + }); + $("#file").fileinput({ //'showUpload':false, 'showRemove': false, @@ -100,6 +127,21 @@ $('#file').fileinput('upload'); }); + + $("#afstandBtn").click( function(){ + var dist = $("#afstand_distributor").val(); + if (dist == "") { + alert("Du skal vælge distributør"); + return; + } + + + $.get("rest/commands/distancecalculation/" + dist, function() { + loadTasks(); //Force reload of tasks immediately + } ); + + }); + }); @@ -126,14 +168,15 @@ -
- b +
+
+      
-

Actions

+

Upload File

@@ -142,11 +185,9 @@ @@ -166,11 +207,37 @@
-
-
-
+ + +
+
+

Afstand anden rute

+
+
+ + + + +
+ + + + +
+
+ + + + + - + + +