From 7204968187e5f19227603bebaa911cbdb4dc6931 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Tue, 14 Feb 2023 09:23:37 +0000 Subject: [PATCH] change disk icon to loading after action triggers --- scripts/config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/config.js b/scripts/config.js index ef6a1ea..5a90007 100644 --- a/scripts/config.js +++ b/scripts/config.js @@ -174,6 +174,7 @@ async function handleDiskDetach () { dialog.callback = async (result, form) => { if (result === "confirm") { + document.querySelector(`img[data-disk="${this.dataset.disk}"]`).src = "images/actions/loading.svg"; let body = { node: node, type: type, @@ -217,6 +218,7 @@ async function handleDiskAttach () { dialog.callback = async (result, form) => { if (result === "confirm") { + document.querySelector(`img[data-disk="${this.dataset.disk}"]`).src = "images/actions/loading.svg"; let action = {}; let bus = type === "qemu" ? "sata" : "mp"; let details = diskImage; @@ -265,6 +267,7 @@ async function handleDiskResize () { dialog.callback = async (result, form) => { if (result === "confirm") { + document.querySelector(`img[data-disk="${this.dataset.disk}"]`).src = "images/actions/loading.svg"; let body = { node: node, type: type, @@ -322,6 +325,7 @@ async function handleDiskMove () { dialog.callback = async (result, form) => { if (result === "confirm") { + document.querySelector(`img[data-disk="${this.dataset.disk}"]`).src = "images/actions/loading.svg"; let action = {storage: storageSelect.value, delete: deleteCheckbox.checked ? "1": "0"} if (type === "qemu") { // if vm, move disk action.disk = this.dataset.disk; @@ -367,6 +371,7 @@ async function handleDiskDelete () { dialog.callback = async (result, form) => { if (result === "confirm") { + document.querySelector(`img[data-disk="${this.dataset.disk}"]`).src = "images/actions/loading.svg"; let body = { node: node, type: type,