Skip to content

Commit

Permalink
[xray] option logs #947
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza0 committed Feb 14, 2024
1 parent 0267a1b commit 525327c
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 0 deletions.
75 changes: 75 additions & 0 deletions web/html/xui/xray.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,49 @@
</a-row>
</a-list-item>
</a-collapse-panel>
<a-collapse-panel header='{{ i18n "pages.xray.logConfigs" }}'>
<a-row :xs="24" :sm="24" :lg="12">
<a-alert type="warning" style="text-align: center;">
<template slot="message">
<a-icon type="exclamation-circle" theme="filled" style="color: #FFA031"></a-icon>
{{ i18n "pages.xray.logConfigsDesc" }}
</template>
</a-alert>
</a-row>
<a-list-item>
<a-row style="padding: 20px">
<a-col :lg="24" :xl="12">
<a-list-item-meta title='Level'/>
</a-col>
<a-col :lg="24" :xl="12">
<template>
<a-select
v-model="logLevel"
style="width: 100%" :dropdown-class-name="themeSwitcher.currentTheme">
<a-select-option v-for="level in ['none', 'debug', 'info', 'warning', 'error']" :value="level">[[ level ]]</a-select-option>
</a-select>
</template>
</a-col>
</a-row>
</a-list-item>
<a-row style="padding: 20px">
<a-col :lg="24" :xl="12">
<a-list-item-meta title='Access Logs' />
</a-col>
<a-col :lg="24" :xl="12">
<a-input v-model="logAccess"></a-input>
</a-col>
</a-row>
<a-row style="padding: 20px">
<a-col :lg="24" :xl="12">
<a-list-item-meta title='Error Logs' />
</a-col>
<a-col :lg="24" :xl="12">
<a-input v-model="logError"></a-input>
</a-col>
</a-row>
</a-list-item>
</a-collapse-panel>
<a-collapse-panel header='{{ i18n "pages.xray.blockConfigs"}}'>
<a-row :xs="24" :sm="24" :lg="12">
<a-alert type="warning" style="text-align: center;">
Expand Down Expand Up @@ -920,6 +963,38 @@
get: function () { return this.xraySetting ? JSON.parse(this.xraySetting) : null; },
set: function (newValue) { this.xraySetting = JSON.stringify(newValue, null, 2); },
},
logSettings: {
get: function () { return this.templateSettings ? this.templateSettings.log : {}; },
set: function (newValue) {
newTemplateSettings = this.templateSettings;
newTemplateSettings.log = newValue;
this.templateSettings = newTemplateSettings;
},
},
logLevel: {
get: function () { return this.logSettings?.loglevel?? 'none'; },
set: function (newValue) {
newLogSettings = this.logSettings;
newLogSettings.loglevel = newValue;
this.logSettings = newLogSettings;
},
},
logAccess: {
get: function () { return this.logSettings?.access?? ''; },
set: function (newValue) {
newLogSettings = this.logSettings;
newValue == "" ? delete newLogSettings.access : newLogSettings.access = newValue;
this.logSettings = newLogSettings;
},
},
logError: {
get: function () { return this.logSettings?.error?? ''; },
set: function (newValue) {
newLogSettings = this.logSettings;
newValue == "" ? delete newLogSettings.error : newLogSettings.error = newValue;
this.logSettings = newLogSettings;
},
},
inboundSettings: {
get: function () { return this.templateSettings ? JSON.stringify(this.templateSettings.inbounds, null, 2) : null; },
set: function (newValue) {
Expand Down
2 changes: 2 additions & 0 deletions web/translation/translate.en_US.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
"advancedTemplate" = "Advanced"
"generalConfigs" = "General Strategy"
"generalConfigsDesc" = "These options will determine general strategy adjustments."
"logConfigs" = "Log"
"logConfigsDesc" = "Logs may affect your server's efficiency. It is recommended to enable it wisely only in case of your needs"
"blockConfigs" = "Protection Shield"
"blockConfigsDesc" = "These options will block traffic based on specific requested protocols and websites."
"blockCountryConfigs" = "Block Country"
Expand Down
2 changes: 2 additions & 0 deletions web/translation/translate.fa_IR.toml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,8 @@
"advancedTemplate" = "پیشرفته"
"generalConfigs" = "استراتژی‌ کلی"
"generalConfigsDesc" = "این گزینه‌ها استراتژی کلی ترافیک را تعیین می‌کنند"
"logConfigs" = "لاگ"
"logConfigsDesc" = "لاگ ها ممکن است بر کارایی سرور شما تأثیر بگذارند. توصیه می شود فقط در صورت نیاز آن را آگاهانه فعال کنید"
"blockConfigs" = "سپر محافظ"
"blockConfigsDesc" = "این گزینه‌ها ترافیک را بر اساس پروتکل‌های درخواستی خاص، و وب سایت‌ها مسدود می‌کند"
"blockCountryConfigs" = "مسدودسازی کشور"
Expand Down
2 changes: 2 additions & 0 deletions web/translation/translate.ru_RU.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
"advancedTemplate" = "Расширенные шаблоны"
"generalConfigs" = "Основные настройки"
"generalConfigsDesc" = "Общие настройки"
"logConfigs" = "Журнал"
"logConfigsDesc" = "Журналы могут повлиять на эффективность вашего сервера. Рекомендуется включать их с умом только в случае ваших нужд!"
"blockConfigs" = "Блокирующие конфигурации"
"blockConfigsDesc" = "Эти параметры не позволят пользователям подключаться к определенным протоколам и веб-сайтам."
"blockCountryConfigs" = "Конфигурация блокировки стран"
Expand Down
2 changes: 2 additions & 0 deletions web/translation/translate.vi_VN.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
"advancedTemplate" = "Mẫu nâng cao"
"generalConfigs" = "Cấu hình Chung"
"generalConfigsDesc" = "Những tùy chọn này sẽ cung cấp điều chỉnh tổng quát."
"logConfigs" = "Nhật ký"
"logConfigsDesc" = "Nhật ký có thể ảnh hưởng đến hiệu suất máy chủ của bạn. Bạn chỉ nên kích hoạt nó một cách khôn ngoan trong trường hợp bạn cần"
"blockConfigs" = "Cấu hình Chặn"
"blockConfigsDesc" = "Những tùy chọn này sẽ ngăn người dùng kết nối đến các giao thức và trang web cụ thể."
"blockCountryConfigs" = "Cấu hình Chặn Quốc gia"
Expand Down
2 changes: 2 additions & 0 deletions web/translation/translate.zh_Hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@
"advancedTemplate" = "高级模板部件"
"generalConfigs" = "通用配置"
"generalConfigsDesc" = "这些选项将提供一般调整"
"logConfigs"="日志"
"logConfigsDesc" = "日志可能会影响您服务器的效率。建议仅在您需要时明智地启用它"
"blockConfigs" = "阻塞配置"
"blockConfigsDesc" = "这些选项将阻止用户连接到特定协议和网站"
"blockCountryConfigs" = "阻止国家配置"
Expand Down

0 comments on commit 525327c

Please sign in to comment.