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

Side by Side Diff: appengine/swarming/ui/res/imp/botpage/bot-page.html

Issue 2661173004: Make deleted bots still show up when searched for by id (Closed)
Patch Set: Address comments Created 3 years, 10 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
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-page> 9 <bot-page>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 #collapse { 76 #collapse {
77 max-width: 700px; 77 max-width: 700px;
78 } 78 }
79 79
80 .cloud { 80 .cloud {
81 white-space: nowrap; 81 white-space: nowrap;
82 margin-bottom: 5px; 82 margin-bottom: 5px;
83 margin-top: auto; 83 margin-top: auto;
84 } 84 }
85 85
86 .deleted {
87 text-align: center;
88 font-size: larger;
89 }
90
86 paper-checkbox { 91 paper-checkbox {
87 --paper-checkbox-label-color: #fff; 92 --paper-checkbox-label-color: #fff;
88 --paper-checkbox-checked-color: #fff; 93 --paper-checkbox-checked-color: #fff;
89 --paper-checkbox-checkmark-color: #000; 94 --paper-checkbox-checkmark-color: #000;
90 --paper-checkbox-unchecked-color: #fff; 95 --paper-checkbox-unchecked-color: #fff;
91 padding: 3px; 96 padding: 3px;
92 } 97 }
93 98
94 paper-dialog { 99 paper-dialog {
95 border-radius: 6px; 100 border-radius: 6px;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 </button> 153 </button>
149 </div> 154 </div>
150 </div> 155 </div>
151 156
152 <h2 hidden$="[[_bot_exists]]">Bot not found.</h2> 157 <h2 hidden$="[[_bot_exists]]">Bot not found.</h2>
153 158
154 <div hidden$="[[_not(_bot_exists)]]"> 159 <div hidden$="[[_not(_bot_exists)]]">
155 <div class="horizontal wrap layout"> 160 <div class="horizontal wrap layout">
156 <div class="flex"> 161 <div class="flex">
157 <table> 162 <table>
163 <template is="dom-if" if="[[_bot.deleted]]">
164 <tr class="dead deleted" title="This bot was deleted.">
165 <td colspan=3>THIS BOT WAS DELETED</td>
166 </td>
167 </tr>
168 </template>
158 <tr class$="[[_isDead(_bot)]]" title="Last time the bot contacted the server."> 169 <tr class$="[[_isDead(_bot)]]" title="Last time the bot contacted the server.">
159 <td>Last Seen</td> 170 <td>Last Seen</td>
160 <td title="[[_bot.human_last_seen_ts]]"> 171 <td title="[[_bot.human_last_seen_ts]]">
161 [[_timeDiffExact(_bot.last_seen_ts)]] ago</td> 172 [[_timeDiffExact(_bot.last_seen_ts)]] ago</td>
162 <td> 173 <td>
163 <!-- dom-ifs are slightly less performant than hidden$=, but 174 <!-- dom-ifs are slightly less performant than hidden$=, but
164 prevent things from first drawing and then hiding. We prefer to 175 prevent things from first drawing and then hiding. We prefer to
165 not flash buttons or quarantined messages --> 176 not flash buttons or quarantined messages -->
166 <template is="dom-if" if="[[_canShutdown(_bot,_permissions)]]" > 177 <template is="dom-if" if="[[_canShutdown(_bot,_permissions)]]" >
167 <button class="raised" on-click="_promptShutdown"> 178 <button class="raised" on-click="_promptShutdown">
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 }, 445 },
435 _parseTasks: { 446 _parseTasks: {
436 type: Function, 447 type: Function,
437 value: function() { 448 value: function() {
438 return this.$.data.parseTasks.bind(this); 449 return this.$.data.parseTasks.bind(this);
439 } 450 }
440 } 451 }
441 }, 452 },
442 453
443 _canCancel: function(bot, permissions) { 454 _canCancel: function(bot, permissions) {
444 return bot && bot.task_id && permissions.cancel_task; 455 return bot && bot.task_id && permissions.cancel_task && !bot.deleted;
445 }, 456 },
446 457
447 _canDelete: function(bot, permissions) { 458 _canDelete: function(bot, permissions) {
448 return bot && bot.is_dead && permissions.delete_bot; 459 return bot && bot.is_dead && permissions.delete_bot && !bot.deleted;
449 }, 460 },
450 461
451 _canShutdown: function(bot, permissions){ 462 _canShutdown: function(bot, permissions){
452 return bot && !bot.is_dead && permissions.terminate_bot; 463 return bot && !bot.is_dead && permissions.terminate_bot && !bot.deleted;
453 }, 464 },
454 465
455 _classVersion: function(serverVersion, otherVersion) { 466 _classVersion: function(serverVersion, otherVersion) {
456 if (serverVersion !== otherVersion) { 467 if (serverVersion !== otherVersion) {
457 return "old_version"; 468 return "old_version";
458 } 469 }
459 return ""; 470 return "";
460 }, 471 },
461 472
462 _clearAndReload: function(botID) { 473 _clearAndReload: function(botID) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 _eventList(showAll) { 507 _eventList(showAll) {
497 if (!this._events) { 508 if (!this._events) {
498 return []; 509 return [];
499 } 510 }
500 return this._events.filter(function(e){ 511 return this._events.filter(function(e){
501 return showAll || e.message; 512 return showAll || e.message;
502 }); 513 });
503 }, 514 },
504 515
505 _isDead(bot){ 516 _isDead(bot){
506 if (bot && bot.is_dead) { 517 if (bot && bot.is_dead && !bot.deleted) {
507 return "dead"; 518 return "dead";
508 } 519 }
509 return ""; 520 return "";
510 }, 521 },
511 522
512 _luciLink: function(revision) { 523 _luciLink: function(revision) {
513 if (!revision) { 524 if (!revision) {
514 return undefined; 525 return undefined;
515 } 526 }
516 return "https://github.com/luci/luci-py/commit/" + revision; 527 return "https://github.com/luci/luci-py/commit/" + revision;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 }, 638 },
628 639
629 _toggleState: function() { 640 _toggleState: function() {
630 this.set("_show_state", !this._show_state); 641 this.set("_show_state", !this._show_state);
631 } 642 }
632 643
633 }); 644 });
634 })(); 645 })();
635 </script> 646 </script>
636 </dom-module> 647 </dom-module>
OLDNEW
« no previous file with comments | « appengine/swarming/ui/build/elements.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698