summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2020-02-27 11:49:56 +0100
committerSimon Rettberg2020-02-27 11:49:56 +0100
commit378d136b8c6757c8999e3f69453d8d11d2f58803 (patch)
tree83eb20619199920e02fa533ae9818e253f7c42ef
parent[rebootcontrol] Fix WOL within same subnet (diff)
downloadslx-admin-378d136b8c6757c8999e3f69453d8d11d2f58803.tar.gz
slx-admin-378d136b8c6757c8999e3f69453d8d11d2f58803.tar.xz
slx-admin-378d136b8c6757c8999e3f69453d8d11d2f58803.zip
[rebootcontrol] Add debug output to WOL job status page
-rw-r--r--modules-available/rebootcontrol/templates/status-wol.html20
1 files changed, 20 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/templates/status-wol.html b/modules-available/rebootcontrol/templates/status-wol.html
index da506982..5a53a6f8 100644
--- a/modules-available/rebootcontrol/templates/status-wol.html
+++ b/modules-available/rebootcontrol/templates/status-wol.html
@@ -45,10 +45,30 @@
</tbody>
</table>
+<a class="text-muted" href="#debug-out" data-toggle="collapse">Debug</a>
+<pre id="debug-out" class="collapse"></pre>
+
<script><!--
function wolCallback(task) {
if (task.statusCode === 'TASK_WAITING' || task.statusCode === 'TASK_PROCESSING') {
stillActive = 25;
+ } else if (task.data && task.data.result) {
+ var $do = $('#debug-out');
+ var txt = $do.text();
+ var res = task.data.result;
+ for (var k in res) {
+ if (res.hasOwnProperty(k)) {
+ txt += k + ":\n";
+ if (res[k].stdout && res[k].stdout.trimEnd && res[k].stdout.trimEnd()) {
+ txt += res[k].stdout.trimEnd() + "\n";
+ }
+ if (res[k].stderr && res[k].stderr.trimEnd && res[k].stderr.trimEnd()) {
+ txt += res[k].stderr.trimEnd() + "\n";
+ }
+ txt += "Exit " + res[k].exitCode + "\n\n";
+ }
+ }
+ $do.text(txt);
}
}
//--></script> \ No newline at end of file