mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 21:19:01 +01:00
fix TPL location in llm_chat_panel.ts
This commit is contained in:
parent
0aa214786c
commit
2f573d4464
@ -13,34 +13,8 @@ import options from "../services/options.js";
|
||||
await libraryLoader.requireCss('stylesheets/llm_chat.css');
|
||||
})();
|
||||
|
||||
interface ChatResponse {
|
||||
id: string;
|
||||
messages: Array<{role: string; content: string}>;
|
||||
sources?: Array<{noteId: string; title: string}>;
|
||||
}
|
||||
|
||||
interface SessionResponse {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export default class LlmChatPanel extends BasicWidget {
|
||||
private noteContextChatMessages!: HTMLElement;
|
||||
private noteContextChatForm!: HTMLFormElement;
|
||||
private noteContextChatInput!: HTMLTextAreaElement;
|
||||
private noteContextChatSendButton!: HTMLButtonElement;
|
||||
private chatContainer!: HTMLElement;
|
||||
private loadingIndicator!: HTMLElement;
|
||||
private sourcesList!: HTMLElement;
|
||||
private useAdvancedContextCheckbox!: HTMLInputElement;
|
||||
private showThinkingCheckbox!: HTMLInputElement;
|
||||
private validationWarning!: HTMLElement;
|
||||
private sessionId: string | null = null;
|
||||
private currentNoteId: string | null = null;
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(`
|
||||
<div class="note-context-chat h-100 w-100 d-flex flex-column">
|
||||
const TPL = `
|
||||
<div class="note-context-chat h-100 w-100 d-flex flex-column">
|
||||
<!-- Move validation warning outside the card with better styling -->
|
||||
<div class="provider-validation-warning alert alert-warning m-2 border-left border-warning" style="display: none; padding-left: 15px; border-left: 4px solid #ffc107; background-color: rgba(255, 248, 230, 0.9); font-size: 0.9rem; box-shadow: 0 2px 5px rgba(0,0,0,0.05);"></div>
|
||||
|
||||
@ -91,8 +65,36 @@ export default class LlmChatPanel extends BasicWidget {
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`);
|
||||
</div>
|
||||
`;
|
||||
|
||||
interface ChatResponse {
|
||||
id: string;
|
||||
messages: Array<{role: string; content: string}>;
|
||||
sources?: Array<{noteId: string; title: string}>;
|
||||
}
|
||||
|
||||
interface SessionResponse {
|
||||
id: string;
|
||||
title: string;
|
||||
}
|
||||
|
||||
export default class LlmChatPanel extends BasicWidget {
|
||||
private noteContextChatMessages!: HTMLElement;
|
||||
private noteContextChatForm!: HTMLFormElement;
|
||||
private noteContextChatInput!: HTMLTextAreaElement;
|
||||
private noteContextChatSendButton!: HTMLButtonElement;
|
||||
private chatContainer!: HTMLElement;
|
||||
private loadingIndicator!: HTMLElement;
|
||||
private sourcesList!: HTMLElement;
|
||||
private useAdvancedContextCheckbox!: HTMLInputElement;
|
||||
private showThinkingCheckbox!: HTMLInputElement;
|
||||
private validationWarning!: HTMLElement;
|
||||
private sessionId: string | null = null;
|
||||
private currentNoteId: string | null = null;
|
||||
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
|
||||
const element = this.$widget[0];
|
||||
this.noteContextChatMessages = element.querySelector('.note-context-chat-messages') as HTMLElement;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user