1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-11-01 12:04:15 +00:00
webvirtcloud/instances/templates/instance_actions.html

53 lines
3 KiB
HTML
Raw Normal View History

2020-05-19 16:53:54 +00:00
{% load i18n %}
{% load bootstrap_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" %}">
{% bs_icon 'clone' %}
2020-07-13 09:33:09 +00:00
</a>
2020-05-19 16:53:54 +00:00
{% else %}
<a class="btn btn-sm btn-secondary" href="{% url 'instances:poweron' instance.id %}" onclick="showPleaseWaitDialog()" title="{% trans "Power On" %}">
2023-08-11 06:40:38 +00:00
{% bs_icon 'play-fill' %}
2020-07-13 09:33:09 +00:00
</a>
2020-05-19 16:53:54 +00:00
{% endif %}
2023-08-11 06:40:38 +00:00
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}">{% bs_icon 'pause-fill' %}</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Off" %}">{% bs_icon 'power' %}</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}">{% bs_icon 'repeat' %}</a>
2020-05-19 16:53:54 +00:00
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
2023-08-11 06:40:38 +00:00
<span>{% bs_icon 'eye-fill' %}</span>
2020-05-19 16:53:54 +00:00
</button>
{% 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" %}">
2023-08-11 06:40:38 +00:00
{% bs_icon 'play-fill' %}
2020-07-13 09:33:09 +00:00
</a>
2023-08-11 06:40:38 +00:00
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Suspend" %}">{% bs_icon 'pause-fill' %}</a>
2020-07-13 09:33:09 +00:00
<a class="btn btn-sm btn-secondary" href="{% url 'instances:force_off' instance.id %}" title="{% trans "Force Off" %}">
{% bs_icon 'power' %}
2020-07-13 09:33:09 +00:00
</a>
<a class="btn btn-sm btn-secondary disabled" title="{% trans "Power Cycle" %}">{% bs_icon 'repeat' %}</a>
2020-05-19 16:53:54 +00:00
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
2023-08-11 06:40:38 +00:00
<span>{% bs_icon 'eye-fill' %}</span>
2020-05-19 16:53:54 +00:00
</button>
{% endif %}
2020-07-13 09:33:09 +00:00
{% if instance.proxy.instance.info.0 == 1 %}
2023-08-11 06:40:38 +00:00
<a class="btn btn-sm btn-secondary disabled" onclick="showPleaseWaitDialog()" title="{% trans "Power On" %}">{% bs_icon 'play-fill' %}</a>
2020-07-13 09:33:09 +00:00
<a class="btn btn-sm btn-secondary" href="{% url 'instances:suspend' instance.id %}"
2023-08-11 06:40:38 +00:00
title="{% trans "Suspend" %}">{% bs_icon 'pause-fill' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:poweroff' instance.id %}">{% bs_icon 'power' %}</a>
<a class="btn btn-sm btn-secondary" href="{% url 'instances:powercycle' instance.id %}">{% bs_icon 'repeat' %}</a>
2020-07-13 09:33:09 +00:00
<button class="btn btn-sm btn-secondary" type="button" onclick='open_console("{{ instance.compute.id }}-{{ instance.get_uuid }}")'
title="{% trans "Console" %}">
2023-08-11 06:40:38 +00:00
<span>{% bs_icon 'eye-fill' %}</span>
2020-05-19 16:53:54 +00:00
</button>
{% 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 %}