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

Side by Side Diff: appengine/swarming/elements/res/imp/tasklist/task-list.html

Issue 2404883002: Add links to MP and resolve minor fixes (Closed)
Patch Set: Fix test Created 4 years, 2 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
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-list> 9 <task-list>
10 10
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 <url-param name="s" 57 <url-param name="s"
58 value="{{_sortstr}}" 58 value="{{_sortstr}}"
59 default_value="created_ts:desc"> 59 default_value="created_ts:desc">
60 </url-param> 60 </url-param>
61 61
62 <swarming-app 62 <swarming-app
63 client_id="[[client_id]]" 63 client_id="[[client_id]]"
64 auth_headers="{{_auth_headers}}" 64 auth_headers="{{_auth_headers}}"
65 permissions="{{_permissions}}" 65 permissions="{{_permissions}}"
66 signed_in="{{_signed_in}}" 66 signed_in="{{_signed_in}}"
67 server_details="{{_server_details}}"
67 busy="[[_or(_busy1,_busy2)]]" 68 busy="[[_or(_busy1,_busy2)]]"
68 name="Swarming Task List"> 69 name="Swarming Task List">
69 70
70 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> 71 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2>
71 72
72 <div hidden$="[[_not(_signed_in)]]"> 73 <div hidden$="[[_not(_signed_in)]]">
73 <task-list-data 74 <task-list-data
74 id="data" 75 id="data"
75 auth_headers="[[_auth_headers]]" 76 auth_headers="[[_auth_headers]]"
76 query_params="[[_query_params]]" 77 query_params="[[_query_params]]"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 class="center" 198 class="center"
198 href$="[[_taskLink(task.deduped_from)]]" 199 href$="[[_taskLink(task.deduped_from)]]"
199 target="_blank"> 200 target="_blank">
200 [[_column('deduped_from',task)]] 201 [[_column('deduped_from',task)]]
201 </a> 202 </a>
202 </td> 203 </td>
203 204
204 <td hidden$="[[_hide('sk_revision', _columns.*)]]"> 205 <td hidden$="[[_hide('sk_revision', _columns.*)]]">
205 <a 206 <a
206 class="center" 207 class="center"
207 href$="[[_skLink(task)]]" 208 href$="[[_skLink(task, _server_details.sk_revision_prefix) ]]"
208 target="_blank"> 209 target="_blank">
209 [[_column('sk_revision',task)]] 210 [[_column('sk_revision',task)]]
210 </a> 211 </a>
211 </td> 212 </td>
212 213
213 <template 214 <template
214 is="dom-repeat" 215 is="dom-repeat"
215 items="[[_plainColumns]]" 216 items="[[_plainColumns]]"
216 as="c"> 217 as="c">
217 <td hidden$="[[_hide(c)]]"> 218 <td hidden$="[[_hide(c)]]">
(...skipping 23 matching lines...) Expand all
241 <paper-button dialog-dismiss autofocus>No</paper-button> 242 <paper-button dialog-dismiss autofocus>No</paper-button>
242 <paper-button dialog-confirm>Yes</paper-button> 243 <paper-button dialog-confirm>Yes</paper-button>
243 </div> 244 </div>
244 </paper-dialog> 245 </paper-dialog>
245 246
246 <error-toast></error-toast> 247 <error-toast></error-toast>
247 248
248 </template> 249 </template>
249 <script> 250 <script>
250 (function(){ 251 (function(){
251 var specialColumns = ["deduped_from", "name", "state", "bot"]; 252 var specialColumns = ["deduped_from", "name", "state", "bot", "sk_revision"] ;
252 253
253 // Given a time attribute like "abandoned_ts", humanTime returns a function 254 // Given a time attribute like "abandoned_ts", humanTime returns a function
254 // that returns the human-friendly version of that attribute. The human 255 // that returns the human-friendly version of that attribute. The human
255 // friendly time was created in task-list-data. 256 // friendly time was created in task-list-data.
256 function humanTime(attr) { 257 function humanTime(attr) {
257 return function(task) { 258 return function(task) {
258 return this._attribute(task, "human_" + attr)[0]; 259 return this._attribute(task, "human_" + attr)[0];
259 } 260 }
260 } 261 }
261 var columnMap = { 262 var columnMap = {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 }, 416 },
416 417
417 reload: function() { 418 reload: function() {
418 if (!this._auth_headers || !this._query_params) { 419 if (!this._auth_headers || !this._query_params) {
419 return; 420 return;
420 } 421 }
421 var url = "/_ah/api/swarming/v1/tasks/list?" + sk.query.fromParamSet(thi s._query_params); 422 var url = "/_ah/api/swarming/v1/tasks/list?" + sk.query.fromParamSet(thi s._query_params);
422 this.$.page_tasks.load(url,this._auth_headers); 423 this.$.page_tasks.load(url,this._auth_headers);
423 }, 424 },
424 425
425 _skLink: function(task) { 426 _skLink: function(task, sk_revision_prefix) {
426 var r = this._attribute(task, "sk_revision")[0]; 427 var r = this._attribute(task, "sk_revision")[0];
427 if (r === "none") { 428 if (r === "none" || !sk_revision_prefix) {
428 return false; 429 return false;
429 } 430 }
430 return "https://skia.googlesource.com/skia/+/" + r; 431 return sk_revision_prefix + r;
431 }, 432 },
432 433
433 _tag: function(task, col) { 434 _tag: function(task, col) {
434 if (!task || !task.tagMap) { 435 if (!task || !task.tagMap) {
435 return undefined; 436 return undefined;
436 } 437 }
437 return task.tagMap[col]; 438 return task.tagMap[col];
438 }, 439 },
439 440
440 _taskClass: function(task) { 441 _taskClass: function(task) {
441 return this.stateClass(this._column("state", task)); 442 return this.stateClass(this._column("state", task));
442 } 443 }
443 }); 444 });
444 })(); 445 })();
445 </script> 446 </script>
446 </dom-module> 447 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698