mirror of
https://github.com/retspen/webvirtcloud
synced 2026-12-02 08:56:07 +00:00
perf(instances): the VM page lists ISO images without reading every pool
The VM page refreshed every active storage pool to list the ISO images for its CD-ROM drives. A pool holding large disk images took up to seconds to refresh, most of the page's time, on every page load. The page now lists the ISO images libvirt already knows. Images uploaded through the panel are known at once. For an image copied to a pool by hand, the Removable media section has a Refresh ISO list button that refreshes the active pools and returns to the page.
This commit is contained in:
parent
37905a0b75
commit
d5d054de71
6 changed files with 52 additions and 19 deletions
|
|
@ -1685,6 +1685,14 @@ def mount_iso(request, pk):
|
|||
return redirect(same_origin_referer(request, reverse("instances:instance", args=[pk])) + "#disks")
|
||||
|
||||
|
||||
@require_POST
|
||||
@superuser_only
|
||||
def refresh_iso(request, pk):
|
||||
instance = get_instance(request.user, pk, perm_type="change")
|
||||
instance.proxy.refresh_iso_pools()
|
||||
return _back(request, pk, "disks")
|
||||
|
||||
|
||||
@require_POST
|
||||
def snapshot(request, pk):
|
||||
return _snapshot_job(request, pk, "snapshot.create",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue