Chromium Code Reviews| Index: dashboard/dashboard/speed_releasing.py |
| diff --git a/dashboard/dashboard/speed_releasing.py b/dashboard/dashboard/speed_releasing.py |
| index a1ec155ecd5b218bc5abe2880dcb6c65712f756f..accfbeb902a034e45c3caede8111548f45fde3b8 100644 |
| --- a/dashboard/dashboard/speed_releasing.py |
| +++ b/dashboard/dashboard/speed_releasing.py |
| @@ -7,23 +7,40 @@ |
| import json |
| from dashboard.common import request_handler |
| +from dashboard.models import table_config |
| class SpeedReleasingHandler(request_handler.RequestHandler): |
| """Request handler for requests for speed releasing page.""" |
| - def get(self): |
| + def get(self, _): |
| """Renders the UI for the speed releasing page.""" |
| + |
| self.RenderStaticHtml('speed_releasing.html') |
| - def post(self): |
| + def post(self, table_name): |
|
eakuefner
2017/01/11 20:15:48
Also, as I mused about on the other CL, I'm not su
|
| """Returns dynamic data for /speed_releasing. |
| Outputs: |
| JSON for the /speed_releasing page XHR request. |
| """ |
| - values = {} |
| - self.GetDynamicVariables(values) |
| - self.response.out.write(json.dumps({ |
| - 'xsrf_token': values['xsrf_token'], |
| - })) |
| + if table_name: |
| + query = table_config.TableConfig.query( |
| + table_config.TableConfig.name == table_name) |
| + table_values = query.fetch(limit=1) |
| + values = {} |
| + self.GetDynamicVariables(values) |
| + self.response.out.write(json.dumps({ |
| + 'xsrf_token': values['xsrf_token'], |
| + 'table_bots': table_values[0].bots, |
| + 'table_tests': table_values[0].tests, |
| + 'table_layout': table_values[0].table_layout, |
| + })) |
| + else: |
| + values = {} |
| + self.GetDynamicVariables(values) |
| + self.response.out.write(json.dumps({ |
| + 'xsrf_token': values['xsrf_token'], |
| + 'table_bots': 'TODO jessimb, list links for health reports.' |
| + })) |
| + |