fix:修复了日期选择的问题

This commit is contained in:
xuncha
2026-01-17 12:02:17 +08:00
parent 650de55202
commit 9402483d87
4 changed files with 102 additions and 14 deletions

View File

@@ -58,6 +58,7 @@ function SettingsPage() {
const [whisperModelName, setWhisperModelName] = useState('base')
const [whisperModelDir, setWhisperModelDir] = useState('')
const [whisperDownloadSource, setWhisperDownloadSource] = useState('tsinghua')
const [autoTranscribeVoice, setAutoTranscribeVoice] = useState(true)
const [isWhisperDownloading, setIsWhisperDownloading] = useState(false)
const [whisperDownloadProgress, setWhisperDownloadProgress] = useState(0)
const [whisperModelStatus, setWhisperModelStatus] = useState<{ exists: boolean; path?: string } | null>(null)
@@ -125,6 +126,7 @@ function SettingsPage() {
const savedWhisperModelName = await configService.getWhisperModelName()
const savedWhisperModelDir = await configService.getWhisperModelDir()
const savedWhisperSource = await configService.getWhisperDownloadSource()
const savedAutoTranscribeVoice = await configService.getAutoTranscribeVoice()
if (savedKey) setDecryptKey(savedKey)
if (savedPath) setDbPath(savedPath)
@@ -138,6 +140,7 @@ function SettingsPage() {
if (savedWhisperModelName) setWhisperModelName(savedWhisperModelName)
if (savedWhisperModelDir) setWhisperModelDir(savedWhisperModelDir)
if (savedWhisperSource) setWhisperDownloadSource(savedWhisperSource)
setAutoTranscribeVoice(savedAutoTranscribeVoice)
} catch (e) {
console.error('加载配置失败:', e)
}
@@ -762,8 +765,25 @@ function SettingsPage() {
<p className="section-desc"></p>
<div className="form-group whisper-section">
<label> (Whisper)</label>
<span className="form-hint"></span>
<div className="whisper-grid">
<span className="form-hint"></span>
<label style={{ marginTop: '12px', marginBottom: '8px', display: 'block' }}></label>
<label className="switch" htmlFor="auto-transcribe-toggle">
<input
id="auto-transcribe-toggle"
className="switch-input"
type="checkbox"
checked={autoTranscribeVoice}
onChange={(e) => {
const enabled = e.target.checked
setAutoTranscribeVoice(enabled)
configService.setAutoTranscribeVoice(enabled)
}}
/>
<span className="switch-slider" />
</label>
<div className="whisper-grid" style={{ marginTop: '16px' }}>
<div className="whisper-field">
<span className="field-label"></span>
<select