diff options
Diffstat (limited to 'modules-available/dnbd3/templates/page-serverlist.html')
-rw-r--r-- | modules-available/dnbd3/templates/page-serverlist.html | 55 |
1 files changed, 38 insertions, 17 deletions
diff --git a/modules-available/dnbd3/templates/page-serverlist.html b/modules-available/dnbd3/templates/page-serverlist.html index c5905dcd..65e4d6ea 100644 --- a/modules-available/dnbd3/templates/page-serverlist.html +++ b/modules-available/dnbd3/templates/page-serverlist.html @@ -15,14 +15,14 @@ <form method="post" action="?do=dnbd3"> <input type="hidden" name="token" value="{{token}}"> <div class="checkbox"> - <input id="enable-dnbd3" type="checkbox" name="enabled" {{enabled_checked_s}}> + <input id="enable-dnbd3" type="checkbox" name="enabled" {{enabled_checked_s}} {{perms.toggle-usage.disabled}}> <label for="enable-dnbd3">{{lang_enableDnbd3}}</label> </div> <div class="checkbox"> - <input id="allow-nfs" type="checkbox" name="with-nfs" {{nfs_checked_s}}> + <input id="allow-nfs" type="checkbox" name="with-nfs" {{nfs_checked_s}} {{perms.toggle-usage.disabled}}> <label for="allow-nfs">{{lang_allowNfsFallback}}</label> </div> - <button type="submit" name="action" value="toggle-usage" class="btn btn-success"> + <button type="submit" name="action" value="toggle-usage" class="btn btn-success" {{perms.toggle-usage.disabled}}> <span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}} </button> @@ -36,7 +36,10 @@ <input type="hidden" name="action" value="refresh"> <h2> {{lang_serverList}} - <button id="refbtn" type="submit" class="btn btn-default"><span class="glyphicon glyphicon-refresh"></span></button> + <button id="refbtn" type="submit" class="btn btn-default" {{perms.refresh.disabled}} title="{{lang_manualRefreshInfo}}"> + <span class="glyphicon glyphicon-refresh"></span> + {{lang_manualRefresh}} + </button> </h2> </form> @@ -78,14 +81,18 @@ </td> <td class="{{#self}}slx-bold{{/self}}"> {{#machineuuid}} - <a class="pull-right btn btn-default btn-xs" href="?do=Statistics&uuid={{machineuuid}}"> + <a class="pull-right btn btn-default btn-xs" href="?do=statistics&uuid={{machineuuid}}"> <span class="glyphicon glyphicon-eye-open"></span> </a> {{/machineuuid}} + {{^perms.view.details.disabled}} <a href="?do=dnbd3&show=proxy&server={{serverid}}"> + {{/perms.view.details.disabled}} {{fixedip}} <span class="small">{{clientip}}</span> + {{^perms.view.details.disabled}} </a> + {{/perms.view.details.disabled}} <div class="small">{{hostname}}</div> </td> <td data-sort="int" data-sort-default="desc" data-sort-value="{{disktotal}}"> @@ -123,7 +130,7 @@ {{#locations}} {{locations}} {{/locations}} - <a href="?do=dnbd3&show=locations&server={{serverid}}" class="btn btn-default btn-xs"> + <a href="?do=dnbd3&show=locations&server={{serverid}}" class="btn btn-default btn-xs {{edit_disabled}}"> <span class="glyphicon glyphicon-map-marker"></span> </a> {{/self}} @@ -132,17 +139,19 @@ {{#machineuuid}} {{#rebootcontrol}} <button class="btn btn-warning btn-xs reboot-btn" type="button" data-id="{{serverid}}" - data-toggle="modal" data-target="#server-reboot-modal" title="{{lang_reboot}}"> + data-toggle="modal" data-target="#server-reboot-modal" title="{{lang_reboot}}" + {{edit_disabled}}> <span class="glyphicon glyphicon-repeat"></span> </button> {{/rebootcontrol}} <button class="btn btn-default btn-xs edit-btn" type="button" data-id="{{serverid}}" - data-toggle="modal" data-target="#server-edit-modal" title="{{lang_settings}}"> + data-toggle="modal" data-target="#server-edit-modal" title="{{lang_settings}}" + {{edit_disabled}}> <span class="glyphicon glyphicon-cog"></span> </button> {{/machineuuid}} {{^self}} - <button class="btn btn-danger btn-xs" name="server" value="{{serverid}}" + <button class="btn btn-danger btn-xs" name="server" value="{{serverid}}" {{edit_disabled}} onclick="return confirm('{{lang_wantToDelete}}')" title="{{lang_delete}}"> <span class="glyphicon glyphicon-trash"></span> </button> @@ -156,7 +165,7 @@ <div class="btn-toolbar pull-right"> <div class="btn-group"> - <button type="button" class="btn btn-success" data-toggle="modal" data-target="#add-modal"> + <button type="button" class="btn btn-success" data-toggle="modal" data-target="#add-modal" {{perms.configure.external.disabled}}> <span class="glyphicon glyphicon-plus"></span> {{lang_externalServerAdd}} </button> @@ -165,7 +174,7 @@ </button> </div> <div class="btn-group"> - <a class="btn btn-success" href="?do=runmode&module=dnbd3&modeid=proxy&redirect=?do=dnbd3"> + <a class="btn btn-success {{perms.configure.proxy.disabled}}" href="?do=runmode&module=dnbd3&modeid=proxy&redirect=?do=dnbd3"> <span class="glyphicon glyphicon-plus"></span> {{lang_managedServerAdd}} </a> @@ -380,20 +389,32 @@ document.addEventListener('DOMContentLoaded', function () { } $t.html('<span class="glyphicon glyphicon-refresh slx-rotation"></span>'); var sid = rebootServerId; + var taskId = false; + var lastText; var query = function() { + data = {"token": TOKEN, "action": "reboot", "server": sid}; + if (taskId !== false) data['taskid'] = taskId; $.ajax({ - "data": {"token": TOKEN, "action": "reboot", "server": sid}, + "data": data, "method": "POST", - "dataType": "text", + "dataType": "json", "url": "?do=dnbd3" }).done(function (data) { - $t.text(data); - if (data.indexOf('REBOOTING') !== -1 || data.indexOf('CONNECTING') !== -1) { + if (!data || !data.taskId) return; + if (taskId === false) taskId = data.taskId; + if (data.error) data.rebootStatus += ' (' + data.error + ')'; + if (data.rebootStatus !== lastText) { + $t.empty().text(data.rebootStatus); + } + if (data.taskStatus === 'TASK_PROCESSING' || data.taskStatus === 'TASK_WAITING') { setTimeout(query, 5000); - $t.append($('<span class="glyphicon glyphicon-refresh slx-rotation"></span>')); + if (data.rebootStatus !== lastText) { + $t.append($('<span class="glyphicon glyphicon-refresh slx-rotation"></span>')); + } } + lastText = data.rebootStatus; }).fail(function () { - $.text('Failed'); + $t.text('Failed'); }); }; query(); |