refactor(panel): rename injected globals + collapse QR modal entries
Rename the SPA globals injected by Go to drop the ad-hoc dunder shape and free up the bare `webBasePath` name (still the DB setting key) from colliding with the JS global it used to share: window.__X_UI_BASE_PATH__ -> window.X_UI_BASE_PATH window.__X_UI_CUR_VER__ -> window.X_UI_CUR_VER Also rework the QR-Code modal to fold every QR (subscription + JSON sub URL, share links, WireGuard config/peer links) into a single a-collapse with one panel per QR. Subscription panels are listed first and open by default; everything else stays collapsed so a multi-link inbound no longer scrolls forever.
This commit is contained in:
@@ -57,7 +57,7 @@ function refreshBasePath() {
|
||||
}
|
||||
|
||||
// `apply: 'serve'` keeps the injection out of `vite build` — dist.go
|
||||
// already injects __X_UI_BASE_PATH__ at runtime in production.
|
||||
// already injects webBasePath at runtime in production.
|
||||
function injectBasePathPlugin() {
|
||||
return {
|
||||
name: 'xui-inject-base-path',
|
||||
@@ -65,7 +65,7 @@ function injectBasePathPlugin() {
|
||||
transformIndexHtml(html) {
|
||||
const basePath = refreshBasePath();
|
||||
const escaped = basePath.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
||||
const tag = `<script>window.__X_UI_BASE_PATH__="${escaped}";</script>`;
|
||||
const tag = `<script>window.X_UI_BASE_PATH="${escaped}";</script>`;
|
||||
return html.replace('</head>', `${tag}</head>`);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user