diff --git a/main.c b/main.c index 3fbdd3a..b0b0354 100644 --- a/main.c +++ b/main.c @@ -1607,8 +1607,6 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { "
"); H("%s
%s
Lade...
';" - "if(il)il.innerHTML='';" "var gp=fetch('/api/sm/games',{method:'POST'}).then(function(r){return r.json();}).catch(function(){return null;});" "var ip=fetch('/api/sm/images',{method:'POST'}).then(function(r){return r.json();}).catch(function(){return null;});" "Promise.all([gp,ip]).then(function(res){" @@ -1801,45 +1797,27 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { "var ba=img.mounted" "?''" ":'';" - "h+='SM API nicht erreichbar
':'Keine Spiele gefunden
');" - "}" - "if(!il)return;" - "if(!id||id.error||id.status){il.innerHTML=''+(id&&id.error?id.error:'nicht erreichbar')+'
';return;}" - "if(!id.images||!id.images.length){il.innerHTML='Keine Image-Dateien gefunden
';return;}" - "var ih='| Datei / Pfad | ';" - "ih+='Typ | Gr\\u00f6\\u00dfe | ';" - "ih+='Mount |
|---|---|---|---|
| '+fn+'';"
- "ih+=' '+dir+' | ';"
- "ih+=''+ext+' | ';" - "ih+=''+sz+' | ';" - "ih+=''+st+' '+iba+' |
SM API nicht erreichbar — l\\u00e4uft ShadowMountPlus?
':'Keine Spiele gefunden
');" + "}});}" "function loadGames(){loadGamePanel(0);}" "function _smMount(i){var g=window._smG&&window._smG[i];if(!g)return;" + "var gl=document.getElementById('games-list');" + "if(gl)gl.innerHTML='Mounting...
';" "if(g.tid)mountGame(g.tid);else manualMount(g.path);}" - "function _smUnmount(i){var g=window._smG&&window._smG[i];if(g&&g.tid)unmountGame(g.tid);}"); + "function _smUnmount(i){var g=window._smG&&window._smG[i];if(!g)return;" + "var gl=document.getElementById('games-list');" + "if(gl)gl.innerHTML='Unmounting...
';" + "if(g.tid)unmountGame(g.tid);}"); H("function smRawDebug(){" "var dbg=document.getElementById('sm-raw-dbg');" "var pre=document.getElementById('sm-raw-pre');" @@ -1853,12 +1831,12 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { "pre.textContent='=== /api/v1/games ===\\n'+res[0]+'\\n\\n=== /api/v1/images ===\\n'+res[1];" "});}" "function manualMount(path){" - "var il=document.getElementById('images-list');" - "if(il)il.innerHTML='Mounting...
';" + "var gl=document.getElementById('games-list');" + "if(gl)gl.innerHTML='Mounting...
';" "fetch('/api/manual/add?path='+encodeURIComponent(path),{method:'POST'})" ".then(function(r){return r.json();})" ".then(function(d){" - "if(d.error&&il)il.innerHTML=''+d.error+'
';" + "if(d.error&&gl)gl.innerHTML=''+d.error+'
';" "setTimeout(function(){loadGamePanel(0);},4000);})" ".catch(function(){setTimeout(function(){loadGamePanel(0);},4000);});}" "function renderGamesList(el,games){"