1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-10 04:06:47 +00:00

style(instances): the XML tab's editor is taller and its review marks the changed lines

The VM's XML editor takes most of the window's height and is framed like
a form field. The review dialog shows removed and added lines on a red and
green tint, and each part of the diff starts with its line number instead
of the unified diff's @@ header.
This commit is contained in:
catborise 2026-11-04 14:17:45 +03:00
parent 9cda2f4e1b
commit ab2192ef5f
7 changed files with 243 additions and 211 deletions

View file

@ -629,7 +629,7 @@
{% endif %}
<form action="{% url 'instances:change_xml' instance.id %}" method="post" role="form" aria-label="Edit instance XML form" id="xml-form">
{% csrf_token %}
<div class="col-sm-12 xmlheight">
<div class="xml-editor mb-3">
<textarea id="editor">{{ instance.inst_xml }}</textarea>
</div>
<button type="submit" class="btn btn-primary float-end" name="change_xml">{% trans "Review changes" %}</button>
@ -646,7 +646,7 @@
<div class="modal-body">
<div class="alert alert-danger d-none" role="alert" id="xml-review-error"></div>
<p class="d-none" id="xml-review-same">{% trans "The XML is the same as the VM's definition; there is nothing to save." %}</p>
<pre class="d-none mb-0" id="xml-review-diff"></pre>
<pre class="d-none mb-0 xml-diff" id="xml-review-diff" data-line="{% blocktrans with line="__line__" %}Line {{ line }}{% endblocktrans %}"></pre>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-outline-secondary" data-bs-dismiss="modal">{% trans "Cancel" %}</button>