diff options
Diffstat (limited to 'modules-available/rebootcontrol/templates/status-wol.html')
-rw-r--r-- | modules-available/rebootcontrol/templates/status-wol.html | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/modules-available/rebootcontrol/templates/status-wol.html b/modules-available/rebootcontrol/templates/status-wol.html new file mode 100644 index 00000000..70517f84 --- /dev/null +++ b/modules-available/rebootcontrol/templates/status-wol.html @@ -0,0 +1,82 @@ +<h3>{{timestamp_s}}</h3> + +{{#locations}} +<div class="loc">{{name}}</div> +{{/locations}} +<div class="clearfix slx-space"></div> + +{{#tasks}} +<div data-tm-id="{{.}}" data-tm-callback="wolCallback" data-tm-log="messages">{{lang_aWolJob}}</div> +{{/tasks}} +{{^tasks}} +<div class="alert alert-warning"> + <span class="glyphicon glyphicon-exclamation-sign"></span> + {{lang_noTasksForJob}} +</div> +{{/tasks}} + +<pre>{{log}}</pre> + +<table class="table table-hover stupidtable" id="dataTable"> + <thead> + <tr> + <th data-sort="string">{{lang_client}}</th> + <th data-sort="ipv4">{{lang_ip}}</th> + <th data-sort="string"> + {{lang_status}} + </th> + </tr> + </thead> + + <tbody> + {{#clients}} + <tr> + <td> + {{#machineuuid}} + <a href="?do=statistics&uuid={{machineuuid}}"> + {{hostname}}{{^hostname}}{{machineuuid}}{{/hostname}} + </a> + {{/machineuuid}} + {{^machineuuid}} + {{hostname}}{{^hostname}}{{clientip}}{{/hostname}} + {{/machineuuid}} + </td> + <td>{{clientip}}</td> + <td> + {{#machineuuid}} + <span id="status-{{machineuuid}}" class="machineuuid" data-uuid="{{machineuuid}}"></span> + <span id="spinner-{{machineuuid}}" class="glyphicon glyphicon-refresh slx-rotation"></span> + {{/machineuuid}} + </td> + </tr> + {{/clients}} + </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> |