| 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) + | 397 return "Dead. Last seen " + sk.human.diffDate(bot.last_seen_ts) + |
| 398 " ago"; | 398 " ago"; |
| 399 } | 399 } |
| 400 if (bot.quarantined) { | 400 if (bot.quarantined) { |
| 401 var msg = this._state(bot, "quarantined")[0]; | 401 var msg = this._state(bot, "quarantined")[0]; |
| 402 // Sometimes, the quarantined message is actually in "error". This | 402 // Sometimes, the quarantined message is actually in "error". This |
| 403 // happens when the bot code has thrown an exception. | 403 // happens when the bot code has thrown an exception. |
| 404 if (msg === UNKNOWN || msg === "true" || msg === true) { | 404 if (msg === UNKNOWN || msg === "true" || msg === true) { |
| 405 msg = this._attribute(bot, "error"); | 405 msg = this._attribute(bot, "error"); |
| 406 } | 406 } |
| 407 var errs = []; |
| 408 // Show all the errors that are active on devices to make it more |
| 409 // clear if this is a transient error (e.g. device is too hot) |
| 410 // or if it is requires human interaction (e.g. device is unauthorized
) |
| 411 this._devices(bot).forEach(function(d){ |
| 412 if (d.state !== "available") { |
| 413 errs.push(d.state); |
| 414 } |
| 415 }); |
| 416 if (errs.length) { |
| 417 msg += " ["+errs.join(",")+"]"; |
| 418 } |
| 407 return "Quarantined: " + msg; | 419 return "Quarantined: " + msg; |
| 408 } | 420 } |
| 409 return "Alive"; | 421 return "Alive"; |
| 410 }, | 422 }, |
| 411 task: function(bot) { | 423 task: function(bot) { |
| 412 return this._taskId(bot); | 424 return this._taskId(bot); |
| 413 }, | 425 }, |
| 414 uptime: function(bot) { | 426 uptime: function(bot) { |
| 415 var u = this._state(bot, "uptime"); | 427 var u = this._state(bot, "uptime"); |
| 416 if (!u) { | 428 if (!u) { |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 return; | 699 return; |
| 688 } | 700 } |
| 689 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu
ery_params); | 701 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu
ery_params); |
| 690 this.$.page_bots.load(url,this._auth_headers); | 702 this.$.page_bots.load(url,this._auth_headers); |
| 691 } | 703 } |
| 692 | 704 |
| 693 }); | 705 }); |
| 694 })(); | 706 })(); |
| 695 </script> | 707 </script> |
| 696 </dom-module> | 708 </dom-module> |
| OLD | NEW |