mirror of
https://github.com/retspen/webvirtcloud
synced 2025-07-31 12:41:08 +00:00
replace deprecated ifequal/ifnotequal with if
This commit is contained in:
parent
e46bb99b3b
commit
6a0d04d300
14 changed files with 74 additions and 74 deletions
|
@ -34,12 +34,12 @@
|
|||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
{% ifequal view_style "nongrouped" %}
|
||||
{% if view_style == "nongrouped" %}
|
||||
{% include 'allinstances_index_nongrouped.html' %}
|
||||
{% endifequal %}
|
||||
{% ifequal view_style "grouped" %}
|
||||
{% endif %}
|
||||
{% if view_style == "grouped" %}
|
||||
{% include 'allinstances_index_grouped.html' %}
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% else %}
|
||||
{% if not all_user_vms %}
|
||||
|
@ -64,15 +64,15 @@
|
|||
{% for inst, vm in all_user_vms.items %}
|
||||
<tr>
|
||||
<td><a href="{% url 'instance' vm.compute_id vm.name %}">{{ vm.name }}</a><br><small><em>{{ vm.title }}</em></small></td>
|
||||
<td>{% ifequal vm.status 1 %}
|
||||
<td>{% if vm.status == 1 %}
|
||||
<span class="text-success">{% trans "Active" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 5 %}
|
||||
{% endif %}
|
||||
{% if vm.status == 5 %}
|
||||
<span class="text-danger">{% trans "Off" %}</span>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 3 %}
|
||||
{% endif %}
|
||||
{% if vm.status == 3 %}
|
||||
<span class="text-warning">{% trans "Suspend" %}</span>
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ vm.vcpu }}</td>
|
||||
<td>{{ vm.memory }} {% trans "MB" %}</td>
|
||||
|
|
|
@ -23,9 +23,9 @@
|
|||
</td>
|
||||
<td class="d-none d-sm-table-cell"></td>
|
||||
<td>
|
||||
{% ifequal host.2 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
||||
{% ifequal host.2 2 %}<span class="text-warning">{% trans "Not Active" %}</span>{% endifequal %}
|
||||
{% ifequal host.2 3 %}<span class="text-danger">{% trans "Connection Failed" %}</span>{% endifequal %}
|
||||
{% if host.2 == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||
{% if host.2 == 2 %}<span class="text-warning">{% trans "Not Active" %}</span>{% endif %}
|
||||
{% if host.2 == 3 %}<span class="text-danger">{% trans "Connection Failed" %}</span>{% endif %}
|
||||
</td>
|
||||
<td class="d-none d-sm-table-cell text-center">{{ host.3 }}</td>
|
||||
<td class="d-none d-sm-table-cell text-right">{{ host.4|filesizeformat }}</td>
|
||||
|
@ -53,9 +53,9 @@
|
|||
</span>
|
||||
</td>
|
||||
<td>
|
||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
||||
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||
</td>
|
||||
<td class="d-none d-sm-table-cell text-center">{{ vm.vcpu }}</td>
|
||||
<td class="d-none d-sm-table-cell text-right">{{ vm.memory |filesizeformat }}</td>
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
<td><a href="{% url 'instance' host.0 inst %}">{{ inst }}</a><br><small><em>{{ info.title }}</em></small></td>
|
||||
<td><a href="{% url 'overview' host.0 %}">{{ host.1 }}</a><br><small><em>{% if info.userinstances.count > 0 %}{{ info.userinstances.first_user.user.username }}{% if info.userinstances.count > 1 %} (+{{ info.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
|
||||
<td>
|
||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
||||
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||
</td>
|
||||
<td>{{ vm.vcpu }}</td>
|
||||
<td>{{ vm.memory|filesizeformat }}</td>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %}
|
||||
<input type="hidden" name="name" value="{{ inst }}"/>
|
||||
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
||||
{% ifequal vm.status 5 %}
|
||||
{% if vm.status == 5 %}
|
||||
{% if vm.is_template %}
|
||||
<button class="btn btn-sm btn-secondary" type="button" name="clone" title="{% trans "Clone" %}" onclick="goto_instance_clone({{ host.0 }}, '{{ inst }}');">
|
||||
<span class="fa fa-clone"></span>
|
||||
|
@ -24,8 +24,8 @@
|
|||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
||||
<span class="fa fa-eye"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 3 %}
|
||||
{% endif %}
|
||||
{% if vm.status == 3 %}
|
||||
<button class="btn btn-sm btn-secondary" type="submit" name="resume" title="{% trans "Resume" %}">
|
||||
<span class="fa fa-play"></span>
|
||||
</button>
|
||||
|
@ -41,8 +41,8 @@
|
|||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
||||
<span class="fa fa-eye"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% ifequal vm.status 1 %}
|
||||
{% endif %}
|
||||
{% if vm.status == 1 %}
|
||||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power On" %}" disabled>
|
||||
<span class="fa fa-play"></span>
|
||||
</button>
|
||||
|
@ -58,5 +58,5 @@
|
|||
<button class="btn btn-sm btn-secondary" type="button" onclick='open_console("{{ host.0 }}-{{ vm.uuid }}")' title="{% trans "Console" %}">
|
||||
<span class="fa fa-eye"></span>
|
||||
</button>
|
||||
{% endifequal %}
|
||||
{% endif %}
|
||||
</form>
|
|
@ -82,9 +82,9 @@
|
|||
<td><a class="text-secondary" href="{% url 'instance' host.0 inst %}">{{ inst }}</a><br><small><em>{{ vm.title }}</em></small></td>
|
||||
<td class="d-none d-md-table-cell"><small><em>{% if vm.userinstances.count > 0 %}{{ vm.userinstances.first_user.user.username }}{% if vm.userinstances.count > 1 %} (+{{ vm.userinstances.count|add:"-1" }}){% endif %}{% endif %}</em></small></td>
|
||||
<td>
|
||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
||||
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||
</td>
|
||||
<td>{{ vm.vcpu }}</td>
|
||||
<td>{{ vm.memory|filesizeformat }}</td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue