summaryrefslogtreecommitdiffstats
path: root/modules-available/rebootcontrol/templates
diff options
context:
space:
mode:
Diffstat (limited to 'modules-available/rebootcontrol/templates')
-rw-r--r--modules-available/rebootcontrol/templates/exec-enter-command.html41
-rw-r--r--modules-available/rebootcontrol/templates/status-exec.html55
-rw-r--r--modules-available/rebootcontrol/templates/status-wol.html2
3 files changed, 97 insertions, 1 deletions
diff --git a/modules-available/rebootcontrol/templates/exec-enter-command.html b/modules-available/rebootcontrol/templates/exec-enter-command.html
new file mode 100644
index 00000000..5916e2a8
--- /dev/null
+++ b/modules-available/rebootcontrol/templates/exec-enter-command.html
@@ -0,0 +1,41 @@
+<h2>{{lang_execRemoteCommand}}</h2>
+
+<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>{{hostname}}{{^hostname}}{{machineuuid}}{{/hostname}}</td>
+ <td>{{clientip}}</td>
+ <td>{{state}}</td>
+ </tr>
+ {{/clients}}
+ </tbody>
+</table>
+
+<h3>{{lang_enterCommand}}</h3>
+
+<form method="post" action="?do=rebootcontrol" id="list-form">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="show" value="exec">
+ <input type="hidden" name="id" value="{{id}}">
+ <div>
+ <label for="script-text">{{lang_scriptOrCommand}}</label>
+ <textarea id="script-text" class="form-control" name="script" rows="10"></textarea>
+ </div>
+ <div class="text-right slx-space">
+ <button type="submit" class="btn btn-primary" name="action" value="exec">
+ <span class="glyphicon glyphicon-play"></span>
+ {{lang_remoteExec}}
+ </button>
+ </div>
+</form> \ No newline at end of file
diff --git a/modules-available/rebootcontrol/templates/status-exec.html b/modules-available/rebootcontrol/templates/status-exec.html
new file mode 100644
index 00000000..140de02b
--- /dev/null
+++ b/modules-available/rebootcontrol/templates/status-exec.html
@@ -0,0 +1,55 @@
+
+<div data-tm-id="{{id}}" data-tm-log="error" data-tm-callback="updateStatus">{{lang_executingRemotely}}</div>
+
+<div class="slx-space"></div>
+
+<div class="row">
+ <div class="col-md-5 slx-bold">{{lang_host}}</div>
+ <div class="col-md-5 slx-bold">{{lang_status}}</div>
+ <div class="col-md-2 slx-bold text-right">{{lang_exitCode}}</div>
+</div>
+
+{{#clients}}
+<div class="slx-space" id="client-{{machineuuid}}">
+ <div class="row">
+ <div class="col-md-5 slx-bold">{{hostname}}{{^hostname}}{{clientip}}{{/hostname}}</div>
+ <div class="col-md-5 state"></div>
+ <div class="col-md-2 text-right exitCode"></div>
+ </div>
+ <i>{{lang_stdout}}</i>
+ <pre class="stdout"></pre>
+ <i>{{lang_stderr}}</i>
+ <pre class="stderr"></pre>
+</div>
+<hr>
+{{/clients}}
+
+<script><!--
+
+var ingoreHosts = {};
+
+function updateStatus(task) {
+ if (!task || !task.data || !task.data.result)
+ return;
+ for (var host in task.data.result) {
+ if (ingoreHosts[host] || !task.data.result.hasOwnProperty(host))
+ continue;
+ updateStatusClient(host, task.data.result[host]);
+ }
+}
+function updateStatusClient(id, status) {
+ var $p = $('#client-' + id);
+ if ($p.length === 0)
+ return;
+ $p.find('.state').text(status.state);
+ $p.find('.stdout').text(status.stdout);
+ $p.find('.stderr').text(status.stderr);
+ if (status.state === 'DONE' || status.state === 'ERROR' || status.state === 'TIMEOUT') {
+ $p.find('.state').addClass((status.state === 'DONE') ? 'text-success' : 'text-danger');
+ if (status.exitCode >= 0) {
+ $p.find('.exitCode').text(status.exitCode).addClass((status.exitCode === 0 ? 'text-success' : 'text-danger'));
+ }
+ ingoreHosts[id] = true;
+ }
+}
+//--></script> \ No newline at end of file
diff --git a/modules-available/rebootcontrol/templates/status-wol.html b/modules-available/rebootcontrol/templates/status-wol.html
index da19b57d..3e83126c 100644
--- a/modules-available/rebootcontrol/templates/status-wol.html
+++ b/modules-available/rebootcontrol/templates/status-wol.html
@@ -4,7 +4,7 @@
<div class="clearfix slx-space"></div>
{{#tasks}}
-<div data-tm-id="{{id}}" data-tm-callback="wolCallback">{{lang_aWolJob}}</div>
+<div data-tm-id="{{.}}" data-tm-callback="wolCallback">{{lang_aWolJob}}</div>
{{/tasks}}
{{^tasks}}
<div class="alert alert-warning">