mirror of
https://github.com/fancive/obsidian-parallel-reader.git
synced 2026-07-22 17:20:24 +00:00
feat(settings): expose cliTimeoutMs in settings tab UI
Adds CLI timeout text input below CLI path; renders only when CLI backend is selected. Adds settingCliTimeoutDesc i18n key for both languages. https://claude.ai/code/session_012cK5rUGQvqkuxUZ59x7dLn
This commit is contained in:
parent
a20d94ca7e
commit
f4f3a33585
2 changed files with 17 additions and 0 deletions
|
|
@ -101,6 +101,7 @@ export const STRINGS: Record<string, Record<string, string>> = {
|
|||
settingCliPathDesc: '留空则自动探测常见位置;Obsidian GUI 启动时不继承 shell PATH,必要时填绝对路径',
|
||||
settingCliPathPlaceholder: '例:/Users/you/bin/codex',
|
||||
settingCliTimeoutName: 'CLI 超时 (ms)',
|
||||
settingCliTimeoutDesc: 'CLI 调用的超时时间(毫秒);低于 1000ms 或非法值会恢复默认值(120000ms)',
|
||||
apiProviderHeader: 'API Provider',
|
||||
settingProviderPresetName: 'Provider preset',
|
||||
settingProviderPresetDesc: '参考 OpenClaw 的 provider/model 思路:preset 只负责协议、base URL 和认证默认值',
|
||||
|
|
@ -264,6 +265,8 @@ export const STRINGS: Record<string, Record<string, string>> = {
|
|||
'Leave blank to auto-detect common paths. Obsidian launched from the GUI may not inherit shell PATH.',
|
||||
settingCliPathPlaceholder: 'Example: /Users/you/bin/codex',
|
||||
settingCliTimeoutName: 'CLI timeout (ms)',
|
||||
settingCliTimeoutDesc:
|
||||
'Timeout for CLI calls in milliseconds; values below 1000ms or invalid values reset to default (120000ms)',
|
||||
apiProviderHeader: 'API Provider',
|
||||
settingProviderPresetName: 'Provider preset',
|
||||
settingProviderPresetDesc:
|
||||
|
|
|
|||
|
|
@ -117,6 +117,20 @@ export class ParallelReaderSettingTab extends PluginSettingTab {
|
|||
this.plugin.saveSettingsDebounced();
|
||||
}),
|
||||
);
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName(this.tr('settingCliTimeoutName'))
|
||||
.setDesc(this.tr('settingCliTimeoutDesc'))
|
||||
.addText((t) =>
|
||||
t
|
||||
.setPlaceholder(String(DEFAULT_SETTINGS.cliTimeoutMs))
|
||||
.setValue(String(this.plugin.settings.cliTimeoutMs || DEFAULT_SETTINGS.cliTimeoutMs))
|
||||
.onChange((v) => {
|
||||
const n = parseInt(v, 10);
|
||||
this.plugin.settings.cliTimeoutMs = Number.isFinite(n) && n >= 1000 ? n : DEFAULT_SETTINGS.cliTimeoutMs;
|
||||
this.plugin.saveSettingsDebounced();
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
private renderApiBackendSettings(containerEl: HTMLElement) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue