| 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 <h1>THIS UI WILL GO AWAY ON JAN 1, 2017. If it has something you need and the ne
w UI doesn't have it, file a bug ASAP. </h1> |
| 73 <a href="{{try_link}}">Try out the new bot list UI</a> |
| 74 <p/> |
| 75 <form id="filter_and_order" name="filter_and_order" method="GET"> |
| 76 <table> |
| 77 <tr> |
| 78 <td> |
| 79 <table class=property_table> |
| 80 <tbody> |
| 81 <tr> |
| 82 <td>Current bot version</td> |
| 83 <td>{{current_version[:8]}}</td> |
| 84 </tr> |
| 85 <tr> |
| 86 <td>Bots alive</td> |
| 87 <td>{{num_bots_alive}}</td> |
| 88 </tr> |
| 89 <tr> |
| 90 <td>Bots running a task</td> |
| 91 <td>{{num_bots_busy}}</td> |
| 92 </tr> |
| 93 <tr> |
| 94 <td>Bots dead</td> |
| 95 <td>{{num_bots_dead}}</td> |
| 96 </tr> |
| 97 <tr> |
| 98 <td>Bots quarantined</td> |
| 99 <td>{{num_bots_quarantined}}</td> |
| 100 </tr> |
| 101 <tr> |
| 102 <td>Bots shown below</td> |
| 103 <td>{{bots|length}}</td> |
| 104 </tr> |
| 105 </tbody> |
| 106 </table> |
| 107 </td> |
| 108 <td> |
| 109 <div title="Filter by bot dimensions."> |
| 110 Filter by advertized bot dimensions<br> |
| 111 Use "key:value" format, e.g. "gpu:none" |
| 112 <br> |
| 113 <textarea id="dimensions" name="dimensions" rows="3" cols="30">{{dimensi
ons}}</textarea> |
| 114 <br> |
| 115 <input type="submit" value="Filter"> |
| 116 </div> |
| 117 </td> |
| 118 <td> |
| 119 Limit: |
| 120 <br> |
| 121 <input type="range" id="limitRange" name="limit" value="{{limit}}" min=10 |
| 122 max=500 step=5 onchange="update_limit_text(this.value);" |
| 123 onmousemove="update_limit_text(this.value);" > |
| 124 <input type="text" id="limitText" value="{{limit}}" maxlength="3" |
| 125 onchange="update_limit_range(this.value);"> |
| 126 </td> |
| 127 </tr> |
| 128 </table> |
| 129 <p/> |
| 130 {% for sort_option in sort_options %} |
| 131 <label> |
| 132 <input type="radio" name="sort_by" value="{{sort_option.key}}" |
| 133 onchange="submit_form()" |
| 134 {% if sort_by == sort_option.key %}checked{%endif%}> |
| 135 {{sort_option.name}} |
| 136 </input> |
| 137 </label> |
| 138 {% endfor %} |
| 139 <p/> |
| 140 </form> |
| 141 |
| 142 {% import 'swarming/bot_view.html' as bot_view %} |
| 143 <table id="machine-table" class="alterning_background" |
| 144 summary="This table lists all machines that have polled this server"> |
| 145 <thead> |
| 146 <th>ID</th> |
| 147 <th>Last contact</th> |
| 148 <th>Dimensions</th> |
| 149 <th>State</th> |
| 150 <th>Version</th> |
| 151 <th>Task</th> |
| 152 </thead> |
| 153 <tbody> |
| 154 {% for bot in bots %} |
| 155 <tr class="request {% if bot.is_dead(now) %}bot_dead{% elif bot.quarantined
%}bot_quarantined{% endif %}"> |
| 156 <td nowrap>{{bot_view.bot_link(bot.id, is_privileged_user)}}</td> |
| 157 <td> |
| 158 {{(now-bot.last_seen_ts)|timedeltaformat}} |
| 159 {% if is_admin and bot.is_dead(now) %} |
| 160 <form id="delete_{{bot.id}}" method="post" |
| 161 action="/oldui/restricted/bot/{{bot.id}}/delete"> |
| 162 <input type="hidden" name="xsrf_token" value="{{xsrf_token}}" /> |
| 163 <input type="submit" value="Delete" /> |
| 164 </form> |
| 165 {% endif %} |
| 166 </td> |
| 167 <td nowrap>{{bot_view.render_dict(bot.dimensions)}}</td> |
| 168 <td nowrap>{{bot_view.render_dict(bot.state)}}</td> |
| 169 <td {%if bot.version != current_version%}class="bot_bad_version"{%endif%
}> |
| 170 {{bot.version[:8]}} |
| 171 </td> |
| 172 <td> |
| 173 {% if bot.task %} |
| 174 <a href="/oldui/user/task/{{bot.task_id}}">{{bot.task_name}}</a> |
| 175 {% else %}‑‑{% endif%} |
| 176 </td> |
| 177 </tr> |
| 178 {% endfor %} |
| 179 </tbody> |
| 180 </table> |
| 181 |
| 182 {% if cursor %} |
| 183 <p/> |
| 184 <a href="/oldui/restricted/bots?limit={{limit}}&sort_by={{sort_by}}&cursor={{cur
sor|urlencode}}&dimensions={{dimensions|urlencode}}">Next page</a> |
| 185 {% endif %} |
| 186 |
| 187 {% endblock %} |
| OLD | NEW |