mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +00:00
instance templates show clone button instead of poweron on instances list page
This commit is contained in:
parent
16ef164ed9
commit
e9e62e3c41
1 changed files with 23 additions and 6 deletions
|
@ -69,9 +69,15 @@
|
||||||
<input type="hidden" name="name" value="{{ vm }}"/>
|
<input type="hidden" name="name" value="{{ vm }}"/>
|
||||||
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
||||||
{% ifequal info.status 5 %}
|
{% ifequal info.status 5 %}
|
||||||
<button class="btn btn-sm btn-default {% if info.is_template %}disabled{% endif %}" type="submit" name="poweron" title="{% trans "Power On" %}">
|
{% if info.is_template %}
|
||||||
|
<button class="btn btn-sm btn-default" type="button" name="clone" title="{% trans "Clone" %}" onclick="goto_instance_clone({{ host.0 }}, '{{ vm }}');">
|
||||||
|
<span class="glyphicon glyphicon-duplicate"></span>
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<button class="btn btn-sm btn-default" type="submit" name="poweron" title="{% trans "Power On" %}">
|
||||||
<span class="glyphicon glyphicon-play"></span>
|
<span class="glyphicon glyphicon-play"></span>
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Suspend" %}">
|
<button class="btn btn-sm btn-default disabled" title="{% trans "Suspend" %}">
|
||||||
<span class="glyphicon glyphicon-pause"></span>
|
<span class="glyphicon glyphicon-pause"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -166,9 +172,15 @@
|
||||||
<input type="hidden" name="name" value="{{ vm.name }}"/>
|
<input type="hidden" name="name" value="{{ vm.name }}"/>
|
||||||
<input type="hidden" name="compute_id" value="{{ vm.compute_id }}"/>
|
<input type="hidden" name="compute_id" value="{{ vm.compute_id }}"/>
|
||||||
{% ifequal vm.status 5 %}
|
{% ifequal vm.status 5 %}
|
||||||
<button class="btn btn-sm btn-default {% if inst.instance.is_template %}disabled{% endif %}" type="submit" name="poweron" title="Power On">
|
{% if inst.instance.is_template %}
|
||||||
|
<button class="btn btn-sm btn-default" type="button" name="clone" title="{% trans "Clone" %}" onclick="goto_instance_clone({{ vm.compute_id }}, '{{ vm.name }}');">
|
||||||
|
<span class="glyphicon glyphicon-duplicate"></span>
|
||||||
|
</button>
|
||||||
|
{% else %}
|
||||||
|
<button class="btn btn-sm btn-default" type="submit" name="poweron" title="{% trans "Power On" %}">
|
||||||
<span class="glyphicon glyphicon-play"></span>
|
<span class="glyphicon glyphicon-play"></span>
|
||||||
</button>
|
</button>
|
||||||
|
{% endif %}
|
||||||
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
<button class="btn btn-sm btn-default disabled" title="{% trans "Power Off" %}">
|
||||||
<span class="glyphicon glyphicon-off"></span>
|
<span class="glyphicon glyphicon-off"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -239,6 +251,11 @@
|
||||||
}(jQuery));
|
}(jQuery));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
<script>
|
||||||
|
function goto_instance_clone(compute, instance) {
|
||||||
|
window.location = "/instance/" + compute + "/" + instance + "/#clone";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<script>
|
<script>
|
||||||
function goto_compute() {
|
function goto_compute() {
|
||||||
|
|
Loading…
Reference in a new issue