Authored by htoooth

fix

... ... @@ -12,7 +12,7 @@ class errorModel extends model {
pageSize = pageSize || 10;
let recordsTotal = await this.mysql.query('SELECT COUNT(*) as count from error_report where app = ?', [app]).then(([r]) => r.count);
let data = await this.mysql.query('SELECT id, app, type, preq_id, req_id, uid, udid, code, line, `column`, script, message, stack from error_report where app = ? order by create_time desc limit ?, ? ', [app, page, pageSize]).then(r => r.map(vars.handleItem));
let data = await this.mysql.query('SELECT id, app, type, preq_id, req_id, uid, udid, code, line, `column`, script, message, stack, create_time as time from error_report where app = ? order by create_time desc limit ?, ? ', [app, page, pageSize]).then(r => r.map(vars.handleItem));
return {
recordsTotal,
... ...
... ... @@ -12,7 +12,7 @@ class slowRouteModel extends model {
pageSize = pageSize || 10;
let recordsTotal = await this.mysql.query('SELECT COUNT(*) as count from slow_duration where app = ?', [app]).then(([r]) => r.count);
let data = await this.mysql.query('SELECT id, app, `type`, preq_id, req_id, uid, udid, api, route, duration from slow_duration where app = ? ORDER BY create_time DESC LIMIT ?, ? ', [app, page, pageSize]).then(r => {
let data = await this.mysql.query('SELECT id, app, `type`, preq_id, req_id, uid, udid, api, route, duration, create_time as time from slow_duration where app = ? ORDER BY create_time DESC LIMIT ?, ? ', [app, page, pageSize]).then(r => {
return r.map(vars.handleItem)
});
... ...
const APP_VALUE = {
0: 'unknown',
1: 'yohobuy',
2: 'yohobuywap',
3: 'blk',
4: 'blkwap'
};
const TYPE_VALUE = {
0: 'unknown',
1: 'api',
2: 'route',
3: 'firstscreen',
4: 'domready',
5: 'documentload'
};
function handleItem(i) {
i.app = APP_VALUE[i.app];
i.type = TYPE_VALUE[i.type];
return i;
}
module.exports = {
handleItem
};
\ No newline at end of file
... ... @@ -37,10 +37,11 @@
<table id="table-servers" class="table table-striped table-bordered">
<thead class="">
<tr>
<td >时间</td>
<td >应用名称</td>
<td >接口名称</td>
<td >路由</td>
<td >时间</td>
<td >耗时</td>
</thead>
<tbody>
... ... @@ -82,12 +83,14 @@
dataSrc: 'data',
pageLength: 25,
columns: [
{data: 'time'},
{data: 'app'},
{data: 'api'},
{data: 'route'},
{data: 'duration'},
],
data: [{
time: '',
app: '',
api: 0,
route: 0,
... ... @@ -95,7 +98,7 @@
}],
columnDefs: [{
orderable: false,
targets: [0,1,2,3]
targets: [0,1,2,3, 4]
}]
});
... ...