From 77ca2cb52f5721b4867786c5cd727a46c537d840 Mon Sep 17 00:00:00 2001 From: KarnerF Date: Sun, 30 Aug 2026 13:12:06 +0200 Subject: [PATCH] Add Rohdaten debug button to show raw SM API responses --- main.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 25064d2..6e92879 100644 --- a/main.c +++ b/main.c @@ -1596,10 +1596,16 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { H("
"); H("
%s
",L(LS_GAMES)); if(!has_api) H("

ab 1.7alpha3

"); - H("
" - "
"); + ICO("ref") " Refresh" + "
"); + H(""); H("

%s

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

%s

",L(LS_LOADING)); @@ -1838,6 +1844,18 @@ static void fn(struct mg_connection *c, int ev, void *ev_data) { "ih+=''+iba+'';" "});ih+='';il.innerHTML=ih;});}" "function loadGames(){loadGamePanel(0);}" + "function smRawDebug(){" + "var dbg=document.getElementById('sm-raw-dbg');" + "var pre=document.getElementById('sm-raw-pre');" + "if(!dbg||!pre)return;" + "dbg.style.display=dbg.style.display==='none'?'block':'none';" + "if(dbg.style.display==='none')return;" + "pre.textContent='Lade...';" + "var gp=fetch('/api/sm/games',{method:'POST'}).then(function(r){return r.text();}).catch(function(e){return 'ERROR: '+e;});" + "var ip=fetch('/api/sm/images',{method:'POST'}).then(function(r){return r.text();}).catch(function(e){return 'ERROR: '+e;});" + "Promise.all([gp,ip]).then(function(res){" + "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...

';"