feat(settings): move request logging toggle behind hidden entry

This commit is contained in:
Supra4E8C
2025-12-22 22:41:50 +08:00
parent 68974ffc68
commit 94962158ef
7 changed files with 151 additions and 29 deletions

View File

@@ -288,12 +288,6 @@ export function DashboardPage() {
{config.loggingToFile ? t('common.yes') : t('common.no')}
</span>
</div>
<div className={styles.configItem}>
<span className={styles.configLabel}>{t('basic_settings.request_log_enable')}</span>
<span className={`${styles.configValue} ${config.requestLog ? styles.enabled : styles.disabled}`}>
{config.requestLog ? t('common.yes') : t('common.no')}
</span>
</div>
<div className={styles.configItem}>
<span className={styles.configLabel}>{t('basic_settings.retry_count_label')}</span>
<span className={styles.configValue}>{config.requestRetry ?? 0}</span>

View File

@@ -16,7 +16,6 @@ type PendingKey =
| 'switchProject'
| 'switchPreview'
| 'usage'
| 'requestLog'
| 'loggingToFile'
| 'wsAuth';
@@ -70,7 +69,7 @@ export function SettingsPage() {
const toggleSetting = async (
section: PendingKey,
rawKey: 'debug' | 'usage-statistics-enabled' | 'request-log' | 'logging-to-file' | 'ws-auth',
rawKey: 'debug' | 'usage-statistics-enabled' | 'logging-to-file' | 'ws-auth',
value: boolean,
updater: (val: boolean) => Promise<any>,
successMessage: string
@@ -81,8 +80,6 @@ export function SettingsPage() {
return config?.debug ?? false;
case 'usage-statistics-enabled':
return config?.usageStatisticsEnabled ?? false;
case 'request-log':
return config?.requestLog ?? false;
case 'logging-to-file':
return config?.loggingToFile ?? false;
case 'ws-auth':
@@ -200,21 +197,6 @@ export function SettingsPage() {
}
/>
<ToggleSwitch
label={t('basic_settings.request_log_enable')}
checked={config?.requestLog ?? false}
disabled={disableControls || pending.requestLog || loading}
onChange={(value) =>
toggleSetting(
'requestLog',
'request-log',
value,
configApi.updateRequestLog,
t('notification.request_log_updated')
)
}
/>
<ToggleSwitch
label={t('basic_settings.logging_to_file_enable')}
checked={config?.loggingToFile ?? false}