...
|
...
|
@@ -21,10 +21,11 @@ |
|
|
margin-right: 10px;
|
|
|
margin-bottom: 10px;
|
|
|
}
|
|
|
.time, .app, .type, .route, .api, .uid, .code, .preqid, .reqid, .script, .message, .stack {
|
|
|
.time, .app, .type, .route, .api, .uid, .code, .preqid, .reqid, .script, .message, .stack .useragent{
|
|
|
word-wrap: break-word;
|
|
|
word-break:break-all;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
...
|
...
|
@@ -169,6 +170,10 @@ |
|
|
<td class="uid"></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>useragent</td>
|
|
|
<td class="useragent"></td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td>错识状态码</td>
|
|
|
<td class="code"></td>
|
|
|
</tr>
|
...
|
...
|
@@ -236,6 +241,13 @@ |
|
|
initDatePicker();
|
|
|
});
|
|
|
|
|
|
function formateDate(d) {
|
|
|
return (d.getMonth() + 1) + "/" + d.getDate() + "/" + d.getFullYear() +
|
|
|
' ' + ("0" + d.getHours()).slice(-2) + ":" +
|
|
|
( "0" + d.getMinutes()).slice(-2) + ":" +
|
|
|
( "0" + d.getSeconds()).slice(-2)
|
|
|
}
|
|
|
|
|
|
function initTable() {
|
|
|
dataTable = $("#table-servers").DataTable({
|
|
|
pageLength: 20,
|
...
|
...
|
@@ -245,6 +257,7 @@ |
|
|
ajax: ajaxUrl(),
|
|
|
dataSrc: 'data',
|
|
|
pageLength: 25,
|
|
|
ordering: false,
|
|
|
columns: [
|
|
|
{data: 'time'},
|
|
|
{data: 'app'},
|
...
|
...
|
@@ -270,7 +283,7 @@ |
|
|
return '';
|
|
|
}
|
|
|
|
|
|
return moment(data).format('YYYY/MM/DD HH:MM:ss');
|
|
|
return formateDate(new Date(data));
|
|
|
},
|
|
|
targets: 0,
|
|
|
width: '12%'
|
...
|
...
|
@@ -328,10 +341,11 @@ |
|
|
$('.script').text('');
|
|
|
$('.message').text('');
|
|
|
$('.stack').text('');
|
|
|
$('.useragent').text('');
|
|
|
}
|
|
|
|
|
|
function setModalData(data) {
|
|
|
$('.time').text(moment(data.time).format('YYYY/MM/DD HH:MM:ss'));
|
|
|
$('.time').text(formateDate(new Date(data.time)));
|
|
|
$('.app').text(data.app);
|
|
|
$('.type').text(data.type);
|
|
|
$('.route').text(data.route);
|
...
|
...
|
@@ -343,6 +357,7 @@ |
|
|
$('.script').text(data.script);
|
|
|
$('.message').text(data.message);
|
|
|
$('.stack').text(data.stack);
|
|
|
$('.useragent').text(data.useragent);
|
|
|
}
|
|
|
|
|
|
const TIME = {
|
...
|
...
|
@@ -366,15 +381,15 @@ |
|
|
$('#reportrange span').html(label);
|
|
|
|
|
|
var lastTime = TIME[label];
|
|
|
var selectedStartTime = moment().subtract(...lastTime).unix();
|
|
|
var selectedEndTime = moment().unix();
|
|
|
var selectedStartTime = moment().subtract(...lastTime).valueOf();
|
|
|
var selectedEndTime = moment().valueOf();
|
|
|
|
|
|
query.time = `${selectedStartTime}:${selectedEndTime}`;
|
|
|
} else if (label && label === '自定义日期'){
|
|
|
$('#reportrange span').html(start.format('YYYY-MM-DD') + ' 至 ' + end.format('YYYY-MM-DD'));
|
|
|
|
|
|
var selectedStartTime = start.format('YYYY-MM-DD').unix();
|
|
|
var selectedEndTime = end.format('YYYY-MM-DD').unix();
|
|
|
var selectedStartTime = moment(start.format('YYYY-MM-DD')).valueOf();
|
|
|
var selectedEndTime = moment(end.add(1, 'd').format('YYYY-MM-DD')).valueOf();
|
|
|
|
|
|
query.time = `${selectedStartTime}:${selectedEndTime}`;
|
|
|
}
|
...
|
...
|
@@ -417,7 +432,11 @@ |
|
|
}
|
|
|
|
|
|
function initSelect() {
|
|
|
$('#selectedHost').change(function() {
|
|
|
$('#selectedHost').select2({
|
|
|
width: 'resolve'
|
|
|
});
|
|
|
|
|
|
$('#selectedHost').on('change', function() {
|
|
|
query.hostname = $('#selectedHost').val();
|
|
|
});
|
|
|
|
...
|
...
|
@@ -433,12 +452,20 @@ |
|
|
query.code = $('#selectedCode').val();
|
|
|
});
|
|
|
|
|
|
$('#selectedRoute').change(function() {
|
|
|
$('#selectedRoute').select2( {
|
|
|
width: 'resolve'
|
|
|
});
|
|
|
|
|
|
$('#selectedRoute').on('change', function() {
|
|
|
query.route = $('#selectedRoute').val();
|
|
|
});
|
|
|
|
|
|
$('#selectedApi').change(function() {
|
|
|
query.api = $('#selectedApi').val();
|
|
|
$('#selectedApi').select2({
|
|
|
width: 'resolve'
|
|
|
});
|
|
|
|
|
|
$('#selectedApi').on("change", function() {
|
|
|
query.api = $('#selectedApi').val()
|
|
|
});
|
|
|
|
|
|
$('#search').on('click', () => {
|
...
|
...
|
@@ -455,12 +482,13 @@ |
|
|
}
|
|
|
|
|
|
function clearSelect() {
|
|
|
$('#selectedHost').val('');
|
|
|
$('#selectedHost').val('').change();
|
|
|
$('#selectedApp').val('');
|
|
|
$('#selectedType').val('');
|
|
|
$('#selectedCode').val('');
|
|
|
$('#selectedRoute').val('');
|
|
|
$('#selectedApi').val('');
|
|
|
|
|
|
$('#selectedRoute').val('').change();
|
|
|
$('#selectedApi').val('').change();
|
|
|
$('#reportrange').trigger('cancel.daterangepicker');
|
|
|
|
|
|
query = {
|
...
|
...
|
|