| OLD | NEW |
| (Empty) |
| 1 {% extends "swarming/base.html" %} | |
| 2 | |
| 3 | |
| 4 {% block headers %} | |
| 5 <style> | |
| 6 h1 { | |
| 7 margin-top: 10px; | |
| 8 margin-bottom: 10px; | |
| 9 } | |
| 10 | |
| 11 table.property_table { | |
| 12 font-family: monospace; | |
| 13 border-spacing: 0; | |
| 14 } | |
| 15 | |
| 16 table.property_table tbody tr:nth-child(even) { | |
| 17 background-color: #eeeeee; | |
| 18 } | |
| 19 | |
| 20 table.property_table td { | |
| 21 padding-left: 1em; | |
| 22 padding-right: 1em; | |
| 23 } | |
| 24 | |
| 25 table.property_table tbody tr:hover { | |
| 26 background-color: #eeffee; | |
| 27 } | |
| 28 | |
| 29 .bot_bad_version { | |
| 30 background-color: #ffffee; | |
| 31 } | |
| 32 | |
| 33 .bot_dead { | |
| 34 background-color: #ffdddd !important; | |
| 35 } | |
| 36 | |
| 37 .bot_quarantined { | |
| 38 background-color: #ff0303 !important; | |
| 39 } | |
| 40 | |
| 41 #limitRange { | |
| 42 width: inherit; | |
| 43 } | |
| 44 </style> | |
| 45 | |
| 46 <script> | |
| 47 function get_limit() { | |
| 48 return document.getElementById('limitText').value; | |
| 49 } | |
| 50 | |
| 51 function update_limit_text(val) { | |
| 52 document.getElementById('limitText').value = val; | |
| 53 } | |
| 54 | |
| 55 function update_limit_range(val) { | |
| 56 document.getElementById('limitRange').value = val; | |
| 57 } | |
| 58 | |
| 59 function submit_form() { | |
| 60 document.getElementById("filter_and_order").submit(); | |
| 61 } | |
| 62 </script> | |
| 63 {% endblock %} | |
| 64 | |
| 65 | |
| 66 {% block body %} | |
| 67 {% import 'swarming/bot_view.html' as bot_view %} | |
| 68 | |
| 69 <h1>Known bots</h1> | |
| 70 <a href="/">Back to root</a> | |
| 71 <br/> | |
| 72 <a href="{{try_link}}">Try out the new bot list UI</a> | |
| 73 <p/> | |
| 74 <form id="filter_and_order" name="filter_and_order" method="GET"> | |
| 75 <table> | |
| 76 <tr> | |
| 77 <td> | |
| 78 <table class=property_table> | |
| 79 <tbody> | |
| 80 <tr> | |
| 81 <td>Current bot version</td> | |
| 82 <td>{{current_version[:8]}}</td> | |
| 83 </tr> | |
| 84 <tr> | |
| 85 <td>Bots alive</td> | |
| 86 <td>{{num_bots_alive}}</td> | |
| 87 </tr> | |
| 88 <tr> | |
| 89 <td>Bots running a task</td> | |
| 90 <td>{{num_bots_busy}}</td> | |
| 91 </tr> | |
| 92 <tr> | |
| 93 <td>Bots dead</td> | |
| 94 <td>{{num_bots_dead}}</td> | |
| 95 </tr> | |
| 96 <tr> | |
| 97 <td>Bots quarantined</td> | |
| 98 <td>{{num_bots_quarantined}}</td> | |
| 99 </tr> | |
| 100 <tr> | |
| 101 <td>Bots shown below</td> | |
| 102 <td>{{bots|length}}</td> | |
| 103 </tr> | |
| 104 </tbody> | |
| 105 </table> | |
| 106 </td> | |
| 107 <td> | |
| 108 <div title="Filter by bot dimensions."> | |
| 109 Filter by advertized bot dimensions<br> | |
| 110 Use "key:value" format, e.g. "gpu:none" | |
| 111 <br> | |
| 112 <textarea id="dimensions" name="dimensions" rows="3" cols="30">{{dimensi
ons}}</textarea> | |
| 113 <br> | |
| 114 <input type="submit" value="Filter"> | |
| 115 </div> | |
| 116 </td> | |
| 117 <td> | |
| 118 Limit: | |
| 119 <br> | |
| 120 <input type="range" id="limitRange" name="limit" value="{{limit}}" min=10 | |
| 121 max=500 step=5 onchange="update_limit_text(this.value);" | |
| 122 onmousemove="update_limit_text(this.value);" > | |
| 123 <input type="text" id="limitText" value="{{limit}}" maxlength="3" | |
| 124 onchange="update_limit_range(this.value);"> | |
| 125 </td> | |
| 126 </tr> | |
| 127 </table> | |
| 128 <p/> | |
| 129 {% for sort_option in sort_options %} | |
| 130 <label> | |
| 131 <input type="radio" name="sort_by" value="{{sort_option.key}}" | |
| 132 onchange="submit_form()" | |
| 133 {% if sort_by == sort_option.key %}checked{%endif%}> | |
| 134 {{sort_option.name}} | |
| 135 </input> | |
| 136 </label> | |
| 137 {% endfor %} | |
| 138 <p/> | |
| 139 </form> | |
| 140 | |
| 141 {% import 'swarming/bot_view.html' as bot_view %} | |
| 142 <table id="machine-table" class="alterning_background" | |
| 143 summary="This table lists all machines that have polled this server"> | |
| 144 <thead> | |
| 145 <th>ID</th> | |
| 146 <th>Last contact</th> | |
| 147 <th>Dimensions</th> | |
| 148 <th>State</th> | |
| 149 <th>Version</th> | |
| 150 <th>Task</th> | |
| 151 </thead> | |
| 152 <tbody> | |
| 153 {% for bot in bots %} | |
| 154 <tr class="request {% if bot.is_dead(now) %}bot_dead{% elif bot.quarantined
%}bot_quarantined{% endif %}"> | |
| 155 <td nowrap>{{bot_view.bot_link(bot.id, is_privileged_user)}}</td> | |
| 156 <td> | |
| 157 {{(now-bot.last_seen_ts)|timedeltaformat}} | |
| 158 {% if is_admin and bot.is_dead(now) %} | |
| 159 <form id="delete_{{bot.id}}" method="post" | |
| 160 action="/restricted/bot/{{bot.id}}/delete"> | |
| 161 <input type="hidden" name="xsrf_token" value="{{xsrf_token}}" /> | |
| 162 <input type="submit" value="Delete" /> | |
| 163 </form> | |
| 164 {% endif %} | |
| 165 </td> | |
| 166 <td nowrap>{{bot_view.render_dict(bot.dimensions)}}</td> | |
| 167 <td nowrap>{{bot_view.render_dict(bot.state)}}</td> | |
| 168 <td {%if bot.version != current_version%}class="bot_bad_version"{%endif%
}> | |
| 169 {{bot.version[:8]}} | |
| 170 </td> | |
| 171 <td> | |
| 172 {% if bot.task %} | |
| 173 <a href="/user/task/{{bot.task_id}}">{{bot.task_name}}</a> | |
| 174 {% else %}‑‑{% endif%} | |
| 175 </td> | |
| 176 </tr> | |
| 177 {% endfor %} | |
| 178 </tbody> | |
| 179 </table> | |
| 180 | |
| 181 {% if cursor %} | |
| 182 <p/> | |
| 183 <a href="/restricted/bots?limit={{limit}}&sort_by={{sort_by}}&cursor={{cursor|ur
lencode}}&dimensions={{dimensions|urlencode}}">Next page</a> | |
| 184 {% endif %} | |
| 185 | |
| 186 {% endblock %} | |
| OLD | NEW |