diff options
Diffstat (limited to 'modules-available/locations/templates/locations.html')
-rw-r--r-- | modules-available/locations/templates/locations.html | 122 |
1 files changed, 42 insertions, 80 deletions
diff --git a/modules-available/locations/templates/locations.html b/modules-available/locations/templates/locations.html index a63e3b8c..efd48216 100644 --- a/modules-available/locations/templates/locations.html +++ b/modules-available/locations/templates/locations.html @@ -28,24 +28,14 @@ </div> {{/mismatchMachines}} - <table class="table table-condensed locations" style="margin-bottom:0"> + <table class="table table-condensed table-hover locations" style="margin-bottom:0"> <tr> <th width="100%">{{lang_locationName}}</th> - <th> - {{#havestatistics}}{{lang_machineCount}}{{/havestatistics}} - </th> - <th> - {{#havestatistics}}{{lang_machineLoad}}{{/havestatistics}} - </th> - <th class="text-nowrap"> - {{#havebaseconfig}}{{lang_editConfigVariables}}{{/havebaseconfig}} - </th> - <th class="text-nowrap"> - {{#havesysconfig}}{{lang_sysConfig}}{{/havesysconfig}} - </th> + {{#plugins}} <th class="text-nowrap"> - {{#haveipxe}}{{lang_bootMenu}}{{/haveipxe}} + {{header}} </th> + {{/plugins}} </tr> {{#list}} <tr> @@ -55,75 +45,36 @@ <span>{{locationname}}</span> {{/show-only}} {{^show-only}} - <a href="#" onclick="slxOpenLocation(this, {{locationid}}); return false"> + <a id="loc-{{locationid}}" href="#" onclick="slxOpenLocation(this, {{locationid}}); return false"> {{locationname}} <b class="caret"></b> </a> {{/show-only}} </td> - <td class="text-nowrap" align="right"> - {{#havestatistics}} - <a href="?do=Statistics&show=list&filters=location={{locationid}}"> {{clientCount}} </a> - <span style="display:inline-block;width:5ex"> - {{#hasChild}} - (<a href="?do=Statistics&show=list&filters=location~{{locationid}}">↓{{clientCountSum}}</a>) - {{/hasChild}} - </span> - {{/havestatistics}} - </td> - <td class="text-nowrap" align="right"> - {{#havestatistics}} - {{clientLoad}} - {{/havestatistics}} - </td> - <td class="text-nowrap {{overriddenClass}}"> - {{#havebaseconfig}} - <div class="pull-right" style="z-index:-1"> - <a class="btn btn-default btn-xs" href="?do=baseconfig&module=locations&locationid={{locationid}}"><span class="glyphicon glyphicon-edit"></span></a> - </div> - {{#overriddenVars}} - {{lang_overrideCount}}: {{overriddenVars}}   - {{/overriddenVars}} - {{/havebaseconfig}} - </td> - <td class="text-nowrap"> - {{#havesysconfig}} - <div class="pull-right"> - <a class="btn btn-default btn-xs" href="?do=sysconfig&locationid={{locationid}}"><span class="glyphicon glyphicon-edit"></span></a> - </div> - <span class="{{configClass}}"> - {{configName}}   - </span> - {{/havesysconfig}} - </td> - <td class="text-nowrap"> - {{#haveipxe}} - <div class="pull-right"> - <a class="btn btn-default btn-xs" href="?do=serversetup&show=assignlocation&locationid={{locationid}}"><span class="glyphicon glyphicon-edit"></span></a> - </div> - <span class="{{customMenuClass}}"> - {{customMenu}}   - </span> - {{/haveipxe}} + {{#plugins}} + <td> + <table width="100%"><tr> + <td class="text-nowrap {{class}}">{{{html}}}</td> + {{#url}} + <td class="edit-btn"> + <a class="btn btn-default btn-xs" href="{{.}}"> + <span class="glyphicon glyphicon-edit"></span> + </a> + </td> + {{/url}} + </tr></table> </td> + {{/plugins}} </tr> {{/list}} - {{#unassignedCount}} <tr> <td>{{lang_unassignedMachines}}</td> - <td class="text-nowrap" align="right"> - <a href="?do=Statistics&show=list&filters=location=0"> - {{unassignedCount}} - </a> - <span style="display:inline-block;width:5ex"></span> - </td> - <td class="text-nowrap" align="right"> - {{unassignedLoad}} + {{#plugins}} + <td class="text-nowrap"> + {{{propagateDefaultHtml}}} </td> - <td></td> - <td>{{defaultConfig}}</td> + {{/plugins}} </tr> - {{/unassignedCount}} </table> <form method="post" action="?do=Locations"> <input type="hidden" name="token" value="{{token}}"> @@ -151,6 +102,14 @@ var slxLastLocation = false; var newRowCounter = 0; +document.addEventListener("DOMContentLoaded", function() { + var id = window.location.hash.substring(1); + if (id !== "") { + var loc_dom = document.getElementById("loc-" + id); + slxOpenLocation(loc_dom, id); + } +}); + function slxAddLocationRow() { $("#saveLocationRows").show(); var tr = $('#lasttr'); @@ -190,12 +149,12 @@ function slxOpenLocation(e, lid) { } return; } - var td = $('<td>').attr('colspan', '6').css('padding', '0px 0px 12px'); + var td = $('<td>').attr('colspan', '{{colspan}}').css('padding', '0px 0px 12px'); var tr = $('<tr>').attr('id', 'location-details-' + lid); tr.append(td); $(e).closest('tr').addClass('active slx-bold').after(tr); td.load('?do=Locations&page=details&action=showlocation&locationid=' + lid, function() { - slxAttachCidr(); + if (slxAttachCidr) slxAttachCidr(); scollIntoView(tr); }); slxLastLocation = tr; @@ -216,18 +175,14 @@ function scollIntoView(el) { function slxAddSubnetRow(e, lid) { var tr = $('#loc-sub-' + lid); - tr.before('<tr id="row' + slxAddCounter + '" class="cidrmagic">\ + tr.before('<tr class="cidrmagic">\ <td>#</td>\ <td><input class="form-control cidrstart" type="text" name="newstartaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\ <td><input class="form-control cidrend" type="text" name="newendaddr[' + slxAddCounter + ']" pattern="\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}"></td>\ - <td class="text-center"><button class="btn btn-default btn-sm" type="button" onclick="removeNewSubnetRow(' + slxAddCounter + ')"><span class="glyphicon glyphicon-remove"></span></button></td>\ + <td class="text-center"><button class="btn btn-default btn-sm" type="button" onclick="$(this).closest(\'tr\').remove()"><span class="glyphicon glyphicon-remove"></span></button></td>\ </tr>'); slxAddCounter++; - slxAttachCidr(); -} - -function removeNewSubnetRow(r) { - $("#row"+r).remove(); + if (slxAttachCidr) slxAttachCidr(); } function deleteSubnetWarning(locid) { @@ -238,5 +193,12 @@ function deleteSubnetWarning(locid) { form.submit(); } } + +function loadOpeningTimes(locid) { + var $e = $("#openingTimesModal" + locid).find('.modal-body'); + if (!$e.is(':empty')) return; + $e.load("?do=Locations&page=details&action=getOpeningtimes&locid=" + locid) +} + // --> </script> |