From be5b7455b5bc222f891edea5f8121b9eaf27bf09 Mon Sep 17 00:00:00 2001 From: duanfuxiang Date: Mon, 31 Mar 2025 18:01:31 +0800 Subject: [PATCH] update api text inpu is password --- src/core/ripgrep/index.ts | 4 ---- src/settings/SettingTab.tsx | 24 ++++++++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/core/ripgrep/index.ts b/src/core/ripgrep/index.ts index 434b6da..1572c89 100644 --- a/src/core/ripgrep/index.ts +++ b/src/core/ripgrep/index.ts @@ -111,7 +111,6 @@ export async function regexSearchFiles( let output: string try { output = await execRipgrep(rgPath, args) - console.log("output", output) } catch (error) { console.error("Error executing ripgrep:", error) return "No results found" @@ -161,9 +160,6 @@ export async function regexSearchFiles( results.push(currentResult as SearchResult) } - console.log("results", results) - console.log("currentResult", currentResult) - return formatResults(results, directoryPath) } diff --git a/src/settings/SettingTab.tsx b/src/settings/SettingTab.tsx index 2b759f1..7045f63 100644 --- a/src/settings/SettingTab.tsx +++ b/src/settings/SettingTab.tsx @@ -116,16 +116,20 @@ export class InfioSettingTab extends PluginSettingTab { a.setAttr('rel', 'noopener'); })) .setClass('setting-item-heading-smaller') - .addText((text) => - text + .addText((text) => { + const t = text .setValue(this.plugin.settings.serperApiKey) .onChange(async (value) => { await this.plugin.setSettings({ ...this.plugin.settings, serperApiKey: value, }) - }), - ) + }); + if (t.inputEl) { + t.inputEl.type = "password"; + } + return t; + }) new Setting(containerEl) .setName('Jina API key (Optional)') @@ -139,16 +143,20 @@ export class InfioSettingTab extends PluginSettingTab { a.setAttr('rel', 'noopener'); })) .setClass('setting-item-heading-smaller') - .addText((text) => - text + .addText((text) => { + const t = text .setValue(this.plugin.settings.jinaApiKey) .onChange(async (value) => { await this.plugin.setSettings({ ...this.plugin.settings, jinaApiKey: value, }) - }), - ) + }); + if (t.inputEl) { + t.inputEl.type = "password"; + } + return t; + }) } renderRAGSection(containerEl: HTMLElement): void {