summaryrefslogtreecommitdiffstats
path: root/modules-available/statistics/templates/clientlist.html
diff options
context:
space:
mode:
authorUdo Walter2017-12-28 21:12:08 +0100
committerUdo Walter2017-12-28 21:12:08 +0100
commitbf3ea5f9ffe8c0f34744b858dd0a294bbf091ddc (patch)
treef189e5299e5be14717c08b9f244100e0a7bc6a4f /modules-available/statistics/templates/clientlist.html
parent[eventlog] added permission to view the log (diff)
downloadslx-admin-bf3ea5f9ffe8c0f34744b858dd0a294bbf091ddc.tar.gz
slx-admin-bf3ea5f9ffe8c0f34744b858dd0a294bbf091ddc.tar.xz
slx-admin-bf3ea5f9ffe8c0f34744b858dd0a294bbf091ddc.zip
[statistics] added permissions to view client statistics, delete clients and edit notes of clients
Diffstat (limited to 'modules-available/statistics/templates/clientlist.html')
-rw-r--r--modules-available/statistics/templates/clientlist.html44
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) {