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');
|
|
|
|
|
|
|
|
|
|
$('table').smartTable({
|
|
|
|
|
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 },
|
|
|
|
|
{ title: "错误", field: "Message", sortable: false },
|
|
|
|
|
{ title: "记录时间", field: "LogTime", sortable: true }
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('.form_date').datetimepicker({
|
|
|
|
|
language: 'zh-CN',
|
|
|
|
|
weekStart: 1,
|
|
|
|
|
todayBtn: 1,
|
|
|
|
|
autoclose: 1,
|
|
|
|
|
todayHighlight: 1,
|
|
|
|
|
startView: 2,
|
|
|
|
|
minView: 2,
|
|
|
|
|
forceParse: 0,
|
|
|
|
|
format: 'yyyy-mm-dd',
|
2018-08-04 01:31:52 +08:00
|
|
|
|
pickerPosition: 'bottom-left',
|
|
|
|
|
fontAwesome: true
|
2018-06-07 00:45:47 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#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
|
|
|
|
});
|