Skip to content

Commit c13db79

Browse files
authored
Pretty Panel and Xray settings (#2726)
* chore: refactor `setting-list-item` component * chore: remove padding * chore: replace settings list with settings collapse panels * chore: add missing translations * chore: fix translation
1 parent d6d05a9 commit c13db79

15 files changed

+841
-645
lines changed

web/html/xui/component/setting.html

+27-23
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
11
{{define "component/settingListItem"}}
2-
<a-list-item style="padding: 20px">
3-
<a-row v-if="type === 'textarea'">
4-
<a-col>
5-
<a-list-item-meta :title="title" :description="desc"/>
6-
<a-textarea class="ant-setting-textarea" :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10 }"></a-textarea>
7-
<!--a-textarea :value="value" @input="$emit('input', $event.target.value)" :auto-size="{ minRows: 10, maxRows: 30 }"></a-textarea-->
8-
</a-col>
9-
</a-row>
10-
<a-row v-else>
2+
<a-list-item :style="{ padding: padding }">
3+
<a-row>
114
<a-col :lg="24" :xl="12">
12-
<a-list-item-meta :title="title" :description="desc"/>
5+
<a-list-item-meta>
6+
<template #title>
7+
<slot name="title"></slot>
8+
</template>
9+
<template #description>
10+
<slot name="description"></slot>
11+
</template>
12+
</a-list-item-meta>
1313
</a-col>
1414
<a-col :lg="24" :xl="12">
15-
<template v-if="type === 'text'">
16-
<a-input :value="value" @input="$emit('input', $event.target.value)" :placeholder="placeholder"></a-input>
17-
</template>
18-
<template v-else-if="type === 'number'">
19-
<a-input-number :value="value" :step="step" @change="value => $emit('input', value)" :min="min" :max="max" style="width: 100%;"></a-input-number>
20-
</template>
21-
<template v-else-if="type === 'switch'">
22-
<a-switch :checked="value" @change="value => $emit('input', value)"></a-switch>
23-
</template>
15+
<slot name="control"></slot>
2416
</a-col>
2517
</a-row>
2618
</a-list-item>
2719
{{end}}
2820

2921
{{define "component/setting"}}
3022
<script>
31-
Vue.component('setting-list-item', {
32-
props: ["type", "title", "desc", "value", "min", "max" , "step", "placeholder"],
33-
template: `{{template "component/settingListItem"}}`,
34-
});
23+
Vue.component('a-setting-list-item', {
24+
props: ["title", "description", "paddings"],
25+
template: `{{ template "component/settingListItem" }}`,
26+
computed: {
27+
padding() {
28+
switch (this.paddings) {
29+
case "small":
30+
return "10px 20px !important"
31+
break;
32+
default:
33+
return "20px !important"
34+
break;
35+
}
36+
}
37+
}
38+
})
3539
</script>
3640
{{end}}

web/html/xui/settings.html

+498-324
Large diffs are not rendered by default.

web/html/xui/xray.html

+196-274
Large diffs are not rendered by default.

web/translation/translate.en_US.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Mux Settings"
322322
"direct" = "Direct Connection"
323323
"directDesc" = "Directly establishes connections with domains or IP ranges of a specific country."
324-
324+
"notifications" = "Notifications"
325+
"certs" = "Certificaties"
326+
"externalTraffic" = "External Traffic"
327+
"dateAndTime" = "Date and Time"
328+
"proxyAndServer" = "Proxy and Server"
329+
"intervals" = "Intervals"
330+
"information" = "Information"
331+
"language" = "Language"
332+
"telegramBotLanguage" = "Telegram Bot Language"
325333

326334
[pages.xray]
327335
"title" = "Xray Configs"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Pool Size"
463471

464472
[pages.settings.security]
465-
"admin" = "Admin"
473+
"admin" = "Admin credentials"
466474
"secret" = "Secret Token"
467475
"loginSecurity" = "Secure Login"
468476
"loginSecurityDesc" = "Adds an additional layer of authentication to provide more security."

web/translation/translate.es_ES.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Configuración Mux"
322322
"direct" = "Conexión Directa"
323323
"directDesc" = "Establece conexiones directas con dominios o rangos de IP de un país específico."
324-
324+
"notifications" = "Notificaciones"
325+
"certs" = "Certificados"
326+
"externalTraffic" = "Tráfico Externo"
327+
"dateAndTime" = "Fecha y Hora"
328+
"proxyAndServer" = "Proxy y Servidor"
329+
"intervals" = "Intervalos"
330+
"information" = "Información"
331+
"language" = "Idioma"
332+
"telegramBotLanguage" = "Idioma del Bot de Telegram"
325333

326334
[pages.xray]
327335
"title" = "Xray Configuración"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Tamaño del grupo"
463471

464472
[pages.settings.security]
465-
"admin" = "Administrador"
473+
"admin" = "Credenciales de administrador"
466474
"secret" = "Token Secreto"
467475
"loginSecurity" = "Seguridad de Inicio de Sesión"
468476
"loginSecurityDesc" = "Habilitar un paso adicional de seguridad para el inicio de sesión de usuarios."

web/translation/translate.fa_IR.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "تنظیمات ماکس"
322322
"direct" = "اتصال مستقیم"
323323
"directDesc" = "به طور مستقیم با دامنه ها یا محدوده آی‌پی یک کشور خاص ارتباط برقرار می کند"
324-
324+
"notifications" = "اعلان‌ها"
325+
"certs" = "گواهی‌ها"
326+
"externalTraffic" = "ترافیک خارجی"
327+
"dateAndTime" = "تاریخ و زمان"
328+
"proxyAndServer" = "پراکسی و سرور"
329+
"intervals" = "فواصل"
330+
"information" = "اطلاعات"
331+
"language" = "زبان"
332+
"telegramBotLanguage" = "زبان ربات تلگرام"
325333

326334
[pages.xray]
327335
"title" = "پیکربندی ایکس‌ری"
@@ -462,7 +470,7 @@
462470
"poolSize" = "اندازه استخر"
463471

464472
[pages.settings.security]
465-
"admin" = "مدیر"
473+
"admin" = "اعتبارنامه‌های ادمین"
466474
"secret" = "توکن مخفی"
467475
"loginSecurity" = "ورود ایمن"
468476
"loginSecurityDesc" = "یک لایه اضافی از احراز هویت برای ایجاد امنیت بیشتر اضافه می کند"

web/translation/translate.id_ID.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,15 @@
320320
"muxSett" = "Pengaturan Mux"
321321
"direct" = "Koneksi langsung"
322322
"directDesc" = "Secara langsung membuat koneksi dengan domain atau rentang IP negara tertentu."
323-
323+
"notifications" = "Notifikasi"
324+
"certs" = "Sertifikat"
325+
"externalTraffic" = "Lalu Lintas Eksternal"
326+
"dateAndTime" = "Tanggal dan Waktu"
327+
"proxyAndServer" = "Proxy dan Server"
328+
"intervals" = "Interval"
329+
"information" = "Informasi"
330+
"language" = "Bahasa"
331+
"telegramBotLanguage" = "Bahasa Bot Telegram"
324332

325333
[pages.xray]
326334
"title" = "Konfigurasi Xray"
@@ -461,7 +469,7 @@
461469
"poolSize" = "Ukuran Kolam"
462470

463471
[pages.settings.security]
464-
"admin" = "Admin"
472+
"admin" = "Kredensial admin"
465473
"secret" = "Token Rahasia"
466474
"loginSecurity" = "Login Aman"
467475
"loginSecurityDesc" = "Menambahkan lapisan otentikasi tambahan untuk memberikan keamanan lebih."

web/translation/translate.ja_JP.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "マルチプレクサ設定"
322322
"direct" = "直接接続"
323323
"directDesc" = "特定の国のドメインまたはIP範囲に直接接続する"
324-
324+
"notifications" = "通知"
325+
"certs" = "証明書"
326+
"externalTraffic" = "外部トラフィック"
327+
"dateAndTime" = "日付と時刻"
328+
"proxyAndServer" = "プロキシとサーバー"
329+
"intervals" = "間隔"
330+
"information" = "情報"
331+
"language" = "言語"
332+
"telegramBotLanguage" = "Telegram Botの言語"
325333

326334
[pages.xray]
327335
"title" = "Xray 設定"
@@ -462,7 +470,7 @@
462470
"poolSize" = "プールサイズ"
463471

464472
[pages.settings.security]
465-
"admin" = "管理者"
473+
"admin" = "管理者の資格情報"
466474
"secret" = "セキュリティトークン"
467475
"loginSecurity" = "ログインセキュリティ"
468476
"loginSecurityDesc" = "追加の認証を追加してセキュリティを向上させる"

web/translation/translate.pt_BR.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Configurações de Mux"
322322
"direct" = "Conexão Direta"
323323
"directDesc" = "Estabelece conexões diretamente com domínios ou intervalos de IP de um país específico."
324-
324+
"notifications" = "Notificações"
325+
"certs" = "Certificados"
326+
"externalTraffic" = "Tráfego Externo"
327+
"dateAndTime" = "Data e Hora"
328+
"proxyAndServer" = "Proxy e Servidor"
329+
"intervals" = "Intervalos"
330+
"information" = "Informação"
331+
"language" = "Idioma"
332+
"telegramBotLanguage" = "Idioma do Bot do Telegram"
325333

326334
[pages.xray]
327335
"title" = "Configurações Xray"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Tamanho do Pool"
463471

464472
[pages.settings.security]
465-
"admin" = "Admin"
473+
"admin" = "Credenciais de administrador"
466474
"secret" = "Token Secreto"
467475
"loginSecurity" = "Login Seguro"
468476
"loginSecurityDesc" = "Adiciona uma camada extra de autenticação para fornecer mais segurança."

web/translation/translate.ru_RU.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Mux Настройки"
322322
"direct" = "Прямая связь"
323323
"directDesc" = "Устанавливает прямые соединения с доменами или IP-адресами определённой страны."
324-
324+
"notifications" = "Уведомления"
325+
"certs" = "Сертификаты"
326+
"externalTraffic" = "Внешний трафик"
327+
"dateAndTime" = "Дата и время"
328+
"proxyAndServer" = "Прокси и сервер"
329+
"intervals" = "Интервалы"
330+
"information" = "Информация"
331+
"language" = "Язык"
332+
"telegramBotLanguage" = "Язык Telegram-бота"
325333

326334
[pages.xray]
327335
"title" = "Настройки Xray"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Размер пула"
463471

464472
[pages.settings.security]
465-
"admin" = "Админ"
473+
"admin" = "Учетные данные администратора"
466474
"secret" = "Секретный токен"
467475
"loginSecurity" = "Безопасность входа"
468476
"loginSecurityDesc" = "Включить дополнительные меры безопасности входа пользователя"

web/translation/translate.tr_TR.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Mux Ayarları"
322322
"direct" = "Doğrudan Bağlantı"
323323
"directDesc" = "Belirli bir ülkenin alan adları veya IP aralıkları ile doğrudan bağlantı kurar."
324-
324+
"notifications" = "Bildirimler"
325+
"certs" = "Sertifikalar"
326+
"externalTraffic" = "Harici Trafik"
327+
"dateAndTime" = "Tarih ve Saat"
328+
"proxyAndServer" = "Proxy ve Sunucu"
329+
"intervals" = "Aralıklar"
330+
"information" = "Bilgi"
331+
"language" = "Dil"
332+
"telegramBotLanguage" = "Telegram Bot Dili"
325333

326334
[pages.xray]
327335
"title" = "Xray Yapılandırmaları"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Havuz Boyutu"
463471

464472
[pages.settings.security]
465-
"admin" = "Yönetici"
473+
"admin" = "Yönetici kimlik bilgileri"
466474
"secret" = "Gizli Anahtar"
467475
"loginSecurity" = "Güvenli Giriş"
468476
"loginSecurityDesc" = "Daha fazla güvenlik sağlamak için ek bir kimlik doğrulama katmanı ekler."

web/translation/translate.uk_UA.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Налаштування Mux"
322322
"direct" = "Пряме підключення"
323323
"directDesc" = "Безпосередньо встановлює з’єднання з доменами або діапазонами IP певної країни."
324-
324+
"notifications" = "Сповіщення"
325+
"certs" = "Сертифікати"
326+
"externalTraffic" = "Зовнішній трафік"
327+
"dateAndTime" = "Дата та час"
328+
"proxyAndServer" = "Проксі та сервер"
329+
"intervals" = "Інтервали"
330+
"information" = "Інформація"
331+
"language" = "Мова"
332+
"telegramBotLanguage" = "Мова Telegram-бота"
325333

326334
[pages.xray]
327335
"title" = "Xray конфігурації"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Розмір пулу"
463471

464472
[pages.settings.security]
465-
"admin" = "Адміністратор"
473+
"admin" = "Облікові дані адміністратора"
466474
"secret" = "Секретний маркер"
467475
"loginSecurity" = "Безпечний вхід"
468476
"loginSecurityDesc" = "Додає додатковий рівень автентифікації для забезпечення більшої безпеки."

web/translation/translate.vi_VN.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "Mux Cài đặt"
322322
"direct" = "Kết nối trực tiếp"
323323
"directDesc" = "Trực tiếp thiết lập kết nối với tên miền hoặc dải IP của một quốc gia cụ thể."
324-
324+
"notifications" = "Thông báo"
325+
"certs" = "Chứng chỉ"
326+
"externalTraffic" = "Lưu lượng bên ngoài"
327+
"dateAndTime" = "Ngày và giờ"
328+
"proxyAndServer" = "Proxy và máy chủ"
329+
"intervals" = "Khoảng thời gian"
330+
"information" = "Thông tin"
331+
"language" = "Ngôn ngữ"
332+
"telegramBotLanguage" = "Ngôn ngữ của Bot Telegram"
325333

326334
[pages.xray]
327335
"title" = "Cài đặt Xray"
@@ -462,7 +470,7 @@
462470
"poolSize" = "Kích thước bể bơi"
463471

464472
[pages.settings.security]
465-
"admin" = "Quản trị viên"
473+
"admin" = "Thông tin đăng nhập quản trị viên"
466474
"secret" = "Mã thông báo bí mật"
467475
"loginSecurity" = "Bảo mật đăng nhập"
468476
"loginSecurityDesc" = "Bật bước bảo mật đăng nhập bổ sung cho người dùng"

web/translation/translate.zh_CN.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "复用器设置"
322322
"direct" = "直接连接"
323323
"directDesc" = "直接与特定国家的域或IP范围建立连接"
324-
324+
"notifications" = "通知"
325+
"certs" = "证书"
326+
"externalTraffic" = "外部流量"
327+
"dateAndTime" = "日期和时间"
328+
"proxyAndServer" = "代理和服务器"
329+
"intervals" = "间隔"
330+
"information" = "信息"
331+
"language" = "语言"
332+
"telegramBotLanguage" = "Telegram 机器人语言"
325333

326334
[pages.xray]
327335
"title" = "Xray 配置"
@@ -462,7 +470,7 @@
462470
"poolSize" = "池大小"
463471

464472
[pages.settings.security]
465-
"admin" = "管理员"
473+
"admin" = "管理员凭据"
466474
"secret" = "安全令牌"
467475
"loginSecurity" = "登录安全"
468476
"loginSecurityDesc" = "添加额外的身份验证以提高安全性"

web/translation/translate.zh_TW.toml

+10-2
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,15 @@
321321
"muxSett" = "複用器設定"
322322
"direct" = "直接連線"
323323
"directDesc" = "直接與特定國家的域或IP範圍建立連線"
324-
324+
"notifications" = "通知"
325+
"certs" = "證書"
326+
"externalTraffic" = "外部流量"
327+
"dateAndTime" = "日期和時間"
328+
"proxyAndServer" = "代理和伺服器"
329+
"intervals" = "間隔"
330+
"information" = "資訊"
331+
"language" = "語言"
332+
"telegramBotLanguage" = "Telegram 機器人語言"
325333

326334
[pages.xray]
327335
"title" = "Xray 配置"
@@ -462,7 +470,7 @@
462470
"poolSize" = "池大小"
463471

464472
[pages.settings.security]
465-
"admin" = "管理員"
473+
"admin" = "管理員憑證"
466474
"secret" = "安全令牌"
467475
"loginSecurity" = "登入安全"
468476
"loginSecurityDesc" = "新增額外的身份驗證以提高安全性"

0 commit comments

Comments
 (0)