diff --git a/static/web_panel/home.html b/static/web_panel/home.html index 58f3395..fa5894b 100644 --- a/static/web_panel/home.html +++ b/static/web_panel/home.html @@ -79,6 +79,6 @@ - + diff --git a/static/web_panel/js/app.js b/static/web_panel/js/app.js index c4df3df..08594cd 100644 --- a/static/web_panel/js/app.js +++ b/static/web_panel/js/app.js @@ -124,6 +124,7 @@ async function loadPage(pageName) { var cleanHtml = html.replace(/]*>([\s\S]*?)<\/script>/gi, function(m,code){ scripts.push(code.trim()); return ''; }); content.innerHTML = cleanHtml; + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){ console.error('Inline script error:', ex); } }); @@ -186,6 +187,7 @@ async function loadPluginPage(pluginName) { content.style.padding = '0'; content.innerHTML = '
'+clean+'
'; + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){ console.error('Plugin script error:', ex); } }); @@ -251,6 +253,7 @@ window.pickPath = function(mode, callback) { var clean = html.replace(/]*>([\s\S]*?)<\/script>/gi, function(m,code){ scripts.push(code.trim()); return ''; }); contentArea.innerHTML = clean; // Execute scripts + scripts.forEach(function(code){ try { var s=document.createElement('script'); s.textContent=code; document.head.appendChild(s); document.head.removeChild(s); } catch(ex){} });