fix ai_settings TPL location

This commit is contained in:
perf3ct 2025-03-28 21:26:09 +00:00
parent 2f573d4464
commit d1cd0a8817
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
2 changed files with 358 additions and 358 deletions

View File

@ -1,3 +0,0 @@
import AiSettingsWidget from "./ai_settings.ts";
export default AiSettingsWidget;

View File

@ -60,6 +60,7 @@ interface OpenAIModelResponse {
}>; }>;
} }
// After all interfaces, before class definition, add the TPL constant
interface AnthropicModelResponse { interface AnthropicModelResponse {
success: boolean; success: boolean;
chatModels: Array<{ chatModels: Array<{
@ -74,13 +75,7 @@ interface AnthropicModelResponse {
}>; }>;
} }
export default class AiSettingsWidget extends OptionsWidget { const TPL = `
private statsRefreshInterval: NodeJS.Timeout | null = null;
private indexRebuildRefreshInterval: NodeJS.Timeout | null = null;
private readonly STATS_REFRESH_INTERVAL = 5000; // 5 seconds
doRender() {
this.$widget = $(`
<div class="options-section"> <div class="options-section">
<h4>${t("ai_llm.title")}</h4> <h4>${t("ai_llm.title")}</h4>
@ -434,7 +429,15 @@ export default class AiSettingsWidget extends OptionsWidget {
</div> </div>
</div> </div>
</div> </div>
</div>`); </div>`;
export default class AiSettingsWidget extends OptionsWidget {
private statsRefreshInterval: NodeJS.Timeout | null = null;
private indexRebuildRefreshInterval: NodeJS.Timeout | null = null;
private readonly STATS_REFRESH_INTERVAL = 5000; // 5 seconds
doRender() {
this.$widget = $(TPL);
const $aiEnabled = this.$widget.find('.ai-enabled'); const $aiEnabled = this.$widget.find('.ai-enabled');
$aiEnabled.on('change', async () => { $aiEnabled.on('change', async () => {