Skip to content

Commit

Permalink
feat: handle error log
Browse files Browse the repository at this point in the history
  • Loading branch information
dolphin0618 committed Jul 5, 2024
1 parent 81baa46 commit 5cc20e6
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bisheng",
"version": "0.3.2",
"version": "0.3.2.1",
"private": true,
"dependencies": {
"@emotion/react": "^11.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function MessagePanne({ useName, guideWord, loadMore }) {
} else if (msg.files?.length) {
type = 'file'
} else if (['tool', 'flow', 'knowledge'].includes(msg.category)
// || msg.category === 'processing'
|| (msg.category === 'processing' && msg.thought.indexOf(`status_code`) === -1)
) { // 项目演示?
type = 'runLog'
} else if (msg.thought) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export default function MessageSystem({ data }) {
const border = { system: 'border-slate-500', question: 'border-amber-500', processing: 'border-cyan-600', answer: 'border-lime-600', report: 'border-slate-500', guide: 'border-none' }

// 中英去掉最终的回答(report)
if(data.category === 'report') return null
// if(data.category === 'report') return null

return <div className="py-1">
<div className={`relative rounded-sm px-6 py-4 border text-sm ${data.category === 'guide' ? 'bg-[#EDEFF6]' : 'bg-slate-50'} ${border[data.category || 'system']}`}>
{logMkdown}
{data.category === 'report' && <CopyIcon className=" absolute right-4 top-2 cursor-pointer" onClick={(e) => handleCopy(e.target.parentNode)}></CopyIcon>}
{/* 中英 */}
{<CopyIcon className=" absolute right-4 top-2 cursor-pointer" onClick={(e) => handleCopy(e.target.parentNode)}></CopyIcon>}
{/* {<CopyIcon className=" absolute right-4 top-2 cursor-pointer" onClick={(e) => handleCopy(e.target.parentNode)}></CopyIcon>} */}
</div>
</div>
};
4 changes: 2 additions & 2 deletions src/frontend/src/pages/ChatAppPage/components/FileView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ export default function FileView({ data }) {
<span className="loading loading-infinity loading-lg"></span>
</div>
// {/* 中英 */}
// : <div id="warp-pdf" className="file-view absolute">
: <div id="warp-pdf" className="file-view absolute pointer-events-none">
: <div id="warp-pdf" className="file-view absolute">
{/* : <div id="warp-pdf" className="file-view absolute pointer-events-none"> */}
<List
ref={listRef}
itemCount={pdf?.numPages || 100}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const ResultPanne = ({ chatId, words, data, onClose, onAdd, children }: { chatId
<div className="w-[300px] bg-gray-100 rounded-md py-4 px-2 h-full overflow-y-auto no-scrollbar">
{/* label */}
{/* 中英 */}
{/* <div className="mb-4 text-sm font-bold">
<div className="mb-4 text-sm font-bold">
{t('chat.filterLabel')}
<div className="tooltip fixed" data-tip={t('chat.tooltipText')}><span data-theme="light" className="badge cursor-pointer">?</span></div>
</div>
Expand All @@ -109,15 +109,15 @@ const ResultPanne = ({ chatId, words, data, onClose, onAdd, children }: { chatId
}}></input></div> :
<div className="badge badge-info gap-2 cursor-pointer bg-[rgba(53,126,249,.86)] text-gray-50" onClick={handleOpenInput}><span>{t('chat.addCustomLabel')}</span></div>
}
</div> */}
</div>
{/* files */}
<div className="mt-4">
<p className="mb-4 text-sm font-bold">{t('chat.sourceDocumentsLabel')}</p>
{files.map(_file =>
_file.right ? <div key={_file.id} onClick={() => setFile(_file)} className={`group rounded-xl bg-[#fff] hover-bg-gray-200 flex items-center px-4 mb-2 relative min-h-16 cursor-pointer ${file?.id === _file.id && 'bg-gray-200'}`}>
<p className="text-sm break-all">{_file.fileName}</p>
{/* 中英 */}
{/* <div className="absolute right-1 top-1 gap-2 hidden group-hover:flex">
<div className="absolute right-1 top-1 gap-2 hidden group-hover:flex">
{
_file.fileUrl && <div className="tooltip" data-tip={t('chat.downloadPDFTooltip')}>
<a href="javascript:;" onClick={(event) => { downloadFile(checkSassUrl(_file.fileUrl), _file.fileName.replace(/\.[\w\d]+$/, '.pdf')); event.stopPropagation() }} >
Expand All @@ -132,7 +132,7 @@ const ResultPanne = ({ chatId, words, data, onClose, onAdd, children }: { chatId
</a>
</div>
}
</div> */}
</div>
<span className="absolute right-1 bottom-1 text-blue-400 text-sm">{_file.score}</span>
</div> :
<div key={_file.id} className={`msk group rounded-xl bg-[#fff] hover-bg-gray-200 flex items-center px-4 mb-2 relative min-h-16 cursor-pointer ${file?.id === _file.id && 'bg-gray-200'}`}>
Expand Down
8 changes: 4 additions & 4 deletions src/frontend/src/pages/LoginPage/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ export const LoginPage = () => {
)
}
{/* 中英 */}
<Button
{/* <Button
className='h-[48px] mt-[32px] dark:bg-button'
disabled={isLoading} onClick={handleLogin} >{t('login.loginButton')}</Button>
{/* {
disabled={isLoading} onClick={handleLogin} >{t('login.loginButton')}</Button> */}
{
showLogin ? <>
<div className="text-center">
<a href="javascript:;" className=" text-blue-500 text-sm hover:underline" onClick={() => setShowLogin(false)}>{t('login.noAccountRegister')}</a>
Expand All @@ -198,7 +198,7 @@ export const LoginPage = () => {
className='h-[48px] mt-[32px] dark:bg-button'
disabled={isLoading} onClick={handleRegister} >{t('login.registerButton')}</Button>
</>
} */}
}
{appConfig.hasSSO && <LoginBridge />}
</div>
<div className=" absolute right-[16px] bottom-[16px] flex">
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { viteStaticCopy } from 'vite-plugin-static-copy';
import svgr from "vite-plugin-svgr";

// Use environment variable to determine the target.
const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7861";
const target = process.env.VITE_PROXY_TARGET || "https://bisheng.dataelem.com/";
const apiRoutes = ["^/api/", "/health"];

const proxyTargets = apiRoutes.reduce((proxyObj, route) => {
Expand Down

0 comments on commit 5cc20e6

Please sign in to comment.