19 |
|
|
20 |
|
|
21 |
function loadTasks() { |
function loadTasks() { |
22 |
$.get("TaskServlet", function(data) { |
$.get("rest/tasks/list", function(data) { |
23 |
//console.log(data); |
//console.log(data); |
24 |
|
|
25 |
|
|
42 |
|
|
43 |
html += "<div class='panel " + pclass + "'>"; |
html += "<div class='panel " + pclass + "'>"; |
44 |
html += "<div class='panel-heading'><h4 class='panel-title'>" + entry.description + "</h4></div>"; |
html += "<div class='panel-heading'><h4 class='panel-title'>" + entry.description + "</h4></div>"; |
45 |
|
html += " <div class='panel-body'>"; |
46 |
|
|
47 |
html += entry.detail; |
html += entry.detail; |
48 |
|
|
49 |
if (entry.state == "STATE_ABORTED") |
if (entry.state == "STATE_ABORTED") |
50 |
html += "<br><div style='color: red'>" + entry.errorMessage + "</div>"; |
html += "<br><div style='color: red'>" + entry.errorMessage + "</div>"; |
51 |
|
|
52 |
|
if (entry.state == "STATE_RUNNING") { |
53 |
|
if (entry.percentCompleted >= 0) { |
54 |
|
var percent = entry.percentCompleted.toFixed(2); |
55 |
|
html += "<div class='progress'>"; |
56 |
|
html += "<div class='progress-bar' role='progressbar' aria-valuenow='" + percent + "' aria-valuemin='0' aria-valuemax='100' style='width:" + percent + "%'> " ; |
57 |
|
html += percent + "%"; |
58 |
|
html += " </div>"; |
59 |
|
html += "</div>"; |
60 |
|
} |
61 |
|
} |
62 |
|
|
63 |
|
var viewlog = ""; |
64 |
|
if (entry.state == "STATE_RUNNING" || entry.state == "STATE_DONE" || entry.state == "STATE_ABORTED") { |
65 |
|
viewlog = "<span style='float: right'><a href='#' class='viewlog' taskid='" + entry.id+ "'>Log</a></span>"; |
66 |
|
} |
67 |
|
|
68 |
html += "<br/><div style='font-size: 8px; margin: 7px;'>" + entry.state + "</div>"; |
html += " <div style='font-size: 8px; '>" + entry.state + viewlog + "</div>"; |
69 |
|
|
70 |
html += "</div>"; |
html += " </div>"; //panel-body |
71 |
|
html += "</div>"; //panel |
72 |
|
|
73 |
}); |
}); |
74 |
if (html == "") { |
if (html == "") { |
94 |
|
|
95 |
$(document).ready( function() { |
$(document).ready( function() { |
96 |
loadTasks(); |
loadTasks(); |
97 |
setInterval(loadTasks, 2500); |
//setInterval(loadTasks, 2500); |
98 |
|
|
99 |
|
|
100 |
|
$(document).on('click', '.viewlog', function(event) { // Bind future elements |
101 |
|
var taskid = $(this).attr('taskid'); |
102 |
|
$("#logview").load('rest/tasks/log/' + taskid); |
103 |
|
|
104 |
|
}); |
105 |
|
|
106 |
$("#file").fileinput({ |
$("#file").fileinput({ |
107 |
//'showUpload':false, |
//'showUpload':false, |
108 |
'showRemove': false, |
'showRemove': false, |
136 |
} |
} |
137 |
|
|
138 |
|
|
139 |
$.get("rest/commands/distancecalculation/" + dist); |
$.get("rest/commands/distancecalculation/" + dist, function() { |
140 |
|
loadTasks(); //Force reload of tasks immediately |
141 |
|
} ); |
142 |
|
|
143 |
}); |
}); |
144 |
|
|
168 |
</div> |
</div> |
169 |
</div> |
</div> |
170 |
|
|
171 |
<div class="col-sm-6" id="center" > |
<div class="col-sm-6" id="center"> |
172 |
b |
<pre id="logview"> |
173 |
|
</pre> |
174 |
</div> |
</div> |
175 |
|
|
176 |
<div class="col-sm-3" id="rightCol" > |
<div class="col-sm-3" id="rightCol" > |