Changeset 83956 in webkit


Ignore:
Timestamp:
Apr 15, 2011 12:54:27 AM (13 years ago)
Author:
eric@webkit.org
Message:

2011-04-15 Eric Seidel <eric@webkit.org>

Reviewed by Mihai Parparita.

queues.webkit.org should display when a bot last rebooted
https://bugs.webkit.org/show_bug.cgi?id=58562

There is more repeated code here than I would like. I fear
my django-fu isn't quite up to snuff.

  • QueueStatusServer/handlers/queuestatus.py:
  • QueueStatusServer/templates/queuestatus.html:
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r83946 r83956  
     12011-04-15  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Mihai Parparita.
     4
     5        queues.webkit.org should display when a bot last rebooted
     6        https://bugs.webkit.org/show_bug.cgi?id=58562
     7
     8        There is more repeated code here than I would like.  I fear
     9        my django-fu isn't quite up to snuff.
     10
     11        * QueueStatusServer/handlers/queuestatus.py:
     12        * QueueStatusServer/templates/queuestatus.html:
     13
    1142011-04-14  Alok Priyadarshi  <alokp@chromium.org>
    215
  • trunk/Tools/QueueStatusServer/handlers/queuestatus.py

    r83881 r83956  
    6464        return statuses.order("-date").fetch(15)
    6565
    66     def _fetch_last_pass(self, queue, bot_id):
     66    def _fetch_last_message_matching(self, queue, bot_id, message):
    6767        statuses = queuestatus.QueueStatus.all()
    6868        statuses = statuses.filter("queue_name =", queue.name())
    6969        if bot_id:
    7070            statuses.filter("bot_id =", bot_id)
    71         statuses.filter("message =", "Pass")
     71        statuses.filter("message =", message)
    7272        return statuses.order("-date").get()
    7373
     
    8686
    8787        statuses = self._fetch_statuses(queue, bot_id)
    88         last_pass = self._fetch_last_pass(queue, bot_id)
    8988        template_values = {
    9089            "page_title": self._page_title(queue, bot_id),
     
    9291            "status_groups": self._build_status_groups(statuses),
    9392            "bot_id": bot_id,
    94             "last_pass": last_pass,
     93            "last_pass": self._fetch_last_message_matching(queue, bot_id, "Pass"),
     94            "last_boot": self._fetch_last_message_matching(queue, bot_id, "Starting Queue"),
    9595        }
    9696        self.response.out.write(template.render("templates/queuestatus.html", template_values))
  • trunk/Tools/QueueStatusServer/templates/queuestatus.html

    r83881 r83956  
    88<h1>{{ page_title }}</h1>
    99
    10 {% if last_pass %}
    1110<h3>Summary</h3>
    12 <div>Last Pass: {{ last_pass.date|timesince }} ago</div>
     11<div>
     12Last Pass: {{ last_pass.date|timesince }} ago
     13{% if not bot_id and last_pass.bot_id %}
     14by <a href="/queue-status/{{last_pass.queue_name}}/bots/{{last_pass.bot_id}}">{{ last_pass.bot_id }}</a>
    1315{% endif %}
     16</div>
     17<div>
     18Last Boot: {{ last_boot.date|timesince }} ago
     19{% if not bot_id and last_boot.bot_id %}
     20by <a href="/queue-status/{{last_boot.queue_name}}/bots/{{last_boot.bot_id}}">{{ last_boot.bot_id }}</a>
     21{% endif %}
     22</div>
    1423
    1524<h3>Recent Status</h3>
Note: See TracChangeset for help on using the changeset viewer.