1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2025-07-31 12:41:08 +00:00

Instances overhaul

This commit is contained in:
Real-Gecko 2020-07-13 15:33:09 +06:00
parent f23e6b000f
commit 47009d47ca
69 changed files with 5011 additions and 4127 deletions

View file

@ -1,61 +1,44 @@
{% load i18n %}
{% load icons %}
<form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %}
<input type="hidden" name="name" value="{{ inst }}"/>
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
{% if vm.status == 5 %}
{% if vm.is_template %}
<button class="btn btn-sm btn-secondary" type="button" name="clone" title="{% trans "Clone" %}" onclick="goto_instance_clone({{ host.0 }}, '{{ inst }}');">
<span class="fa fa-clone"></span>
</button>
{% if instance.proxy.instance.info.0 == 5 %}
{% if instance.is_template %}
<a href="{% url 'instances:instance' instance.id %}#clone" class="btn btn-sm btn-secondary" title="{% trans "Clone" %}">
{% icon 'clone' %}
</a>
{% else %}
<button class="btn btn-sm btn-secondary" type="submit" name="poweron" title="{% trans "Power On" %}">
<span class="fa fa-play"></span>
</button>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:poweron' instance.id %}" title="{% trans "Power On" %}">
{% icon 'play' %}
</a>
{% endif %}
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}" disabled>
<span class="fa fa-pause"></span>
</button>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power Off" %}" disabled>
<span class="fa fa-power-off"></span>
</button>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}" disabled>
<span class="fa fa-refresh"></span>
</button>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}">{% icon 'pause' %}</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Off" %}">{% icon 'power-off' %}</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}">{% icon 'refresh' %}</a>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
<span class="fa fa-eye"></span>
</button>
{% endif %}
{% if vm.status == 3 %}
<button class="btn btn-sm btn-secondary" type="submit" name="resume" title="{% trans "Resume" %}">
<span class="fa fa-play"></span>
</button>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}" disabled>
<span class="fa fa-pause"></span>
</button>
<button class="btn btn-sm btn-secondary" type="submit" name="powerforce" title="{% trans "Force Off" %}" onclick="return confirm('Are you sure to force it down?')">
<span class="fa fa-power-off"></span>
</button>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}" disabled>
<span class="fa fa-refresh"></span>
</button>
{% if instance.proxy.instance.info.0 == 3 %}
<a class="btn btn-sm btn-secondary" href="{% url 'instances:resume' instance.id %}" title="{% trans "Resume" %}">
{% icon 'play' %}
</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}">{% icon 'pause' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:force_off' instance.id %}" title="{% trans "Force Off" %}">
{% icon 'power-off' %}
</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}">{% icon 'refresh' %}</a>
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
<span class="fa fa-eye"></span>
</button>
{% endif %}
{% if vm.status == 1 %}
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power On" %}" disabled>
<span class="fa fa-play"></span>
</button>
<button class="btn btn-sm btn-secondary" type="submit" name="suspend" title="{% trans "Suspend" %}">
<span class="fa fa-pause"></span>
</button>
<button class="btn btn-sm btn-secondary" type="submit" name="poweroff" title="{% trans "Power Off" %}" onclick="return confirm('Are you sure?')">
<span class="fa fa-power-off"></span>
</button>
<button class="btn btn-sm btn-secondary" type="submit" name="powercycle" title="{% trans "Power Cycle" %}" onclick="return confirm('Are you sure?')">
<span class="fa fa-refresh"></span>
</button>
<button class="btn btn-sm btn-secondary" type="button" onclick='open_console("{{ host.0 }}-{{ vm.uuid }}")' title="{% trans "Console" %}">
{% if instance.proxy.instance.info.0 == 1 %}
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power On" %}">{% icon 'play' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:suspend' instance.id %}"
title="{% trans "Suspend" %}">{% icon 'pause' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:poweroff' instance.id %}">{% icon 'power-off' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:powercycle' instance.id %}">{% icon 'refresh' %}</a>
<button class="btn btn-sm btn-secondary" type="button" onclick='open_console("{{ instance.compute.id }}-{{ instance.get_uuid }}")'
title="{% trans "Console" %}">
<span class="fa fa-eye"></span>
</button>
{% endif %}