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

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

Issue 2359243004: Minor improvements of task list (Closed) Base URL: git@github.com:luci/luci-py@task-list
Patch Set: fix-merge 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 not of much use, so we'll ignore it in _hide() and use this._colum ns. 113 not of much use, so we'll ignore it in _hide() and use this._colum ns.
114 --> 114 -->
115 <th hidden$="[[_hide('state', _columns.*)]]"> 115 <th hidden$="[[_hide('state', _columns.*)]]">
116 <span>State</span> 116 <span>State</span>
117 <sort-toggle 117 <sort-toggle
118 name="state" 118 name="state"
119 current="[[_sort]]"> 119 current="[[_sort]]">
120 </sort-toggle> 120 </sort-toggle>
121 </th> 121 </th>
122 122
123 <th hidden$="[[_hide('bot', _columns.*)]]">
124 <span>Bot Assigned</span>
125 <sort-toggle
126 name="bot"
127 current="[[_sort]]">
128 </sort-toggle>
129 </th>
130
123 <th hidden$="[[_hide('deduped_from', _columns.*)]]"> 131 <th hidden$="[[_hide('deduped_from', _columns.*)]]">
124 <span>Deduped from</span> 132 <span>Deduped from</span>
125 <sort-toggle 133 <sort-toggle
126 name="deduped_from" 134 name="deduped_from"
127 current="[[_sort]]"> 135 current="[[_sort]]">
128 </sort-toggle> 136 </sort-toggle>
129 </th> 137 </th>
130 138
131 <template 139 <template
132 is="dom-repeat" 140 is="dom-repeat"
(...skipping 28 matching lines...) Expand all
161 </td> 169 </td>
162 <td hidden$="[[_hide('state', _columns.*)]]"> 170 <td hidden$="[[_hide('state', _columns.*)]]">
163 [[_column('state', task)]] 171 [[_column('state', task)]]
164 <paper-button 172 <paper-button
165 raised 173 raised
166 hidden$="[[_cannotCancel(task,_permissions)]]" 174 hidden$="[[_cannotCancel(task,_permissions)]]"
167 on-tap="_promptCancel"> 175 on-tap="_promptCancel">
168 Cancel 176 Cancel
169 </paper-button> 177 </paper-button>
170 </td> 178 </td>
179 <td hidden$="[[_hide('bot', _columns.*)]]">
180 <a
181 class="center"
182 href$="[[_botLink(task.bot_id)]]"
183 target="_blank">
184 [[_column('bot',task)]]
185 </a>
186 </td>
171 <td hidden$="[[_hide('deduped_from', _columns.*)]]"> 187 <td hidden$="[[_hide('deduped_from', _columns.*)]]">
172 <a 188 <a
173 class="center" 189 class="center"
174 href$="[[_taskLink(task.deduped_from)]]" 190 href$="[[_taskLink(task.deduped_from)]]"
175 target="_blank"> 191 target="_blank">
176 [[_column('deduped_from',task)]] 192 [[_column('deduped_from',task)]]
177 </a> 193 </a>
178 </td> 194 </td>
179 195
180 <template 196 <template
(...skipping 20 matching lines...) Expand all
201 <paper-button dialog-dismiss autofocus>No</paper-button> 217 <paper-button dialog-dismiss autofocus>No</paper-button>
202 <paper-button dialog-confirm>Yes</paper-button> 218 <paper-button dialog-confirm>Yes</paper-button>
203 </div> 219 </div>
204 </paper-dialog> 220 </paper-dialog>
205 221
206 <error-toast></error-toast> 222 <error-toast></error-toast>
207 223
208 </template> 224 </template>
209 <script> 225 <script>
210 (function(){ 226 (function(){
211 var specialColumns = ["deduped_from", "name", "state"]; 227 var specialColumns = ["deduped_from", "name", "state", "bot"];
212 228
213 // Given a time attribute like "abandoned_ts", humanTime returns a function 229 // Given a time attribute like "abandoned_ts", humanTime returns a function
214 // that returns the human-friendly version of that attribute. The human 230 // that returns the human-friendly version of that attribute. The human
215 // friendly time was created in task-list-data. 231 // friendly time was created in task-list-data.
216 function humanTime(attr) { 232 function humanTime(attr) {
217 return function(task) { 233 return function(task) {
218 return this._attribute(task, "human_" + attr)[0]; 234 return this._attribute(task, "human_" + attr)[0];
219 } 235 }
220 } 236 }
221 var columnMap = { 237 var columnMap = {
222 abandoned_ts: humanTime("abandoned_ts"), 238 abandoned_ts: humanTime("abandoned_ts"),
239 bot: function(task) {
240 return this._attribute(task, "bot_id")[0];
241 },
223 completed_ts: humanTime("completed_ts"), 242 completed_ts: humanTime("completed_ts"),
224 costs_usd: function(task) { 243 costs_usd: function(task) {
225 return this._attribute(task, "costs_usd", 0)[0]; 244 return this._attribute(task, "costs_usd", 0)[0];
226 }, 245 },
227 created_ts: humanTime("created_ts"), 246 created_ts: humanTime("created_ts"),
228 duration: humanTime("duration"), 247 duration: humanTime("duration"),
229 modified_ts: humanTime("modified_ts"), 248 modified_ts: humanTime("modified_ts"),
230 started_ts: humanTime("started_ts"), 249 started_ts: humanTime("started_ts"),
231 state: function(task) { 250 state: function(task) {
232 var state = this._attribute(task, "state")[0]; 251 var state = this._attribute(task, "state")[0];
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return task.tagMap[col]; 377 return task.tagMap[col];
359 }, 378 },
360 379
361 _taskClass: function(task) { 380 _taskClass: function(task) {
362 return this.stateClass(this._column("state", task)); 381 return this.stateClass(this._column("state", task));
363 } 382 }
364 }); 383 });
365 })(); 384 })();
366 </script> 385 </script>
367 </dom-module> 386 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698