diff options
Diffstat (limited to 'modules-available/statistics/templates/clientlist.html')
-rw-r--r-- | modules-available/statistics/templates/clientlist.html | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 13e148fa..3d3e66a4 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -10,22 +10,22 @@ <td></td> <td></td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('lastseen')"> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('lastseen')"> <span id="btn_filter_lastseen" class="glyphicon glyphicon-filter"></span> </button> </td> <td> - <button class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')"> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')"> <span id="btn_filter_kvmstate" class="glyphicon glyphicon-filter"></span> </button> </td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('gbram')"> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('gbram')"> <span id="btn_filter_gbram" class="glyphicon glyphicon-filter"></span> </button> </td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('hddgb')"> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('hddgb')"> <span id="btn_filter_hddgb" class="glyphicon glyphicon-filter"></span> </button> </td> @@ -49,11 +49,15 @@ {{#rows}} <tr> <td data-sort-value="{{hostname}}" class="text-nowrap"> + {{#deleteAllowed}} <div class="checkbox checkbox-inline"> - <input type="checkbox" name="uuid[]" value="{{machineuuid}}"> + <input type="checkbox" name="uuid[]" value="{{machineuuid}}" class="deleteCheckboxes"> <label></label> </div> - {{#hasnotes}}<span class="glyphicon glyphicon-exclamation-sign pull-right"></span>{{/hasnotes}} + {{/deleteAllowed}} + {{#hasnotes}} + <span class="glyphicon glyphicon-exclamation-sign pull-right"></span> + {{/hasnotes}} {{#state_OFFLINE}} <span class="glyphicon glyphicon-off" title="{{lang_machineOff}}"></span> {{/state_OFFLINE}} @@ -91,10 +95,10 @@ </table> <div class="text-right buttonbar"> <button type="reset" class="btn btn-default"> - <span class="glyphicon glyphicon-remove"></span> + <span class="glyphicon glyphicon-refresh"></span> {{lang_reset}} </button> - <button type="button" class="btn btn-danger" onclick="$('#del-confirm').modal()"> + <button id="deleteButton" type="button" class="btn btn-danger" onclick="$('#del-confirm').modal()"> <span class="glyphicon glyphicon-trash"></span> {{lang_delete}} </button> @@ -122,6 +126,9 @@ </form> <script type="application/javascript"><!-- + +selectedMachineCounter = 0; + document.addEventListener("DOMContentLoaded", function () { ['gbram', 'hddgb', 'realcores', 'kvmstate', 'lastseen', 'clientip'].forEach(function (v) { var $sortBtn = $('#sortButton-' + v); @@ -138,6 +145,27 @@ document.addEventListener("DOMContentLoaded", function () { container: 'body', trigger : 'hover' }); + + $("#deleteButton").prop("disabled", true); + $(".deleteCheckboxes").change(function() { + if ($(this).is(':checked')) { + selectedMachineCounter++; + if (selectedMachineCounter === 1) { + $("#deleteButton").prop("disabled", false); + } + } else { + selectedMachineCounter--; + if (selectedMachineCounter === 0) { + $("#deleteButton").prop("disabled", true); + } + } + }); + + $("button[type=reset]").click(function() { + selectedMachineCounter = 0; + $("#deleteButton").prop("disabled", true); + }); + }); function toggleButton(v) { |