summaryrefslogtreecommitdiffstats
path: root/modules-available/usblockoff/templates
diff options
context:
space:
mode:
authorJannik Schönartz2017-12-12 16:56:59 +0100
committerJannik Schönartz2017-12-12 16:56:59 +0100
commit186515ab545a70ea8ec3e38b062a89138f9f5a0a (patch)
treeedc46ae5cb09355aed5b6be401c9fa75fe2964a4 /modules-available/usblockoff/templates
parentMoved save/reset/add-usb-device buttons to the right side (diff)
downloadslx-admin-186515ab545a70ea8ec3e38b062a89138f9f5a0a.tar.gz
slx-admin-186515ab545a70ea8ec3e38b062a89138f9f5a0a.tar.xz
slx-admin-186515ab545a70ea8ec3e38b062a89138f9f5a0a.zip
[usb-lock-off] Reformatting code.
Diffstat (limited to 'modules-available/usblockoff/templates')
-rw-r--r--modules-available/usblockoff/templates/server-prop-bool.html6
-rw-r--r--modules-available/usblockoff/templates/server-prop-dropdown.html8
-rw-r--r--modules-available/usblockoff/templates/server-prop-generic.html6
-rw-r--r--modules-available/usblockoff/templates/usb-choose-config.html206
-rw-r--r--modules-available/usblockoff/templates/usb-configuration.html39
-rw-r--r--modules-available/usblockoff/templates/usb-device-list.html155
6 files changed, 213 insertions, 207 deletions
diff --git a/modules-available/usblockoff/templates/server-prop-bool.html b/modules-available/usblockoff/templates/server-prop-bool.html
index f430d02c..de7c990a 100644
--- a/modules-available/usblockoff/templates/server-prop-bool.html
+++ b/modules-available/usblockoff/templates/server-prop-bool.html
@@ -7,9 +7,9 @@
</div>
<div class="col-md-2">
{{#helptext}}
- <a class="btn btn-default" title="{{helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
+ <a class="btn btn-default" title="{{helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
{{/helptext}}
</div>
</div>
diff --git a/modules-available/usblockoff/templates/server-prop-dropdown.html b/modules-available/usblockoff/templates/server-prop-dropdown.html
index 80667766..337c40aa 100644
--- a/modules-available/usblockoff/templates/server-prop-dropdown.html
+++ b/modules-available/usblockoff/templates/server-prop-dropdown.html
@@ -4,15 +4,15 @@
<div class="col-md-7">
<select class="form-control" id="prop-{{property}}" name="prop-{{property}}">
{{#select_list}}
- <option {{#active}}selected{{/active}}>{{option}}</option>
+ <option {{#active}}selected{{/active}}>{{option}}</option>
{{/select_list}}
</select>
</div>
<div class="col-md-2">
{{#helptext}}
- <a class="btn btn-default" title="{{helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
+ <a class="btn btn-default" title="{{helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
{{/helptext}}
</div>
</div>
diff --git a/modules-available/usblockoff/templates/server-prop-generic.html b/modules-available/usblockoff/templates/server-prop-generic.html
index 9e94c23d..3c06585e 100644
--- a/modules-available/usblockoff/templates/server-prop-generic.html
+++ b/modules-available/usblockoff/templates/server-prop-generic.html
@@ -7,9 +7,9 @@
</div>
<div class="col-md-2">
{{#helptext}}
- <a class="btn btn-default" title="{{helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
+ <a class="btn btn-default" title="{{helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
{{/helptext}}
</div>
</div>
diff --git a/modules-available/usblockoff/templates/usb-choose-config.html b/modules-available/usblockoff/templates/usb-choose-config.html
index d446e4cf..f2f5bb10 100644
--- a/modules-available/usblockoff/templates/usb-choose-config.html
+++ b/modules-available/usblockoff/templates/usb-choose-config.html
@@ -3,116 +3,118 @@
<input type="hidden" name="action" id="formAction" value="updateConfig">
<input type="hidden" name="id" value="0" id="configID">
- <div class="panel panel-default">
- <div class="panel-heading">{{lang_general}}</div>
- <div class="panel-body">
- <div class="list-group">
+ <div class="panel panel-default">
+ <div class="panel-heading">{{lang_general}}</div>
+ <div class="panel-body">
+ <div class="list-group">
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-3">
- <label>{{lang_config}}</label>
- </div>
- <div class="col-sm-7">
- <div class="col-sm-7">
- <!--<input class="form-control" name="{{name}}" id="{{name}}" value="{{value}}">-->
- <select class="form-control" id="select_config" name="select_config" onchange="loadConfig(this);">
- <option value="0">{{lang_createNewConfig}}</option>
- {{#config_list}}
- <option value={{config_id}}>{{config_name}}</option>
- {{/config_list}}
- </select>
- </div>
- </div>
- <div class="col-sm-2">
- <a class="btn btn-default" title="{{lang_config_helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
- </div>
- </div>
- </div>
+ <div class="list-group-item">
+ <div class="row">
+ <div class="col-sm-3">
+ <label>{{lang_config}}</label>
+ </div>
+ <div class="col-sm-7">
+ <div class="col-sm-7">
+ <!--<input class="form-control" name="{{name}}" id="{{name}}" value="{{value}}">-->
+ <select class="form-control" id="select_config" name="select_config"
+ onchange="loadConfig(this);">
+ <option value="0">{{lang_createNewConfig}}</option>
+ {{#config_list}}
+ <option value={{config_id}}>{{config_name}}</option>
+ {{/config_list}}
+ </select>
+ </div>
+ </div>
+ <div class="col-sm-2">
+ <a class="btn btn-default" title="{{lang_config_helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
+ </div>
+ </div>
+ </div>
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-3">
- <label>{{lang_configName}}</label>
- </div>
- <div class="col-sm-7">
- <div class="col-sm-7">
- <input required class="form-control" name="configName" id="configName" value="{{configName}}">
- </div>
- </div>
- <div class="col-sm-2">
- <a class="btn btn-default" title="{{lang_configName_helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
- </div>
- </div>
- </div>
+ <div class="list-group-item">
+ <div class="row">
+ <div class="col-sm-3">
+ <label>{{lang_configName}}</label>
+ </div>
+ <div class="col-sm-7">
+ <div class="col-sm-7">
+ <input required class="form-control" name="configName" id="configName" value="{{configName}}">
+ </div>
+ </div>
+ <div class="col-sm-2">
+ <a class="btn btn-default" title="{{lang_configName_helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
+ </div>
+ </div>
+ </div>
- <div class="list-group-item">
- <div class="row">
- <div class="col-sm-3">
- <label>{{lang_deleteConfig}}</label>
- </div>
- <div class="col-sm-7">
- <div class="col-sm-7">
- <!-- <button class="btn btn-danger confirm-delete" type="submit" onclick="deleteConfig();">{{lang_delete}}</button>-->
- <button class="btn btn-danger" value="" id="deleteConfigButton" title="{{lang_delete}}" onclick="deleteConfig(event);">
- <span class="glyphicon glyphicon-trash"> {{lang_delete}}</span>
- </button>
- </div>
- </div>
- <div class="col-sm-2">
- <a class="btn btn-default" title="{{lang_deleteConfig_helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
- </div>
- </div>
- </div>
+ <div class="list-group-item">
+ <div class="row">
+ <div class="col-sm-3">
+ <label>{{lang_deleteConfig}}</label>
+ </div>
+ <div class="col-sm-7">
+ <div class="col-sm-7">
+ <!-- <button class="btn btn-danger confirm-delete" type="submit" onclick="deleteConfig();">{{lang_delete}}</button>-->
+ <button class="btn btn-danger" value="" id="deleteConfigButton" title="{{lang_delete}}"
+ onclick="deleteConfig(event);">
+ <span class="glyphicon glyphicon-trash"> {{lang_delete}}</span>
+ </button>
+ </div>
+ </div>
+ <div class="col-sm-2">
+ <a class="btn btn-default" title="{{lang_deleteConfig_helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
+ </div>
+ </div>
+ </div>
- </div>
- </div>
- </div>
- <div id="configDIV"></div>
+ </div>
+ </div>
+ </div>
+ <div id="configDIV"></div>
</form>
<script type="text/javascript">
-document.addEventListener("DOMContentLoaded", function () {
- $('#select_config').change();
-});
+ document.addEventListener("DOMContentLoaded", function () {
+ $('#select_config').change();
+ });
-function loadConfig(selectedOption) {
- var configID = selectedOption.value;
- var configName = $('#select_config option:selected').text();
- $('#configDIV').load("?do=usblockoff&action=loadConfig&id=" + configID);
- $('#configID').val(configID);
- if (configID == 0) {
- $('#configName').val('');
- } else {
- $('#configName').val(configName);
- }
-}
+ function loadConfig(selectedOption) {
+ var configID = selectedOption.value;
+ var configName = $('#select_config option:selected').text();
+ $('#configDIV').load("?do=usblockoff&action=loadConfig&id=" + configID);
+ $('#configID').val(configID);
+ if (configID == 0) {
+ $('#configName').val('');
+ } else {
+ $('#configName').val(configName);
+ }
+ }
-function deleteConfig(event) {
- event.preventDefault();
+ function deleteConfig(event) {
+ event.preventDefault();
- BootstrapDialog.confirm({
- title: '{{lang_delete}}',
- message: '{{lang_deleteConfigMessage}}',
- type: BootstrapDialog.TYPE_DANGER, // <-- Default value is BootstrapDialog.TYPE_PRIMARY
- closable: false, // <-- Default value is false
- draggable: false, // <-- Default value is false
- btnCancelLabel: '{{lang_cancel}}', // <-- Default value is 'Cancel',
- btnOKLabel: '{{lang_delete}}', // <-- Default value is 'OK',
- btnOKClass: 'btn-danger', // <-- If you didn't specify it, dialog type will be used,
- callback: function(result) {
- if (result) {
- var configID = $('#select_config option:selected').val();
- $('#configID').val(configID);
- $('#formAction').val('deleteConfig');
- $('#configForm').submit();
+ BootstrapDialog.confirm({
+ title: '{{lang_delete}}',
+ message: '{{lang_deleteConfigMessage}}',
+ type: BootstrapDialog.TYPE_DANGER, // <-- Default value is BootstrapDialog.TYPE_PRIMARY
+ closable: false, // <-- Default value is false
+ draggable: false, // <-- Default value is false
+ btnCancelLabel: '{{lang_cancel}}', // <-- Default value is 'Cancel',
+ btnOKLabel: '{{lang_delete}}', // <-- Default value is 'OK',
+ btnOKClass: 'btn-danger', // <-- If you didn't specify it, dialog type will be used,
+ callback: function (result) {
+ if (result) {
+ var configID = $('#select_config option:selected').val();
+ $('#configID').val(configID);
+ $('#formAction').val('deleteConfig');
+ $('#configForm').submit();
+ }
}
- }
- });
-}
+ });
+ }
</script>
diff --git a/modules-available/usblockoff/templates/usb-configuration.html b/modules-available/usblockoff/templates/usb-configuration.html
index d6317e11..7032e249 100644
--- a/modules-available/usblockoff/templates/usb-configuration.html
+++ b/modules-available/usblockoff/templates/usb-configuration.html
@@ -3,52 +3,53 @@
<div class="panel-body">
<div class="list-group">
- {{#list}}
+ {{#list}}
<div class="list-group-item">
<div class="row">
<div class="col-sm-3">
<label>{{name}}</label>
</div>
<div class="col-sm-7">
- <div class="col-sm-7">
+ <div class="col-sm-7">
<input class="form-control" name="{{name}}" id="{{name}}" value="{{value}}">
</div>
</div>
<div class="col-sm-2">
- <a class="btn btn-default" title="{{helptext}}">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
+ <a class="btn btn-default" title="{{helptext}}">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
</div>
</div>
</div>
- {{/list}}
+ {{/list}}
</div>
</div>
</div>
<div class="panel panel-default">
- <div class="panel-heading">rules.conf</div>
- <div class="panel-body">
- <div class="list-group">
+ <div class="panel-heading">rules.conf</div>
+ <div class="panel-body">
+ <div class="list-group">
- <div class="form-group">
- <textarea class="form-control" rows="10" name="rules" id="rules">{{rules}}</textarea>
- </div>
+ <div class="form-group">
+ <textarea class="form-control" rows="10" name="rules" id="rules">{{rules}}</textarea>
+ </div>
<div class="pull-right">
+ <a class="btn btn-default" title="{{lang_howToRuleLang}}"
+ href="https://dkopecek.github.io/usbguard/documentation/rule-language.html"
+ style="float: right;" target="_blank">
+ <span class="glyphicon glyphicon-question-sign"></span>
+ </a>
<a class="btn btn-success" style="margin-right: 3px;" onclick="loadAddDeviceModal();">
<span style="margin-right: 5px;" class="glyphicon glyphicon-plus"></span>
<span>{{lang_devices}}</span>
</a>
- <a class="btn btn-default" title="{{lang_howToRuleLang}}" href="https://dkopecek.github.io/usbguard/documentation/rule-language.html"
- style="float: right;" target="_blank">
- <span class="glyphicon glyphicon-question-sign"></span>
- </a>
</div>
- </div>
- </div>
+ </div>
+ </div>
</div>
<div class="pull-right">
@@ -62,7 +63,7 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header" id="myModalHeader"></div>
- <div class="modal-body" id="myModalBody" ></div>
+ <div class="modal-body" id="myModalBody"></div>
<div class="modal-footer">
<button id="myModalAddButton" class="btn btn-success" type="button" onclick="addDevices();">
<span style="margin-right: 5px;" class="glyphicon glyphicon-plus"></span>
diff --git a/modules-available/usblockoff/templates/usb-device-list.html b/modules-available/usblockoff/templates/usb-device-list.html
index a7ecf989..a6cd96b0 100644
--- a/modules-available/usblockoff/templates/usb-device-list.html
+++ b/modules-available/usblockoff/templates/usb-device-list.html
@@ -1,24 +1,25 @@
<div>
-<form method="post" action="?do=usblockoff" id="addDevicesForm">
- <input type="hidden" name="token" value="{{token}}">
- <input type="hidden" name="action" value="addDevices">
-
- <div class="input-group" id="search">
- <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
- <input type="text" id="myInput" class="form-control" onkeyup="search()" placeholder="Search for .." style="font-size: 16px;"/>
- <span class="input-group-addon" style="width:0px; padding-left:0px; padding-right:0px; border:none;"></span>
- <select class="form-control" id="searchFor" style="font-size: 16px;" onchange="search()">
- <option value="0" select>Name</option>
- <option value="1">Date / Time</option>
- <option value="2">User Information</option>
- <option value="3">USB Information</option>
- <option value="4">Rules Information</option>
- </select>
- </div>
-
- <div style="max-height: 800px; overflow-x: auto;">
- <table class="table table-hover" id="myTable">
- <thead>
+ <form method="post" action="?do=usblockoff" id="addDevicesForm">
+ <input type="hidden" name="token" value="{{token}}">
+ <input type="hidden" name="action" value="addDevices">
+
+ <div class="input-group" id="search">
+ <span class="input-group-addon"><i class="glyphicon glyphicon-search"></i></span>
+ <input type="text" id="myInput" class="form-control" onkeyup="search()" placeholder="Search for .."
+ style="font-size: 16px;"/>
+ <span class="input-group-addon" style="width:0px; padding-left:0px; padding-right:0px; border:none;"></span>
+ <select class="form-control" id="searchFor" style="font-size: 16px;" onchange="search()">
+ <option value="0" select>Name</option>
+ <option value="1">Date / Time</option>
+ <option value="2">User Information</option>
+ <option value="3">USB Information</option>
+ <option value="4">Rules Information</option>
+ </select>
+ </div>
+
+ <div style="max-height: 800px; overflow-x: auto;">
+ <table class="table table-hover" id="myTable">
+ <thead>
<tr>
<th width="1" style="text-align: center;">Name</th>
<th width="1" style="text-align: center;">Time</th>
@@ -26,43 +27,44 @@
<th width="1">USB Info</th>
<th width="1">Rule Info</th>
</tr>
- </thead>
- {{#list}}
- <input type="hidden" id="{{uid}}-prop-name" value="{{name}}">
- <input type="hidden" id="{{uid}}-prop-id" value="{{id}}">
- <input type="hidden" id="{{uid}}-prop-serial" value="{{serial}}">
- <input type="hidden" id="{{uid}}-prop-via-port" value="{{via-port}}">
- <input type="hidden" id="{{uid}}-prop-hash" value="{{hash}}">
- <input type="hidden" id="{{uid}}-prop-parent-hash" value="{{parent-hash}}">
- <input type="hidden" id="{{uid}}-prop-with-interface" value="{{with-interface}}">
-
- <tbody onclick="clickRow(this, {{uid}});" id="{{uid}}">
+ </thead>
+ {{#list}}
+ <input type="hidden" id="{{uid}}-prop-name" value="{{name}}">
+ <input type="hidden" id="{{uid}}-prop-id" value="{{id}}">
+ <input type="hidden" id="{{uid}}-prop-serial" value="{{serial}}">
+ <input type="hidden" id="{{uid}}-prop-via-port" value="{{via-port}}">
+ <input type="hidden" id="{{uid}}-prop-hash" value="{{hash}}">
+ <input type="hidden" id="{{uid}}-prop-parent-hash" value="{{parent-hash}}">
+ <input type="hidden" id="{{uid}}-prop-with-interface" value="{{with-interface}}">
+
+ <tbody onclick="clickRow(this, {{uid}});" id="{{uid}}">
<tr>
<td nowrap align="center" style="vertical-align: middle;"><label>{{name}}</label></td>
<td nowrap align="center" style="vertical-align: middle;">{{time}}<br>{{date}}</td>
<td nowrap><font size="0">User: {{user}}<br>Location: {{location}}<br>Client: {{clientip}}</font></td>
<td nowrap><font size="0">id: {{id}}<br>Serial: {{serial}}<br>via-port: {{via-port}}</font></td>
- <td nowrap><font size="0">hash: {{hash}}<br>parent-hash: {{parent-hash}}<br>with-interface: {{with-interface}}</font></td>
+ <td nowrap><font size="0">hash: {{hash}}<br>parent-hash: {{parent-hash}}<br>with-interface:
+ {{with-interface}}</font></td>
</tr>
- </tbody>
- {{/list}}
- </table>
- </div>
+ </tbody>
+ {{/list}}
+ </table>
+ </div>
- <div class="panel panel-default">
- <div class="panel-heading">Rule Options</div>
- <div class="panel-body">
- <div class="list-group">
+ <div class="panel panel-default">
+ <div class="panel-heading">Rule Options</div>
+ <div class="panel-body">
+ <div class="list-group">
- {{#settings}}
- {{{settingHtml}}}
- {{/settings}}
+ {{#settings}}
+ {{{settingHtml}}}
+ {{/settings}}
- </div>
- </div>
- </div>
+ </div>
+ </div>
+ </div>
-</form>
+ </form>
</div>
<script type="text/javascript">
@@ -98,36 +100,36 @@
function search() {
var searchForIndex = $('#searchFor').val();
- // Declare variables
- var input, filter, table, tr, td, i;
- input = document.getElementById("myInput");
- filter = input.value.toUpperCase();
- table = document.getElementById("myTable");
- tr = table.getElementsByTagName("tr");
-
- // Loop through all table rows, and hide those who don't match the search query
- for (i = 0; i < tr.length; i++) {
- td = tr[i].getElementsByTagName("td")[searchForIndex];
- if (td) {
- if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
- tr[i].style.display = "";
- } else {
- tr[i].style.display = "none";
- }
+ // Declare variables
+ var input, filter, table, tr, td, i;
+ input = document.getElementById("myInput");
+ filter = input.value.toUpperCase();
+ table = document.getElementById("myTable");
+ tr = table.getElementsByTagName("tr");
+
+ // Loop through all table rows, and hide those who don't match the search query
+ for (i = 0; i < tr.length; i++) {
+ td = tr[i].getElementsByTagName("td")[searchForIndex];
+ if (td) {
+ if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
+ tr[i].style.display = "";
+ } else {
+ tr[i].style.display = "none";
}
}
+ }
}
function addDevices() {
- $('.selected').each(function() {
+ $('.selected').each(function () {
var rule = $('#prop-action').val();
var selected = $(this);
- $('.settings-bs-switch').each(function() {
- if($(this).is(":checked")) {
+ $('.settings-bs-switch').each(function () {
+ if ($(this).is(":checked")) {
var settingname = $(this).attr('name').substring(5);
var info = $('#' + $(selected).attr('id') + '-' + $(this).attr('name'));
- if(settingname == 'id' || settingname == 'with-interface') {
+ if (settingname == 'id' || settingname == 'with-interface') {
rule += ' ' + settingname + ' ' + info.val();
} else {
rule += ' ' + settingname + ' "' + info.val() + '"';
@@ -146,25 +148,26 @@
<style type='text/css'>
.selected {
- background-color: #F5F5F5;
+ background-color: #F5F5F5;
}
+
#myTable {
- border-collapse: collapse; /* Collapse borders */
- width: 100%; /* Full-width */
- border: 1px solid #ddd; /* Add a grey border */
+ border-collapse: collapse; /* Collapse borders */
+ width: 100%; /* Full-width */
+ border: 1px solid #ddd; /* Add a grey border */
}
#myTable th, #myTable td {
- padding: 12px; /* Add padding */
+ padding: 12px; /* Add padding */
}
#myTable tr {
- /* Add a bottom border to all table rows */
- border-bottom: 1px solid #ddd;
+ /* Add a bottom border to all table rows */
+ border-bottom: 1px solid #ddd;
}
#myTable tr.header, #myTable tr:hover {
- /* Add a grey background color to the table header and on hover */
- background-color: #f1f1f1;
+ /* Add a grey background color to the table header and on hover */
+ background-color: #f1f1f1;
}
</style>