fix: app_v3.js同步app.js的SENSU_BASE前缀改动
This commit is contained in:
@@ -44,7 +44,13 @@ window.toggleTheme = function(){
|
||||
// ═══ 路由系统 ═══
|
||||
// Hash format: #/dashboard | #/files | #/plugins/example_plugin
|
||||
// Built-in pages map to ./static/pages/{name}.html
|
||||
// Plugin pages load from /plugin/{name}
|
||||
// Plugin pages load from {base}/plugin/{name}
|
||||
|
||||
// 从当前页面路径提取面板前缀 (e.g. /SenSu/home.html → /SenSu)
|
||||
window.SENSU_BASE = (function(){
|
||||
var p = window.location.pathname;
|
||||
return p.substring(0, p.lastIndexOf('/')) || '';
|
||||
})();
|
||||
|
||||
var BUILTIN_PAGES = ['dashboard','logs','console','plugins','projects','proxy','files','settings'];
|
||||
var _pluginPagesCache = null; // {plugin_name: {path, title, icon}}
|
||||
@@ -167,7 +173,7 @@ async function loadPluginPage(pluginName) {
|
||||
if(!_pluginPagesCache) await fetchPluginPages();
|
||||
|
||||
try {
|
||||
var resp = await fetch('/plugin/'+pluginName+'?t='+Date.now(), {credentials:'include'});
|
||||
var resp = await fetch(window.SENSU_BASE+'/plugin/'+pluginName+'?t='+Date.now(), {credentials:'include'});
|
||||
if(!resp.ok) throw new Error(resp.status);
|
||||
var html = await resp.text();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user