diff --git a/src/components/status-tag/index.tsx b/src/components/status-tag/index.tsx index 8ba9c12a..e95e101a 100644 --- a/src/components/status-tag/index.tsx +++ b/src/components/status-tag/index.tsx @@ -10,6 +10,7 @@ import CopyButton from '../copy-button'; import CopyStyle from './copy.less'; import './index.less'; +const linkReg = /(.*?)<\/a>/g; export const StatusMaps = { transitioning: 'blue', error: 'red', @@ -59,6 +60,18 @@ const StatusTag: React.FC = ({ setStatusColor(StatusColorMap[status]); }, [status]); + const statusMessage = useMemo(() => { + return statusValue.message?.replace(linkReg, ''); + }, [statusValue.message]); + + const messageLink = useMemo(() => { + const link = statusValue.message?.match(linkReg); + if (link) { + return link?.[0].replace(linkReg, '$2'); + } + return null; + }, [statusValue.message]); + const renderContent = () => { const percent = download?.percent || 0; @@ -78,7 +91,7 @@ const StatusTag: React.FC = ({
{actions?.map((item) => { @@ -115,8 +128,12 @@ const StatusTag: React.FC = ({ wordBreak: 'break-word' }} > - {statusValue.message} + {statusMessage} + {statusMessage && } {extra} + {messageLink && ( + + )}
diff --git a/src/hooks/use-chunk-fetch.ts b/src/hooks/use-chunk-fetch.ts index 336c52dd..debe7f25 100644 --- a/src/hooks/use-chunk-fetch.ts +++ b/src/hooks/use-chunk-fetch.ts @@ -65,7 +65,7 @@ const useSetChunkFetch = () => { bufferManager.add(chunk); throttledCallback(); } catch (error) { - console.log('error:', error); + console.log('error============:', error); } } }; @@ -96,6 +96,8 @@ const useSetChunkFetch = () => { ); if (!response.ok) { + const error = await response.json(); + handler(error?.message); return; } diff --git a/src/pages/llmodels/catalog.tsx b/src/pages/llmodels/catalog.tsx index f836ce0a..7063414f 100644 --- a/src/pages/llmodels/catalog.tsx +++ b/src/pages/llmodels/catalog.tsx @@ -210,7 +210,7 @@ const Catalog: React.FC = () => { @@ -224,8 +224,9 @@ const Catalog: React.FC = () => { >