|
|
@@ -1865,113 +1865,113 @@ function _Chat() {
|
|
|
|
|
|
return (
|
|
|
<div className={styles.chat} key={session.id}>
|
|
|
- {
|
|
|
- <div className="window-header" data-tauri-drag-region>
|
|
|
- <div style={{ display: 'flex', alignItems: 'center' }}
|
|
|
- className={`window-header-title ${styles["chat-body-title"]}`}>
|
|
|
- {
|
|
|
- <div style={{ display: 'flex', alignItems: 'center' }}
|
|
|
- className={`window-header-title ${styles["chat-body-title"]}`}>
|
|
|
- <div>
|
|
|
- <img style={{ marginTop: '10%', marginRight: '10px', height: 42 }} src={faviconSrc.src} />
|
|
|
- {/* <Favicon className="window-header-icon" /> */}
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- <div
|
|
|
- className={`window-header-main-title ${styles["chat-body-main-title"]}`}
|
|
|
- // onClickCapture={() => setIsEditingMessage(true)}
|
|
|
- >
|
|
|
- 建科·小智
|
|
|
- </div>
|
|
|
- <div className={`window-header-sub-title ${styles["chat-body-main-title"]}`}>
|
|
|
- {Locale.Chat.SubTitle(session.messages.length)}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- }
|
|
|
- {/* 获取应用列表头部展示在页面最上面 */}
|
|
|
- {
|
|
|
- false &&
|
|
|
- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
|
|
|
- <Select
|
|
|
- style={{ width: '100%', height: 38, marginRight: 10 }}
|
|
|
- value={selectedFruit}
|
|
|
- onChange={(value: "ONLINE" | "LOCAL") => {
|
|
|
- chatStore.clearSessions();
|
|
|
- chatStore.updateCurrentSession((values) => {
|
|
|
- values.appId = globalStore.selectedAppId;
|
|
|
- });
|
|
|
- navigate({ pathname: '/newChat' });
|
|
|
- setSelectedFruit(value);
|
|
|
- chatStore.setChatMode(value);
|
|
|
- }}
|
|
|
- >
|
|
|
- {fruits.map(fruit => (
|
|
|
- <Select.Option key={fruit.id} value={fruit.id}>
|
|
|
- {fruit.name}
|
|
|
- </Select.Option>
|
|
|
- ))}
|
|
|
- </Select>
|
|
|
- {
|
|
|
- appList.length > 0 ?
|
|
|
- <Select
|
|
|
- style={{ width: '100%', height: 38, marginRight: 5 }}
|
|
|
- placeholder='请选择'
|
|
|
- options={appList}
|
|
|
- value={appValue}
|
|
|
- onChange={(value) => {
|
|
|
- setAppValue(value);
|
|
|
- globalStore.setSelectedAppId(value);
|
|
|
- chatStore.clearSessions();
|
|
|
- chatStore.updateCurrentSession((values) => {
|
|
|
- values.appId = value;
|
|
|
- });
|
|
|
- useChatStore.setState({
|
|
|
- message: {
|
|
|
- content: '',
|
|
|
- role: 'assistant',
|
|
|
- }
|
|
|
- });
|
|
|
- setSendStatus(false);
|
|
|
- }}
|
|
|
- />
|
|
|
- :
|
|
|
- null
|
|
|
- }
|
|
|
- </div>
|
|
|
- }
|
|
|
- </div>
|
|
|
- <div className="window-actions">
|
|
|
- <div className="window-action-button" onClick={() => {
|
|
|
- localStorage.clear();
|
|
|
- window.location.reload();
|
|
|
- }}>
|
|
|
- <IconButton text='新聊天' icon={<FormOutlined />} />
|
|
|
-
|
|
|
- </div>
|
|
|
- {/* {showMaxIcon && (
|
|
|
- <div className="window-action-button">
|
|
|
- <IconButton
|
|
|
- icon={config.tightBorder ? <MinIcon /> : <MaxIcon />}
|
|
|
- bordered
|
|
|
- title={Locale.Chat.Actions.FullScreen}
|
|
|
- aria={Locale.Chat.Actions.FullScreen}
|
|
|
- onClick={() => {
|
|
|
- config.update(
|
|
|
- (config) => (config.tightBorder = !config.tightBorder),
|
|
|
- );
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
- )} */}
|
|
|
- </div>
|
|
|
- {/* <PromptToast
|
|
|
- showToast={!hitBottom}
|
|
|
- showModal={showPromptModal}
|
|
|
- setShowModal={setShowPromptModal}
|
|
|
- /> */}
|
|
|
- </div>
|
|
|
- }
|
|
|
+ {/*{*/}
|
|
|
+ {/* <div className="window-header" data-tauri-drag-region>*/}
|
|
|
+ {/* <div style={{ display: 'flex', alignItems: 'center' }}*/}
|
|
|
+ {/* className={`window-header-title ${styles["chat-body-title"]}`}>*/}
|
|
|
+ {/* {*/}
|
|
|
+ {/* <div style={{ display: 'flex', alignItems: 'center' }}*/}
|
|
|
+ {/* className={`window-header-title ${styles["chat-body-title"]}`}>*/}
|
|
|
+ {/* <div>*/}
|
|
|
+ {/* <img style={{ marginTop: '10%', marginRight: '10px', height: 42 }} src={faviconSrc.src} />*/}
|
|
|
+ {/* /!* <Favicon className="window-header-icon" /> *!/*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* <div>*/}
|
|
|
+ {/* <div*/}
|
|
|
+ {/* className={`window-header-main-title ${styles["chat-body-main-title"]}`}*/}
|
|
|
+ {/* // onClickCapture={() => setIsEditingMessage(true)}*/}
|
|
|
+ {/* >*/}
|
|
|
+ {/* 建科·小智*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* <div className={`window-header-sub-title ${styles["chat-body-main-title"]}`}>*/}
|
|
|
+ {/* {Locale.Chat.SubTitle(session.messages.length)}*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* }*/}
|
|
|
+ {/* /!* 获取应用列表头部展示在页面最上面 *!/*/}
|
|
|
+ {/* {*/}
|
|
|
+ {/* false &&*/}
|
|
|
+ {/* <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>*/}
|
|
|
+ {/* <Select*/}
|
|
|
+ {/* style={{ width: '100%', height: 38, marginRight: 10 }}*/}
|
|
|
+ {/* value={selectedFruit}*/}
|
|
|
+ {/* onChange={(value: "ONLINE" | "LOCAL") => {*/}
|
|
|
+ {/* chatStore.clearSessions();*/}
|
|
|
+ {/* chatStore.updateCurrentSession((values) => {*/}
|
|
|
+ {/* values.appId = globalStore.selectedAppId;*/}
|
|
|
+ {/* });*/}
|
|
|
+ {/* navigate({ pathname: '/newChat' });*/}
|
|
|
+ {/* setSelectedFruit(value);*/}
|
|
|
+ {/* chatStore.setChatMode(value);*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/* >*/}
|
|
|
+ {/* {fruits.map(fruit => (*/}
|
|
|
+ {/* <Select.Option key={fruit.id} value={fruit.id}>*/}
|
|
|
+ {/* {fruit.name}*/}
|
|
|
+ {/* </Select.Option>*/}
|
|
|
+ {/* ))}*/}
|
|
|
+ {/* </Select>*/}
|
|
|
+ {/* {*/}
|
|
|
+ {/* appList.length > 0 ?*/}
|
|
|
+ {/* <Select*/}
|
|
|
+ {/* style={{ width: '100%', height: 38, marginRight: 5 }}*/}
|
|
|
+ {/* placeholder='请选择'*/}
|
|
|
+ {/* options={appList}*/}
|
|
|
+ {/* value={appValue}*/}
|
|
|
+ {/* onChange={(value) => {*/}
|
|
|
+ {/* setAppValue(value);*/}
|
|
|
+ {/* globalStore.setSelectedAppId(value);*/}
|
|
|
+ {/* chatStore.clearSessions();*/}
|
|
|
+ {/* chatStore.updateCurrentSession((values) => {*/}
|
|
|
+ {/* values.appId = value;*/}
|
|
|
+ {/* });*/}
|
|
|
+ {/* useChatStore.setState({*/}
|
|
|
+ {/* message: {*/}
|
|
|
+ {/* content: '',*/}
|
|
|
+ {/* role: 'assistant',*/}
|
|
|
+ {/* }*/}
|
|
|
+ {/* });*/}
|
|
|
+ {/* setSendStatus(false);*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/* />*/}
|
|
|
+ {/* :*/}
|
|
|
+ {/* null*/}
|
|
|
+ {/* }*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* }*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* <div className="window-actions">*/}
|
|
|
+ {/* <div className="window-action-button" onClick={() => {*/}
|
|
|
+ {/* localStorage.clear();*/}
|
|
|
+ {/* window.location.reload();*/}
|
|
|
+ {/* }}>*/}
|
|
|
+ {/* <IconButton text='新聊天' icon={<FormOutlined />} />*/}
|
|
|
+
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* /!* {showMaxIcon && (*/}
|
|
|
+ {/* <div className="window-action-button">*/}
|
|
|
+ {/* <IconButton*/}
|
|
|
+ {/* icon={config.tightBorder ? <MinIcon /> : <MaxIcon />}*/}
|
|
|
+ {/* bordered*/}
|
|
|
+ {/* title={Locale.Chat.Actions.FullScreen}*/}
|
|
|
+ {/* aria={Locale.Chat.Actions.FullScreen}*/}
|
|
|
+ {/* onClick={() => {*/}
|
|
|
+ {/* config.update(*/}
|
|
|
+ {/* (config) => (config.tightBorder = !config.tightBorder),*/}
|
|
|
+ {/* );*/}
|
|
|
+ {/* }}*/}
|
|
|
+ {/* />*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* )} *!/*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/* /!* <PromptToast*/}
|
|
|
+ {/* showToast={!hitBottom}*/}
|
|
|
+ {/* showModal={showPromptModal}*/}
|
|
|
+ {/* setShowModal={setShowPromptModal}*/}
|
|
|
+ {/* /> *!/*/}
|
|
|
+ {/* </div>*/}
|
|
|
+ {/*}*/}
|
|
|
<div
|
|
|
className={styles["chat-body"]}
|
|
|
ref={scrollRef}
|