mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-04 19:48:02 +02:00
Add files via upload
This commit is contained in:
@@ -200,9 +200,10 @@ func (db *DB) ListConversations(limit, offset int, search string) ([]*Conversati
|
|||||||
|
|
||||||
// UpdateConversationTitle 更新对话标题
|
// UpdateConversationTitle 更新对话标题
|
||||||
func (db *DB) UpdateConversationTitle(id, title string) error {
|
func (db *DB) UpdateConversationTitle(id, title string) error {
|
||||||
|
// 注意:不更新 updated_at,因为重命名操作不应该改变对话的更新时间
|
||||||
_, err := db.Exec(
|
_, err := db.Exec(
|
||||||
"UPDATE conversations SET title = ?, updated_at = ? WHERE id = ?",
|
"UPDATE conversations SET title = ? WHERE id = ?",
|
||||||
title, time.Now(), id,
|
title, id,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("更新对话标题失败: %w", err)
|
return fmt.Errorf("更新对话标题失败: %w", err)
|
||||||
|
|||||||
@@ -292,9 +292,10 @@ func (db *DB) UpdateConversationPinned(id string, pinned bool) error {
|
|||||||
if pinned {
|
if pinned {
|
||||||
pinnedValue = 1
|
pinnedValue = 1
|
||||||
}
|
}
|
||||||
|
// 注意:不更新 updated_at,因为置顶操作不应该改变对话的更新时间
|
||||||
_, err := db.Exec(
|
_, err := db.Exec(
|
||||||
"UPDATE conversations SET pinned = ?, updated_at = ? WHERE id = ?",
|
"UPDATE conversations SET pinned = ? WHERE id = ?",
|
||||||
pinnedValue, time.Now(), id,
|
pinnedValue, id,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("更新对话置顶状态失败: %w", err)
|
return fmt.Errorf("更新对话置顶状态失败: %w", err)
|
||||||
|
|||||||
@@ -448,8 +448,11 @@ function handleStreamEvent(event, progressElement, progressId,
|
|||||||
updateActiveConversation();
|
updateActiveConversation();
|
||||||
addAttackChainButton(currentConversationId);
|
addAttackChainButton(currentConversationId);
|
||||||
loadActiveTasks();
|
loadActiveTasks();
|
||||||
// 立即刷新对话列表,让新对话显示在历史记录中
|
// 延迟刷新对话列表,确保用户消息已保存,updated_at已更新
|
||||||
loadConversations();
|
// 这样新对话才能正确显示在最近对话列表的顶部
|
||||||
|
setTimeout(() => {
|
||||||
|
loadConversations();
|
||||||
|
}, 200);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'iteration':
|
case 'iteration':
|
||||||
@@ -627,8 +630,10 @@ function handleStreamEvent(event, progressElement, progressId,
|
|||||||
collapseAllProgressDetails(assistantId, progressId);
|
collapseAllProgressDetails(assistantId, progressId);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
// 刷新对话列表
|
// 延迟刷新对话列表,确保助手消息已保存,updated_at已更新
|
||||||
loadConversations();
|
setTimeout(() => {
|
||||||
|
loadConversations();
|
||||||
|
}, 200);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'error':
|
case 'error':
|
||||||
|
|||||||
Reference in New Issue
Block a user