diff options
author | Simon Rettberg | 2018-04-25 16:46:18 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-04-25 16:46:18 +0200 |
commit | 7d4b41dc7e85b4f5f249c61db11ae27d53144c9c (patch) | |
tree | 5e36609f07cb851a5bbbecda66c42b0e51f76002 /modules-available/rebootcontrol/templates | |
parent | [locations] Fix machine counting (diff) | |
download | slx-admin-7d4b41dc7e85b4f5f249c61db11ae27d53144c9c.tar.gz slx-admin-7d4b41dc7e85b4f5f249c61db11ae27d53144c9c.tar.xz slx-admin-7d4b41dc7e85b4f5f249c61db11ae27d53144c9c.zip |
[rebootcontrol] Nicer status list; list of all running jobs
Diffstat (limited to 'modules-available/rebootcontrol/templates')
-rw-r--r-- | modules-available/rebootcontrol/templates/_page.html | 44 | ||||
-rw-r--r-- | modules-available/rebootcontrol/templates/status.html | 26 | ||||
-rw-r--r-- | modules-available/rebootcontrol/templates/task-list.html | 33 |
3 files changed, 72 insertions, 31 deletions
diff --git a/modules-available/rebootcontrol/templates/_page.html b/modules-available/rebootcontrol/templates/_page.html index 82f82b02..a124e165 100644 --- a/modules-available/rebootcontrol/templates/_page.html +++ b/modules-available/rebootcontrol/templates/_page.html @@ -1,4 +1,6 @@ -<form id="tableDataForm" method="post" action="?do=rebootcontrol" class="form-inline"> +<h3>{{location}}</h3> + +<form method="post" action="?do=rebootcontrol" class="form-inline"> <input type="hidden" name="token" value="{{token}}"> <div class="row"> <div class="col-md-12"> @@ -45,9 +47,7 @@ </div> </div> - <!-- Modals --> - <div class ="modal fade" id="rebootModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> @@ -56,17 +56,27 @@ <h4 class="modal-title" id="myModalLabel">{{lang_rebootButton}}</h4> </div> <div class="modal-body"> - {{lang_rebootCheck}} + <div>{{lang_rebootCheck}}</div> + <div>{{lang_rebootIn}} <input name="r-minutes" title="{{lang_shutdownIn}}" type="number" value="0" min="0" pattern="\d+"> {{lang_minutes}}</div> + <div> + <div class="checkbox checkbox-inline"> + <input name="quick" type="checkbox" value="on" id="rb-quick"> + <label for="rb-quick">{{lang_kexecRebootCheck}}</label> + </div> + </div> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> - <button type="submit" {{perms.action.reboot.disabled}} name="action" value="reboot" class="btn btn-warning"><span class="glyphicon glyphicon-repeat"></span> {{lang_reboot}}</button> + <button type="submit" {{perms.action.reboot.disabled}} name="action" value="reboot" class="btn btn-warning"> + <span class="glyphicon glyphicon-repeat"></span> + {{lang_reboot}} + </button> </div> </div> </div> </div> - <div class ="modal fade" id="shutdownModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> + <div class ="modal fade" id="shutdownModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> @@ -74,12 +84,15 @@ <h4 class="modal-title" id="myModalLabel2">{{lang_shutdownButton}}</h4> </div> <div class="modal-body"> - {{lang_shutdownCheck}} - {{lang_shutdownIn}} <input id="shutdownTimer" name="minutes" title="{{lang_shutdownIn}}" type="number" value="0" min="0" pattern="\d+"> {{lang_minutes}} + <div>{{lang_shutdownCheck}}</div> + {{lang_shutdownIn}} <input name="s-minutes" title="{{lang_shutdownIn}}" type="number" value="0" min="0" pattern="\d+"> {{lang_minutes}} </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">{{lang_cancel}}</button> - <button type="submit" {{perms.action.shutdown.disabled}} name="action" value="shutdown" class="btn btn-danger"><span class="glyphicon glyphicon-off"></span> {{lang_shutdownButton}}</button> + <button type="submit" {{perms.action.shutdown.disabled}} name="action" value="shutdown" class="btn btn-danger"> + <span class="glyphicon glyphicon-off"></span> + {{lang_shutdownButton}} + </button> </div> </div> </div> @@ -168,17 +181,4 @@ } } - function generateNewKeypair() { - if (!confirm('{{lang_confirmNewKeypair}}')) - return; - $.ajax({ - url: '?do=rebootcontrol', - type: 'POST', - data: { action: "generateNewKeypair", token: TOKEN }, - success: function(value) { - $('#pubKey').text(value); - } - }); - } - </script>
\ No newline at end of file diff --git a/modules-available/rebootcontrol/templates/status.html b/modules-available/rebootcontrol/templates/status.html index c2fdab46..c05b2fad 100644 --- a/modules-available/rebootcontrol/templates/status.html +++ b/modules-available/rebootcontrol/templates/status.html @@ -7,8 +7,6 @@ </form> </div> -<div data-tm-id="{{taskId}}" data-tm-log="error" data-tm-callback="updateStatus"></div> - <div> <table class="table table-hover stupidtable" id="dataTable"> <thead> @@ -24,7 +22,7 @@ <tbody> {{#clients}} <tr> - <td>{{machineuuid}}</td> + <td>{{hostname}}{{^hostname}}{{machineuuid}}{{/hostname}}</td> <td>{{clientip}}</td> <td id="status-{{machineuuid}}"></td> </tr> @@ -33,6 +31,8 @@ </table> </div> +<div data-tm-id="{{taskId}}" data-tm-log="error" data-tm-callback="updateStatus"></div> + <script type="application/javascript"> statusStrings = { "CONNECTING" : "{{lang_connecting}}", @@ -50,12 +50,20 @@ return; var clientStatus = task.data.clientStatus; for (var uuid in clientStatus) { - if (clientStatus.hasOwnProperty(uuid)) { - var shutdownTime = ' '; - if (clientStatus[uuid] === 'SHUTDOWN_AT' || clientStatus[uuid] === 'REBOOT_AT') { - shutdownTime += task.data.time; - } - $("#status-" + uuid).text(statusStrings[clientStatus[uuid]] + shutdownTime); + if (!clientStatus.hasOwnProperty(uuid)) + continue; + var $s = $("#status-" + uuid); + var status = clientStatus[uuid]; + if ($s.data('state') === status) + continue; + $s.data('state', status); + var text = statusStrings[status]; + if (status === 'SHUTDOWN_AT' || status === 'REBOOT_AT') { + text += ' ' + task.data.time; + } + $s.text(text); + if (status === 'CONNECTING' || status === 'REBOOTING') { + $s.append('<span class="glyphicon glyphicon-hourglass"></span>'); } } } diff --git a/modules-available/rebootcontrol/templates/task-list.html b/modules-available/rebootcontrol/templates/task-list.html new file mode 100644 index 00000000..063ba949 --- /dev/null +++ b/modules-available/rebootcontrol/templates/task-list.html @@ -0,0 +1,33 @@ +<h3>{{lang_activeTasks}}</h3> +<table class="table"> + <thead> + <tr> + <th>{{lang_mode}}</th> + <th>{{lang_location}}</th> + <th>{{lang_time}}</th> + <th>{{lang_clientCount}}</th> + <th>{{lang_status}}</th> + </tr> + </thead> + <tbody> + {{#list}} + <tr> + <td> + <a href="?do=rebootcontrol&taskid={{taskId}}">{{mode}}</a> + </td> + <td> + {{locationName}} + </td> + <td> + {{time}} + </td> + <td> + {{clientCount}} + </td> + <td> + {{status}} + </td> + </tr> + {{/list}} + </tbody> +</table>
\ No newline at end of file |