fix issue#21
This commit is contained in:
parent
6ab0c789b4
commit
7b3daacdf5
@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [main] 0.1.3
|
||||||
|
- 解决 issue#21 点击按钮后的发送文本后不会清空当前的输入框。
|
||||||
|
- 修复暂停按键在多轮对话后消失的问题。
|
||||||
|
|
||||||
## [main] 0.1.2
|
## [main] 0.1.2
|
||||||
- 新特性:用户发送的信息增加「重新发送」按钮。
|
- 新特性:用户发送的信息增加「重新发送」按钮。
|
||||||
- 支持特性 issue#17 「关于左侧添加mcp服务器操作优化问题」:增加强制聚焦功能,用户创建mcp服务器连接的过程中不会让输入框失去焦点。
|
- 支持特性 issue#17 「关于左侧添加mcp服务器操作优化问题」:增加强制聚焦功能,用户创建mcp服务器连接的过程中不会让输入框失去焦点。
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"name": "openmcp",
|
"name": "openmcp",
|
||||||
"displayName": "OpenMCP",
|
"displayName": "OpenMCP",
|
||||||
"description": "An all in one MCP Client/TestTool",
|
"description": "An all in one MCP Client/TestTool",
|
||||||
"version": "0.1.2",
|
"version": "0.1.3",
|
||||||
"publisher": "kirigaya",
|
"publisher": "kirigaya",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "kirigaya",
|
"name": "kirigaya",
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
<div class="input-wrapper">
|
<div class="input-wrapper">
|
||||||
|
|
||||||
<KRichTextarea
|
<KRichTextarea
|
||||||
|
:ref="el => editorRef = el"
|
||||||
:tabId="tabId"
|
:tabId="tabId"
|
||||||
v-model="userInput"
|
v-model="userInput"
|
||||||
:placeholder="t('enter-message-dot')"
|
:placeholder="t('enter-message-dot')"
|
||||||
@ -43,6 +44,7 @@ const props = defineProps({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const emits = defineEmits(['update:scrollToBottom']);
|
const emits = defineEmits(['update:scrollToBottom']);
|
||||||
|
const editorRef = ref<any>(null);
|
||||||
|
|
||||||
const tab = tabs.content[props.tabId];
|
const tab = tabs.content[props.tabId];
|
||||||
const tabStorage = tab.storage as ChatStorage;
|
const tabStorage = tab.storage as ChatStorage;
|
||||||
@ -84,6 +86,7 @@ function clearErrorMessage(errorMessage: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleSend(newMessage?: string) {
|
function handleSend(newMessage?: string) {
|
||||||
|
|
||||||
// 将富文本信息转换成纯文本信息
|
// 将富文本信息转换成纯文本信息
|
||||||
const userMessage = newMessage || userInput.value;
|
const userMessage = newMessage || userInput.value;
|
||||||
|
|
||||||
@ -115,8 +118,6 @@ function handleSend(newMessage?: string) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
isLoading.value = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loop.registerOnChunk(() => {
|
loop.registerOnChunk(() => {
|
||||||
@ -124,7 +125,6 @@ function handleSend(newMessage?: string) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
loop.registerOnDone(() => {
|
loop.registerOnDone(() => {
|
||||||
isLoading.value = false;
|
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -133,9 +133,16 @@ function handleSend(newMessage?: string) {
|
|||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
});
|
});
|
||||||
|
|
||||||
loop.start(tabStorage, userMessage);
|
loop.start(tabStorage, userMessage).then(() => {
|
||||||
|
isLoading.value = false;
|
||||||
|
});
|
||||||
|
|
||||||
|
// 清空文本
|
||||||
userInput.value = '';
|
userInput.value = '';
|
||||||
|
const editor = editorRef.value.editor;
|
||||||
|
if (editor) {
|
||||||
|
editor.innerHTML = '';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleAbort() {
|
function handleAbort() {
|
||||||
|
@ -117,6 +117,12 @@ function extractTextFromCollection(collection: HTMLCollection) {
|
|||||||
|
|
||||||
const isComposing = ref(false);
|
const isComposing = ref(false);
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
editor,
|
||||||
|
handleBackspace,
|
||||||
|
handleInput,
|
||||||
|
});
|
||||||
|
|
||||||
function handleKeydown(event: KeyboardEvent) {
|
function handleKeydown(event: KeyboardEvent) {
|
||||||
|
|
||||||
if (event.key === 'Enter' && !event.shiftKey && !isComposing.value) {
|
if (event.key === 'Enter' && !event.shiftKey && !isComposing.value) {
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
</span>
|
</span>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
OpenMCP Client 0.1.2 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
OpenMCP Client 0.1.3 由 OpenMCP@<a href="https://www.zhihu.com/people/can-meng-zhong-de-che-xian">锦恢</a> 开发
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user