135 lines
4.2 KiB
HTML
135 lines
4.2 KiB
HTML
{{extend 'layout.html'}}
|
|
{{import os, stat, time}}
|
|
|
|
{{block sectionclass}}errors{{end}}
|
|
|
|
<style>
|
|
table.sortable {
|
|
border-spacing:0px;
|
|
}
|
|
table.sortable td, table.sortable th {
|
|
padding: 2px 5px 2px 5px;
|
|
}
|
|
table.sortable thead {
|
|
background-color:#eee;
|
|
color:#666666;
|
|
font-weight: bold;
|
|
cursor: default;
|
|
}
|
|
tr.error_ticket:hover {
|
|
background-color: #eee;
|
|
}
|
|
</style>
|
|
|
|
<script language="JavaScript">
|
|
function check(){
|
|
for (var i = 0; i < document.myform.elements.length; i++) {
|
|
var e = document.myform.elements[i];
|
|
if (e.type == 'checkbox') e.checked = true;
|
|
}
|
|
}
|
|
function uncheck(){
|
|
for (var i = 0; i < document.myform.elements.length; i++) {
|
|
var e = document.myform.elements[i];
|
|
if (e.type == 'checkbox') e.checked = false;
|
|
}
|
|
}
|
|
jQuery(document).ready(function() { jQuery('.traceback').hide(); });
|
|
</script>
|
|
|
|
<h2>{{=T('Error logs for "%(app)s"',dict(app=app))}}</h2>
|
|
|
|
<div class="errorform">
|
|
<form name="myform" method="post">
|
|
<input name="CheckAll" value="{{=T('check all')}}"
|
|
onclick="check()" type="button">
|
|
<input name="CheckAll" value="{{=T('uncheck all')}}"
|
|
onclick="uncheck()" type="button">
|
|
<input value="{{=T('delete all checked')}}" type="submit"><br><br>
|
|
|
|
{{ if 'new' in method: }}
|
|
{{base_url = 'db' in method and 'ticketdb' or 'ticket' }}
|
|
<h3>{{=T('Click row to expand traceback')}}</h3>
|
|
<p class="controls">
|
|
{{if 'db' in method:}}
|
|
source : db
|
|
<a class="button" href="{{=URL(args=[app, 'new'])}}"><span>switch to : filesystem</span></a>
|
|
<a class="button" href="{{=URL(args=[app, 'dbold'])}}"><span>lists by ticket</span></a>
|
|
{{else:}}
|
|
source : filesystem
|
|
<a class="button" href="{{=URL(args=[app, 'dbnew'])}}"><span>switch to : db</span></a>
|
|
<a class="button" href="{{=URL(args=[app, 'old'])}}"><span>lists by ticket</span></a>
|
|
{{pass}}
|
|
</p>
|
|
<table id="trck_errors" class="sortable">
|
|
<thead>
|
|
<tr>
|
|
<th>{{=T("Delete")}}</th>
|
|
<th>{{=T("Count")}}</th>
|
|
<th>{{=T("File")}}</th>
|
|
<th>{{=T("Error")}}</th>
|
|
<th></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{for e in errors:}}
|
|
<tr class="error_ticket">
|
|
<td><input type="checkbox" name="delete_{{=e['hash']}}" /></td>
|
|
<td>{{=e['count']}}</td>
|
|
<td>{{=e['causer']}}</td>
|
|
<td>{{=A(e['last_line'],_href="#",_onclick="collapse('%s');"%e['hash'])}}</td>
|
|
<td>+</td>
|
|
<td>{{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}</td>
|
|
</tr>
|
|
<tr id="{{=e['hash']}}" class="traceback">
|
|
<td colspan="6">
|
|
<div>
|
|
{{=CODE(e['pickel']['traceback'])}}
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{{pass}}
|
|
</tbody>
|
|
</table>
|
|
{{ else: }}
|
|
<h3>{{=T('Click row to view a ticket')}}</h3>
|
|
<p class="controls">
|
|
{{if 'db' in method:}}
|
|
source : db
|
|
<a class="button" href="{{=URL(args=[app, 'old'])}}"><span>switch to : filesystem</span></a>
|
|
<a class="button" href="{{=URL(args=[app, 'dbnew'])}}"><span>lists by exception</span></a>
|
|
{{else:}}
|
|
source : filesystem
|
|
<a class="button" href="{{=URL(args=[app, 'dbold'])}}"><span>switch to : db</span></a>
|
|
<a class="button" href="{{=URL(args=[app, 'new'])}}"><span>lists by exception</span></a>
|
|
{{pass}}
|
|
</p>
|
|
<table class="sortable">
|
|
<thead>
|
|
<tr>
|
|
<th>{{=T("Delete")}}</th>
|
|
<th>{{=T("Ticket")}}</th>
|
|
<th>{{=T("Date and Time")}}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{{for ticket in tickets:}}
|
|
<tr>
|
|
<td><input type="checkbox" name="delete_{{=ticket}}"/></td>
|
|
{{if 'db' in method:}}
|
|
<td><a href="{{=URL('ticketdb',args=[app,ticket])}}">{{=ticket}}</a></td>
|
|
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}</td>
|
|
{{else:}}
|
|
<td><a href="{{=URL('ticket',args=[app,ticket])}}">{{=ticket}}</a></td>
|
|
<td>{{=time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(os.stat(os.path.join(request.folder,'../%s/errors/%s' % (app,ticket)))[stat.ST_CTIME]))}}</td>
|
|
{{pass}}
|
|
</tr>
|
|
{{pass}}
|
|
</tbody>
|
|
</table>
|
|
{{ pass }}
|
|
</form>
|
|
</div>
|
|
|