mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 15:45:23 +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
|
@ -59,7 +59,7 @@
|
||||||
<h5 class="modal-title">{% trans "Edit connection" %}</h5>
|
<h5 class="modal-title">{% trans "Edit connection" %}</h5>
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
{% ifequal compute.type 1 %}
|
{% if compute.type == 1 %}
|
||||||
<form method="post" role="form" aria-label="Edit tcp host form">{% csrf_token %}
|
<form method="post" role="form" aria-label="Edit tcp host form">{% csrf_token %}
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
@ -105,8 +105,8 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal compute.type 2 %}
|
{% if compute.type == 2 %}
|
||||||
<form method="post" role="form" aria-label="Edit ssh host form">{% csrf_token %}
|
<form method="post" role="form" aria-label="Edit ssh host form">{% csrf_token %}
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p class="modal-body">{% trans "Need create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
|
<p class="modal-body">{% trans "Need create ssh <a href='https://github.com/retspen/webvirtmgr/wiki/Setup-SSH-Authorization'>authorization key</a>. If you have another SSH port on your server, you can add IP:PORT like '192.168.1.1:2222'." %}</p>
|
||||||
|
@ -149,8 +149,8 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal compute.type 3 %}
|
{% if compute.type == 3 %}
|
||||||
<form method="post" role="form" aria-label="Edit tls host form">{% csrf_token %}
|
<form method="post" role="form" aria-label="Edit tls host form">{% csrf_token %}
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
@ -197,8 +197,8 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal compute.type 4 %}
|
{% if compute.type == 4 %}
|
||||||
<form method="post" role="form" aria-label="Edit/delete host form">{% csrf_token %}
|
<form method="post" role="form" aria-label="Edit/delete host form">{% csrf_token %}
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
|
@ -226,7 +226,7 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</div><!-- /.modal-content -->
|
</div><!-- /.modal-content -->
|
||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
|
@ -140,7 +140,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
{% else %}
|
{% else %}
|
||||||
<option value="{{ mode }}" {% ifequal mode default_cpu_mode %}selected {% endifequal %}>
|
<option value="{{ mode }}" {% if mode == default_cpu_mode %}selected {% endif %}>
|
||||||
{% trans mode %}
|
{% trans mode %}
|
||||||
</option>
|
</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -343,7 +343,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
{% else %}
|
{% else %}
|
||||||
<option value="{{ mode }}" {% ifequal mode default_cpu_mode %}selected {% endifequal %}>
|
<option value="{{ mode }}" {% if mode == default_cpu_mode %}selected {% endif %}>
|
||||||
{% trans mode %}
|
{% trans mode %}
|
||||||
</option>
|
</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -555,7 +555,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</optgroup>
|
</optgroup>
|
||||||
{% else %}
|
{% else %}
|
||||||
<option value="{{ mode }}" {% ifequal mode default_cpu_mode %}selected {% endifequal %}>
|
<option value="{{ mode }}" {% if mode == default_cpu_mode %}selected{% endif %}>
|
||||||
{% trans mode %}
|
{% trans mode %}
|
||||||
</option>
|
</option>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -34,12 +34,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% ifequal view_style "nongrouped" %}
|
{% if view_style == "nongrouped" %}
|
||||||
{% include 'allinstances_index_nongrouped.html' %}
|
{% include 'allinstances_index_nongrouped.html' %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal view_style "grouped" %}
|
{% if view_style == "grouped" %}
|
||||||
{% include 'allinstances_index_grouped.html' %}
|
{% include 'allinstances_index_grouped.html' %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% if not all_user_vms %}
|
{% if not all_user_vms %}
|
||||||
|
@ -64,15 +64,15 @@
|
||||||
{% for inst, vm in all_user_vms.items %}
|
{% for inst, vm in all_user_vms.items %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="{% url 'instance' vm.compute_id vm.name %}">{{ vm.name }}</a><br><small><em>{{ vm.title }}</em></small></td>
|
<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>
|
<span class="text-success">{% trans "Active" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal vm.status 5 %}
|
{% if vm.status == 5 %}
|
||||||
<span class="text-danger">{% trans "Off" %}</span>
|
<span class="text-danger">{% trans "Off" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal vm.status 3 %}
|
{% if vm.status == 3 %}
|
||||||
<span class="text-warning">{% trans "Suspend" %}</span>
|
<span class="text-warning">{% trans "Suspend" %}</span>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ vm.vcpu }}</td>
|
<td>{{ vm.vcpu }}</td>
|
||||||
<td>{{ vm.memory }} {% trans "MB" %}</td>
|
<td>{{ vm.memory }} {% trans "MB" %}</td>
|
||||||
|
|
|
@ -23,9 +23,9 @@
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none d-sm-table-cell"></td>
|
<td class="d-none d-sm-table-cell"></td>
|
||||||
<td>
|
<td>
|
||||||
{% ifequal host.2 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
{% if host.2 == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||||
{% ifequal host.2 2 %}<span class="text-warning">{% trans "Not Active" %}</span>{% endifequal %}
|
{% if host.2 == 2 %}<span class="text-warning">{% trans "Not Active" %}</span>{% endif %}
|
||||||
{% ifequal host.2 3 %}<span class="text-danger">{% trans "Connection Failed" %}</span>{% endifequal %}
|
{% if host.2 == 3 %}<span class="text-danger">{% trans "Connection Failed" %}</span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none d-sm-table-cell text-center">{{ host.3 }}</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>
|
<td class="d-none d-sm-table-cell text-right">{{ host.4|filesizeformat }}</td>
|
||||||
|
@ -53,9 +53,9 @@
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td class="d-none d-sm-table-cell text-center">{{ vm.vcpu }}</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>
|
<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 '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><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>
|
<td>
|
||||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ vm.vcpu }}</td>
|
<td>{{ vm.vcpu }}</td>
|
||||||
<td>{{ vm.memory|filesizeformat }}</td>
|
<td>{{ vm.memory|filesizeformat }}</td>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<form action="" method="post" role="form" aria-label="Shortcut instance action form">{% csrf_token %}
|
<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="name" value="{{ inst }}"/>
|
||||||
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
<input type="hidden" name="compute_id" value="{{ host.0 }}"/>
|
||||||
{% ifequal vm.status 5 %}
|
{% if vm.status == 5 %}
|
||||||
{% if vm.is_template %}
|
{% 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 }}');">
|
<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>
|
<span class="fa fa-clone"></span>
|
||||||
|
@ -24,8 +24,8 @@
|
||||||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
||||||
<span class="fa fa-eye"></span>
|
<span class="fa fa-eye"></span>
|
||||||
</button>
|
</button>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal vm.status 3 %}
|
{% if vm.status == 3 %}
|
||||||
<button class="btn btn-sm btn-secondary" type="submit" name="resume" title="{% trans "Resume" %}">
|
<button class="btn btn-sm btn-secondary" type="submit" name="resume" title="{% trans "Resume" %}">
|
||||||
<span class="fa fa-play"></span>
|
<span class="fa fa-play"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -41,8 +41,8 @@
|
||||||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
<button class="btn btn-sm btn-secondary disabled" title="{% trans "VNC Console" %}" disabled>
|
||||||
<span class="fa fa-eye"></span>
|
<span class="fa fa-eye"></span>
|
||||||
</button>
|
</button>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal vm.status 1 %}
|
{% if vm.status == 1 %}
|
||||||
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power On" %}" disabled>
|
<button class="btn btn-sm btn-secondary disabled" title="{% trans "Power On" %}" disabled>
|
||||||
<span class="fa fa-play"></span>
|
<span class="fa fa-play"></span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -58,5 +58,5 @@
|
||||||
<button class="btn btn-sm btn-secondary" type="button" onclick='open_console("{{ host.0 }}-{{ vm.uuid }}")' title="{% trans "Console" %}">
|
<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>
|
<span class="fa fa-eye"></span>
|
||||||
</button>
|
</button>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</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><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 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>
|
<td>
|
||||||
{% ifequal vm.status 1 %}<span class="text-success">{% trans "Active" %}</span>{% endifequal %}
|
{% if vm.status == 1 %}<span class="text-success">{% trans "Active" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endifequal %}
|
{% if vm.status == 5 %}<span class="text-danger">{% trans "Off" %}</span>{% endif %}
|
||||||
{% ifequal vm.status 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endifequal %}
|
{% if vm.status == 3 %}<span class="text-warning">{% trans "Suspend" %}</span>{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ vm.vcpu }}</td>
|
<td>{{ vm.vcpu }}</td>
|
||||||
<td>{{ vm.memory|filesizeformat }}</td>
|
<td>{{ vm.memory|filesizeformat }}</td>
|
||||||
|
|
|
@ -39,36 +39,36 @@
|
||||||
<dl class="ml-3 row">
|
<dl class="ml-3 row">
|
||||||
<dt class="col-4">{% trans "Interface" %}</dt>
|
<dt class="col-4">{% trans "Interface" %}</dt>
|
||||||
<dd class="col-8"><strong>{{ iface }}</strong></dd>
|
<dd class="col-8"><strong>{{ iface }}</strong></dd>
|
||||||
<dt class="col-4">{% trans "IPv4" %} ({% ifequal ipv4 None %}{% trans 'None' %}{% else %}{{ ipv4_type }}{% endifequal %})</dt>
|
<dt class="col-4">{% trans "IPv4" %} ({% if ipv4 == None %}{% trans 'None' %}{% else %}{{ ipv4_type }}{% endif %})</dt>
|
||||||
<dd class="col-8">{{ ipv4 }}</dd>
|
<dd class="col-8">{{ ipv4 }}</dd>
|
||||||
<dt class="col-4">{% trans "IPv6" %} ({% ifequal ipv6 None %}{% trans 'None' %}{% else %}{{ ipv6_type }}{% endifequal %})</dt>
|
<dt class="col-4">{% trans "IPv6" %} ({% if ipv6 == None %}{% trans 'None' %}{% else %}{{ ipv6_type }}{% endif %})</dt>
|
||||||
<dd class="col-8">{{ ipv6 }}</dd>
|
<dd class="col-8">{{ ipv6 }}</dd>
|
||||||
<dt class="col-4">{% trans "MAC" %}</dt>
|
<dt class="col-4">{% trans "MAC" %}</dt>
|
||||||
<dd class="col-8">{{ mac }}</dd>
|
<dd class="col-8">{{ mac }}</dd>
|
||||||
<dt class="col-4">{% trans "Interface Type" %}</dt>
|
<dt class="col-4">{% trans "Interface Type" %}</dt>
|
||||||
<dd class="col-8">{{ itype }}</dd>
|
<dd class="col-8">{{ itype }}</dd>
|
||||||
{% ifequal itype 'bridge' %}
|
{% if itype == 'bridge' %}
|
||||||
<dt class="col-4">{% trans "Bridge Device" %}</dt>
|
<dt class="col-4">{% trans "Bridge Device" %}</dt>
|
||||||
<dd class="col-8">{{ bridge }}</dd>
|
<dd class="col-8">{{ bridge }}</dd>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
<dt class="col-4">{% trans "Boot Mode" %}</dt>
|
<dt class="col-4">{% trans "Boot Mode" %}</dt>
|
||||||
<dd class="col-8">{{ start_mode }}</dd>
|
<dd class="col-8">{{ start_mode }}</dd>
|
||||||
<dt class="col-4">{% trans "State" %}</dt>
|
<dt class="col-4">{% trans "State" %}</dt>
|
||||||
<dd class="col-8">
|
<dd class="col-8">
|
||||||
<form action="" method="post" role="form" aria-label="Interface start/stop/delete form">{% csrf_token %}
|
<form action="" method="post" role="form" aria-label="Interface start/stop/delete form">{% csrf_token %}
|
||||||
{% ifequal state 0 %}
|
{% if state == 0 %}
|
||||||
<input type="submit" class="btn btn-sm btn-primary" name="start" value="{% trans "Start" %}">
|
<input type="submit" class="btn btn-sm btn-primary" name="start" value="{% trans "Start" %}">
|
||||||
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<h5>{% trans 'Slaves' %}</h5>
|
<h5>{% trans 'Slaves' %}</h5>
|
||||||
{% ifequal itype 'bridge' %}
|
{% if itype == 'bridge' %}
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -91,7 +91,7 @@
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,8 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
{% for iface in ifaces_all %}
|
{% for iface in ifaces_all %}
|
||||||
<div class="col-12 col-sm-4">
|
<div class="col-12 col-sm-4">
|
||||||
<div class="mb-3 card {% ifequal iface.state 1 %}border-success{% else %}border-danger{% endifequal %} shadow-sm">
|
<div class="mb-3 card {% if iface.state == 1 %}border-success{% else %}border-danger{% endif %} shadow-sm">
|
||||||
<div class="card-header {% ifequal iface.state 1 %}bg-success{% else %}bg-danger{% endifequal %}">
|
<div class="card-header {% if iface.state == 1 %}bg-success{% else %}bg-danger{% endif %}">
|
||||||
<h6 class="my-0 card-title">
|
<h6 class="my-0 card-title">
|
||||||
<a class="card-link text-light" href="{% url 'interface' compute.id iface.name %}">{{ iface.name }}</a>
|
<a class="card-link text-light" href="{% url 'interface' compute.id iface.name %}">{{ iface.name }}</a>
|
||||||
</h6>
|
</h6>
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
from django.shortcuts import render, get_object_or_404
|
from django.shortcuts import render, get_object_or_404
|
||||||
from django.http import HttpResponseRedirect
|
from django.http import HttpResponseRedirect
|
||||||
from django.urls import reverse
|
from django.urls import reverse
|
||||||
|
from libvirt import libvirtError
|
||||||
from computes.models import Compute
|
from computes.models import Compute
|
||||||
from interfaces.forms import AddInterface
|
from interfaces.forms import AddInterface
|
||||||
from vrtManager.interface import wvmInterface, wvmInterfaces
|
from vrtManager.interface import wvmInterface, wvmInterfaces
|
||||||
from libvirt import libvirtError
|
|
||||||
from admin.decorators import superuser_only
|
from admin.decorators import superuser_only
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,22 +48,22 @@
|
||||||
<dt class="col-6">{% trans "State" %}</dt>
|
<dt class="col-6">{% trans "State" %}</dt>
|
||||||
<dd class="col-6">
|
<dd class="col-6">
|
||||||
<form action="" method="post" role="form" aria-label="Network start/stop/delete form">{% csrf_token %}
|
<form action="" method="post" role="form" aria-label="Network start/stop/delete form">{% csrf_token %}
|
||||||
{% ifequal state 0 %}
|
{% if state == 0 %}
|
||||||
<input type="submit" class="btn btn-sm btn-success" name="start" value="{% trans "Start" %}">
|
<input type="submit" class="btn btn-sm btn-success" name="start" value="{% trans "Start" %}">
|
||||||
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="col-6">{% trans "Autostart" %}</dt>
|
<dt class="col-6">{% trans "Autostart" %}</dt>
|
||||||
<dd class="col-6">
|
<dd class="col-6">
|
||||||
<form action="" method="post" role="form" aria-label="Network enable/disable autostart form">{% csrf_token %}
|
<form action="" method="post" role="form" aria-label="Network enable/disable autostart form">{% csrf_token %}
|
||||||
{% ifequal autostart 0 %}
|
{% if autostart == 0 %}
|
||||||
<input type="submit" class="btn btn-sm btn-success" name="set_autostart" value="{% trans "Enable" %}">
|
<input type="submit" class="btn btn-sm btn-success" name="set_autostart" value="{% trans "Enable" %}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="unset_autostart" onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
<input type="submit" class="btn btn-sm btn-secondary" name="unset_autostart" onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
@ -94,15 +94,15 @@
|
||||||
<dl class="ml-3 row">
|
<dl class="ml-3 row">
|
||||||
<dt class="col-6">{% trans "IPv4 Forwarding" %}</dt>
|
<dt class="col-6">{% trans "IPv4 Forwarding" %}</dt>
|
||||||
<dd class="col-6">
|
<dd class="col-6">
|
||||||
{% ifequal net_forward.0 'nat' %}
|
{% if net_forward.0 == 'nat' %}
|
||||||
{% trans "NAT" %}
|
{% trans "NAT" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal net_forward.0 'route' %}
|
{% if net_forward.0 == 'route' %}
|
||||||
{% trans "ROUTE" %}
|
{% trans "ROUTE" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal net_forward.0 'bridge' %}
|
{% if net_forward.0 == 'bridge' %}
|
||||||
{% trans "BRIDGE" %}
|
{% trans "BRIDGE" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% if not net_forward.0 %}
|
{% if not net_forward.0 %}
|
||||||
{% trans "ISOLATE" %}
|
{% trans "ISOLATE" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -66,15 +66,15 @@
|
||||||
{% for secret in secrets_all %}
|
{% for secret in secrets_all %}
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{{ secret.uuid }}</th>
|
<th scope="row">{{ secret.uuid }}</th>
|
||||||
<td>{% ifequal secret.usageType 0 %}
|
<td>{% if secret.usageType == 0 %}
|
||||||
{% trans "volume" %}
|
{% trans "volume" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal secret.usageType 1 %}
|
{% if secret.usageType == 1 %}
|
||||||
{% trans "iscsi" %}
|
{% trans "iscsi" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% ifequal secret.usageType 2 %}
|
{% if secret.usageType 2 %}
|
||||||
{% trans "ceph" %}
|
{% trans "ceph" %}
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ secret.usage }}</td>
|
<td>{{ secret.usage }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
{% ifnotequal state 0 %}
|
{% if state != 0 %}
|
||||||
{% ifequal pool "iso" %}
|
{% if pool == "iso" %}
|
||||||
<a href="#IsoUpload" class="btn btn-success float-right" data-toggle="modal">
|
<a href="#IsoUpload" class="btn btn-success float-right" data-toggle="modal">
|
||||||
<span class="fa fa-plus" aria-hidden="true"></span>
|
<span class="fa fa-plus" aria-hidden="true"></span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -85,6 +85,6 @@
|
||||||
</div> <!-- /.modal-content -->
|
</div> <!-- /.modal-content -->
|
||||||
</div> <!-- /.modal-dialog -->
|
</div> <!-- /.modal-dialog -->
|
||||||
</div> <!-- /.modal -->
|
</div> <!-- /.modal -->
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
{% endifnotequal %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
|
@ -58,26 +58,26 @@
|
||||||
<dt class="col-6">{% trans "State" %}</dt>
|
<dt class="col-6">{% trans "State" %}</dt>
|
||||||
<dd class="col-6">
|
<dd class="col-6">
|
||||||
<form action="" method="post" role="form" aria-label="Storage start/stop form">{% csrf_token %}
|
<form action="" method="post" role="form" aria-label="Storage start/stop form">{% csrf_token %}
|
||||||
{% ifequal state 0 %}
|
{% if state == 0 %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="start" value="{% trans "Start" %}">
|
<input type="submit" class="btn btn-sm btn-secondary" name="start" value="{% trans "Start" %}">
|
||||||
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}"
|
<input type="submit" class="btn btn-sm btn-danger" name="delete" value="{% trans "Delete" %}"
|
||||||
onclick="return confirm('{% trans "Are you sure?" %}')">
|
onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}"
|
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}"
|
||||||
onclick="return confirm('{% trans "Are you sure?" %}')">
|
onclick="return confirm('{% trans "Are you sure?" %}')">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="col-6">{% trans "Autostart" %}</dt>
|
<dt class="col-6">{% trans "Autostart" %}</dt>
|
||||||
<dd class="col-6">
|
<dd class="col-6">
|
||||||
<form action="" method="post" role="form" aria-label="Storage disable/enable autostart form">{% csrf_token %}
|
<form action="" method="post" role="form" aria-label="Storage disable/enable autostart form">{% csrf_token %}
|
||||||
{% ifequal autostart 0 %}
|
{% if autostart == 0 %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="set_autostart"
|
<input type="submit" class="btn btn-sm btn-secondary" name="set_autostart"
|
||||||
value="{% trans "Enable" %}">
|
value="{% trans "Enable" %}">
|
||||||
{% else %}
|
{% else %}
|
||||||
<input type="submit" class="btn btn-sm btn-secondary" name="unset_autostart"
|
<input type="submit" class="btn btn-sm btn-secondary" name="unset_autostart"
|
||||||
onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
onclick="return confirm('{% trans "Are you sure?" %}')" value="{% trans "Disable" %}">
|
||||||
{% endifequal %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
Loading…
Reference in a new issue