diff options
author | Dan McGee <dan@archlinux.org> | 2014-11-08 13:43:59 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2014-11-08 13:43:59 -0600 |
commit | eb7172cd4d9d7af690b2be06e3f925d3023be71c (patch) | |
tree | 5ba9d30d7dc1e985e37d58ea0c04548b034ec75c /templates/mirrors/url_details_logs.html.jinja | |
parent | cd22bfd73b184888df13b194ecdf6e482b36c3fc (diff) |
Convert some of URL details to Jinja2
Anytime we have a loop with >100 items, the Django template engine
begins to be the bottleneck. This one is relatively straightforward to
convert, and sets the stage for converting the mirror status page as
well.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'templates/mirrors/url_details_logs.html.jinja')
-rw-r--r-- | templates/mirrors/url_details_logs.html.jinja | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/templates/mirrors/url_details_logs.html.jinja b/templates/mirrors/url_details_logs.html.jinja new file mode 100644 index 00000000..8f7c5644 --- /dev/null +++ b/templates/mirrors/url_details_logs.html.jinja @@ -0,0 +1,28 @@ + <h3>Check Logs</h3> + + <table id="check_logs" class="results"> + <thead> + <tr> + <th>Check Time</th> + <th>Check Location</th> + <th>Check IP</th> + <th>Last Sync</th> + <th>Delay (hh:mm)</th> + <th>Duration (s)</th> + <th>Success?</th> + <th>Error Message</th> + </tr> + </thead> + <tbody> + {% for log in logs %}<tr class="{{ loop.cycle('odd', 'even') }}"> + <td>{{ log.check_time|date('Y-m-d H:i') }}</td> + <td class="country">{{ country_flag(log.location.country) }}{{ log.location.country.name }}</td> + <td>{{ log.location.source_ip }}</td> + <td>{{ log.last_sync|date('Y-m-d H:i') }}</td> + <td>{{ log.delay()|duration }}</td> + <td>{{ log.duration|floatvalue }}</td> + <td>{{ log.is_success|yesno|capfirst }}</td> + <td class="wrap">{{ log.error|linebreaksbr }}</td> + </tr>{% endfor %} + </tbody> + </table> |