diff --git a/frontend/html/inbounds.html b/frontend/inbounds.html
similarity index 100%
rename from frontend/html/inbounds.html
rename to frontend/inbounds.html
diff --git a/frontend/html/index.html b/frontend/index.html
similarity index 100%
rename from frontend/html/index.html
rename to frontend/index.html
diff --git a/frontend/html/login.html b/frontend/login.html
similarity index 100%
rename from frontend/html/login.html
rename to frontend/login.html
diff --git a/frontend/html/settings.html b/frontend/settings.html
similarity index 100%
rename from frontend/html/settings.html
rename to frontend/settings.html
diff --git a/frontend/html/subpage.html b/frontend/subpage.html
similarity index 100%
rename from frontend/html/subpage.html
rename to frontend/subpage.html
diff --git a/frontend/vite.config.js b/frontend/vite.config.js
index f1cde1a0..a7bba04e 100644
--- a/frontend/vite.config.js
+++ b/frontend/vite.config.js
@@ -6,20 +6,20 @@ import path from 'node:path';
// via embed.FS without reaching outside the web/ tree.
const outDir = path.resolve(__dirname, '../web/dist');
-// In production the Go binary serves /panel/ from web/dist/html/.html.
-// In dev the Vue app lives at /html/index.html, /html/settings.html, ... while
-// AppSidebar links use the production-style /panel/ URLs. Map each
-// migrated route to its Vite entry so the sidebar works without relying on
-// the Go backend for already-ported pages.
+// In production the Go binary serves /panel/ from web/dist/.html.
+// In dev the Vue app lives at /index.html, /settings.html, ... while AppSidebar
+// links use the production-style /panel/ URLs. Map each migrated route
+// to its Vite entry so the sidebar works without relying on the Go backend
+// for already-ported pages.
const MIGRATED_ROUTES = {
- '/panel': '/html/index.html',
- '/panel/': '/html/index.html',
- '/panel/settings': '/html/settings.html',
- '/panel/settings/': '/html/settings.html',
- '/panel/inbounds': '/html/inbounds.html',
- '/panel/inbounds/': '/html/inbounds.html',
- '/panel/xray': '/html/xray.html',
- '/panel/xray/': '/html/xray.html',
+ '/panel': '/index.html',
+ '/panel/': '/index.html',
+ '/panel/settings': '/settings.html',
+ '/panel/settings/': '/settings.html',
+ '/panel/inbounds': '/inbounds.html',
+ '/panel/inbounds/': '/inbounds.html',
+ '/panel/xray': '/xray.html',
+ '/panel/xray/': '/xray.html',
};
// Build a proxy config that suppresses ECONNREFUSED noise when the Go
@@ -102,12 +102,12 @@ export default defineConfig({
// As pages get ported in later phases, add their entrypoints here.
rollupOptions: {
input: {
- index: path.resolve(__dirname, 'html/index.html'),
- login: path.resolve(__dirname, 'html/login.html'),
- settings: path.resolve(__dirname, 'html/settings.html'),
- inbounds: path.resolve(__dirname, 'html/inbounds.html'),
- xray: path.resolve(__dirname, 'html/xray.html'),
- subpage: path.resolve(__dirname, 'html/subpage.html'),
+ index: path.resolve(__dirname, 'index.html'),
+ login: path.resolve(__dirname, 'login.html'),
+ settings: path.resolve(__dirname, 'settings.html'),
+ inbounds: path.resolve(__dirname, 'inbounds.html'),
+ xray: path.resolve(__dirname, 'xray.html'),
+ subpage: path.resolve(__dirname, 'subpage.html'),
},
output: {
// Split vendor deps into stable chunks so each page only pulls
@@ -143,9 +143,9 @@ export default defineConfig({
port: 5173,
strictPort: true,
proxy: makeBackendProxy('http://localhost:2053', [
- // Patterns are anchored regex so /html/login.html, /html/index.html
- // etc. (which Vite serves itself) are NOT forwarded — only the
- // bare backend paths and their sub-routes.
+ // Patterns are anchored regex so /login.html and /index.html
+ // (which Vite serves itself) are NOT forwarded — only the bare
+ // backend paths and their sub-routes.
'^/(login|logout|getTwoFactorEnable|csrf-token)$',
'^/(panel|server)(/|$)',
]),
diff --git a/frontend/html/xray.html b/frontend/xray.html
similarity index 100%
rename from frontend/html/xray.html
rename to frontend/xray.html
diff --git a/sub/subController.go b/sub/subController.go
index 76aa1504..ddb24c11 100644
--- a/sub/subController.go
+++ b/sub/subController.go
@@ -148,14 +148,14 @@ func (a *SUBController) subs(c *gin.Context) {
}
}
-// serveSubPage renders web/dist/html/subpage.html for the current subscription
+// serveSubPage renders web/dist/subpage.html for the current subscription
// request. The Vite-built SPA reads window.__SUB_PAGE_DATA__ on mount —
// we inject that here, along with window.__X_UI_BASE_PATH__ so the
// page's static asset references resolve correctly when the panel runs
// behind a URL prefix.
func (a *SUBController) serveSubPage(c *gin.Context, basePath string, page PageData) {
dist := webpkg.EmbeddedDist()
- body, err := dist.ReadFile("dist/html/subpage.html")
+ body, err := dist.ReadFile("dist/subpage.html")
if err != nil {
c.String(http.StatusInternalServerError, "missing embedded subpage")
return
diff --git a/sub/subService.go b/sub/subService.go
index d326e0f1..33605ad6 100644
--- a/sub/subService.go
+++ b/sub/subService.go
@@ -1350,7 +1350,7 @@ func searchHost(headers any) string {
return ""
}
-// PageData is a view model for html/subpage.html
+// PageData is a view model for subpage.html
// PageData contains data for rendering the subscription information page.
type PageData struct {
Host string
diff --git a/web/controller/dist.go b/web/controller/dist.go
index 9a00a8bd..24eca57d 100644
--- a/web/controller/dist.go
+++ b/web/controller/dist.go
@@ -36,8 +36,8 @@ func SetDistFS(fs embed.FS) {
// GETs can hit the 304 path on repeat loads.
var distPageBuildTime = time.Now()
-// serveDistPage reads `dist/html/` from the embedded FS and writes
-// it to the response. Two transforms run before send:
+// serveDistPage reads `dist/` from the embedded FS and writes it
+// to the response. Two transforms run before send:
//
// 1. `` is injected
// just before so the AppSidebar's link generator sees the
@@ -51,7 +51,7 @@ var distPageBuildTime = time.Now()
// reaches users on the next reload; the long-hashed JS/CSS files
// under /assets/ stay cacheable indefinitely.
func serveDistPage(c *gin.Context, name string) {
- body, err := distFS.ReadFile("dist/html/" + name)
+ body, err := distFS.ReadFile("dist/" + name)
if err != nil {
c.String(http.StatusInternalServerError, "missing embedded page: %s", name)
return