2018-06-07 00:45:47 +08:00
|
|
|
|
$(function () {
|
|
|
|
|
var $dialog = $('#dialogNew');
|
|
|
|
|
var $dataForm = $('#dataForm');
|
|
|
|
|
var $dataFormDetail = $('#dataFormDetail');
|
|
|
|
|
var $errorList = $('#errorList');
|
|
|
|
|
var $errorDetail = $('#errorDetail');
|
|
|
|
|
var $errorDetailTitle = $('#myDetailModalLabel');
|
|
|
|
|
|
2018-10-30 13:07:29 +08:00
|
|
|
|
$('.card-body table').smartTable({
|
2018-06-07 00:45:47 +08:00
|
|
|
|
url: Exceptions.url,
|
|
|
|
|
sortName: 'LogTime',
|
2018-06-12 11:31:23 +08:00
|
|
|
|
sortOrder: 'desc',
|
2018-06-07 00:45:47 +08:00
|
|
|
|
queryParams: function (params) { return $.extend(params, { StartTime: $("#txt_operate_start").val(), EndTime: $("#txt_operate_end").val() }); },
|
|
|
|
|
columns: [
|
|
|
|
|
{ title: "请求网址", field: "ErrorPage", sortable: true },
|
2018-06-12 11:31:23 +08:00
|
|
|
|
{ title: "用户名", field: "UserId", sortable: true },
|
2018-06-07 00:45:47 +08:00
|
|
|
|
{ title: "IP", field: "UserIp", sortable: true },
|
2018-09-28 09:09:09 +08:00
|
|
|
|
{ title: "异常类型", field: "ExceptionType", sortable: false },
|
|
|
|
|
{ title: "异常描述", field: "Message", sortable: false },
|
2018-06-07 00:45:47 +08:00
|
|
|
|
{ title: "记录时间", field: "LogTime", sortable: true }
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#btn_view').on('click', function (row) {
|
|
|
|
|
$.bc({
|
2018-09-09 13:19:05 +08:00
|
|
|
|
url: Exceptions.url, method: "post",
|
2018-06-07 00:45:47 +08:00
|
|
|
|
callback: function (result) {
|
|
|
|
|
var html = result.map(function (ele) {
|
2018-08-04 18:47:43 +08:00
|
|
|
|
return $.format('<div class="form-group col-lg-3 col-md-3 col-sm-4 col-6"><a class="logfile" data-toggle="tooltip" title="{0}" href="#"><i class="fa fa-file-text-o"></i><span>{0}</span></a></div>', ele);
|
2018-06-07 00:45:47 +08:00
|
|
|
|
}).join('');
|
2018-08-04 18:47:43 +08:00
|
|
|
|
$dataForm.children('div').html(html).find('[data-toggle="tooltip"]').tooltip();
|
2018-06-07 00:45:47 +08:00
|
|
|
|
$dialog.modal('show');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$dialog.on('click', 'a', function () {
|
2018-08-04 18:47:43 +08:00
|
|
|
|
var fileName = $(this).tooltip('hide').find('span').text();
|
2018-06-07 00:45:47 +08:00
|
|
|
|
$errorDetailTitle.text(fileName);
|
|
|
|
|
$errorList.hide();
|
|
|
|
|
$errorDetail.show();
|
|
|
|
|
$dataFormDetail.html('<div class="text-center"><i class="fa fa-spinner fa-pulse fa-3x fa-fw"></i></div>');
|
|
|
|
|
$.bc({
|
2018-09-09 13:19:05 +08:00
|
|
|
|
url: Exceptions.url, method: "put", data: { FileName: fileName },
|
2018-06-07 00:45:47 +08:00
|
|
|
|
callback: function (result) {
|
|
|
|
|
$dataFormDetail.html(result);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$errorDetail.on('click', 'button', function () {
|
|
|
|
|
$errorDetail.hide();
|
|
|
|
|
$errorList.show();
|
|
|
|
|
});
|
2016-11-11 21:44:41 +08:00
|
|
|
|
});
|