diff options
Diffstat (limited to 'modules-available/statistics/templates')
4 files changed, 59 insertions, 19 deletions
diff --git a/modules-available/statistics/templates/clientlist.html b/modules-available/statistics/templates/clientlist.html index 13e148fa..d06eb4f7 100644 --- a/modules-available/statistics/templates/clientlist.html +++ b/modules-available/statistics/templates/clientlist.html @@ -10,28 +10,28 @@ <td></td> <td></td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('lastseen')"> - <span id="btn_filter_lastseen" class="glyphicon glyphicon-filter"></span> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('lastseen')"> + <span class="glyphicon glyphicon-filter"></span> </button> </td> <td> - <button class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')"> - <span id="btn_filter_kvmstate" class="glyphicon glyphicon-filter"></span> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('kvmstate')"> + <span class="glyphicon glyphicon-filter"></span> </button> </td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('gbram')"> - <span id="btn_filter_gbram" class="glyphicon glyphicon-filter"></span> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('gbram')"> + <span class="glyphicon glyphicon-filter"></span> </button> </td> <td class="text-right"> - <button class="btn btn-default btn-xs" onclick="popupFilter('hddgb')"> - <span id="btn_filter_hddgb" class="glyphicon glyphicon-filter"></span> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('hddgb')"> + <span class="glyphicon glyphicon-filter"></span> </button> </td> <td> - <button class="btn btn-default btn-xs" onclick="popupFilter('realcores')"> - <span id="btn_filter_cpu" class="glyphicon glyphicon-filter"></span> + <button type="button" class="btn btn-default btn-xs" onclick="popupFilter('realcores')"> + <span class="glyphicon glyphicon-filter"></span> </button> </td> </tr> @@ -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}} @@ -68,7 +72,11 @@ {{/state_STANDBY}} <a href="?do=Statistics&uuid={{machineuuid}}"><b>{{hostname}}</b></a> <div class="small">{{machineuuid}}</div> - {{#rmmodule}}<div class="small">{{lang_runMode}}: <a class="slx-bold" href="?do=runmode&module={{rmmodule}}">{{rmmodule}}</a></div>{{/rmmodule}} + {{#rmmodule}} + <div class="small">{{lang_runMode}}: + <a class="slx-bold" href="?do=runmode&module={{rmmodule}}">{{moduleName}}</a> / {{modeName}} + </div> + {{/rmmodule}} </td> <td data-sort-value="{{clientip}}"><b><a href="?do=Statistics&show=list&filters=subnet={{subnet}}">{{subnet}}</a>{{lastoctet}}</b><br>{{macaddr}}</td> <td data-sort-value="{{lastseen_int}}" class="text-right text-nowrap">{{lastseen}}</td> @@ -91,10 +99,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 +130,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 +149,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) { diff --git a/modules-available/statistics/templates/filterbox.html b/modules-available/statistics/templates/filterbox.html index 32464031..58b66a75 100644 --- a/modules-available/statistics/templates/filterbox.html +++ b/modules-available/statistics/templates/filterbox.html @@ -99,7 +99,9 @@ var slxFilterNames = { state: '{{lang_usageState}}', location: '{{lang_location}}', currentuser: '{{lang_currentUser}}', - subnet: '{{lang_subnet}}' + subnet: '{{lang_subnet}}', + runtime: '{{lang_runtimeHours}}', + hostname: '{{lang_hostname}}' }; slxLocations = {{{locations}}}; @@ -176,10 +178,12 @@ document.addEventListener("DOMContentLoaded", function () { $('#argumentSelect').show(); columns[col]['values'].forEach(function (v) { var t = v; + var disabled = true; if (col === 'location' && slxLocations['L' + v]) { t = slxLocations['L' + v].pad + ' ' + slxLocations['L' + v].name; + disabled = slxLocations['L' + v].disabled; } - $('#argumentSelect').append($('<option>', { value: v, text: t })); + $('#argumentSelect').append($('<option>', { value: v, text: t, disabled: disabled })); }); } else { $('#argumentInput').datepicker('remove'); diff --git a/modules-available/statistics/templates/machine-notes.html b/modules-available/statistics/templates/machine-notes.html index 22ed96e9..66e44da4 100644 --- a/modules-available/statistics/templates/machine-notes.html +++ b/modules-available/statistics/templates/machine-notes.html @@ -8,9 +8,9 @@ <input type="hidden" name="token" value="{{token}}"> <input type="hidden" name="action" value="setnotes"> <input type="hidden" name="uuid" value="{{machineuuid}}"> - <textarea name="content" class="form-control" cols="101" rows="10">{{notes}}</textarea> + <textarea name="content" class="form-control" cols="101" rows="10" {{^notesAllowed}}disabled{{/notesAllowed}}>{{notes}}</textarea> <br/> - <button type="submit" class="btn btn-primary pull-right"><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> + <button type="submit" class="btn btn-primary pull-right" {{^notesAllowed}}disabled{{/notesAllowed}}><span class="glyphicon glyphicon-floppy-disk"></span> {{lang_save}}</button> </form> </div> </div> diff --git a/modules-available/statistics/templates/page-replace.html b/modules-available/statistics/templates/page-replace.html index f87610a2..d0e9f766 100644 --- a/modules-available/statistics/templates/page-replace.html +++ b/modules-available/statistics/templates/page-replace.html @@ -17,6 +17,10 @@ } </style> +<p> + {{lang_replaceInstructions}} +</p> + <form method="post" action="?do=statistics&show=replace"> <input type="hidden" name="token" value="{{token}}"> <table class="reptable"> |