~lifeless/python-oops-tools/bug-881400

« back to all changes in this revision

Viewing changes to src/oopstools/oops/templates/oops.html

  • Committer: Robert Collins
  • Date: 2011-10-13 20:18:51 UTC
  • Revision ID: robertc@robertcollins.net-20111013201851-ym8jmdhoeol3p83s
Export of cruft-deleted tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
{% load oops_extras %}
 
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
3
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
  <head>
 
6
    <title>{{ oops.oopsid }}</title>
 
7
    <style type="text/css" media="screen">
 
8
      @import url("/oops/static/oops.css");
 
9
    </style>
 
10
  </head>
 
11
 
 
12
  <body>
 
13
 
 
14
<div id="leftcontent">
 
15
  <ul>
 
16
  <div id="oops">
 
17
    <li>OOPS: <span>{{ oops.oopsid }}</span></li>
 
18
    <li>Filename: <span>{{ oops.pathname }}</span></li>
 
19
    <li>Informational: <span>{{ oops.informational }}</span></li>
 
20
    {% if oops.bug %}
 
21
      <li>Bug: <a href="https://launchpad.net/bugs/{{oops.bug}}">{{ oops.bug }}</a></li>
 
22
    {% else %}
 
23
      <form action="meta" method="post">
 
24
        <input type="text" size="8" name="bug_number" />
 
25
        <input type="hidden" name="oopsid" value="{{ oops.oopsid }}" />
 
26
        <input type="hidden" name="pageid" value="{{ oops.pageid }}" />
 
27
        <input type="hidden" name="date" value="{{ oops.date }}" />
 
28
        <input type="submit" value="Bug #" />
 
29
      </form>
 
30
    {% endif %}
 
31
  </div>
 
32
  <div id="request">
 
33
    <li>HTTP method: <span>{{ oops.http_method }}</span></li>
 
34
    <li>URL: <a href="{{ oops.url }}">{{ oops.url }}</a></li>
 
35
    <li>Referrer: <a href="{{ oops.referrer }}">{{ oops.referrer }}</a></li>
 
36
  </div>
 
37
  <div id="exception">
 
38
    <li>Date: <span>{{ oops.date }}</span></li>
 
39
    <li>Page-id: <span>{{ oops.pageid }}</span></li>
 
40
    {% ifequal oops.oopsinfestation.last_seen_oops.oopsid oops.oopsid %}
 
41
      <li>(This is the most recent instance.) </li>
 
42
    {% else %}
 
43
      <li>Last seen:
 
44
        <span>{{ oops.oopsinfestation.last_seen_oops.date }}</span>
 
45
        <a href="/oops/?oopsid={{ oops.oopsinfestation.last_seen_oops.oopsid }}">
 
46
           {{ oops.oopsinfestation.last_seen_oops.oopsid }}
 
47
        </a>
 
48
      </li>
 
49
    {% endifequal %}
 
50
    <li>Past week count: <span>{{ oops.oopsinfestation.past_week_count }}</span></li>
 
51
  </div>
 
52
    <!--! XXX: link the user to Launchpad profile, if anonymous no link-->
 
53
  <div id="person">
 
54
    <li>User: <span>{{ oops.user }}</span></li>
 
55
    <li>DB id: <span>{{ oops.user_db_id }}</span></li>
 
56
    <!--! XXX: using LP api retrieve this user karma -->
 
57
  </div>
 
58
  <div id="branch">
 
59
    <li>Branch: <span>{{ oops.branch_nick }}</span></li>
 
60
    <li>Revno: <span>{{ oops.revno }}</span></li>
 
61
  </div>
 
62
  <div id="database">
 
63
    <li>SQL time: <span>{{ oops.accumulated_time }}</span> ms</li>
 
64
    <li>Non-sql time: <span>{{ oops.total_non_sql_time }}</span> ms</li>
 
65
    <li>Total time: <span>{{ oops.total_time }}</span> ms</li>
 
66
    <li>Statement Count: <span>{{ oops.statements_count }}</span></li>
 
67
  </div>
 
68
  <div id="toc">
 
69
    <li><a href="#requestvars">Request variables</a></li>
 
70
    <li><a href="#longstatements">Long SQL Statements</a></li>
 
71
    <li><a href="#repeatedstatements">Repeated SQL Statements</a></li>
 
72
    <li><a href="#statementlog">SQL statement log</a></li>
 
73
  </div>
 
74
  </ul>
 
75
</div>
 
76
 
 
77
<div id="main">
 
78
  <div id="traceback">
 
79
    <h3><a name="top"></a>Traceback</h3>
 
80
  <!--! XXX: find a way to fold the traceback if more than X lines -->
 
81
    <pre class="listing traceback">
 
82
  <span>{{ oops.exception_type }}</span>: <span>{{oops.exception_value}}</span>
 
83
 
 
84
    <span>{{ oops.traceback }}</span>
 
85
    </pre>
 
86
  </div>
 
87
  <hr />
 
88
  <div id="request_variables">
 
89
    <h3>
 
90
      <a name="requestvars"></a>Request Variables
 
91
      <a class="top" href="#top">top</a>
 
92
    </h3>
 
93
      <ul>
 
94
        {% for key, value in oops.req_vars %}
 
95
          <li>{{key}}: {{value}}</li>
 
96
        {% endfor %}
 
97
      </ul>
 
98
  </div>
 
99
 
 
100
  <hr />
 
101
  <h3>
 
102
    <a name="longstatements"></a>Long SQL Statements (Shows up to five statements)
 
103
    <a class="top" href="#top">top</a>
 
104
  </h3>
 
105
    <table id="longstatements">
 
106
      <thead>
 
107
        <tr>
 
108
          <th></th>
 
109
          <th>Time</th>
 
110
          <th>Reps</th>
 
111
          <th>Database id</th>
 
112
          <th>Statement</th>
 
113
        </tr>
 
114
      </thead>
 
115
      <tbody>
 
116
        {% for num, total_time, reps, db_id, statement in oops.longest_statements|slice:":5" %}
 
117
          <tr>
 
118
            <td>{{num}}.</td>
 
119
            <td>{{total_time}}</td>
 
120
            <td>{{reps}}</td>
 
121
            <td>{{db_id}}</td>
 
122
            <td><pre>{{statement|format_sql}}</pre></td>
 
123
          </tr>
 
124
        {% endfor %}
 
125
      </tbody>
 
126
    </table>
 
127
  <hr />
 
128
  <h3>
 
129
    <a name="repeatedstatements"></a>Repeated SQL Statements
 
130
    <a class="top" href="#top">top</a>
 
131
  </h3>
 
132
    <table id="repeatedstatements">
 
133
      <thead>
 
134
        <tr>
 
135
          <th />
 
136
          <th>Reps</th>
 
137
          <th>Total time</th>
 
138
          <th>Average time</th>
 
139
          <th>Saving</th>
 
140
          <th>Database id</th>
 
141
          <th>Statement</th>
 
142
        </tr>
 
143
      </thead>
 
144
      <tbody>
 
145
        {% for num, reps, total_time, average, saving, db_id, projected_total_time, statement in oops.repeated_statements %}
 
146
          <tr>
 
147
            <td>{{num}}.</td>
 
148
            <td>{{reps}}</td>
 
149
            <td>{{total_time}}</td>
 
150
            <td>{{average}}</td>
 
151
            <td>{{saving}}</td>
 
152
            <td>{{db_id}}</td>
 
153
            <td><pre>{{statement|format_sql}}</pre></td>
 
154
          </tr>
 
155
        {% endfor %}
 
156
      </tbody>
 
157
    </table>
 
158
    <hr />
 
159
  <h3>
 
160
    <a name="statementlog"></a>SQL Statement Log
 
161
    <a class="top" href="#top">top</a>
 
162
  </h3>
 
163
   <table id="statementlog">
 
164
     <thead>
 
165
       <tr>
 
166
         <th></th>
 
167
         <th>Start</th>
 
168
         <th>Length</th>
 
169
         <th>Database id</th>
 
170
         <th>Statement</th>
 
171
       </tr>
 
172
     </thead>
 
173
     <tbody>
 
174
       {% for num, start, stop, db_id, length, statement in oops.formatted_statements %}
 
175
         <tr>
 
176
           <td>{{num}}.</td>
 
177
           <td>{{start}}</td>
 
178
           <td>{{length}}ms</td>
 
179
           <td>{{db_id}}</td>
 
180
           <td><pre>{{statement|format_sql}}</pre></td>
 
181
         </tr>
 
182
      {% endfor %}
 
183
     </tbody>
 
184
   </table>
 
185
   </div>
 
186
  </body>
 
187
</html>