2020-05-19 16:53:54 +00:00
|
|
|
{% load i18n %}
|
2020-07-13 09:33:09 +00:00
|
|
|
{% load icons %}
|
2020-05-26 13:18:38 +00:00
|
|
|
<form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %}
|
2020-07-13 09:33:09 +00:00
|
|
|
{% 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>
|
2020-05-19 16:53:54 +00:00
|
|
|
{% else %}
|
2023-04-24 11:39:22 +00:00
|
|
|
<a class="btn btn-sm btn-secondary" href="{% url 'instances:poweron' instance.id %}" onclick="showPleaseWaitDialog()" title="{% trans "Power On" %}">
|
2020-07-13 09:33:09 +00:00
|
|
|
{% icon 'play' %}
|
|
|
|
</a>
|
2020-05-19 16:53:54 +00:00
|
|
|
{% endif %}
|
2020-07-13 09:33:09 +00:00
|
|
|
<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>
|
2020-05-19 16:53:54 +00:00
|
|
|
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
|
|
|
<span class="fa fa-eye"></span>
|
|
|
|
</button>
|
2020-06-04 12:40:57 +00:00
|
|
|
{% endif %}
|
2020-07-13 09:33:09 +00:00
|
|
|
{% 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>
|
2020-05-19 16:53:54 +00:00
|
|
|
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
|
|
|
<span class="fa fa-eye"></span>
|
|
|
|
</button>
|
2020-06-04 12:40:57 +00:00
|
|
|
{% endif %}
|
2020-07-13 09:33:09 +00:00
|
|
|
{% if instance.proxy.instance.info.0 == 1 %}
|
2023-04-24 11:39:22 +00:00
|
|
|
<a class="btn btn-sm btn-secondary disabled" onclick="showPleaseWaitDialog()" title="{% trans "Power On" %}">{% icon 'play' %}</a>
|
2020-07-13 09:33:09 +00:00
|
|
|
<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" %}">
|
2020-05-19 16:53:54 +00:00
|
|
|
<span class="fa fa-eye"></span>
|
|
|
|
</button>
|
2020-06-04 12:40:57 +00:00
|
|
|
{% endif %}
|
2020-07-17 08:04:21 +00:00
|
|
|
</form>
|
|
|
|
{% block script %}
|
|
|
|
<script>
|
|
|
|
function open_console(uuid) {
|
|
|
|
url = '{% url 'console' %}?token=' + uuid + '';
|
|
|
|
window.open(url, '', 'width=850,height=650')
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{% endblock script %}
|