chore: pretty theme menu in sidebar

- adding translation for theme menu
- using the default menu item style from ant design
This commit is contained in:
Shishkevich D. 2025-03-17 10:01:42 +00:00
parent e3120c4028
commit 631744e698
14 changed files with 48 additions and 22 deletions

View file

@ -1,33 +1,23 @@
{{define "menuItems"}} {{define "menuItems"}}
<a-menu-item key="{{ .base_path }}panel/"> <a-menu-item key="{{ .base_path }}panel/">
<a-icon type="dashboard"></a-icon> <a-icon type="dashboard"></a-icon>
<span> <span>{{ i18n "menu.dashboard"}}</span>
<b>{{ i18n "menu.dashboard"}}</b>
</span>
</a-menu-item> </a-menu-item>
<a-menu-item key="{{ .base_path }}panel/inbounds"> <a-menu-item key="{{ .base_path }}panel/inbounds">
<a-icon type="user"></a-icon> <a-icon type="user"></a-icon>
<span> <span>{{ i18n "menu.inbounds"}}</span>
<b>{{ i18n "menu.inbounds"}}</b>
</span>
</a-menu-item> </a-menu-item>
<a-menu-item key="{{ .base_path }}panel/settings"> <a-menu-item key="{{ .base_path }}panel/settings">
<a-icon type="setting"></a-icon> <a-icon type="setting"></a-icon>
<span> <span>{{ i18n "menu.settings"}}</span>
<b>{{ i18n "menu.settings"}}</b>
</span>
</a-menu-item> </a-menu-item>
<a-menu-item key="{{ .base_path }}panel/xray"> <a-menu-item key="{{ .base_path }}panel/xray">
<a-icon type="tool"></a-icon> <a-icon type="tool"></a-icon>
<span> <span>{{ i18n "menu.xray"}}</span>
<b>{{ i18n "menu.xray"}}</b>
</span>
</a-menu-item> </a-menu-item>
<a-menu-item key="{{ .base_path }}logout"> <a-menu-item key="{{ .base_path }}logout">
<a-icon type="logout"></a-icon> <a-icon type="logout"></a-icon>
<span> <span>{{ i18n "menu.logout"}}</span>
<b>{{ i18n "menu.logout"}}</b>
</span>
</a-menu-item> </a-menu-item>
{{end}} {{end}}

View file

@ -4,15 +4,15 @@
<a-sub-menu> <a-sub-menu>
<span slot="title"> <span slot="title">
<a-icon type="bulb" :theme="themeSwitcher.isDarkTheme ? 'filled' : 'outlined'"></a-icon> <a-icon type="bulb" :theme="themeSwitcher.isDarkTheme ? 'filled' : 'outlined'"></a-icon>
<span>Theme</span> <span>{{ i18n "menu.theme" }}</span>
</span> </span>
<a-menu-item id="change-theme" class="ant-menu-theme-switch" @mousedown="themeSwitcher.animationsOff()"> Dark <a-menu-item id="change-theme" class="ant-menu-theme-switch" @mousedown="themeSwitcher.animationsOff()">
<a-switch style="margin-left: 2px;" size="small" :default-checked="themeSwitcher.isDarkTheme" <span>{{ i18n "menu.dark" }}</span>
@change="themeSwitcher.toggleTheme()"></a-switch> <a-switch style="margin-left: 2px;" size="small" :default-checked="themeSwitcher.isDarkTheme" @change="themeSwitcher.toggleTheme()"></a-switch>
</a-menu-item> </a-menu-item>
<a-menu-item id="change-theme-ultra" v-if="themeSwitcher.isDarkTheme" class="ant-menu-theme-switch" <a-menu-item id="change-theme-ultra" v-if="themeSwitcher.isDarkTheme" class="ant-menu-theme-switch" @mousedown="themeSwitcher.animationsOffUltra()">
@mousedown="themeSwitcher.animationsOffUltra()"> Ultra <a-checkbox style="margin-left: 2px;" <span>{{ i18n "menu.ultraDark" }}</span>
:checked="themeSwitcher.isUltra" @click="themeSwitcher.toggleUltra()"></a-checkbox> <a-checkbox style="margin-left: 2px;" :checked="themeSwitcher.isUltra" @click="themeSwitcher.toggleUltra()"></a-checkbox>
</a-menu-item> </a-menu-item>
</a-sub-menu> </a-sub-menu>
</a-menu> </a-menu>

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "No added reverse proxies." "emptyReverseDesc" = "No added reverse proxies."
[menu] [menu]
"theme" = "Theme"
"dark" = "Dark"
"ultraDark" = "Ultra Dark"
"dashboard" = "Overview" "dashboard" = "Overview"
"inbounds" = "Inbounds" "inbounds" = "Inbounds"
"settings" = "Panel Settings" "settings" = "Panel Settings"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "No hay proxies inversos añadidos." "emptyReverseDesc" = "No hay proxies inversos añadidos."
[menu] [menu]
"theme" = "Tema"
"dark" = "Oscuro"
"ultraDark" = "Ultra Oscuro"
"dashboard" = "Estado del Sistema" "dashboard" = "Estado del Sistema"
"inbounds" = "Entradas" "inbounds" = "Entradas"
"settings" = "Configuraciones" "settings" = "Configuraciones"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "هیچ پروکسی معکوس اضافه نشده است." "emptyReverseDesc" = "هیچ پروکسی معکوس اضافه نشده است."
[menu] [menu]
"theme" = "تم"
"dark" = "تیره"
"ultraDark" = "فوق تیره"
"dashboard" = "نمای کلی" "dashboard" = "نمای کلی"
"inbounds" = "ورودی‌ها" "inbounds" = "ورودی‌ها"
"settings" = "تنظیمات پنل" "settings" = "تنظیمات پنل"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Tidak ada proxy terbalik yang ditambahkan." "emptyReverseDesc" = "Tidak ada proxy terbalik yang ditambahkan."
[menu] [menu]
"theme" = "Tema"
"dark" = "Gelap"
"ultraDark" = "Sangat Gelap"
"dashboard" = "Ikhtisar" "dashboard" = "Ikhtisar"
"inbounds" = "Masuk" "inbounds" = "Masuk"
"settings" = "Pengaturan Panel" "settings" = "Pengaturan Panel"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "追加されたリバースプロキシはありません。" "emptyReverseDesc" = "追加されたリバースプロキシはありません。"
[menu] [menu]
"theme" = "テーマ"
"dark" = "ダーク"
"ultraDark" = "ウルトラダーク"
"dashboard" = "ダッシュボード" "dashboard" = "ダッシュボード"
"inbounds" = "インバウンド一覧" "inbounds" = "インバウンド一覧"
"settings" = "パネル設定" "settings" = "パネル設定"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Nenhum proxy reverso adicionado." "emptyReverseDesc" = "Nenhum proxy reverso adicionado."
[menu] [menu]
"theme" = "Tema"
"dark" = "Escuro"
"ultraDark" = "Ultra Escuro"
"dashboard" = "Visão Geral" "dashboard" = "Visão Geral"
"inbounds" = "Inbounds" "inbounds" = "Inbounds"
"settings" = "Panel Settings" "settings" = "Panel Settings"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Нет добавленных обратных прокси." "emptyReverseDesc" = "Нет добавленных обратных прокси."
[menu] [menu]
"theme" = "Тема"
"dark" = "Темная"
"ultraDark" = "Ультра темная"
"dashboard" = "Статус системы" "dashboard" = "Статус системы"
"inbounds" = "Подключения" "inbounds" = "Подключения"
"settings" = "Настройки панели" "settings" = "Настройки панели"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Eklenmiş ters proxy yok." "emptyReverseDesc" = "Eklenmiş ters proxy yok."
[menu] [menu]
"theme" = "Tema"
"dark" = "Koyu"
"ultraDark" = "Ultra Koyu"
"dashboard" = "Genel Bakış" "dashboard" = "Genel Bakış"
"inbounds" = "Gelenler" "inbounds" = "Gelenler"
"settings" = "Panel Ayarları" "settings" = "Panel Ayarları"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Немає доданих зворотних проксі." "emptyReverseDesc" = "Немає доданих зворотних проксі."
[menu] [menu]
"theme" = "Тема"
"dark" = "Темна"
"ultraDark" = "Ультра темна"
"dashboard" = "Огляд" "dashboard" = "Огляд"
"inbounds" = "Вхідні" "inbounds" = "Вхідні"
"settings" = "Параметри панелі" "settings" = "Параметри панелі"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "Không có proxy ngược nào được thêm." "emptyReverseDesc" = "Không có proxy ngược nào được thêm."
[menu] [menu]
"theme" = "Chủ đề"
"dark" = "Tối"
"ultraDark" = "Siêu tối"
"dashboard" = "Trạng thái hệ thống" "dashboard" = "Trạng thái hệ thống"
"inbounds" = "Đầu vào khách hàng" "inbounds" = "Đầu vào khách hàng"
"settings" = "Cài đặt bảng điều khiển" "settings" = "Cài đặt bảng điều khiển"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "未添加反向代理。" "emptyReverseDesc" = "未添加反向代理。"
[menu] [menu]
"theme" = "主题"
"dark" = "暗色"
"ultraDark" = "超暗色"
"dashboard" = "系统状态" "dashboard" = "系统状态"
"inbounds" = "入站列表" "inbounds" = "入站列表"
"settings" = "面板设置" "settings" = "面板设置"

View file

@ -67,6 +67,9 @@
"emptyReverseDesc" = "未添加反向代理。" "emptyReverseDesc" = "未添加反向代理。"
[menu] [menu]
"theme" = "主題"
"dark" = "深色"
"ultraDark" = "超深色"
"dashboard" = "系統狀態" "dashboard" = "系統狀態"
"inbounds" = "入站列表" "inbounds" = "入站列表"
"settings" = "面板設定" "settings" = "面板設定"