--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/01 09:24:15 2899 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/11 17:35:31 2932 @@ -2,13 +2,25 @@ + + + + + @@ -19,7 +31,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -41,7 +53,12 @@ html += "
"; - html += "

" + entry.description + "

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

" + entry.description + "

"; + html += "
"; html += "
"; html += entry.detail; @@ -60,7 +77,12 @@ } } - html += "
" + entry.state + "
"; + var viewlog = ""; + if (entry.state == "STATE_RUNNING" || entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") { + viewlog = "Log"; + } + + html += "
" + entry.state + viewlog + "
"; html += "
"; //panel-body html += "
"; //panel @@ -89,9 +111,26 @@ $(document).ready( function() { loadTasks(); - setInterval(loadTasks, 2500); + setInterval(loadTasks, 5000); + + $("#center").resizable({ + handles: 'e, w' + }); + $(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, @@ -123,9 +162,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 } ); @@ -143,7 +184,7 @@

Dao Adresse Vedligehold

-
+
@@ -157,8 +198,9 @@
-
- b +
+
+      
@@ -210,7 +252,15 @@ + + + +
+