From db62a07fb89e08e974210ccb0f62cc648d799e94 Mon Sep 17 00:00:00 2001
From: "Shishkevich D." <135337715+shishkevichd@users.noreply.github.com>
Date: Mon, 17 Mar 2025 18:26:07 +0700
Subject: Code refactoring (#2785)
* chore: pretty theme menu in sidebar
* refactor: renaming component templates
* refactor: create custom `a-statistic` component
* fix: display button text only on large screens
* chore: remove loading background in overview page
* fix: show `Version` text when xray version is unknown
---
web/html/login.html | 4 +-
web/html/xui/common_sider.html | 20 +--
web/html/xui/component/aCustomStatistic.html | 55 ++++++
web/html/xui/component/aPasswordInput.html | 57 ++++++
web/html/xui/component/aPersianDatepicker.html | 72 ++++++++
web/html/xui/component/aSettingListItem.html | 49 ++++++
web/html/xui/component/aTableSortable.html | 232 +++++++++++++++++++++++++
web/html/xui/component/aThemeSwitch.html | 118 +++++++++++++
web/html/xui/component/password.html | 57 ------
web/html/xui/component/persianDatepicker.html | 72 --------
web/html/xui/component/setting.html | 57 ------
web/html/xui/component/sortableTable.html | 232 -------------------------
web/html/xui/component/themeSwitch.html | 118 -------------
web/html/xui/inbounds.html | 4 +-
web/html/xui/index.html | 71 ++++----
web/html/xui/settings.html | 6 +-
web/html/xui/xray.html | 6 +-
web/translation/translate.en_US.toml | 3 +
web/translation/translate.es_ES.toml | 3 +
web/translation/translate.fa_IR.toml | 3 +
web/translation/translate.id_ID.toml | 3 +
web/translation/translate.ja_JP.toml | 3 +
web/translation/translate.pt_BR.toml | 3 +
web/translation/translate.ru_RU.toml | 3 +
web/translation/translate.tr_TR.toml | 3 +
web/translation/translate.uk_UA.toml | 3 +
web/translation/translate.vi_VN.toml | 3 +
web/translation/translate.zh_CN.toml | 3 +
web/translation/translate.zh_TW.toml | 3 +
29 files changed, 671 insertions(+), 595 deletions(-)
create mode 100644 web/html/xui/component/aCustomStatistic.html
create mode 100644 web/html/xui/component/aPasswordInput.html
create mode 100644 web/html/xui/component/aPersianDatepicker.html
create mode 100644 web/html/xui/component/aSettingListItem.html
create mode 100644 web/html/xui/component/aTableSortable.html
create mode 100644 web/html/xui/component/aThemeSwitch.html
delete mode 100644 web/html/xui/component/password.html
delete mode 100644 web/html/xui/component/persianDatepicker.html
delete mode 100644 web/html/xui/component/setting.html
delete mode 100644 web/html/xui/component/sortableTable.html
delete mode 100644 web/html/xui/component/themeSwitch.html
diff --git a/web/html/login.html b/web/html/login.html
index fc48b9ec..b27333a5 100644
--- a/web/html/login.html
+++ b/web/html/login.html
@@ -473,8 +473,8 @@
{{template "js" .}}
-{{template "component/themeSwitcher" .}}
-{{template "component/password" .}}
+{{template "component/aThemeSwitch" .}}
+{{template "component/aPasswordInput" .}}
+{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/aPasswordInput.html b/web/html/xui/component/aPasswordInput.html
new file mode 100644
index 00000000..460e7e76
--- /dev/null
+++ b/web/html/xui/component/aPasswordInput.html
@@ -0,0 +1,57 @@
+{{define "component/passwordInput"}}
+
+
+
+
+
+
+
+
+
+
+{{end}}
+
+{{define "component/aPasswordInput"}}
+
+{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/aPersianDatepicker.html b/web/html/xui/component/aPersianDatepicker.html
new file mode 100644
index 00000000..58132ddd
--- /dev/null
+++ b/web/html/xui/component/aPersianDatepicker.html
@@ -0,0 +1,72 @@
+{{define "component/persianDatepickerTemplate"}}
+
+
+
+{{end}}
+
+{{define "component/aPersianDatepicker"}}
+
+
+
+
+{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/aSettingListItem.html b/web/html/xui/component/aSettingListItem.html
new file mode 100644
index 00000000..6a7d31d0
--- /dev/null
+++ b/web/html/xui/component/aSettingListItem.html
@@ -0,0 +1,49 @@
+{{define "component/settingListItem"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{{end}}
+
+{{define "component/aSettingListItem"}}
+
+{{end}}
diff --git a/web/html/xui/component/aTableSortable.html b/web/html/xui/component/aTableSortable.html
new file mode 100644
index 00000000..7dbc3d0a
--- /dev/null
+++ b/web/html/xui/component/aTableSortable.html
@@ -0,0 +1,232 @@
+{{define "component/sortableTableTrigger"}}
+
+{{end}}
+
+{{define "component/aTableSortable"}}
+
+
+{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/aThemeSwitch.html b/web/html/xui/component/aThemeSwitch.html
new file mode 100644
index 00000000..9a213ca6
--- /dev/null
+++ b/web/html/xui/component/aThemeSwitch.html
@@ -0,0 +1,118 @@
+{{define "component/themeSwitchTemplate"}}
+
+
+
+
+
+ {{ i18n "menu.theme" }}
+
+
+
+
+
+
+{{end}}
+
+{{define "component/themeSwitchTemplateLogin"}}
+
+
+
+
+
+{{end}}
+
+{{define "component/aThemeSwitch"}}
+
+{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/password.html b/web/html/xui/component/password.html
deleted file mode 100644
index 0fea1430..00000000
--- a/web/html/xui/component/password.html
+++ /dev/null
@@ -1,57 +0,0 @@
-{{define "component/passwordInput"}}
-
-
-
-
-
-
-
-
-
-
-{{end}}
-
-{{define "component/password"}}
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/persianDatepicker.html b/web/html/xui/component/persianDatepicker.html
deleted file mode 100644
index 2df79a06..00000000
--- a/web/html/xui/component/persianDatepicker.html
+++ /dev/null
@@ -1,72 +0,0 @@
-{{define "component/persianDatepickerTemplate"}}
-
-
-
-{{end}}
-
-{{define "component/persianDatepicker"}}
-
-
-
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/setting.html
deleted file mode 100644
index 85220d25..00000000
--- a/web/html/xui/component/setting.html
+++ /dev/null
@@ -1,57 +0,0 @@
-{{define "component/settingListItem"}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{{end}}
-
-{{define "component/setting"}}
-
-{{end}}
diff --git a/web/html/xui/component/sortableTable.html b/web/html/xui/component/sortableTable.html
deleted file mode 100644
index 67bbcee2..00000000
--- a/web/html/xui/component/sortableTable.html
+++ /dev/null
@@ -1,232 +0,0 @@
-{{define "component/sortableTableTrigger"}}
-
-{{end}}
-
-{{define "component/sortableTable"}}
-
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/xui/component/themeSwitch.html b/web/html/xui/component/themeSwitch.html
deleted file mode 100644
index 28cb79b1..00000000
--- a/web/html/xui/component/themeSwitch.html
+++ /dev/null
@@ -1,118 +0,0 @@
-{{define "component/themeSwitchTemplate"}}
-
-
-
-
-
- Theme
-
-
-
-
-
-
-{{end}}
-
-{{define "component/themeSwitchTemplateLogin"}}
-
-
-
-
-
-{{end}}
-
-{{define "component/themeSwitcher"}}
-
-{{end}}
\ No newline at end of file
diff --git a/web/html/xui/inbounds.html b/web/html/xui/inbounds.html
index c8cf93d3..d8b3c40a 100644
--- a/web/html/xui/inbounds.html
+++ b/web/html/xui/inbounds.html
@@ -548,8 +548,8 @@
-{{template "component/themeSwitcher" .}}
-{{template "component/persianDatepicker" .}}
+{{template "component/aThemeSwitch" .}}
+{{template "component/aPersianDatepicker" .}}
-{{template "component/themeSwitcher" .}}
-{{template "component/password" .}}
-{{template "component/setting"}}
+{{template "component/aThemeSwitch" .}}
+{{template "component/aPasswordInput" .}}
+{{template "component/aSettingListItem" .}}