--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/01 07:30:14 2895 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/05 11:01:48 2927 @@ -6,6 +6,15 @@ + + @@ -19,7 +28,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -41,7 +50,13 @@ html += "
"; - html += "

" + entry.description + "

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

" + entry.description + "

"; + html += "
"; + html += "
"; html += entry.detail; @@ -59,9 +74,15 @@ } } - html += "
" + entry.state + "
"; + 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 == "") { @@ -87,9 +108,22 @@ $(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, 'showRemove': false, @@ -121,9 +155,11 @@ alert("Du skal vælge distributør"); return; } + var type = $("#afstand_type").val(); + var url = "rest/commands/distancecalculation/" + dist + "/" + type; - $.get("rest/commands/distancecalculation/" + dist, function() { + $.get(url, function() { loadTasks(); //Force reload of tasks immediately } ); @@ -141,7 +177,7 @@

Dao Adresse Vedligehold

-
+
@@ -155,8 +191,9 @@
-
- b +
+
+      
@@ -208,7 +245,15 @@ + + + +
+