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

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

Issue 2258853002: Midway through extracting filters (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-py@tasklist
Patch Set: Revert gpu stuff and tidy up Created 4 years, 4 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 <url-param name="sort" 59 <url-param name="sort"
60 value="{{_sortstr}}" 60 value="{{_sortstr}}"
61 default_value="id:asc"> 61 default_value="id:asc">
62 </url-param> 62 </url-param>
63 63
64 <swarming-app 64 <swarming-app
65 client_id="[[client_id]]" 65 client_id="[[client_id]]"
66 auth_headers="{{_auth_headers}}" 66 auth_headers="{{_auth_headers}}"
67 signed_in="{{_signed_in}}" 67 signed_in="{{_signed_in}}"
68
69 busy="[[_busy]]" 68 busy="[[_busy]]"
70 name="Swarming Bot List"> 69 name="Swarming Bot List">
71 70
72 <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>
73 72
74 <div hidden$="[[_not(_signed_in)]]"> 73 <div hidden$="[[_not(_signed_in)]]">
75 74
76 <div class="horizontal layout"> 75 <div class="horizontal layout">
77 76
78 <bot-filters 77 <bot-filters
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 return pool.join(" | "); 294 return pool.join(" | ");
296 }, 295 },
297 status: function(bot) { 296 status: function(bot) {
298 // If a bot is both dead and quarantined, show the deadness over the 297 // If a bot is both dead and quarantined, show the deadness over the
299 // quarentinedness. 298 // quarentinedness.
300 if (bot.is_dead) { 299 if (bot.is_dead) {
301 return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) + 300 return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) +
302 " ago"; 301 " ago";
303 } 302 }
304 if (bot.quarantined) { 303 if (bot.quarantined) {
305 return "Quarantined: " + this._attribute(bot, "quarantined"); 304 var msg = this._state(bot, "quarantined")[0];
305 // Sometimes, the quarantined message is actually in "error". This
306 // happens when the bot code has thrown an exception.
307 if (msg === "unknown" || msg === "true" || msg === true) {
308 msg = this._attribute(bot, "error");
309 }
310 return "Quarantined: " + msg;
306 } 311 }
307 return "Alive"; 312 return "Alive";
308 }, 313 },
309 task: function(bot){ 314 task: function(bot){
310 return this._taskId(bot); 315 return this._taskId(bot);
311 }, 316 },
312 }; 317 };
313 318
314 var deviceColumnMap = { 319 var deviceColumnMap = {
315 android_devices: function(device) { 320 android_devices: function(device) {
(...skipping 29 matching lines...) Expand all
345 disk_space: function(dir, botA, botB) { 350 disk_space: function(dir, botA, botB) {
346 // We sort based on the raw number of MB of the first disk. 351 // We sort based on the raw number of MB of the first disk.
347 var botACol = botA.disks[0].mb; 352 var botACol = botA.disks[0].mb;
348 var botBCol = botB.disks[0].mb;; 353 var botBCol = botB.disks[0].mb;;
349 return dir * swarming.naturalCompare(botACol, botBCol); 354 return dir * swarming.naturalCompare(botACol, botBCol);
350 }, 355 },
351 }; 356 };
352 357
353 Polymer({ 358 Polymer({
354 is: 'bot-list', 359 is: 'bot-list',
355 behaviors: [SwarmingBehaviors.BotListBehavior, 360
356 SwarmingBehaviors.DynamicTableBehavior], 361 // The order behaviors are applied in matters - later ones overwrite
362 // attributes of earlier ones
363 behaviors: [
364 SwarmingBehaviors.BotListBehavior,
365 SwarmingBehaviors.DynamicTableBehavior,
366 ],
357 367
358 properties: { 368 properties: {
359 client_id: { 369 client_id: {
360 type: String, 370 type: String,
361 }, 371 },
362 372
363 // For dynamic table. 373 // For dynamic table.
364 _columnMap: { 374 _columnMap: {
365 type: Object, 375 type: Object,
366 value: columnMap, 376 value: columnMap,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 if (data && data.task_id) { 432 if (data && data.task_id) {
423 return "/user/task/" + data.task_id; 433 return "/user/task/" + data.task_id;
424 } 434 }
425 return undefined; 435 return undefined;
426 } 436 }
427 437
428 }); 438 });
429 })(); 439 })();
430 </script> 440 </script>
431 </dom-module> 441 </dom-module>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698