1 | {{extend 'default.mobile/layout.html'}} |
---|
2 | {{import os, stat, time}} |
---|
3 | |
---|
4 | {{block sectionclass}}errors{{end}} |
---|
5 | |
---|
6 | <style> |
---|
7 | table.sortable { |
---|
8 | border-spacing:0px; |
---|
9 | } |
---|
10 | table.sortable td, table.sortable th { |
---|
11 | padding: 2px 5px 2px 5px; |
---|
12 | } |
---|
13 | table.sortable thead { |
---|
14 | background-color:#eee; |
---|
15 | color:#666666; |
---|
16 | font-weight: bold; |
---|
17 | cursor: default; |
---|
18 | } |
---|
19 | tr.error_ticket:hover { |
---|
20 | background-color: #eee; |
---|
21 | } |
---|
22 | a.unavailable { |
---|
23 | color: #ff0000; |
---|
24 | } |
---|
25 | </style> |
---|
26 | |
---|
27 | <script language="JavaScript"> |
---|
28 | function check(){ |
---|
29 | for (var i = 0; i < document.myform.elements.length; i++) { |
---|
30 | var e = document.myform.elements[i]; |
---|
31 | if (e.type == 'checkbox') e.checked = true; |
---|
32 | } |
---|
33 | } |
---|
34 | function uncheck(){ |
---|
35 | for (var i = 0; i < document.myform.elements.length; i++) { |
---|
36 | var e = document.myform.elements[i]; |
---|
37 | if (e.type == 'checkbox') e.checked = false; |
---|
38 | } |
---|
39 | } |
---|
40 | jQuery(document).ready(function() { jQuery('.traceback').hide(); }); |
---|
41 | </script> |
---|
42 | {{if db_ready['status'] == False: |
---|
43 | switchurl = db_ready['errmessage'] |
---|
44 | switchbutton = XML("""<a data-role="button" data-inline="true" data-inline="true" href="%(href)s" title="%(title)s" class="unavailable"><span>switch to : db</span></a>""" % dict(href=switchurl, title=db_ready['errmessage'])) |
---|
45 | else: |
---|
46 | switchurl = URL(args=[app, 'dbnew']) |
---|
47 | switchbutton = XML("""<a data-role="button" data-inline="true" data-inline="true" href="%s"><span>switch to : db</span></a>""" % (switchurl)) |
---|
48 | pass}} |
---|
49 | <h2>{{=T('Error logs for "%(app)s"',dict(app=app))}}</h2> |
---|
50 | |
---|
51 | <div> |
---|
52 | <form name="myform" method="post"> |
---|
53 | <div data-role="controlgroup" data-type="horizontal"> |
---|
54 | <input name="CheckAll" value="{{=T('check all')}}" |
---|
55 | onclick="check()" type="button"> |
---|
56 | <input name="CheckAll" value="{{=T('uncheck all')}}" |
---|
57 | onclick="uncheck()" type="button"> |
---|
58 | <input value="{{=T('delete all checked')}}" type="submit"><br><br> |
---|
59 | </div> |
---|
60 | |
---|
61 | {{ if 'new' in method: }} |
---|
62 | {{base_url = 'db' in method and 'ticketdb' or 'ticket' }} |
---|
63 | <h3>{{=T('Click row to expand traceback')}}</h3> |
---|
64 | <p> |
---|
65 | {{if 'db' in method:}} |
---|
66 | source : db |
---|
67 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'new'])}}"><span>switch to : filesystem</span></a> |
---|
68 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'dbold'])}}"><span>lists by ticket</span></a> |
---|
69 | {{else:}} |
---|
70 | source : filesystem |
---|
71 | {{=switchbutton}} |
---|
72 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'old'])}}"><span>lists by ticket</span></a> |
---|
73 | {{pass}} |
---|
74 | </p> |
---|
75 | <table id="trck_errors" class="sortable"> |
---|
76 | <thead> |
---|
77 | <tr> |
---|
78 | <th>{{=T("Delete")}}</th> |
---|
79 | <th>{{=T("Count")}}</th> |
---|
80 | <th>{{=T("File")}}</th> |
---|
81 | <th>{{=T("Error")}}</th> |
---|
82 | <th></th> |
---|
83 | <th></th> |
---|
84 | </tr> |
---|
85 | </thead> |
---|
86 | <tbody> |
---|
87 | {{for e in errors:}} |
---|
88 | <tr class="error_ticket"> |
---|
89 | <td><input type="checkbox" name="delete_{{=e['hash']}}" /></td> |
---|
90 | <td>{{=e['count']}}</td> |
---|
91 | <td>{{=e['causer']}}</td> |
---|
92 | <td>{{=A(e['last_line'],_href="#",_onclick="collapse('%s');"%e['hash'])}}</td> |
---|
93 | <td>+</td> |
---|
94 | <td>{{=A(T('details'),_href=URL(base_url,args=[app,e['ticket']]))}}</td> |
---|
95 | </tr> |
---|
96 | <tr id="{{=e['hash']}}" class="traceback"> |
---|
97 | <td colspan="6"> |
---|
98 | <div> |
---|
99 | {{=CODE(e['pickel']['traceback'])}} |
---|
100 | </div> |
---|
101 | </td> |
---|
102 | </tr> |
---|
103 | {{pass}} |
---|
104 | </tbody> |
---|
105 | </table> |
---|
106 | {{ else: }} |
---|
107 | <h3>{{=T('Click row to view a ticket')}}</h3> |
---|
108 | <p> |
---|
109 | {{if 'db' in method:}} |
---|
110 | source : db |
---|
111 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'old'])}}"><span>switch to : filesystem</span></a> |
---|
112 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'dbnew'])}}"><span>lists by exception</span></a> |
---|
113 | {{else:}} |
---|
114 | source : filesystem |
---|
115 | {{=switchbutton}} |
---|
116 | <a data-role="button" data-inline="true" href="{{=URL(args=[app, 'new'])}}"><span>lists by exception</span></a> |
---|
117 | {{pass}} |
---|
118 | </p> |
---|
119 | <table class="sortable"> |
---|
120 | <thead> |
---|
121 | <tr> |
---|
122 | <th>{{=T("Delete")}}</th> |
---|
123 | <th>{{=T("Ticket")}}</th> |
---|
124 | <th>{{=T("Date and Time")}}</th> |
---|
125 | </tr> |
---|
126 | </thead> |
---|
127 | <tbody> |
---|
128 | {{for ticket in tickets:}} |
---|
129 | <tr> |
---|
130 | <td><input type="checkbox" name="delete_{{=ticket}}"/></td> |
---|
131 | {{if 'db' in method:}} |
---|
132 | <td><a href="{{=URL('ticketdb',args=[app,ticket])}}">{{=ticket}}</a></td> |
---|
133 | <td>{{=time.strftime('%Y-%m-%d %H:%M:%S',times[ticket].timetuple())}}</td> |
---|
134 | {{else:}} |
---|
135 | <td><a href="{{=URL('ticket',args=[app,ticket])}}">{{=ticket}}</a></td> |
---|
136 | <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> |
---|
137 | {{pass}} |
---|
138 | </tr> |
---|
139 | {{pass}} |
---|
140 | </tbody> |
---|
141 | </table> |
---|
142 | {{ pass }} |
---|
143 | </form> |
---|
144 | </div> |
---|
145 | |
---|