{% extends "base.html" %}{% block content %}
{% set ok = ["ACTIVE","available","running"] %}
{% set info = ["BUILD","BUILDING","REBOOT","HARD_REBOOT","RESIZE"] %}
{% set warn = ["VERIFY_RESIZE","PAUSED","SUSPENDED","SHUTOFF","pending"] %}
<div class="page-header">
 <div class="titles"><h1>{{ vm.name }}</h1><p class="subtitle mono">{{ vm.id }}</p></div>
 <div class="actions">
  <form class="inline" method="post" action="/vms/{{ vm.name }}/reboot"><button>reboot</button></form>
  <form class="inline" method="post" action="/vms/{{ vm.name }}/delete"><button class="danger">delete</button></form>
  <a class="btn" href="/vms">back</a>
 </div>
</div>
<div class="table-wrap">
<table class="kv">
 <tbody>
 <tr><th>ID</th><td class="mono">{{ vm.id }}</td></tr>
 <tr><th>Status</th><td><span class="badge {% if vm.status in ok %}badge-ok{% elif vm.status in info %}badge-info{% elif vm.status in warn %}badge-warn{% elif vm.status == 'ERROR' %}badge-danger{% else %}badge-neutral{% endif %}">{{ vm.status }}</span></td></tr>
 <tr><th>Flavor</th><td>{{ vm.flavor }}</td></tr>
 <tr><th>Image</th><td>{{ vm.image }}</td></tr>
 <tr><th>Private IPs</th><td class="mono">{{ vm.private_ips|join(", ") }}</td></tr>
 <tr><th>Floating IPs</th><td class="mono">{{ vm.floating_ips|join(", ") }}</td></tr>
 <tr><th>Security groups</th><td>{{ vm.security_groups|join(", ") }}</td></tr>
 <tr><th>Key</th><td>{{ vm.key_name or "—" }}</td></tr>
 <tr><th>Created</th><td>{{ vm.created_at or "—" }}</td></tr>
 </tbody>
</table>
</div>
{% endblock %}
