--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/01/24 21:48:55 2838 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/04 22:00:00 2923 @@ -6,6 +6,15 @@ + + @@ -19,7 +28,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -41,13 +50,39 @@ html += "
"; - html += "

" + entry.description + "

"; + html += "
"; + if (entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") { + html += ""; + } + html += "

" + entry.description + "

"; + html += "
"; + 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 += "
"; + html += "
" + entry.state + viewlog + "
"; + + html += "
"; //panel-body + html += ""; //panel }); if (html == "") { @@ -73,8 +108,21 @@ $(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); + + }); + $(document).on('click', '.removetask', function(event) { // Bind future elements + var taskid = $(this).attr('taskid'); + $.get('rest/tasks/remove/' + taskid, function() { + loadTasks(); + }); + }); $("#file").fileinput({ //'showUpload':false, @@ -100,6 +148,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 + } ); + + }); + }); @@ -112,7 +175,7 @@

Dao Adresse Vedligehold

-
+
@@ -126,14 +189,15 @@
-
- b +
+
+      
-

Actions

+

Upload File

@@ -142,11 +206,9 @@ @@ -166,11 +228,37 @@
-
-
-
+
+ +
+
+

Afstand anden rute

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