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: [PATCH] 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 ++++++++++++++
.../{password.html => aPasswordInput.html} | 2 +-
...atepicker.html => aPersianDatepicker.html} | 2 +-
.../{setting.html => aSettingListItem.html} | 10 +--
...sortableTable.html => aTableSortable.html} | 2 +-
.../{themeSwitch.html => aThemeSwitch.html} | 16 ++---
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 +
24 files changed, 155 insertions(+), 79 deletions(-)
create mode 100644 web/html/xui/component/aCustomStatistic.html
rename web/html/xui/component/{password.html => aPasswordInput.html} (96%)
rename web/html/xui/component/{persianDatepicker.html => aPersianDatepicker.html} (97%)
rename web/html/xui/component/{setting.html => aSettingListItem.html} (85%)
rename web/html/xui/component/{sortableTable.html => aTableSortable.html} (99%)
rename web/html/xui/component/{themeSwitch.html => aThemeSwitch.html} (88%)
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/password.html b/web/html/xui/component/aPasswordInput.html
similarity index 96%
rename from web/html/xui/component/password.html
rename to web/html/xui/component/aPasswordInput.html
index 0fea1430..460e7e76 100644
--- a/web/html/xui/component/password.html
+++ b/web/html/xui/component/aPasswordInput.html
@@ -12,7 +12,7 @@
{{end}}
-{{define "component/password"}}
+{{define "component/aPasswordInput"}}
diff --git a/web/html/xui/component/setting.html b/web/html/xui/component/aSettingListItem.html
similarity index 85%
rename from web/html/xui/component/setting.html
rename to web/html/xui/component/aSettingListItem.html
index 85220d25..6a7d31d0 100644
--- a/web/html/xui/component/setting.html
+++ b/web/html/xui/component/aSettingListItem.html
@@ -18,18 +18,10 @@
{{end}}
-{{define "component/setting"}}
+{{define "component/aSettingListItem"}}
-{{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" .}}