web: add responsive table style to connections too
Fixed a small issue for sftpfs too
This commit is contained in:
parent
acb4310c11
commit
f895059660
2 changed files with 21 additions and 14 deletions
|
@ -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}}
|
|
@ -307,15 +307,15 @@ func (fs *SFTPFs) Create(name string, flag int) (File, *PipeWriter, func(), erro
|
|||
if err == nil && errFlush != nil {
|
||||
err = errFlush
|
||||
}
|
||||
var errTruncate error
|
||||
if err != nil {
|
||||
errTruncate = f.Truncate(n)
|
||||
}
|
||||
errClose := f.Close()
|
||||
if err == nil && errClose != nil {
|
||||
err = errClose
|
||||
}
|
||||
r.CloseWithError(err) //nolint:errcheck
|
||||
var errTruncate error
|
||||
if err != nil {
|
||||
errTruncate = f.Truncate(n)
|
||||
}
|
||||
p.Done(err)
|
||||
fsLog(fs, logger.LevelDebug, "upload completed, path: %#v, readed bytes: %v, err: %v err truncate: %v",
|
||||
name, n, err, errTruncate)
|
||||
|
|
Loading…
Add table
Reference in a new issue