From 945217c5368c8b609fefecafb0f8d55635927bdd Mon Sep 17 00:00:00 2001 From: "Othman H. Suseno" Date: Thu, 18 Dec 2025 12:07:23 +0700 Subject: [PATCH] fix delete stuck UI --- web/templates/storage.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/web/templates/storage.html b/web/templates/storage.html index af30586..1332446 100644 --- a/web/templates/storage.html +++ b/web/templates/storage.html @@ -256,7 +256,14 @@ function getAuthHeaders() { async function loadPools() { try { - const res = await fetch('/api/v1/pools', { headers: getAuthHeaders() }); + // Add cache-busting to ensure fresh data + const res = await fetch('/api/v1/pools?_=' + Date.now(), { + headers: { + ...getAuthHeaders(), + 'Cache-Control': 'no-cache', + 'Pragma': 'no-cache' + } + }); const data = await res.json().catch(() => null); const listEl = document.getElementById('pools-list'); @@ -621,7 +628,9 @@ async function deletePool(name) { }); if (res.ok) { - loadPools(); + // Wait a moment for the deletion to fully complete, then refresh + await new Promise(resolve => setTimeout(resolve, 500)); + await loadPools(); alert('Pool deleted successfully'); } else { const err = await res.json();