From 83eccb6ce31a894ceb4941b5899019ba09e57cac Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Sat, 21 Jun 2025 08:36:12 +0000
Subject: [PATCH] refactor: use new page templates
---
web/html/common/head.html | 31 --
web/html/common/js.html | 14 -
web/html/common/page.html | 58 +++
web/html/inbounds.html | 27 +-
web/html/index.html | 744 +++++++++++++++++++-------------------
web/html/login.html | 326 +++++++++--------
web/html/settings.html | 131 ++++---
web/html/xray.html | 178 +++++----
8 files changed, 756 insertions(+), 753 deletions(-)
delete mode 100644 web/html/common/head.html
delete mode 100644 web/html/common/js.html
create mode 100644 web/html/common/page.html
diff --git a/web/html/common/head.html b/web/html/common/head.html
deleted file mode 100644
index 35901769..00000000
--- a/web/html/common/head.html
+++ /dev/null
@@ -1,31 +0,0 @@
-{{define "head"}}
-
-
-
-
-
-
-
-
- {{ .host }} – {{ i18n .title}}
-
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/common/js.html b/web/html/common/js.html
deleted file mode 100644
index 1c2d64b3..00000000
--- a/web/html/common/js.html
+++ /dev/null
@@ -1,14 +0,0 @@
-{{define "js"}}
-
-
-
-
-
-
-
-
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/common/page.html b/web/html/common/page.html
new file mode 100644
index 00000000..f1c58fe1
--- /dev/null
+++ b/web/html/common/page.html
@@ -0,0 +1,58 @@
+{{ define "page/head_start" }}
+
+
+
+
+
+
+
+
+
+
+ {{ .host }} – {{ i18n .title}}
+{{ end }}
+
+{{ define "page/head_end" }}
+
+{{ end }}
+
+{{ define "page/body_start" }}
+
+
+{{ end }}
+
+{{ define "page/body_scripts" }}
+
+
+
+
+
+
+
+
+
+{{ end }}
+
+{{ define "page/body_end" }}
+
+
+{{ end }}
\ No newline at end of file
diff --git a/web/html/inbounds.html b/web/html/inbounds.html
index 5ee541df..7b00ae5e 100644
--- a/web/html/inbounds.html
+++ b/web/html/inbounds.html
@@ -1,6 +1,4 @@
-
-
-{{template "head" .}}
+{{ template "page/head_start" .}}
+{{ template "page/head_end" .}}
-
+{{ template "page/body_start" .}}
@@ -657,7 +656,7 @@
-{{template "js" .}}
+{{template "page/body_scripts" .}}
@@ -666,6 +665,13 @@
{{template "component/aThemeSwitch" .}}
{{template "component/aCustomStatistic" .}}
{{template "component/aPersianDatepicker" .}}
+{{template "modals/inboundModal"}}
+{{template "modals/promptModal"}}
+{{template "modals/qrcodeModal"}}
+{{template "modals/textModal"}}
+{{template "modals/inboundInfoModal"}}
+{{template "modals/clientsModal"}}
+{{template "modals/clientsBulkModal"}}
-
-{{template "modals/inboundModal"}}
-{{template "modals/promptModal"}}
-{{template "modals/qrcodeModal"}}
-{{template "modals/textModal"}}
-{{template "modals/inboundInfoModal"}}
-{{template "modals/clientsModal"}}
-{{template "modals/clientsBulkModal"}}
-
-
+{{ template "page/body_end" .}}
\ No newline at end of file
diff --git a/web/html/index.html b/web/html/index.html
index 2a6fb0ad..61e3947f 100644
--- a/web/html/index.html
+++ b/web/html/index.html
@@ -1,6 +1,4 @@
-
-
-{{template "head" .}}
+{{ template "page/head_start" .}}
+{{ template "page/head_end" .}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+{{ template "page/body_start" .}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{{ i18n "pages.index.cpu" }}: [[ CPUFormatter.cpuCoreFormat(status.cpuCores) ]]
+
+
+
+ {{ i18n "pages.index.logicalProcessors" }}: [[ (status.logicalPro) ]]
+ {{ i18n "pages.index.frequency" }}: [[ CPUFormatter.cpuSpeedFormat(status.cpuSpeedMhz) ]]
+
+
+
+
+
+
+
+ {{ i18n "pages.index.memory"}}: [[ SizeFormatter.sizeFormat(status.mem.current) ]] / [[ SizeFormatter.sizeFormat(status.mem.total) ]]
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.index.swap" }}: [[ SizeFormatter.sizeFormat(status.swap.current) ]] / [[ SizeFormatter.sizeFormat(status.swap.total) ]]
+
+
+
+
+
+ {{ i18n "pages.index.storage"}}: [[ SizeFormatter.sizeFormat(status.disk.current) ]] / [[ SizeFormatter.sizeFormat(status.disk.total) ]]
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
{{ i18n "pages.index.cpu" }}: [[ CPUFormatter.cpuCoreFormat(status.cpuCores) ]]
-
-
-
- {{ i18n "pages.index.logicalProcessors" }}: [[ (status.logicalPro) ]]
- {{ i18n "pages.index.frequency" }}: [[ CPUFormatter.cpuSpeedFormat(status.cpuSpeedMhz) ]]
-
-
-
-
-
-
-
- {{ i18n "pages.index.memory"}}: [[ SizeFormatter.sizeFormat(status.mem.current) ]] / [[ SizeFormatter.sizeFormat(status.mem.total) ]]
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.swap" }}: [[ SizeFormatter.sizeFormat(status.swap.current) ]] / [[ SizeFormatter.sizeFormat(status.swap.total) ]]
-
-
-
-
-
- {{ i18n "pages.index.storage"}}: [[ SizeFormatter.sizeFormat(status.disk.current) ]] / [[ SizeFormatter.sizeFormat(status.disk.total) ]]
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.xrayStatus" }}
-
- v[[ status.xray.version ]]
-
-
+
+
+
+
+ {{ i18n "pages.index.xrayStatus" }}
+
+ v[[ status.xray.version ]]
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.xrayErrorPopoverTitle" }}
-
-
-
-
-
-
-
- [[ line ]]
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.stopXray" }}
-
-
-
- {{ i18n "pages.index.restartXray" }}
-
-
-
-
- [[ status.xray.version != 'Unknown' ? `v${status.xray.version}` : '{{ i18n "pages.index.xraySwitch" }}' ]]
+
+
+
+
+
+ {{ i18n "pages.index.xrayErrorPopoverTitle" }}
+
+
+
+
+
-
+
+ [[ line ]]
+
+
+
-
-
-
-
-
-
-
- {{ i18n "pages.index.logs" }}
-
-
-
- {{ i18n "pages.index.config" }}
-
-
-
- {{ i18n "pages.index.backup" }}
-
-
-
-
-
-
-
-
- v{{ .cur_ver }}
-
-
-
-
- @XrayUI
-
-
-
-
- {{ i18n "pages.index.documentation" }}
-
-
-
-
-
-
- Xray: [[ TimeFormatter.formatSecond(status.appStats.uptime) ]]
- OS: [[ TimeFormatter.formatSecond(status.uptime) ]]
-
-
-
-
+
+
+
+
+ {{ i18n "pages.index.stopXray" }}
+
+
+
+ {{ i18n "pages.index.restartXray" }}
+
+
+
+
+ [[ status.xray.version != 'Unknown' ? `v${status.xray.version}` : '{{ i18n "pages.index.xraySwitch" }}' ]]
+
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.index.logs" }}
+
+
+
+ {{ i18n "pages.index.config" }}
+
+
+
+ {{ i18n "pages.index.backup" }}
+
+
+
+
+
+
+
-
- [[ status.loads[0] ]] | [[ status.loads[1] ]] | [[ status.loads[2] ]]
-
- {{ i18n "pages.index.systemLoadDesc" }}
-
-
+ v{{ .cur_ver }}
-
-
-
-
- {{ i18n "pages.index.memory" }}: [[ SizeFormatter.sizeFormat(status.appStats.mem) ]]
- {{ i18n "pages.index.threads" }}: [[ status.appStats.threads ]]
-
-
-
-
-
-
-
-
-
-
-
- /s
-
-
-
-
-
-
-
-
-
- /s
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.toggleIpVisibility" }}
+
+
+
+ @XrayUI
+
+
+
+
+ {{ i18n "pages.index.documentation" }}
+
+
+
+
+
+
+ Xray: [[ TimeFormatter.formatSecond(status.appStats.uptime) ]]
+ OS: [[ TimeFormatter.formatSecond(status.uptime) ]]
+
+
+
+
+
+
+ [[ status.loads[0] ]] | [[ status.loads[1] ]] | [[ status.loads[2] ]]
+
+ {{ i18n "pages.index.systemLoadDesc" }}
+
+
+
+
+
+
+
+ {{ i18n "pages.index.memory" }}: [[ SizeFormatter.sizeFormat(status.appStats.mem) ]]
+ {{ i18n "pages.index.threads" }}: [[ status.appStats.threads ]]
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- versionModal.visible = false" :class="themeSwitcher.currentTheme" footer="">
-
-
-
-
-
- [[ version ]]
-
-
-
-
-
-
-
- [[ file ]]
-
-
-
-
-
-
- logModal.visible = false"
- :class="themeSwitcher.currentTheme"
- width="800px" footer="">
-
- {{ i18n "pages.index.logs" }}
-
-
-
-
-
-
-
- 10
- 20
- 50
- 100
- 500
-
-
- Debug
- Info
- Notice
- Warning
- Error
-
-
-
-
- SysLog
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.index.exportDatabase" }}
- {{ i18n "pages.index.exportDatabaseDesc" }}
-
-
-
-
-
- {{ i18n "pages.index.importDatabase" }}
- {{ i18n "pages.index.importDatabaseDesc" }}
-
-
-
-
-
+
+ /s
+
+
+
+
+
+
+
+
+
+ /s
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.index.toggleIpVisibility" }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-{{template "js" .}}
+ versionModal.visible = false" :class="themeSwitcher.currentTheme" footer="">
+
+
+
+
+
+ [[ version ]]
+
+
+
+
+
+
+
+ [[ file ]]
+
+
+
+
+
+
+ logModal.visible = false"
+ :class="themeSwitcher.currentTheme"
+ width="800px" footer="">
+
+ {{ i18n "pages.index.logs" }}
+
+
+
+
+
+
+
+ 10
+ 20
+ 50
+ 100
+ 500
+
+
+ Debug
+ Info
+ Notice
+ Warning
+ Error
+
+
+
+
+ SysLog
+
+
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.index.exportDatabase" }}
+ {{ i18n "pages.index.exportDatabaseDesc" }}
+
+
+
+
+
+ {{ i18n "pages.index.importDatabase" }}
+ {{ i18n "pages.index.importDatabaseDesc" }}
+
+
+
+
+
+
+{{template "page/body_scripts" .}}
{{template "component/aSidebar" .}}
{{template "component/aThemeSwitch" .}}
{{template "component/aCustomStatistic" .}}
@@ -788,5 +787,4 @@
},
});
-
-
+{{ template "page/body_end" .}}
\ No newline at end of file
diff --git a/web/html/login.html b/web/html/login.html
index 68e849f5..be6b9585 100644
--- a/web/html/login.html
+++ b/web/html/login.html
@@ -1,6 +1,4 @@
-
-
-{{template "head" .}}
+{{ template "page/head_start" .}}
+{{ template "page/head_end" .}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.settings.language" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.login.hello" }}
- {{ i18n "pages.login.title" }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- [[ loading ? '' : '{{ i18n "login" }}' ]]
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{template "js" .}}
- {{template "component/aThemeSwitch" .}}
-
-
-
+ function takeNext(word) {
+ return word.nextElementSibling ? word.nextElementSibling : word.parentElement.firstElementChild;
+ }
+
+ function switchWord(oldWord, newWord) {
+ oldWord.classList.remove('is-visible');
+ oldWord.classList.add('is-hidden');
+ newWord.classList.remove('is-hidden');
+ newWord.classList.add('is-visible');
+ }
+ });
+
+{{ template "page/body_end" .}}
\ No newline at end of file
diff --git a/web/html/settings.html b/web/html/settings.html
index dec40de7..18e0d6a8 100644
--- a/web/html/settings.html
+++ b/web/html/settings.html
@@ -1,6 +1,4 @@
-
-
-{{template "head" .}}
+{{ template "page/head_start" .}}
-
-
-
-
-
-
-
-
-
- {{ i18n "secAlertConf" }}
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.settings.save" }}
- {{ i18n "pages.settings.restartPanel" }}
-
-
-
-
-
-
-
-
-
-
-
- {{ template "settings/panel/general" . }}
-
-
- {{ template "settings/panel/security" . }}
-
-
- {{ template "settings/panel/telegram" . }}
-
-
- {{ template "settings/panel/subscription/general" . }}
-
-
- {{ template "settings/panel/subscription/json" . }}
-
-
-
-
-
-
+{{ template "page/head_end" .}}
+
+{{ template "page/body_start" .}}
+
+
+
+
+
+
+
+
+ {{ i18n "secAlertConf" }}
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.settings.save" }}
+ {{ i18n "pages.settings.restartPanel" }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ template "settings/panel/general" . }}
+
+
+ {{ template "settings/panel/security" . }}
+
+
+ {{ template "settings/panel/telegram" . }}
+
+
+ {{ template "settings/panel/subscription/general" . }}
+
+
+ {{ template "settings/panel/subscription/json" . }}
+
+
+
+
+
-{{template "js" .}}
+
+{{template "page/body_scripts" .}}
@@ -531,5 +531,4 @@
}
});
-
-
\ No newline at end of file
+{{ template "page/body_end" .}}
\ No newline at end of file
diff --git a/web/html/xray.html b/web/html/xray.html
index eb99b794..8a60dafe 100644
--- a/web/html/xray.html
+++ b/web/html/xray.html
@@ -1,22 +1,8 @@
-
-
-{{template "head" .}}
+{{ template "page/head_start" .}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ i18n "pages.xray.save" }}
- {{ i18n "pages.xray.restart" }}
-
- {{ i18n "pages.index.xrayErrorPopoverTitle" }}
-
- [[ line ]]
-
-
-
-
-
-
-
-
-
-
-
-
- { this.changePage(activeKey); }"
- :class="themeSwitcher.currentTheme">
-
- {{ template "settings/xray/basics" . }}
-
-
- {{ template "settings/xray/routing" . }}
-
-
- {{ template "settings/xray/outbounds" . }}
-
-
- {{ template "settings/xray/reverse" . }}
-
-
- {{ template "settings/xray/balancers" . }}
-
-
- {{ template "settings/xray/dns" . }}
-
-
- {{ template "settings/xray/advanced" . }}
-
-
-
-
-
-
-
-{{template "js" .}}
+{{ template "page/head_end" .}}
+
+{{ template "page/body_start" .}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ i18n "pages.xray.save" }}
+ {{ i18n "pages.xray.restart" }}
+
+ {{ i18n "pages.index.xrayErrorPopoverTitle" }}
+
+ [[ line ]]
+
+
+
+
+
+
+
+
+
+
+
+
+ { this.changePage(activeKey); }"
+ :class="themeSwitcher.currentTheme">
+
+ {{ template "settings/xray/basics" . }}
+
+
+ {{ template "settings/xray/routing" . }}
+
+
+ {{ template "settings/xray/outbounds" . }}
+
+
+ {{ template "settings/xray/reverse" . }}
+
+
+ {{ template "settings/xray/balancers" . }}
+
+
+ {{ template "settings/xray/dns" . }}
+
+
+ {{ template "settings/xray/advanced" . }}
+
+
+
+
+
+
+
+{{template "page/body_scripts" .}}
+
+
+
+
+
+
+
+
+
+
+
{{template "component/aSidebar" .}}
{{template "component/aThemeSwitch" .}}
{{template "component/aTableSortable" .}}
@@ -1410,5 +1409,4 @@
},
});
-
-
+{{ template "page/body_end" .}}
\ No newline at end of file