1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 11:46:49 +00:00

fix(interfaces): no create, start, stop or delete where libvirt cannot change interfaces

libvirt's udev interface backend (RHEL 9 and later, Debian 12) only reads
interfaces, so the create form and the start, stop and delete buttons
only failed there. The pages ask the host with an invalid definition,
which defines nothing: a backend without define refuses it as not
supported. There they show the interface state and a note instead, and
posts change nothing; the host's devices, needed only by the create
form, are not read. Any other answer keeps the pages as they were.
This commit is contained in:
catborise 2026-10-10 21:27:31 +03:00
parent 35fea424ee
commit 0bb4337043
9 changed files with 175 additions and 12 deletions

View file

@ -35,6 +35,7 @@
</div>
</div>
{% if changeable is False %}{% include 'interfaces_unchangeable.html' %}{% endif %}
<div class="row">
<dl class="ms-3 row">
<dt class="col-4">{% trans "Interface" %}</dt>
@ -55,6 +56,9 @@
<dd class="col-8">{{ start_mode }}</dd>
<dt class="col-4">{% trans "State" %}</dt>
<dd class="col-8">
{% if changeable is False %}
{% if state == 0 %}{% trans "Inactive" %}{% else %}{% trans "Active" %}{% endif %}
{% else %}
<form action="" method="post" role="form" aria-label="Interface start/stop/delete form">{% csrf_token %}
{% if state == 0 %}
<input type="submit" class="btn btn-sm btn-primary" name="start" value="{% trans "Start" %}">
@ -63,6 +67,7 @@
<input type="submit" class="btn btn-sm btn-secondary" name="stop" value="{% trans "Stop" %}" onclick="return confirm('{% trans "Are you sure?" %}')">
{% endif %}
</form>
{% endif %}
</dd>
</dl>