|
|
@@ -4,8 +4,10 @@
|
|
|
|
|
|
{{define "extra_css"}}
|
|
|
<link href="/static/vendor/datatables/dataTables.bootstrap4.min.css" rel="stylesheet">
|
|
|
-<link href="/static/vendor/datatables/select.bootstrap4.min.css" rel="stylesheet">
|
|
|
<link href="/static/vendor/datatables/buttons.bootstrap4.min.css" rel="stylesheet">
|
|
|
+<link href="/static/vendor/datatables/fixedHeader.bootstrap4.min.css" rel="stylesheet">
|
|
|
+<link href="/static/vendor/datatables/responsive.bootstrap4.min.css" rel="stylesheet">
|
|
|
+<link href="/static/vendor/datatables/select.bootstrap4.min.css" rel="stylesheet">
|
|
|
{{end}}
|
|
|
|
|
|
{{define "page_body"}}
|
|
|
@@ -20,7 +22,7 @@
|
|
|
<div class="card-body">
|
|
|
{{if .Connections}}
|
|
|
<div class="table-responsive">
|
|
|
- <table class="table table-striped table-bordered" id="dataTable" width="100%" cellspacing="0">
|
|
|
+ <table class="table table-striped table-bordered nowrap" id="dataTable" width="100%" cellspacing="0">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th>ID</th>
|
|
|
@@ -82,10 +84,12 @@
|
|
|
{{define "extra_js"}}
|
|
|
<script src="/static/vendor/datatables/jquery.dataTables.min.js"></script>
|
|
|
<script src="/static/vendor/datatables/dataTables.bootstrap4.min.js"></script>
|
|
|
-<script src="/static/vendor/datatables/dataTables.select.min.js"></script>
|
|
|
-<script src="/static/vendor/datatables/select.bootstrap4.min.js"></script>
|
|
|
<script src="/static/vendor/datatables/dataTables.buttons.min.js"></script>
|
|
|
<script src="/static/vendor/datatables/buttons.bootstrap4.min.js"></script>
|
|
|
+<script src="/static/vendor/datatables/dataTables.fixedHeader.min.js"></script>
|
|
|
+<script src="/static/vendor/datatables/dataTables.responsive.min.js"></script>
|
|
|
+<script src="/static/vendor/datatables/responsive.bootstrap4.min.js"></script>
|
|
|
+<script src="/static/vendor/datatables/dataTables.select.min.js"></script>
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
function disconnectAction() {
|
|
|
@@ -135,12 +139,8 @@
|
|
|
};
|
|
|
|
|
|
var table = $('#dataTable').DataTable({
|
|
|
- dom: "<'row'<'col-sm-12'B>>" +
|
|
|
- "<'row'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>" +
|
|
|
- "<'row'<'col-sm-12'tr>>" +
|
|
|
- "<'row'<'col-sm-12 col-md-5'i><'col-sm-12 col-md-7'p>>",
|
|
|
- select: true,
|
|
|
- buttons: [],
|
|
|
+ "select": "true",
|
|
|
+ "buttons": [],
|
|
|
"columnDefs": [
|
|
|
{
|
|
|
"targets": [0],
|
|
|
@@ -149,17 +149,24 @@
|
|
|
},
|
|
|
],
|
|
|
"scrollX": false,
|
|
|
+ "scrollY": false,
|
|
|
+ "responsive": true,
|
|
|
"order": [[1, 'asc']]
|
|
|
});
|
|
|
|
|
|
+ new $.fn.dataTable.FixedHeader( table );
|
|
|
+
|
|
|
{{if .LoggedAdmin.HasPermission "close_conns"}}
|
|
|
table.button().add(0,'disconnect');
|
|
|
|
|
|
+ table.buttons().container().appendTo('#dataTable_wrapper .col-md-6:eq(0)');
|
|
|
+
|
|
|
table.on('select deselect', function () {
|
|
|
var selectedRows = table.rows({ selected: true }).count();
|
|
|
table.button('disconnect:name').enable(selectedRows == 1);
|
|
|
});
|
|
|
{{end}}
|
|
|
+
|
|
|
});
|
|
|
</script>
|
|
|
{{end}}
|