1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix(tags): second audit: unchanged saves, report, other lists, hosts list

- Saving a VM's tags unchanged writes no audit row.
- The VM report has a Tags column.
- A host's VM list and a user's VMs (account page) show the VMs' tags.
- The hosts list says "No host matches the filters." with Clear the
  filters, as the VM list does; the tag list keeps to a phone's width
  with a long tag.
- A removed VM's delete page says its owners and tags no longer come
  back; the VM history rows say "owners and tags kept/restored".
- The API's ?tag= is trimmed; Tom Select's "Add tag" line shows the name
  in lower case as it is made; Bulk Migrate's tag list goes back to its
  title after a choice, so the same tag can be chosen again.
This commit is contained in:
catborise 2026-11-18 23:15:34 +03:00
parent 45225df1a4
commit b74e798e70
23 changed files with 376 additions and 324 deletions

View file

@ -66,6 +66,7 @@
<div class="col-12 col-md-6">
<a class="fw-semibold text-break" href="{% url 'instances:instance' inst.instance.id %}">{{ inst.instance.name }}</a>
<div class="small text-body-secondary text-break">{% trans "Host" %}: {{ inst.instance.compute.name }}</div>
{% include 'common/tag_badges.html' with tags=inst.instance.tags.all %}
</div>
<div class="col-12 col-md-6 d-flex flex-wrap gap-1">
{# the rights as the VM's Users tab names them: every owner powers the VM and opens its console #}

View file

@ -192,7 +192,7 @@ def ssh_key_delete(request, pk, user_id=None):
@superuser_only
def account(request, user_id):
user = get_object_or_404(User, id=user_id)
user_insts = UserInstance.objects.filter(user_id=user_id).select_related("instance__compute")
user_insts = UserInstance.objects.filter(user_id=user_id).select_related("instance__compute").prefetch_related("instance__tags")
publickeys = UserSSHKey.objects.filter(user_id=user_id)
return render(