16 lines
422 B
Elixir
16 lines
422 B
Elixir
defmodule RecycledCloudWeb.VirtualMachineHostingView do
|
|
use RecycledCloudWeb, :view
|
|
|
|
alias RecycledCloud.OpenNebula, as: ONE
|
|
alias RecycledCloud.OpenNebula.VM
|
|
|
|
def render_state(vm) do
|
|
state = Map.get(vm, :STATE) |> VM.state_for
|
|
if state == :active do
|
|
lcm_state = Map.get(vm, :LCM_STATE) |> VM.lcm_state_for
|
|
raw("#{state} (<b>#{lcm_state}</b>)")
|
|
else
|
|
raw("#{state}")
|
|
end
|
|
end
|
|
end
|