Files
purple-explorer/views/includes/net_list.pug
T

60 lines
2.0 KiB
Plaintext
Raw Normal View History

script.
$(document).ready(function() {
$('#connections-table').dataTable({
autoWidth: true,
searching: false,
ordering: false,
responsive: true,
lengthChange: true,
processing: true,
2020-12-25 15:01:03 -07:00
scrollX: true,
2020-12-01 19:19:50 -07:00
language: {
paginate: {
previous: '<',
next: '>'
}
},
ajax: {
url: '/ext/connections',
dataSrc: function (json) {
return json.data;
}
},
2020-11-23 19:09:05 -07:00
rowCallback: function (row, data, index) {
var flagBlock = '';
if (data['country_code'].length > 1) {
2020-12-12 20:21:49 -07:00
flagBlock = '<div class="margin-left-5 flag-icon flag-icon-'+data['country_code'].toLowerCase()+'"></div>';
2020-11-23 19:09:05 -07:00
}
$("td:eq(0)", row).html(data['address']).addClass('breakWord');
2020-11-23 19:09:05 -07:00
$("td:eq(1)", row).html(data['protocol']);
$("td:eq(2)", row).html(data['version']);
$("td:eq(3)", row).html(data['country']+flagBlock);
},
fnDrawCallback: function(settings) {
2020-12-25 15:01:03 -07:00
fixDataTableColumns();
fixFooterHeightAndPosition();
},
columns: [
{ data: 'address', width: '25%' },
{ data: 'protocol', width: '25%' },
{ data: 'version', width:'25%' },
{ data: 'country', width: '25%'}
]
});
2020-12-12 20:21:49 -07:00
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
2020-12-25 15:01:03 -07:00
fixDataTableColumns();
fixFooterHeightAndPosition();
2020-12-12 20:21:49 -07:00
});
});
2020-12-12 20:21:49 -07:00
.card.card-default.border-0
table#connections-table.table.table-bordered.table-striped.table-paging.mobile-border-right
2020-12-20 18:13:24 -07:00
- var theadClasses = [];
if settings.display.table_header_bgcolor != null && settings.display.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.display.table_header_bgcolor);
thead(class=theadClasses)
tr
2020-12-25 15:01:03 -07:00
th.text-center #{settings.locale.net_address}
th.text-center #{settings.locale.net_protocol}
th.text-center #{settings.locale.net_subversion}
th.text-center #{settings.locale.net_country}
tbody.text-center