1 | {{extend 'layout.html'}} |
---|
2 | {{import os, stat, time}} |
---|
3 | {{block sectionclass}}errors{{end}} |
---|
4 | <!-- begin "errors" block --> |
---|
5 | {{if db_ready['status'] == False: |
---|
6 | switchbutton = A(SPAN(T("switch to : db")), _href=db_ready['errlink'], _class="button unavailable btn btn-danger", _title="%s" % (db_ready['errmessage'])) |
---|
7 | else: |
---|
8 | switchbutton = A(SPAN(T("switch to : db")), _href=URL(args=[app, 'dbnew']), _class="button btn") |
---|
9 | pass}} |
---|
10 | <h2>{{=T('Error logs for "%(app)s"',dict(app=app))}}</h2> |
---|
11 | <div class="errorform"> |
---|
12 | <form name="myform" method="post"> |
---|
13 | {{ if 'new' in method: }} |
---|
14 | {{base_url = 'db' in method and 'ticketdb' or 'ticket' }} |
---|
15 | <p class="controls row-fluid"> |
---|
16 | <div class="controls controls-row"> |
---|
17 | {{if 'db' in method:}} |
---|
18 | <span class="uneditable-input">{{=T('source : db')}}</span> |
---|
19 | <a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>{{=T('switch to : filesystem')}}</span></a> |
---|
20 | <a class="button btn" href="{{=URL(args=[app, 'dbold'])}}"><span>{{=T('lists by ticket')}}</span></a> |
---|
21 | {{else:}} |
---|
22 | <span class="uneditable-input">{{=T('source : filesystem')}}</span> |
---|
23 | {{=switchbutton}} |
---|
24 | <a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>{{=T('lists by ticket')}}</span></a> |
---|
25 | {{pass}} |
---|
26 | </div> |
---|
27 | </p> |
---|
28 | <div class="tablebar"> |
---|
29 | <input value="{{=T('delete all checked')}}" type="submit" class="btn"/> |
---|
30 | <span class="help label label-info">{{=T('Click row to expand traceback')}}</span> |
---|
31 | </div> |
---|
32 | <div class="row-fluid"> |
---|
33 | <div class="span6"> |
---|
34 | <table id="trck_errors" class="sortable table table-hover table-condensed"> |
---|
35 | <thead> |
---|
36 | <tr> |
---|
37 | <th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th> |
---|
38 | <th class="column2">{{=T("Count")}}</th> |
---|
39 | <th class="column3">{{=T("File")}}</th> |
---|
40 | <th>{{=T("Error")}}</th> |
---|
41 | <th class="columnN"></th> |
---|
42 | </tr> |
---|
43 | </thead> |
---|
44 | <tbody> |
---|
45 | {{for e in errors:}} |
---|
46 | <tr class="error_ticket"> |
---|
47 | <td class="cbcentered"><input type="checkbox" name="delete_{{=e['hash']}}" /></td> |
---|
48 | <td>{{=e['count']}}</td> |
---|
49 | <td>{{=e['causer']}}</td> |
---|
50 | <td>{{=A(e['last_line'],_href="#",_onclick="collapse('%s');return false;"%e['hash'])}}</td> |
---|
51 | <td>+ {{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}</td> |
---|
52 | </tr> |
---|
53 | <tr id="{{=e['hash']}}" class="traceback"> |
---|
54 | <td colspan="5"> |
---|
55 | <div class="ticket_code"> |
---|
56 | {{=CODE(e['pickel']['traceback'])}} |
---|
57 | </div> |
---|
58 | </td> |
---|
59 | </tr> |
---|
60 | {{pass}} |
---|
61 | </tbody> |
---|
62 | </table> |
---|
63 | </div> |
---|
64 | </div> |
---|
65 | {{ else: }} |
---|
66 | <p class="controls row-fluid"> |
---|
67 | <div class="controls controls-row"> |
---|
68 | {{if 'db' in method:}} |
---|
69 | <span class="uneditable-input">{{=T('source : db')}}</span> |
---|
70 | <a class="button btn" href="{{=URL(args=[app, 'old'])}}"><span>{{=T('switch to : filesystem')}}</span></a> |
---|
71 | <a class="button btn" href="{{=URL(args=[app, 'dbnew'])}}"><span>{{=T('lists by exception')}}</span></a> |
---|
72 | {{else:}} |
---|
73 | <span class="uneditable-input">{{=T('source : filesystem')}}</span> |
---|
74 | {{=switchbutton}} |
---|
75 | <a class="button btn" href="{{=URL(args=[app, 'new'])}}"><span>{{=T('lists by exception')}}</span></a> |
---|
76 | {{pass}} |
---|
77 | </div> |
---|
78 | </p> |
---|
79 | <div class="tablebar"> |
---|
80 | <input value="{{=T('delete all checked')}}" type="submit" class="btn"/> |
---|
81 | <span class="help label label-info">{{=T('Click row to expand traceback')}}</span> |
---|
82 | </div> |
---|
83 | <div class="row-fluid"> |
---|
84 | <div class="span6"> |
---|
85 | <table id="trck_errors" class="sortable table table-hover table-condensed"> |
---|
86 | <thead> |
---|
87 | <tr> |
---|
88 | <th class="column1 cbcentered"><input type="checkbox" name="delete_all}" /></th> |
---|
89 | <th>{{=T("Ticket")}}</th> |
---|
90 | <th class="columnN1">{{=T("Date and Time")}}</th> |
---|
91 | </tr> |
---|
92 | </thead> |
---|
93 | <tbody> |
---|
94 | {{for ticket in tickets:}} |
---|
95 | <tr> |
---|
96 | <td class="cbcentered"><input type="checkbox" name="delete_{{=ticket}}"/></td> |
---|
97 | {{if 'db' in method:}} |
---|
98 | <td><a href="{{=URL('ticketdb',args=[app,ticket])}}">{{=ticket}}</a></td> |
---|
99 | <td>{{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}</td> |
---|
100 | {{else:}} |
---|
101 | <td><a href="{{=URL('ticket',args=[app,ticket])}}">{{=ticket}}</a></td> |
---|
102 | <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> |
---|
103 | {{pass}} |
---|
104 | </tr> |
---|
105 | {{pass}} |
---|
106 | </tbody> |
---|
107 | </table> |
---|
108 | </div> |
---|
109 | </div> |
---|
110 | {{ pass }} |
---|
111 | </form><!-- /errorform --> |
---|
112 | </div> |
---|
113 | <script type="text/javascript"> |
---|
114 | jQuery(document).ready(function() { |
---|
115 | jQuery('.traceback').hide(); |
---|
116 | jQuery("#trck_errors thead tr th:first input[type=checkbox]").click(function() { |
---|
117 | var checkedStatus = this.checked; |
---|
118 | jQuery("#trck_errors tbody tr td:first-child input[type=checkbox]").each(function() { |
---|
119 | this.checked = checkedStatus; |
---|
120 | }); |
---|
121 | }); |
---|
122 | }); |
---|
123 | </script> |
---|
124 | <!-- end "errors" block --> |
---|