Skip to content

Commit 4c57d1e

Browse files
committed
删除单独的TProxy 日志
1 parent 9ce9e52 commit 4c57d1e

File tree

7 files changed

+19
-50
lines changed

7 files changed

+19
-50
lines changed

src/module/logs/tproxy.log

Whitespace-only changes.

src/webui/index.html

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ <h3 style="margin: 0; font-size: 16px; font-weight: 500;" data-i18n="logs.title"
408408
<mdui-tabs id="logs-tabs" value="service">
409409
<mdui-tab value="service" data-i18n="logs.service_log">服务日志</mdui-tab>
410410
<mdui-tab value="xray" data-i18n="logs.xray_log">Xray 日志</mdui-tab>
411-
<mdui-tab value="tproxy" data-i18n="logs.tproxy_log">TProxy 日志</mdui-tab>
412411

413412
<!-- Service Log Panel -->
414413
<mdui-tab-panel slot="panel" value="service">
@@ -428,14 +427,6 @@ <h3 style="margin: 0; font-size: 16px; font-weight: 500;" data-i18n="logs.title"
428427
</div>
429428
</mdui-tab-panel>
430429

431-
<!-- TProxy Log Panel -->
432-
<mdui-tab-panel slot="panel" value="tproxy">
433-
<div style="padding: 16px;">
434-
<div class="log-container" id="tproxy-log" style="max-height: 400px; overflow-y: auto;">
435-
<mdui-circular-progress></mdui-circular-progress>
436-
</div>
437-
</div>
438-
</mdui-tab-panel>
439430
</mdui-tabs>
440431
</mdui-card>
441432

src/webui/src/i18n/en-US.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const enUS: Record<string, string> = {
9191
'logs.service_log': 'Service Log',
9292
'logs.title': 'Logs',
9393
'logs.xray_log': 'Xray Log',
94-
'logs.tproxy_log': 'TProxy Log',
94+
9595
'logs.refresh': 'Refresh',
9696
'logs.clean': 'Clean',
9797
'logs.clean_success': 'Logs cleaned',

src/webui/src/i18n/ur-PK.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ const urPK: Record<string, string> = {
7777
'logs.service_log': 'سروس لاگ',
7878
'logs.title': 'لاگز',
7979
'logs.xray_log': 'Xray لاگ',
80-
'logs.tproxy_log': 'TProxy لاگ',
80+
8181
'logs.refresh': 'تازہ کریں',
8282
'logs.clean': 'صاف کریں',
8383
'logs.clean_success': 'لاگز صاف ہو گئے',

src/webui/src/i18n/zh-CN.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ const zhCN: Record<string, string> = {
9090
'logs.service_log': '服务日志',
9191
'logs.title': '日志查看',
9292
'logs.xray_log': 'Xray 日志',
93-
'logs.tproxy_log': 'TProxy 日志',
93+
9494
'logs.refresh': '刷新日志',
9595
'logs.clean': '清空日志',
9696
'logs.clean_success': '日志已清空',

src/webui/src/services/settings-service.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -496,13 +496,6 @@ export class SettingsService {
496496
}
497497
}
498498

499-
static async getTproxyLog(lines = 100) {
500-
try {
501-
return await KSU.exec(`tail -n ${lines} ${KSU.MODULE_PATH}/logs/tproxy.log`);
502-
} catch (error) {
503-
return '暂无日志';
504-
}
505-
}
506499

507500
static async renewTProxy() {
508501
try {

src/webui/src/ui/settings-page.ts

Lines changed: 16 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,9 @@ export class SettingsPageManager {
156156
await SettingsService.setModuleSetting('AUTO_START', target.checked);
157157
toast(
158158
I18nService.t('settings.module.toast_autostart') +
159-
(target.checked
160-
? I18nService.t('common.enabled')
161-
: I18nService.t('common.disabled')),
159+
(target.checked
160+
? I18nService.t('common.enabled')
161+
: I18nService.t('common.disabled')),
162162
);
163163
} catch (error: any) {
164164
toast(I18nService.t('common.set_failed') + error.message, true);
@@ -904,15 +904,15 @@ export class SettingsPageManager {
904904

905905
const domains = domainsStr
906906
? domainsStr
907-
.split(',')
908-
.map(d => d.trim())
909-
.filter(d => d)
907+
.split(',')
908+
.map(d => d.trim())
909+
.filter(d => d)
910910
: [];
911911
const expectIPs = expectIPsStr
912912
? expectIPsStr
913-
.split(',')
914-
.map(i => i.trim())
915-
.filter(i => i)
913+
.split(',')
914+
.map(i => i.trim())
915+
.filter(i => i)
916916
: [];
917917

918918
let server: string | DnsServer;
@@ -1204,8 +1204,8 @@ export class SettingsPageManager {
12041204
mode === 'auto'
12051205
? I18nService.t('settings.theme.mode_auto')
12061206
: mode === 'light'
1207-
? I18nService.t('settings.theme.mode_light')
1208-
: I18nService.t('settings.theme.mode_dark');
1207+
? I18nService.t('settings.theme.mode_light')
1208+
: I18nService.t('settings.theme.mode_dark');
12091209
toast(I18nService.t('settings.theme.toast_mode_switched') + modeName);
12101210

12111211
this.ui.statusPage.updateSpeedChartColors();
@@ -1252,10 +1252,10 @@ export class SettingsPageManager {
12521252
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
12531253
return result
12541254
? {
1255-
r: parseInt(result[1], 16),
1256-
g: parseInt(result[2], 16),
1257-
b: parseInt(result[3], 16),
1258-
}
1255+
r: parseInt(result[1], 16),
1256+
g: parseInt(result[2], 16),
1257+
b: parseInt(result[3], 16),
1258+
}
12591259
: { r: 103, g: 80, b: 164 }; // 默认紫色
12601260
};
12611261

@@ -1431,7 +1431,7 @@ export class SettingsPageManager {
14311431
this.applyMonetSetting(enabled);
14321432
toast(
14331433
I18nService.t('settings.monet.toast_toggled') +
1434-
(enabled ? I18nService.t('common.enabled') : I18nService.t('common.disabled')),
1434+
(enabled ? I18nService.t('common.enabled') : I18nService.t('common.disabled')),
14351435
);
14361436
});
14371437
}
@@ -1687,9 +1687,6 @@ export class SettingsPageManager {
16871687
case 'xray':
16881688
this.loadXrayLog();
16891689
break;
1690-
case 'tproxy':
1691-
this.loadTproxyLog();
1692-
break;
16931690
}
16941691
}
16951692

@@ -1721,18 +1718,6 @@ export class SettingsPageManager {
17211718
}
17221719
}
17231720

1724-
async loadTproxyLog(): Promise<void> {
1725-
const container = document.getElementById('tproxy-log');
1726-
if (!container) return;
1727-
1728-
try {
1729-
const log = await SettingsService.getTproxyLog();
1730-
this.renderLog(container, log);
1731-
} catch (error: any) {
1732-
container.innerHTML = `<span style="color: var(--mdui-color-error);">${I18nService.t('logs.load_failed')}: ${error.message}</span>`;
1733-
}
1734-
}
1735-
17361721
renderLog(container: HTMLElement, log: string): void {
17371722
if (!log || log.trim() === '') {
17381723
container.innerHTML =

0 commit comments

Comments
 (0)