|
|
@@ -1587,6 +1587,10 @@ function _Chat() {
|
|
|
return appList.find(item => item.value === value)?.desc;
|
|
|
}
|
|
|
|
|
|
+ const couldStop = ChatControllerPool.hasPending();
|
|
|
+
|
|
|
+ const stopAll = () => ChatControllerPool.stopAll();
|
|
|
+
|
|
|
return (
|
|
|
<div className={styles.chat} key={session.id}>
|
|
|
<div className="window-header" data-tauri-drag-region>
|
|
|
@@ -2061,11 +2065,17 @@ function _Chat() {
|
|
|
</div>
|
|
|
)}
|
|
|
<IconButton
|
|
|
- icon={<SendWhiteIcon />}
|
|
|
- text='发送'
|
|
|
+ icon={couldStop ? <div style={{ width: 13, height: 13, background: '#FFFFFF', borderRadius: 2 }}></div> : <SendWhiteIcon />}
|
|
|
+ text={couldStop ? '停止' : '发送'}
|
|
|
className={styles["chat-input-send"]}
|
|
|
type="primary"
|
|
|
- onClick={() => doSubmit(userInput)}
|
|
|
+ onClick={() => {
|
|
|
+ if (couldStop) {
|
|
|
+ stopAll();
|
|
|
+ } else {
|
|
|
+ doSubmit(userInput);
|
|
|
+ }
|
|
|
+ }}
|
|
|
/>
|
|
|
</label>
|
|
|
</div>
|