Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 14 matching lines...) Expand all Loading... | |
| 25 --> | 25 --> |
| 26 | 26 |
| 27 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html"> | 27 <link rel="import" href="/res/imp/bower_components/iron-flex-layout/iron-flex-la yout-classes.html"> |
| 28 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> | 28 <link rel="import" href="/res/imp/bower_components/polymer/polymer.html"> |
| 29 | 29 |
| 30 <link rel="import" href="/res/imp/common/dynamic-table-behavior.html"> | 30 <link rel="import" href="/res/imp/common/dynamic-table-behavior.html"> |
| 31 <link rel="import" href="/res/imp/common/error-toast.html"> | 31 <link rel="import" href="/res/imp/common/error-toast.html"> |
| 32 <link rel="import" href="/res/imp/common/sort-toggle.html"> | 32 <link rel="import" href="/res/imp/common/sort-toggle.html"> |
| 33 <link rel="import" href="/res/imp/common/swarming-app.html"> | 33 <link rel="import" href="/res/imp/common/swarming-app.html"> |
| 34 <link rel="import" href="/res/imp/common/url-param.html"> | 34 <link rel="import" href="/res/imp/common/url-param.html"> |
| 35 <link rel="import" href="/res/imp/common/pageable-data.html"> | |
| 35 | 36 |
| 36 <link rel="import" href="bot-filters.html"> | 37 <link rel="import" href="bot-filters.html"> |
| 37 <link rel="import" href="bot-list-data.html"> | 38 <link rel="import" href="bot-list-data.html"> |
| 38 <link rel="import" href="bot-list-shared-behavior.html"> | 39 <link rel="import" href="bot-list-shared-behavior.html"> |
| 39 <link rel="import" href="bot-list-summary.html"> | 40 <link rel="import" href="bot-list-summary.html"> |
| 40 | 41 |
| 41 <dom-module id="bot-list"> | 42 <dom-module id="bot-list"> |
| 42 <template> | 43 <template> |
| 43 <style include="iron-flex iron-flex-alignment iron-positioning swarming-app- style dynamic-table-style"> | 44 <style include="iron-flex iron-flex-alignment iron-positioning swarming-app- style dynamic-table-style"> |
| 44 bot-filters, bot-list-summary { | 45 bot-filters, bot-list-summary { |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 60 <url-param name="s" | 61 <url-param name="s" |
| 61 value="{{_sortstr}}" | 62 value="{{_sortstr}}" |
| 62 default_value="id:asc"> | 63 default_value="id:asc"> |
| 63 </url-param> | 64 </url-param> |
| 64 | 65 |
| 65 <swarming-app | 66 <swarming-app |
| 66 client_id="[[client_id]]" | 67 client_id="[[client_id]]" |
| 67 auth_headers="{{_auth_headers}}" | 68 auth_headers="{{_auth_headers}}" |
| 68 signed_in="{{_signed_in}}" | 69 signed_in="{{_signed_in}}" |
| 69 | 70 |
| 70 busy="[[_busy]]" | 71 busy="[[_or(_busy1,_busy2)]]" |
| 71 name="Swarming Bot List"> | 72 name="Swarming Bot List"> |
| 72 | 73 |
| 73 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> | 74 <h2 hidden$="[[_signed_in]]">You must sign in to see anything useful.</h2> |
| 74 | 75 |
| 75 <div hidden$="[[_not(_signed_in)]]"> | 76 <div hidden$="[[_not(_signed_in)]]"> |
| 76 | 77 |
| 77 <div class="horizontal layout"> | 78 <div class="horizontal layout"> |
| 78 | 79 |
| 79 <bot-filters | 80 <bot-filters |
| 80 dimensions="[[_dimensions]]" | 81 dimensions="[[_dimensions]]" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 91 columns="[[_columns]]" | 92 columns="[[_columns]]" |
| 92 fleet="[[_fleet]]" | 93 fleet="[[_fleet]]" |
| 93 filtered_bots="[[_filteredSortedItems]]" | 94 filtered_bots="[[_filteredSortedItems]]" |
| 94 sort="[[_sortstr]]" | 95 sort="[[_sortstr]]" |
| 95 verbose="[[_verbose]]"> | 96 verbose="[[_verbose]]"> |
| 96 </bot-list-summary> | 97 </bot-list-summary> |
| 97 | 98 |
| 98 </div> | 99 </div> |
| 99 | 100 |
| 100 <bot-list-data | 101 <bot-list-data |
| 102 id="data" | |
| 101 auth_headers="[[_auth_headers]]" | 103 auth_headers="[[_auth_headers]]" |
| 102 query_params="[[_query_params]]" | 104 query_params="[[_query_params]]" |
| 103 | 105 |
| 104 bots="{{_items}}" | 106 busy="{{_busy1}}" |
| 105 busy="{{_busy}}" | |
| 106 dimensions="{{_dimensions}}" | 107 dimensions="{{_dimensions}}" |
| 107 fleet="{{_fleet}}" | 108 fleet="{{_fleet}}" |
| 108 primary_map="{{_primary_map}}" | 109 primary_map="{{_primary_map}}" |
| 109 primary_arr="{{_primary_arr}}"> | 110 primary_arr="{{_primary_arr}}"> |
| 110 </bot-list-data> | 111 </bot-list-data> |
| 111 | 112 |
| 112 <table class="bot-list"> | 113 <table class="bot-list"> |
| 113 <thead on-sort_change="_sortChange"> | 114 <thead on-sort_change="_sortChange"> |
| 114 <!-- To allow for dynamic columns without having a lot of copy-pasted | 115 <!-- To allow for dynamic columns without having a lot of copy-pasted |
| 115 code, we break columns up into "special" and "plain" columns. Special | 116 code, we break columns up into "special" and "plain" columns. Special |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 as="c"> | 200 as="c"> |
| 200 <td hidden$="[[_hide(c)]]"> | 201 <td hidden$="[[_hide(c)]]"> |
| 201 [[_deviceColumn(c, device, _verbose)]] | 202 [[_deviceColumn(c, device, _verbose)]] |
| 202 </td> | 203 </td> |
| 203 </template> | 204 </template> |
| 204 </tr> | 205 </tr> |
| 205 </template> <!--devices repeat--> | 206 </template> <!--devices repeat--> |
| 206 </template> <!--bot-table repeat--> | 207 </template> <!--bot-table repeat--> |
| 207 </tbody> | 208 </tbody> |
| 208 </table> | 209 </table> |
| 210 <pageable-data | |
| 211 id="page_bots" | |
| 212 busy="{{_busy2}}" | |
| 213 label="Show more bots" | |
| 214 output="{{_items}}" | |
| 215 parse="[[_parseBots]]"> | |
| 216 </pageable-data> | |
| 209 </div> | 217 </div> |
| 210 | 218 |
| 211 <error-toast></error-toast> | 219 <error-toast></error-toast> |
| 212 </swarming-app> | 220 </swarming-app> |
| 213 | 221 |
| 214 </template> | 222 </template> |
| 215 <script> | 223 <script> |
| 216 (function(){ | 224 (function(){ |
| 217 var UNKNOWN = "unknown"; | 225 var UNKNOWN = "unknown"; |
| 218 // see dynamic-table for more information on specialColumns, headerMap, | 226 // see dynamic-table for more information on specialColumns, headerMap, |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 449 behaviors: [ | 457 behaviors: [ |
| 450 SwarmingBehaviors.BotListBehavior, | 458 SwarmingBehaviors.BotListBehavior, |
| 451 SwarmingBehaviors.DynamicTableBehavior, | 459 SwarmingBehaviors.DynamicTableBehavior, |
| 452 ], | 460 ], |
| 453 | 461 |
| 454 properties: { | 462 properties: { |
| 455 client_id: { | 463 client_id: { |
| 456 type: String, | 464 type: String, |
| 457 }, | 465 }, |
| 458 | 466 |
| 467 _busy1: { | |
| 468 type: Boolean, | |
| 469 value: false | |
| 470 }, | |
| 471 _busy2: { | |
| 472 type: Boolean, | |
| 473 value: false | |
| 474 }, | |
| 475 _parseBots: { | |
| 476 type: Function, | |
| 477 value: function() { | |
| 478 return this.$.data.parseBots.bind(this); | |
| 479 } | |
| 480 }, | |
| 481 | |
| 459 // For dynamic table. | 482 // For dynamic table. |
| 460 _columnMap: { | 483 _columnMap: { |
| 461 type: Object, | 484 type: Object, |
| 462 value: function() { | 485 value: function() { |
| 463 var base = this._commonColumns(); | 486 var base = this._commonColumns(); |
| 464 for (var attr in columnMap) { | 487 for (var attr in columnMap) { |
| 465 base[attr] = columnMap[attr]; | 488 base[attr] = columnMap[attr]; |
| 466 } | 489 } |
| 467 return base; | 490 return base; |
| 468 }, | 491 }, |
| 469 }, | 492 }, |
| 470 _headerMap: { | 493 _headerMap: { |
| 471 type: Object, | 494 type: Object, |
| 472 value: headerMap, | 495 value: headerMap, |
| 473 }, | 496 }, |
| 474 _specialColumns: { | 497 _specialColumns: { |
| 475 type: Array, | 498 type: Array, |
| 476 value: specialColumns, | 499 value: specialColumns, |
| 477 }, | 500 }, |
| 478 _specialSort: { | 501 _specialSort: { |
| 479 type: Object, | 502 type: Object, |
| 480 value: specialSort, | 503 value: specialSort, |
| 481 }, | 504 }, |
| 505 }, | |
| 482 | 506 |
| 483 }, | 507 observers:["reload(_query_params,_auth_headers)"], |
| 484 | 508 |
| 485 _botClass: function(bot) { | 509 _botClass: function(bot) { |
| 486 if (bot.is_dead) { | 510 if (bot.is_dead) { |
| 487 return "dead"; | 511 return "dead"; |
| 488 } | 512 } |
| 489 if (bot.quarantined) { | 513 if (bot.quarantined) { |
| 490 return "quarantined"; | 514 return "quarantined"; |
| 491 } | 515 } |
| 492 return ""; | 516 return ""; |
| 493 }, | 517 }, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 507 return f.bind(this)(device); | 531 return f.bind(this)(device); |
| 508 }, | 532 }, |
| 509 | 533 |
| 510 _deviceClass: function(device) { | 534 _deviceClass: function(device) { |
| 511 if (!device.okay) { | 535 if (!device.okay) { |
| 512 return "bad-device"; | 536 return "bad-device"; |
| 513 } | 537 } |
| 514 return ""; | 538 return ""; |
| 515 }, | 539 }, |
| 516 | 540 |
| 541 reload: function() { | |
|
stephana
2016/10/03 17:34:57
Should be _reload, unless reload is exposed by the
kjlubick
2016/10/03 18:03:01
renamed _reload
| |
| 542 if (!this._auth_headers || !this._query_params) { | |
| 543 return; | |
| 544 } | |
| 545 var url = "/_ah/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this ._query_params); | |
| 546 this.$.page_bots.load(url,this._auth_headers); | |
| 547 } | |
| 548 | |
| 517 }); | 549 }); |
| 518 })(); | 550 })(); |
| 519 </script> | 551 </script> |
| 520 </dom-module> | 552 </dom-module> |
| OLD | NEW |