Changeset 52455 in webkit
- Timestamp:
- Dec 21, 2009 2:12:12 PM (14 years ago)
- Location:
- trunk/WebKitTools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKitTools/ChangeLog
r52453 r52455 1 2009-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 1 13 2009-12-21 Adam Barth <abarth@webkit.org> 2 14 -
trunk/WebKitTools/QueueStatusServer/handlers/statusbubble.py
r52396 r52455 30 30 from google.appengine.ext.webapp import template 31 31 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 32 from model.attachment import Attachment 73 33 74 34 75 35 class StatusBubble(webapp.RequestHandler): 76 36 def get(self, attachment_id): 77 status_summary = StatusSummary() 37 attachment = Attachment(int(attachment_id)) 38 78 39 template_values = { 79 " queue_status" : status_summary.summarize(int(attachment_id)),40 "summary" : attachment.summary() 80 41 } 81 42 self.response.out.write(template.render("templates/statusbubble.html", template_values)) -
trunk/WebKitTools/QueueStatusServer/templates/statusbubble.html
r52396 r52455 20 20 background-color: #8FDF5F; 21 21 border: 1px solid #4F8530; 22 cursor: pointer; 22 23 } 23 24 .fail { 24 25 background-color: #E98080; 25 26 border: 1px solid #A77272; 27 cursor: pointer; 26 28 } 27 29 .pending { 28 30 background-color: #FFFC6C; 29 31 border: 1px solid #C5C56D; 32 cursor: pointer; 33 } 34 .error { 35 background-color: #E0B0FF; 36 border: 1px solid #ACA0B3; 37 cursor: pointer; 30 38 } 31 39 </style> 40 <script> 41 function statusDetail(patch_id) { 42 top.location = "/patch/" + patch_id 43 } 44 </script> 32 45 </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> 35 68 </body> 36 69 </html>
Note: See TracChangeset
for help on using the changeset viewer.