Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: appengine/swarming/elements/res/imp/taskpage/task-page-data.html

Issue 2337363004: Add task-page (Closed) Base URL: git@github.com:luci/luci-py@task-data
Patch Set: Alignment take 2 Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/swarming/elements/res/imp/taskpage/task-page.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2016 The LUCI Authors. All rights reserved. 2 Copyright 2016 The LUCI Authors. All rights reserved.
3 Use of this source code is governed under the Apache License, Version 2.0 3 Use of this source code is governed under the Apache License, Version 2.0
4 that can be found in the LICENSE file. 4 that can be found in the LICENSE file.
5 5
6 This in an HTML Import-able file that contains the definition 6 This in an HTML Import-able file that contains the definition
7 of the following elements: 7 of the following elements:
8 8
9 <task-page-data> 9 <task-page-data>
10 10
(...skipping 20 matching lines...) Expand all
31 Methods: 31 Methods:
32 request(): Force a fetch of the data. This happens automatically when 32 request(): Force a fetch of the data. This happens automatically when
33 auth_headers is set or task_id is changed. 33 auth_headers is set or task_id is changed.
34 34
35 Events: 35 Events:
36 None. 36 None.
37 --> 37 -->
38 38
39 39
40 <link rel="import" href="/res/imp/common/common-behavior.html"> 40 <link rel="import" href="/res/imp/common/common-behavior.html">
41 <link rel="import" href="/res/imp/common/task-behavior.html">
41 42
42 <dom-module id="task-page-data"> 43 <dom-module id="task-page-data">
43 <script> 44 <script>
44 (function(){ 45 (function(){
45 // Time to wait before requesting a new task. This is to allow a user to 46 // Time to wait before requesting a new task. This is to allow a user to
46 // type in a name and not have it make one set of requests for each 47 // type in a name and not have it make one set of requests for each
47 // keystroke. 48 // keystroke.
48 var TASK_ID_DEBOUNCE_MS = 400; 49 var TASK_ID_DEBOUNCE_MS = 400;
49 var lastRequest; 50 var lastRequest;
50 51
51 var TIMES = ["abandoned_ts", "completed_ts", "created_ts", "modified_ts", "s tarted_ts"]; 52 var TIMES = ["abandoned_ts", "completed_ts", "created_ts", "modified_ts", "s tarted_ts"];
52 53
53 Polymer({ 54 Polymer({
54 is: 'task-page-data', 55 is: 'task-page-data',
55 56
56 behaviors: [ 57 behaviors: [
57 SwarmingBehaviors.CommonBehavior, 58 SwarmingBehaviors.CommonBehavior,
59 SwarmingBehaviors.TaskBehavior,
58 ], 60 ],
59 61
60 properties: { 62 properties: {
61 // inputs 63 // inputs
62 auth_headers: { 64 auth_headers: {
63 type: Object, 65 type: Object,
64 }, 66 },
65 task_id: { 67 task_id: {
66 type: String, 68 type: String,
67 }, 69 },
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 return {}; 176 return {};
175 } 177 }
176 var now = new Date(); 178 var now = new Date();
177 TIMES.forEach(function(time) { 179 TIMES.forEach(function(time) {
178 if (result[time]) { 180 if (result[time]) {
179 result[time] = new Date(result[time]); 181 result[time] = new Date(result[time]);
180 result["human_"+time] = sk.human.localeTime(result[time]); 182 result["human_"+time] = sk.human.localeTime(result[time]);
181 } 183 }
182 }); 184 });
183 // Running tasks have no duration set, so we can figure it out. 185 // Running tasks have no duration set, so we can figure it out.
184 if (!result.duration && result.state === "RUNNING" && result.started_ts) { 186 if (!result.duration && result.state === this.RUNNING && result.started_ ts){
185 result.duration = (now - result.started_ts) / 1000; 187 result.duration = (now - result.started_ts) / 1000;
186 } 188 }
187 // Make the duration human readable 189 // Make the duration human readable
188 if (result.duration){ 190 if (result.duration){
189 result.human_duration = this._humanDuration(result.duration); 191 result.human_duration = this._humanDuration(result.duration);
190 } 192 }
191 // result.bot_dimensions 193 // result.bot_dimensions
192 if (result.bot_dimensions) { 194 if (result.bot_dimensions) {
193 result.bot_dimensions.forEach(function(dim){ 195 result.bot_dimensions.forEach(function(dim){
194 if (swarming.alias.has(dim.key)) { 196 if (swarming.alias.has(dim.key)) {
(...skipping 11 matching lines...) Expand all
206 if (!stdout || !stdout.output) { 208 if (!stdout || !stdout.output) {
207 return ""; 209 return "";
208 } 210 }
209 return stdout.output; 211 return stdout.output;
210 } 212 }
211 213
212 }); 214 });
213 })(); 215 })();
214 </script> 216 </script>
215 </dom-module> 217 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/elements/res/imp/taskpage/task-page.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698