Add log switch.

This commit is contained in:
fanlusky committed 2026-08-22 18:33:46 +08:00
1 parent 4b95102501
commit 4088cc213f
3 files changed
+25

No files matched your search

@@ -1,3 +1,6 @@
import { updateConfig } from './config-sync';
import { setupToggleButton } from './shared';
const UPDATE_MANIFEST_URL = 'https://msime.app/update.json';
const RELEASES_PAGE_URL = 'https://github.com/metasequoiaime/MetasequoiaImeTsf/releases';
const REQUEST_TIMEOUT_MS = 10000;
@@ -63,6 +66,10 @@ function setDialogOpen(dialog: HTMLDialogElement, open: boolean): void {
}
export function setupAboutSettings(): void {
setupToggleButton('candidateWindowDiagnosticLogToggleBtn', (active) => {
updateConfig('general.candidate_window_diagnostic_log', active);
});
const checkButton = document.getElementById('about-check-update');
const versionLabel = document.querySelector('#about-settings .about-version');
const statusLabel = document.getElementById('about-update-status');
@@ -90,6 +90,12 @@ export function setupConfigSync(): void {
if (typeof payload.data?.general?.floating_toolbar === 'boolean') {
applyToggleState('ftbToggleBtn', payload.data.general.floating_toolbar);
}
if (typeof payload.data?.general?.candidate_window_diagnostic_log === 'boolean') {
applyToggleState(
'candidateWindowDiagnosticLogToggleBtn',
payload.data.general.candidate_window_diagnostic_log
);
}
if (typeof payload.data?.input?.word_to_character === 'boolean') {
applyToggleState('wordToCharacterToggleBtn', payload.data.input.word_to_character);
}
@@ -24,6 +24,18 @@
</button>
</div>
<div class="section candidate-window-diagnostic-section">
<div class="section-header">
<div>
<div class="section-title">候选框诊断日志</div>
<div class="quick-phrase-description">仅在排查候选框异常时开启。记录窗口、WebView2、焦点会话和通信状态,不记录输入内容或候选文本。日志位于本地应用数据目录的 metasequoiaime\logs。</div>
</div>
<div class="ftb-toggle-btn" id="candidateWindowDiagnosticLogToggleBtn" role="switch" aria-checked="false" tabindex="0">
<div class="ftb-toggle-knob"></div>
</div>
</div>
</div>
<dialog id="about-update-dialog" class="about-update-dialog" aria-labelledby="about-update-dialog-title">
<div class="about-update-dialog-body">
<div id="about-update-dialog-title" class="about-update-dialog-title">发现新版本</div>