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

Side by Side Diff: appengine/swarming/elements/res/imp/botlist/bot-list.html

Issue 2338383002: Refactor prior to adding task-page (Closed) Base URL: git@github.com:luci/luci-py@master
Patch Set: Address nits 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
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 <bot-list> 9 <bot-list>
10 10
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 <tr class$="[[_botClass(bot)]]"> 163 <tr class$="[[_botClass(bot)]]">
164 <td> 164 <td>
165 <a 165 <a
166 class="center" 166 class="center"
167 href$="[[_botLink(bot.bot_id)]]" 167 href$="[[_botLink(bot.bot_id)]]"
168 target="_blank"> 168 target="_blank">
169 [[bot.bot_id]] 169 [[bot.bot_id]]
170 </a> 170 </a>
171 </td> 171 </td>
172 <td hidden$="[[_hide('task', _columns.*)]]"> 172 <td hidden$="[[_hide('task', _columns.*)]]">
173 <a href$="[[_taskLink(bot)]]">[[_taskId(bot)]]</a> 173 <a href$="[[_taskLink(bot.task_id)]]">[[_taskId(bot)]]</a>
174 </td> 174 </td>
175 175
176 <template 176 <template
177 is="dom-repeat" 177 is="dom-repeat"
178 items="[[_plainColumns]]" 178 items="[[_plainColumns]]"
179 as="c"> 179 as="c">
180 <td hidden$="[[_hide(c)]]"> 180 <td hidden$="[[_hide(c)]]">
181 [[_column(c, bot, _verbose)]] 181 [[_column(c, bot, _verbose)]]
182 </td> 182 </td>
183 </template> 183 </template>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 _botClass: function(bot) { 362 _botClass: function(bot) {
363 if (bot.is_dead) { 363 if (bot.is_dead) {
364 return "dead"; 364 return "dead";
365 } 365 }
366 if (bot.quarantined) { 366 if (bot.quarantined) {
367 return "quarantined"; 367 return "quarantined";
368 } 368 }
369 return ""; 369 return "";
370 }, 370 },
371 371
372 _botLink: function(id) {
373 return "/newui/bot?id="+id;
374 },
375
376
377 _androidAliasDevice: function(device) { 372 _androidAliasDevice: function(device) {
378 if (device.notReady) { 373 if (device.notReady) {
379 return UNAUTHENTICATED.toUpperCase(); 374 return UNAUTHENTICATED.toUpperCase();
380 } 375 }
381 return swarming.alias.android(this._deviceType(device)); 376 return swarming.alias.android(this._deviceType(device));
382 }, 377 },
383 378
384 _deviceColumn: function(col, device) { 379 _deviceColumn: function(col, device) {
385 var f = deviceColumnMap[col]; 380 var f = deviceColumnMap[col];
386 if (!f || !device) { 381 if (!f || !device) {
387 return ""; 382 return "";
388 } 383 }
389 return f.bind(this)(device); 384 return f.bind(this)(device);
390 }, 385 },
391 386
392 _deviceClass: function(device) { 387 _deviceClass: function(device) {
393 if (!device.okay) { 388 if (!device.okay) {
394 return "bad-device"; 389 return "bad-device";
395 } 390 }
396 return ""; 391 return "";
397 }, 392 },
398 393
399 _taskLink: function(data) {
400 // TODO(kjlubick): Migrate this to /newui/ when ready
401 if (data && data.task_id) {
402 return "/user/task/" + data.task_id;
403 }
404 return undefined;
405 }
406
407 }); 394 });
408 })(); 395 })();
409 </script> 396 </script>
410 </dom-module> 397 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698