2016-11-15 18:44:54 +08:00
|
|
|
|
$(function () {
|
2016-11-17 21:36:02 +08:00
|
|
|
|
var url = '../api/Exceptions/';
|
2016-11-15 18:44:54 +08:00
|
|
|
|
var $dialog = $('#dialogNew');
|
|
|
|
|
var $dataForm = $('#dataForm');
|
|
|
|
|
var $dataFormDetail = $('#dataFormDetail');
|
|
|
|
|
var $errorList = $('#errorList');
|
|
|
|
|
var $errorDetail = $('#errorDetail');
|
|
|
|
|
var $errorDetailTitle = $('#myDetailModalLabel');
|
|
|
|
|
|
2016-11-17 21:36:02 +08:00
|
|
|
|
var bsa = new BootstrapAdmin({
|
|
|
|
|
url: url,
|
|
|
|
|
bootstrapTable: null,
|
|
|
|
|
validateForm: null
|
|
|
|
|
});
|
|
|
|
|
|
2016-11-15 18:44:54 +08:00
|
|
|
|
$('table').smartTable({
|
2016-11-17 21:36:02 +08:00
|
|
|
|
url: url,
|
2016-11-16 22:52:34 +08:00
|
|
|
|
sortName: 'LogTime',
|
2016-11-17 21:36:02 +08:00
|
|
|
|
queryParams: function (params) { return $.extend(params, { StartTime: $("#txt_operate_start").val(), EndTime: $("#txt_operate_end").val() }); },
|
2016-11-15 18:44:54 +08:00
|
|
|
|
columns: [{ checkbox: true },
|
2016-11-17 21:36:02 +08:00
|
|
|
|
{ title: "请求网址", field: "ErrorPage", sortable: true },
|
|
|
|
|
{ title: "用户名", field: "UserID", sortable: true },
|
|
|
|
|
{ title: "IP", field: "UserIp", sortable: true },
|
2016-11-15 18:44:54 +08:00
|
|
|
|
{ title: "错误", field: "Message", sortable: false },
|
2016-11-16 22:52:34 +08:00
|
|
|
|
{ title: "记录时间", field: "LogTime", sortable: true }
|
2016-11-15 18:44:54 +08:00
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('input[type="datetime"]').parent().datetimepicker({
|
|
|
|
|
locale: "zh-cn",
|
|
|
|
|
format: "YYYY-MM-DD"
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$('#btn_view').on('click', function (row) {
|
|
|
|
|
Exceptions.getFiles(function (data) {
|
|
|
|
|
$dataForm.children('div').html(data);
|
|
|
|
|
});
|
|
|
|
|
$dialog.modal('show');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$dialog.on('click', 'a', function () {
|
2016-11-17 21:36:02 +08:00
|
|
|
|
var fileName = $(this).find('span').text();
|
2016-11-15 18:44:54 +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>');
|
|
|
|
|
Exceptions.getFileByName(fileName, function (data) {
|
2016-11-17 21:36:02 +08:00
|
|
|
|
$dataFormDetail.html(data);
|
2016-11-15 18:44:54 +08:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$errorDetail.on('click', 'button', function () {
|
|
|
|
|
$errorDetail.hide();
|
|
|
|
|
$errorList.show();
|
|
|
|
|
});
|
2016-11-11 21:44:41 +08:00
|
|
|
|
});
|