meta/lib/recycledcloud_web/templates/virtual_machine_hosting/index.html.eex

40 lines
1.1 KiB
Elixir

<h1>Virtual Machines</h1>
<p>This page list all the Virtual Machines linked to your account. It is
not possible to interect with them yet.</p>
<%= for location <- ["LNTH"] do %>
<h2>Location: <%= location %></h2>
<table>
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>State</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<%= for vm <- @vms do %>
<tr>
<td><%= Map.get(vm, :ID) %></td>
<td><%= Map.get(vm, :NAME) %></td>
<td><%= VM.state_for(Map.get(vm, :STATE)) %></td>
<td>
<%= case VM.state_for(Map.get(vm, :STATE)) do
:poweroff ->
link "start", to: Routes.virtual_machine_hosting_path(@conn, :start, Map.get(vm, :ID))
:active ->
link "stop", to: Routes.virtual_machine_hosting_path(@conn, :stop, Map.get(vm, :ID))
_ -> ""
end %>
<%= link "show details", to: Routes.virtual_machine_hosting_path(@conn, :show, Map.get(vm, :ID)) %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>