diff options
author | root | 2019-02-19 18:53:50 +0100 |
---|---|---|
committer | root | 2019-02-19 18:53:50 +0100 |
commit | 0ad4c0f8196b61699754762aacbaab0223478ab9 (patch) | |
tree | de434c4aea8d07ecd01cd3badd48d057d62c2d1b /modules-available/rebootcontrol/templates/status.html | |
parent | [usb-lock-off] Edit rule cleanup and fix of the dropdown boxes. (diff) | |
parent | [statistics] Fix RAM change warning to handle increase too (diff) | |
download | slx-admin-usb-lock-off.tar.gz slx-admin-usb-lock-off.tar.xz slx-admin-usb-lock-off.zip |
Merge branch 'master' into usb-lock-offusb-lock-off
Diffstat (limited to 'modules-available/rebootcontrol/templates/status.html')
-rw-r--r-- | modules-available/rebootcontrol/templates/status.html | 26 |
1 files changed, 17 insertions, 9 deletions
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>'); } } } |