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/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 +- 16 files changed, 633 insertions(+), 593 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 (limited to 'web/html/xui') diff --git a/web/html/xui/common_sider.html b/web/html/xui/common_sider.html index 1d5fe075..97114c15 100644 --- a/web/html/xui/common_sider.html +++ b/web/html/xui/common_sider.html @@ -1,33 +1,23 @@ {{define "menuItems"}} - - {{ i18n "menu.dashboard"}} - + {{ i18n "menu.dashboard"}} - - {{ i18n "menu.inbounds"}} - + {{ i18n "menu.inbounds"}} - - {{ i18n "menu.settings"}} - + {{ i18n "menu.settings"}} - - {{ i18n "menu.xray"}} - + {{ i18n "menu.xray"}} - - {{ i18n "menu.logout"}} - + {{ i18n "menu.logout"}} {{end}} diff --git a/web/html/xui/component/aCustomStatistic.html b/web/html/xui/component/aCustomStatistic.html new file mode 100644 index 00000000..41695e90 --- /dev/null +++ b/web/html/xui/component/aCustomStatistic.html @@ -0,0 +1,55 @@ +{{define "component/customStatistic"}} + +{{end}} + +{{define "component/aCustomStatistic"}} + + + +{{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"}} + +{{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"}} - -{{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" .}}