Skip to content

Commit

Permalink
调整配置位置
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaojianli committed Nov 6, 2024
1 parent 7f608ee commit 41452f9
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 28 deletions.
1 change: 1 addition & 0 deletions webui/src/api/model/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface Btn {
app_id: string
app_secret: string
config_url: string
allow_script_execute: boolean
}

export interface BanlistInvoker {
Expand Down
1 change: 0 additions & 1 deletion webui/src/api/model/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ export interface AutoRangeBan {
export interface Btn {
enabled: boolean
ban_duration: BanDuration
allow_script_execute: boolean
}

export interface MultiDialingBlocker {
Expand Down
12 changes: 12 additions & 0 deletions webui/src/views/settings/components/config/components/btn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
<a-form-item label="App Secret" field="btn.app_secret">
<a-input-password v-model="model.app_secret" style="width: 400px" />
</a-form-item>
<a-form-item
:label="t('page.settings.tab.config.btn.allowScript')"
:tooltip="t('page.settings.tab.config.btn.allowScript.tips')"
field="model.enabled"
>
<a-switch v-model="model.allow_script_execute" />
<template v-if="model.allow_script_execute" #extra>
<a-typography-text type="danger">
{{ t('page.settings.tab.config.btn.allowScript.warning') }}
</a-typography-text></template
>
</a-form-item>
</div>
</a-space>
</template>
Expand Down
5 changes: 5 additions & 0 deletions webui/src/views/settings/components/config/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export default {
'All peers connected to torrents (Including: IP, Port, PeerID, UserAgent, Peer Protocol, Flags, Uploaded, Downloaded, UploadRate, DownloadRate, PeerProgress, YourProgress and Downloader Name)',
'page.settings.tab.config.btn.enableSubmit.modal.content3':
'Are you sure you want to enable submit?',
'page.settings.tab.config.btn.allowScript': 'Allow BTN server push scripts',
'page.settings.tab.config.btn.allowScript.warning':
'Warning, this means that the remote server can execute any code on your device, please enable with caution!',
'page.settings.tab.config.btn.allowScript.tips':
'This option will allow BTN server push scripts to your device, this may increase the accuracy of the ban',

'page.settings.tab.config.ipDatabase.title': 'IP Database',
'page.settings.tab.config.ipDatabase.autoUpdate': 'Enable auto update',
Expand Down
5 changes: 5 additions & 0 deletions webui/src/views/settings/components/config/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ export default {
'page.settings.tab.config.btn.enableSubmit.modal.content2':
'您的 Torrent 列表(包括:Torrent 种子摘要的二次不可逆哈希和 Torrent 大小),连接到您的 Torrent 的所有 Peers (包括:IP地址、端口号、PeerID、UserAgent(ClientName),Peer协议,Peer总下载量,Peer总上传量,Peer瞬时上传速度,Peer瞬时下载速度,Peer下载进度,以及您的下载器名称)',
'page.settings.tab.config.btn.enableSubmit.modal.content3': '确定要开启提交吗?',
'page.settings.tab.config.btn.allowScript': '允许 BTN 服务器下发脚本',
'page.settings.tab.config.btn.allowScript.warning':
'警告,这意味着远程服务器可以在你的设备上执行任意代码,请谨慎开启',
'page.settings.tab.config.btn.allowScript.tips':
'打开此选项后将允许 PeerBanHelper 接收并执行来自 BTN 服务器的动态脚本,这有助于提高反吸血精确度和反吸血效果。',

'page.settings.tab.config.ipDatabase.title': 'IP 数据库',
'page.settings.tab.config.ipDatabase.autoUpdate': '启用自动更新',
Expand Down
12 changes: 0 additions & 12 deletions webui/src/views/settings/components/profile/components/btn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@
={{ formatMilliseconds(model.ban_duration) }}
</template>
</a-form-item>
<a-form-item
:label="t('page.settings.tab.profile.module.btn.allowScript')"
:tooltip="t('page.settings.tab.profile.module.btn.allowScript.tips')"
field="model.enabled"
>
<a-switch v-model="model.allow_script_execute" />
<template v-if="model.allow_script_execute" #extra>
<a-typography-text type="danger">
{{ t('page.settings.tab.profile.module.btn.allowScript.warning') }}
</a-typography-text></template
>
</a-form-item>
</a-space>
</template>
<script setup lang="ts">
Expand Down
8 changes: 1 addition & 7 deletions webui/src/views/settings/components/profile/locale/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,5 @@ export default {
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.tips':
'Set the traffic alert threshold, when the threshold is exceeded, an alert message will be sent to remind you to check the status of the downloader.',
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.value':
'Daily traffic alert threshold',

'page.settings.tab.profile.module.btn.allowScript': 'Allow BTN server push scripts',
'page.settings.tab.profile.module.btn.allowScript.warning':
'Warning, this means that the remote server can execute any code on your device, please enable with caution!',
'page.settings.tab.profile.module.btn.allowScript.tips':
'This option will allow BTN server push scripts to your device, this may increase the accuracy of the ban'
'Daily traffic alert threshold'
}
9 changes: 1 addition & 8 deletions webui/src/views/settings/components/profile/locale/zh-CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,5 @@ export default {
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.enable': '开启流量告警',
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.tips':
'设置流量告警阈值,当超出阈值后将发送告警信息提醒您检查下载器状态',
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.value':
'每日流量告警阈值',

'page.settings.tab.profile.module.btn.allowScript': '允许 BTN 服务器下发脚本',
'page.settings.tab.profile.module.btn.allowScript.warning':
'警告,这意味着远程服务器可以在你的设备上执行任意代码,请谨慎开启',
'page.settings.tab.profile.module.btn.allowScript.tips':
'打开此选项后将允许 PeerBanHelper 接收并执行来自 BTN 服务器的动态脚本,这有助于提高反吸血精确度和反吸血效果。'
'page.settings.tab.profile.module.activeMonitor.trafficMonitoring.daily.value': '每日流量告警阈值'
}

0 comments on commit 41452f9

Please sign in to comment.