1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-25 15:45:23 +00:00

Mark the unreachable computes properly

When a compute can not be connected (for whatever reason) mark it as
not connected in the template.

The generic check

  if compute.status

is not enough because the status variable can contain a string with a
connection error.
This commit is contained in:
Tomas Hlavacek 2020-01-01 23:11:44 +01:00 committed by catborise
parent c62e6ba3bc
commit 2058395081

View file

@ -17,7 +17,7 @@
{% if computes_info %} {% if computes_info %}
{% for compute in computes_info %} {% for compute in computes_info %}
<div id="{{ compute.name }}" class="col-xs-12 col-sm-4"> <div id="{{ compute.name }}" class="col-xs-12 col-sm-4">
<div class="panel {% if compute.status %}panel-success{% else %}panel-danger{% endif %} panel-data"> <div class="panel {% ifequal compute.status 1 %}panel-success{% else %}panel-danger{% endifequal %} panel-data">
<div class="panel-heading"> <div class="panel-heading">
{% ifequal compute.status 1 %} {% ifequal compute.status 1 %}
<h3 class="panel-title"> <h3 class="panel-title">
@ -40,11 +40,11 @@
<p><strong>{% trans "Status" %}:</strong></p> <p><strong>{% trans "Status" %}:</strong></p>
</div> </div>
<div class="col-xs-4 col-sm-6"> <div class="col-xs-4 col-sm-6">
{% if compute.status %} {% ifequal compute.status 1 %}
<p>{% trans "Connected" %}</p> <p>{% trans "Connected" %}</p>
{% else %} {% else %}
<p>{% trans "Not Connected" %}</p> <p>{% trans "Not Connected" %}</p>
{% endif %} {% endifequal %}
{% if compute.details %} {% if compute.details %}
<p>{% trans compute.details %}</p> <p>{% trans compute.details %}</p>
{% else %} {% else %}