|
@@ -3,6 +3,7 @@ class ChatUI {
|
|
this.messageContainer = document.getElementById("chat-messages");
|
|
this.messageContainer = document.getElementById("chat-messages");
|
|
this.input = document.getElementById("chat-input");
|
|
this.input = document.getElementById("chat-input");
|
|
this.sendButton = document.getElementById("send-button");
|
|
this.sendButton = document.getElementById("send-button");
|
|
|
|
+ this.stopButton = document.getElementById("stop-button");
|
|
this.promptButton = document.getElementById("prompt-button");
|
|
this.promptButton = document.getElementById("prompt-button");
|
|
this.promptPanel = document.getElementById("prompt-panel");
|
|
this.promptPanel = document.getElementById("prompt-panel");
|
|
|
|
|
|
@@ -51,7 +52,6 @@ class ChatUI {
|
|
);
|
|
);
|
|
|
|
|
|
// 创建打断按钮
|
|
// 创建打断按钮
|
|
- this.stopButton = document.createElement("button");
|
|
|
|
this.stopButton.className = "stop-button";
|
|
this.stopButton.className = "stop-button";
|
|
this.stopButton.innerHTML = `
|
|
this.stopButton.innerHTML = `
|
|
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
<svg viewBox="0 0 24 24" fill="currentColor">
|
|
@@ -597,8 +597,10 @@ class ChatUI {
|
|
this.input.placeholder = isGenerating ? "回复生成中..." : "输入消息...";
|
|
this.input.placeholder = isGenerating ? "回复生成中..." : "输入消息...";
|
|
if (isGenerating) {
|
|
if (isGenerating) {
|
|
this.inputWrapper.classList.add("generating");
|
|
this.inputWrapper.classList.add("generating");
|
|
|
|
+ this.stopButton.classList.add("show");
|
|
} else {
|
|
} else {
|
|
this.inputWrapper.classList.remove("generating");
|
|
this.inputWrapper.classList.remove("generating");
|
|
|
|
+ this.stopButton.classList.remove("show");
|
|
// AI回复完成后,自动聚焦到输入框
|
|
// AI回复完成后,自动聚焦到输入框
|
|
this.input.focus();
|
|
this.input.focus();
|
|
}
|
|
}
|