OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from datetime import datetime | 5 from datetime import datetime |
6 from datetime import time | 6 from datetime import time |
7 from datetime import timedelta | 7 from datetime import timedelta |
8 import json | 8 import json |
9 | 9 |
10 from common import time_util | 10 from common import time_util |
11 from common.base_handler import BaseHandler | 11 from common.base_handler import BaseHandler, Permission |
12 from common.base_handler import Permission | |
13 from model.wf_try_job_data import WfTryJobData | 12 from model.wf_try_job_data import WfTryJobData |
14 | 13 |
15 | 14 |
16 NOT_AVAILABLE = 'N/A' | 15 NOT_AVAILABLE = 'N/A' |
17 | 16 |
18 | 17 |
19 def _FormatDuration(start_time, end_time): | 18 def _FormatDuration(start_time, end_time): |
20 if not start_time or not end_time: | 19 if not start_time or not end_time: |
21 return NOT_AVAILABLE | 20 return NOT_AVAILABLE |
22 return time_util.FormatTimedelta(end_time - start_time) | 21 return time_util.FormatTimedelta(end_time - start_time) |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 'end_date': time_util.FormatDatetime(end_date), | 124 'end_date': time_util.FormatDatetime(end_date), |
126 'try_jobs_in_progress': try_jobs_in_progress, | 125 'try_jobs_in_progress': try_jobs_in_progress, |
127 'try_jobs_with_error': try_jobs_with_error, | 126 'try_jobs_with_error': try_jobs_with_error, |
128 'successfully_completed_try_jobs': successfully_completed_try_jobs | 127 'successfully_completed_try_jobs': successfully_completed_try_jobs |
129 } | 128 } |
130 | 129 |
131 return { | 130 return { |
132 'template': 'try_job_dashboard.html', | 131 'template': 'try_job_dashboard.html', |
133 'data': data | 132 'data': data |
134 } | 133 } |
OLD | NEW |