--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/01/31 22:45:03 2891 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/02/03 22:30:22 2909 @@ -19,7 +19,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -42,6 +42,7 @@ html += "
"; html += "

" + entry.description + "

"; + html += "
"; html += entry.detail; @@ -59,9 +60,15 @@ } } - 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 += "
"; + html += "
"; //panel-body + html += ""; //panel }); if (html == "") { @@ -87,8 +94,14 @@ $(document).ready( function() { loadTasks(); - setInterval(loadTasks, 2500); + //setInterval(loadTasks, 2500); + + $(document).on('click', '.viewlog', function(event) { // Bind future elements + var taskid = $(this).attr('taskid'); + $("#logview").load('rest/tasks/log/' + taskid); + + }); $("#file").fileinput({ //'showUpload':false, @@ -123,7 +136,9 @@ } - $.get("rest/commands/distancecalculation/" + dist); + $.get("rest/commands/distancecalculation/" + dist, function() { + loadTasks(); //Force reload of tasks immediately + } ); }); @@ -153,8 +168,9 @@ -
- b +
+
+