diff --git a/dsRag/static/ai.html b/dsRag/static/ai.html index 8c927e8c..9a3e58a7 100644 --- a/dsRag/static/ai.html +++ b/dsRag/static/ai.html @@ -73,6 +73,21 @@ background-color: #0056b3; } + #clearBtn { + background-color: #6c757d; + color: white; + border: none; + padding: 10px 20px; + font-size: 16px; + border-radius: 5px; + cursor: pointer; + transition: background-color 0.3s; + } + + #clearBtn:hover { + background-color: #5a6268; + } + .status { text-align: center; margin-bottom: 20px; @@ -132,6 +147,7 @@
+
@@ -139,6 +155,13 @@ let eventSource = null; let textBuffer = ''; + function clearAll() { + document.getElementById('dataArea').innerHTML = '等待问题...'; + document.getElementById('questionInput').value = ''; + document.getElementById('status').textContent = '准备就绪'; + document.getElementById('status').className = 'status'; + } + function submitQuestion() { const question = document.getElementById('questionInput').value.trim(); if (!question) { @@ -159,7 +182,7 @@ submitBtn.textContent = '处理中...'; // 更新状态 - statusDiv.textContent = '正在连接...'; + statusDiv.textContent = '生成中...'; statusDiv.className = 'status connecting'; // 使用fetch发送POST请求并获取完整响应