Changeset 52455 in webkit


Ignore:
Timestamp:
Dec 21, 2009 2:12:12 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-21 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

Update status-bubble to show all the queues
https://bugs.webkit.org/show_bug.cgi?id=32838

Also, move statusbubble over to use memcache.

  • QueueStatusServer/handlers/statusbubble.py:
  • QueueStatusServer/templates/statusbubble.html:
Location:
trunk/WebKitTools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r52453 r52455  
     12009-12-21  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        Update status-bubble to show all the queues
     6        https://bugs.webkit.org/show_bug.cgi?id=32838
     7
     8        Also, move statusbubble over to use memcache.
     9
     10        * QueueStatusServer/handlers/statusbubble.py:
     11        * QueueStatusServer/templates/statusbubble.html:
     12
    1132009-12-21  Adam Barth  <abarth@webkit.org>
    214
  • trunk/WebKitTools/QueueStatusServer/handlers/statusbubble.py

    r52396 r52455  
    3030from google.appengine.ext.webapp import template
    3131
    32 from model.queuestatus import QueueStatus
    33 
    34 
    35 # FIXME: This class is wrong.  I'm going to rebuid the functionality correctly
    36 #        for the dashboard and then kill this class.
    37 class StatusSummary(object):
    38     def _status_to_code(self, status):
    39         code_names = {
    40             "Pass": "pass",
    41             "Pending": "pending",
    42             "Fail": "fail",
    43             "Error": "error",
    44         }
    45         return code_names.get(status, "none")
    46 
    47     def _queue_name_to_code(self, queue_name):
    48         code_names = {
    49             "style-queue": "style",
    50         }
    51         return code_names[queue_name]
    52 
    53     queues = [
    54         "style-queue",
    55     ]
    56 
    57     def __init__(self):
    58         self._summary = {}
    59 
    60     def summarize(self, attachment_id):
    61         if self._summary.get(attachment_id):
    62             return self._summary.get(attachment_id)
    63 
    64         attachment_summary = {}
    65         for queue in self.queues:
    66             statuses = QueueStatus.all().filter('queue_name =', queue).filter('active_patch_id =', attachment_id).order('-date').fetch(1)
    67             status_code = self._status_to_code(statuses[0].message if statuses else None)
    68             queue_code = self._queue_name_to_code(queue)
    69             attachment_summary[queue_code] = status_code
    70 
    71         self._summary[attachment_id] = attachment_summary
    72         return attachment_summary
     32from model.attachment import Attachment
    7333
    7434
    7535class StatusBubble(webapp.RequestHandler):
    7636    def get(self, attachment_id):
    77         status_summary = StatusSummary()
     37        attachment = Attachment(int(attachment_id))
     38
    7839        template_values = {
    79             "queue_status" : status_summary.summarize(int(attachment_id)),
     40            "summary" : attachment.summary()
    8041        }
    8142        self.response.out.write(template.render("templates/statusbubble.html", template_values))
  • trunk/WebKitTools/QueueStatusServer/templates/statusbubble.html

    r52396 r52455  
    2020    background-color: #8FDF5F;
    2121    border: 1px solid #4F8530;
     22    cursor: pointer;
    2223}
    2324.fail {
    2425    background-color: #E98080;
    2526    border: 1px solid #A77272;
     27    cursor: pointer;
    2628}
    2729.pending {
    2830    background-color: #FFFC6C;
    2931    border: 1px solid #C5C56D;
     32    cursor: pointer;
     33}
     34.error {
     35  background-color: #E0B0FF;
     36  border: 1px solid #ACA0B3;
     37  cursor: pointer;
    3038}
    3139</style>
     40<script>
     41function statusDetail(patch_id) {
     42  top.location = "/patch/" + patch_id
     43}
     44</script>
    3245</head>
    33 <body>{% for key, value in queue_status.items %}
    34 <div class="status {{value}}" title="{{key}}: {{value}}">{{key}}</div>{% endfor %}
     46<body>
     47<!-- FIXME: Find some way to remove this copy-and-paste code! -->
     48<div class="status {{ summary.style_queue.state }}"{% if summary.style_queue.status %}
     49    onclick="statusDetail({{ summary.attachment_id }})"
     50    title="{{ summary.style_queue.status.date|timesince }}"{% endif %}>
     51  style
     52</div>
     53<div class="status {{ summary.chromium_ews.state }}"{% if summary.chromium_ews.status %}
     54    onclick="statusDetail({{ summary.attachment_id }})"
     55    title="{{ summary.chromium_ews.status.date|timesince }} ago"{% endif %}>
     56  chromium
     57</div>
     58<div class="status {{ summary.qt_ews.state }}"{% if summary.qt_ews.status %}
     59    onclick="statusDetail({{ summary.attachment_id }})"
     60    title="{{ summary.qt_ews.status.date|timesince }} ago"{% endif %}>
     61  qt
     62</div>
     63<div class="status {{ summary.gtk_ews.state }}"{% if summary.gtk_ews.status %}
     64    onclick="statusDetail({{ summary.attachment_id }})"
     65    title="{{ summary.gtk_ews.status.date|timesince }} ago"{% endif %}>
     66  gtk
     67</div>
    3568</body>
    3669</html>
Note: See TracChangeset for help on using the changeset viewer.