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

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

Issue 2768553002: Add Device errors to bot-list status (Closed)
Patch Set: Created 3 years, 9 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (msg === "No available devices.") {
stephana 2017/03/21 17:33:39 This seems very fragile. Is there no stricter way
kjlubick 2017/03/21 19:56:15 Removed the if statement, because I think it will
408 var errs = [];
409 // Show all the errors that are active to make it more clear if this
410 // is a transient error (e.g. device is too hot) or if it is require s
411 // human interaction (e.g. device is unauthorized)
412 this._devices(bot).forEach(function(d){
413 if (d.state !== "available") {
414 errs.push(d.state);
415 }
416 });
417 if (errs.length) {
418 msg += " ["+errs.join(",")+"]";
419 }
420 }
407 return "Quarantined: " + msg; 421 return "Quarantined: " + msg;
408 } 422 }
409 return "Alive"; 423 return "Alive";
410 }, 424 },
411 task: function(bot) { 425 task: function(bot) {
412 return this._taskId(bot); 426 return this._taskId(bot);
413 }, 427 },
414 uptime: function(bot) { 428 uptime: function(bot) {
415 var u = this._state(bot, "uptime"); 429 var u = this._state(bot, "uptime");
416 if (!u) { 430 if (!u) {
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 return; 701 return;
688 } 702 }
689 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params); 703 var url = "/api/swarming/v1/bots/list?" + sk.query.fromParamSet(this._qu ery_params);
690 this.$.page_bots.load(url,this._auth_headers); 704 this.$.page_bots.load(url,this._auth_headers);
691 } 705 }
692 706
693 }); 707 });
694 })(); 708 })();
695 </script> 709 </script>
696 </dom-module> 710 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | appengine/swarming/ui/res/imp/botlist/bot-list-shared-behavior.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698