diff --git a/docs_v1.0/doc_wasm/index.html b/docs_v1.0/doc_wasm/index.html index 5cf0227..3ac46a9 100644 --- a/docs_v1.0/doc_wasm/index.html +++ b/docs_v1.0/doc_wasm/index.html @@ -85,33 +85,39 @@ async function checkAuth() { } async function initApp() { - await init(); - - // Parse module list - modules = JSON.parse(module_list()); - const listEl = document.getElementById('module-list'); - modules.forEach(([name, cn, en]) => { - const a = document.createElement('a'); - a.className = 'module-link'; - a.dataset.module = name; - a.textContent = `${cn} - ${en}`; - a.onclick = (e) => { e.preventDefault(); loadDoc(name); }; - listEl.appendChild(a); - }); - - // Logout - document.getElementById('logout-btn').onclick = async (e) => { - e.preventDefault(); - await fetch(`${API}/api/v1/auth/logout`, {method:'POST'}); - window.location.reload(); - }; - - // Load initial module from hash or default - const hash = location.hash.slice(1); - if (hash) { - loadDoc(hash); - } else { - loadDoc('01_auth'); + const el = document.getElementById('content'); + try { + await init(); + el.innerHTML = '
WASM initialized. Loading modules...
'; + + // Parse module list + modules = JSON.parse(module_list()); + const listEl = document.getElementById('module-list'); + modules.forEach(([name, cn, en]) => { + const a = document.createElement('a'); + a.className = 'module-link'; + a.dataset.module = name; + a.textContent = `${cn} - ${en}`; + a.onclick = (e) => { e.preventDefault(); loadDoc(name); }; + listEl.appendChild(a); + }); + + // Logout + document.getElementById('logout-btn').onclick = async (e) => { + e.preventDefault(); + await fetch(`${API}/api/v1/auth/logout`, {method:'POST'}); + window.location.reload(); + }; + + // Load initial module from hash or default + const hash = location.hash.slice(1); + if (hash) { + loadDoc(hash); + } else { + loadDoc('01_auth'); + } + } catch(e) { + el.innerHTML = `WASM init error: ${e.message}
${e.stack}`;
}
}
@@ -121,6 +127,7 @@ window.onpopstate = () => {
if (hash) loadDoc(hash);
};
+document.getElementById('content').innerHTML = 'Starting WASM...
'; initApp();