Commit dc494113 by Őry Máté

connect only if booted

parent 4dd1f4cc
...@@ -3,23 +3,8 @@ ...@@ -3,23 +3,8 @@
{% block js %} {% block js %}
<script type="text/javascript"> <script type="text/javascript">
{% if state == "PENDING" %} {% if booting %}
setTimeout("location.reload(true);", 1500) setTimeout("location.reload(true);", 2000);
{% endif %}
{% if state == "ACTIVE" %}
{% if age < 15 %}
setTimeout("document.getElementById('wait').style.display='none';document.getElementById('connect').style.display='block';", 15000-{{age}}000);
{% endif %}
var meloading = false;
function connectbutton() {
if (meloading) {
return false;
}
meloading = true;
setTimeout("document.getElementById('connecting').style.display='none';meloading=false;", 15000);
document.getElementById('connecting').style.display='inline';
return true;
}
{% endif %} {% endif %}
</script> </script>
{% endblock %} {% endblock %}
...@@ -29,14 +14,14 @@ ...@@ -29,14 +14,14 @@
<div class="contentblock" id="state"> <div class="contentblock" id="state">
<h2>{{name}}</h2> <h2>{{name}}</h2>
<div class="content"> <div class="content">
{% if state == "PENDING" %} {% if state == "PENDING" or state == "ACTIVE" and booting %}
<p style="font-size:25px; line-height:2em;text-align:center;"><img src="/static/load-2.gif" /> Gép indítása..</p> <p style="font-size:25px; line-height:2em;text-align:center;"><img src="/static/load-2.gif" /> Gép indítása..</p>
<p style="font-size:25px; line-height:2em;text-align:center;"> <p style="font-size:25px; line-height:2em;text-align:center;">
<form action="{% url vm_delete id %}" method="post" onsubmit="return confirm('Biztosan törli a gépet?')">{% csrf_token %}<input type="submit" class="icon-delete" value="Törlés" /></form> <form action="{% url vm_delete id %}" method="post" onsubmit="return confirm('Biztosan törli a gépet?')">{% csrf_token %}<input type="submit" class="icon-delete" value="Törlés" /></form>
<a href="/"><img src="/static/icons/Go-home.png" alt="&lt;-" /></a> <a href="/"><img src="/static/icons/Go-home.png" alt="&lt;-" /></a>
</p> </p>
{% endif %} {% endif %}
{% if state == "ACTIVE" %} {% if state == "ACTIVE" and not booting %}
{% if age < 15 %} {% if age < 15 %}
<p id="wait" style="font-size:25px; line-height:2em;text-align:center;"><img src="/static/load-2.gif" /> Gép indítása...</p> <p id="wait" style="font-size:25px; line-height:2em;text-align:center;"><img src="/static/load-2.gif" /> Gép indítása...</p>
<p id="connect" style="display:none; font-size:25px; line-height:2em;text-align:center;"> <p id="connect" style="display:none; font-size:25px; line-height:2em;text-align:center;">
......
...@@ -105,7 +105,8 @@ def vm_show(request, iid): ...@@ -105,7 +105,8 @@ def vm_show(request, iid):
'id': iid, 'id': iid,
'age': inst.get_age(), 'age': inst.get_age(),
'instances': _list_instances(request), 'instances': _list_instances(request),
'i': inst 'i': inst,
'booting' : inst.active_since,
})) }))
class VmDeleteView(View): class VmDeleteView(View):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment