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

",L(LS_LOADING)); - H("
%s
",L(LS_IMAGES)); - H("

%s

",L(LS_LOADING)); H(""); /* Panel: Debug Log */ @@ -1775,9 +1773,7 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { H("var _gpR=0;" "function loadGamePanel(retry){_gpR=(retry||0);" "var gl=document.getElementById('games-list');" - "var il=document.getElementById('images-list');" "if(gl)gl.innerHTML='

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+='
';" - "h+=(tid?'':\"\");" + /* CSS background-image: loads silently, no broken image icon if missing */ + "var icbg=tid?'background-image:url(/api/game/icon?title_id='+tid+');background-size:cover;':'';" + "var ic='
'+(!img.mounted&&tid?tid.substring(0,4):'')+'
';" + "h+='
'+ic;" "h+='
';" "h+='
'+fn+'
';" - "h+='
'+(tid||'')+' — '+sz+'
';" + "h+='
'+(tid||'–')+' — '+sz+'
';" "h+='
'+mn+ba+'
';" "});gl.innerHTML=h;" "}else{" - "gl.innerHTML=((!gd||gd.error||gd.status)?'

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='';" - "ih+='';" - "ih+='';" - "ih+='';" - "ih+='';" - "id.images.forEach(function(img,i){" - "var parts=(img.path||'').split('/');" - "var fn=parts.pop()||img.path;" - "var dir=parts.join('/')||'/';" - "var ext=fn.indexOf('.')>-1?fn.split('.').pop().toUpperCase():'';" - "var sz=img.size?(img.size>1073741824?(img.size/1073741824).toFixed(2)+' GB':(img.size/1048576).toFixed(0)+' MB'):'?';" - "var st=img.mounted?'● aktiv':'○';" - "var iba=img.mounted" - "?''" - ":'';" - "ih+='';" - "ih+='';" - "ih+='';" - "ih+='';" - "ih+='';" - "});ih+='
Datei / PfadTypGr\\u00f6\\u00dfeMount
'+fn+'';" - "ih+='
'+dir+'
'+ext+''+sz+''+st+' '+iba+'
';il.innerHTML=ih;});}" + "gl.innerHTML=((!gd||gd.error||gd.status)?'

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){"