Commit 48d04736 by Bence Dányi

webui: state display fixed

parent 508ff864
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
{% block js %} {% block js %}
<script type="text/javascript"> <script type="text/javascript">
{% if booting or state != 'ACTIVE' or i.waiting %} {% if booting or state == 'PENDING' or i.waiting %}
var timer=setInterval(function(){ var timer=setInterval(function(){
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
dataType: 'json', dataType: 'json',
url: '{% url one.views.vm_ajax_instance_status id %}', url: '{% url one.views.vm_ajax_instance_status id %}',
success: function(data){ success: function(data){
if (!data.waiting && !data.booting && data.state == 'ACTIVE'){ if (!data.waiting && !data.booting && data.state != 'PENDING'){
window.location.reload(); window.location.reload();
} else if (!data.waiting) { } else if (!data.waiting) {
window.location.reload(); // window.location.reload();
} }
} }
}); });
...@@ -86,14 +86,20 @@ ...@@ -86,14 +86,20 @@
<img src="{% static "image/load.gif" %}" /> <img src="{% static "image/load.gif" %}" />
{% trans "Saving..." %} {% trans "Saving..." %}
</p> </p>
{% elif state == "ACTIVE" and not booting %} {% elif state == "ACTIVE" and not booting and not i.waiting %}
<p id="connect" style="display:block; font-size:25px; line-height:2em;text-align:center;"> <p id="connect" style="display:block; font-size:25px; line-height:2em;text-align:center;">
<a href="{{uri}}" class="button" onclick="return connectbutton();"> <a href="{{uri}}" class="button" onclick="return connectbutton();">
<img src="{% static "image/load.gif" %}" id="connecting" style="display:none;" /> <img src="{% static "image/load.gif" %}" id="connecting" style="display:none;" />
{% trans "Running" %} {% trans "Running" %}
</a> </a>
</p> </p>
{% elif state == "STOPPED" %} {% elif state == "ACTIVE" and not booting and i.waiting %}
<p style="display:block; font-size:25px; line-height:2em;text-align:center;">
{% trans "Stopping..." %}
</p>
{% elif state == "STOPPED" and i.waiting %}
<p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Starting..." %}</p>
{% elif state == "STOPPED"%}
<p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Stopped" %}</p> <p style="font-size:25px; line-height:2em;text-align:center;">{% trans "Stopped" %}</p>
{% endif %} {% endif %}
{% if state == "DONE" %} {% if state == "DONE" %}
......
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