diff --git a/public/admin.html b/public/admin.html index c3f04a0..7d6dc37 100644 --- a/public/admin.html +++ b/public/admin.html @@ -37,8 +37,9 @@ + +
@@ -58,12 +59,17 @@ } async function api(path, options = {}) { + const statusEl = document.getElementById('status'); + statusEl.textContent = 'Consultando ' + path + '...'; const res = await fetch(withTenant(`${apiRoot}${path}`), options); const data = await res.json().catch(() => null); if (!res.ok) { const err = data?.message ? data.message : res.statusText; + statusEl.textContent = `Error ${res.status}`; throw new Error(err || `HTTP ${res.status}`); } + statusEl.textContent = 'OK'; + setTimeout(() => (statusEl.textContent = ''), 1500); return data; }