| 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-page> | 9 <bot-page> |
| 10 | 10 |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 }, | 347 }, |
| 348 | 348 |
| 349 _concat: function(arr) { | 349 _concat: function(arr) { |
| 350 if (!arr) { | 350 if (!arr) { |
| 351 return ""; | 351 return ""; |
| 352 } | 352 } |
| 353 return arr.join(" | "); | 353 return arr.join(" | "); |
| 354 }, | 354 }, |
| 355 | 355 |
| 356 _deleteBot: function() { | 356 _deleteBot: function() { |
| 357 swarming.postWithToast("/_ah/api/swarming/v1/bot/"+this.bot_id+"/delete"
, | 357 swarming.postWithToast("/api/swarming/v1/bot/"+this.bot_id+"/delete", |
| 358 "Deleting "+this.bot_id, this._auth_headers); | 358 "Deleting "+this.bot_id, this._auth_headers); |
| 359 }, | 359 }, |
| 360 | 360 |
| 361 _eventList(events, showAll) { | 361 _eventList(events, showAll) { |
| 362 if (!events) { | 362 if (!events) { |
| 363 return []; | 363 return []; |
| 364 } | 364 } |
| 365 return events.filter(function(e){ | 365 return events.filter(function(e){ |
| 366 return showAll || e.message; | 366 return showAll || e.message; |
| 367 }); | 367 }); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 }, | 432 }, |
| 433 | 433 |
| 434 _shorten: function(str, length) { | 434 _shorten: function(str, length) { |
| 435 if (!str || ! length) { | 435 if (!str || ! length) { |
| 436 return ""; | 436 return ""; |
| 437 } | 437 } |
| 438 return str.substring(0, length); | 438 return str.substring(0, length); |
| 439 }, | 439 }, |
| 440 | 440 |
| 441 _shutdownBot: function() { | 441 _shutdownBot: function() { |
| 442 swarming.postWithToast("/_ah/api/swarming/v1/bot/"+this.bot_id+"/termina
te", | 442 swarming.postWithToast("/api/swarming/v1/bot/"+this.bot_id+"/terminate", |
| 443 "Shutting down "+this.bot_id, this._auth_headers); | 443 "Shutting down "+this.bot_id, this._auth_headers); |
| 444 }, | 444 }, |
| 445 | 445 |
| 446 _task: function(bot) { | 446 _task: function(bot) { |
| 447 return (bot && bot.task_id) || "idle"; | 447 return (bot && bot.task_id) || "idle"; |
| 448 }, | 448 }, |
| 449 | 449 |
| 450 _taskClass: function(task) { | 450 _taskClass: function(task) { |
| 451 if (task && task.internal_failure) { | 451 if (task && task.internal_failure) { |
| 452 return "bot_died"; | 452 return "bot_died"; |
| 453 } | 453 } |
| 454 if (task && task.failure) { | 454 if (task && task.failure) { |
| 455 return "failed_task"; | 455 return "failed_task"; |
| 456 } | 456 } |
| 457 return ""; | 457 return ""; |
| 458 }, | 458 }, |
| 459 | 459 |
| 460 _toggleState: function() { | 460 _toggleState: function() { |
| 461 this.set("_show_state", !this._show_state); | 461 this.set("_show_state", !this._show_state); |
| 462 } | 462 } |
| 463 | 463 |
| 464 }); | 464 }); |
| 465 })(); | 465 })(); |
| 466 </script> | 466 </script> |
| 467 </dom-module> | 467 </dom-module> |
| OLD | NEW |