--- dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/01/24 21:48:55 2838 +++ dao/DaoAdresseVedligehold/src/main/webapp/index.html 2016/09/21 09:33:45 3116 @@ -2,13 +2,46 @@ + + + + + @@ -19,7 +52,7 @@ function loadTasks() { - $.get("TaskServlet", function(data) { + $.get("rest/tasks/list", function(data) { //console.log(data); @@ -41,13 +74,39 @@ 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; - 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 +132,25 @@ $(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, @@ -100,6 +176,56 @@ $('#file').fileinput('upload'); }); + + + + $("#afstandBtn").click( function(){ + var dist = $("#afstand_distributor").val(); + if (dist == "") { + alert("Du skal vælge distributør"); + return; + } + var type = $("#afstand_type").val(); + var url = "rest/commands/distancecalculation/" + dist + "/" + type; + + + $.get(url, function() { + loadTasks(); //Force reload of tasks immediately + } ); + + }); + + $("#dawaBtn").click( function(){ + + var url = "rest/commands/dawa"; + + + $.get(url, function() { + loadTasks(); //Force reload of tasks immediately + } ); + + }); + + //Toggle fullscreen + $("#panel-fullscreen").click(function (e) { + e.preventDefault(); + + var $this = $(this); + + if ($this.children('i').hasClass('glyphicon-resize-full')) + { + $this.children('i').removeClass('glyphicon-resize-full'); + $this.children('i').addClass('glyphicon-resize-small'); + } + else if ($this.children('i').hasClass('glyphicon-resize-small')) + { + $this.children('i').removeClass('glyphicon-resize-small'); + $this.children('i').addClass('glyphicon-resize-full'); + } + $(this).closest('.panel').toggleClass('panel-fullscreen'); + }); + + }); @@ -112,7 +238,7 @@

Dao Adresse Vedligehold

-
+
@@ -126,14 +252,27 @@
-
- b +
+
+
+

Log

+
    + +
  • + +
+
+
+
+      			
+
+
-

Actions

+

Upload File

@@ -142,11 +281,9 @@ @@ -166,11 +303,55 @@
-
-
-
+
+ +
+
+

Afstand anden rute

+
+
+ + + + + + + + +
+ + + + + +
+
+ +
+
+

Dawa Indlæsning

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