Skip to content

Commit 2ce6477

Browse files
committed
fix: some bugfix
1 parent aa872d8 commit 2ce6477

16 files changed

Lines changed: 57 additions & 42 deletions

File tree

src/frontend/client/src/api/apps.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ export async function getChatHistoryApi({ flowId, chatId, flowType, id, shareTok
160160
// 溯源-分词
161161
export async function splitWordApi(word: string, messageId: string): Promise<string[]> {
162162
return await request.get(`/api/v1/qa/keyword?message_id=${messageId}`)
163+
// .then(res => {
164+
// return {data: null, status_code: 14001, message: "请求参数错误"}
165+
// })
163166
}
164167

165168
// 溯源-获取 chunks

src/frontend/client/src/pages/appChat/components/ResouceModal.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,16 @@ const Anwser = ({ id, msg, onInit, onAdd, fullScreen = false }) => {
1919
const loadData = () => {
2020
splitWordApi(msg, id).then((res) => {
2121
const data = res.data
22+
if (res.status_code === 14001) {
23+
// 自动重试
24+
return setTimeout(() => {
25+
loadData()
26+
}, 1800);
27+
}
2228
// 匹配
2329
const reg = new RegExp(`(${data.join('|')})`, 'g')
2430
setHtml(msg.replace(reg, '<span>$1</span>'))
2531
onInit(data)
26-
}).catch(e => {
27-
// 自动重试
28-
e === 14001 && setTimeout(() => {
29-
loadData()
30-
}, 1800);
3132
})
3233
}
3334
msg && loadData()
@@ -236,7 +237,9 @@ export const ResouceContent = ({ data, setOpen, fullScreen = false }) => {
236237
const [loading, setLoading] = useState(true)
237238
const handleAnwserInit = (words) => {
238239
setKeywords(words)
239-
setLoading(false)
240+
if (words.length) {
241+
setLoading(false)
242+
}
240243
}
241244

242245

11.3 KB
Loading
1.4 KB
Loading

src/frontend/platform/public/locales/en-US/dashboard.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@
402402
"lineChart": "Line",
403403
"basicLineChart": "Basic Line",
404404
"stackedLineChart": "Stacked Line",
405+
"multipleLineChart": "Multiple Line",
405406
"areaChart": "Area",
406407
"stackedAreaChart": "Stacked Area",
407408
"pieChart": "Pie",

src/frontend/platform/public/locales/ja/dashboard.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"selectCharts": "関連グラフを選択",
77
"selectAll": "すべて選択",
8-
"unSelectAll":"すべて選択解除",
8+
"unSelectAll": "すべて選択解除",
99
"unnamedChart": "無名グラフ",
1010
"noDataset": "データセット未設定",
1111

@@ -403,6 +403,7 @@
403403
"lineChart": "折れ線グラフ",
404404
"basicLineChart": "基本折れ線グラフ",
405405
"stackedLineChart": "積立折れ線グラフ",
406+
"multipleLineChart": "組み合わせグラフ",
406407
"areaChart": "面グラフ",
407408
"stackedAreaChart": "積立面グラフ",
408409
"pieChart": "円グラフ",

src/frontend/platform/public/locales/zh-Hans/dashboard.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
"lineChart": "折线图",
380380
"basicLineChart": "基础折线图",
381381
"stackedLineChart": "堆叠折线图",
382+
"multipleLineChart": "组合折线图",
382383
"areaChart": "基础面积图",
383384
"stackedAreaChart": "堆叠面积图",
384385
"pieChart": "饼图",

src/frontend/platform/src/components/bs-comp/chatComponent/MessageButtons.tsx

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ const enum ThumbsState {
1313
ThumbsDown
1414
}
1515

16-
export default function MessageButtons({debug, mark = false, id, onCopy, data, onUnlike, onMarkClick,version, text = '' }) {
17-
16+
export default function MessageButtons({ debug, mark = false, id, onCopy, data, onUnlike, onMarkClick, version, text = '' }) {
17+
1818
const { t } = useTranslation()
1919
const [state, setState] = useState<ThumbsState>(data)
2020
const [copied, setCopied] = useState(false)
@@ -47,31 +47,31 @@ export default function MessageButtons({debug, mark = false, id, onCopy, data, o
4747
<FlagIcon width={12} height={12} className="cursor-pointer" />
4848
<span>{t('addQa')}</span>
4949
</Button>}
50-
{linsightConfig?.tts_model?.id && (
50+
{!mark && linsightConfig?.tts_model?.id && (
5151
<AudioPlayComponent
5252
messageId={String(id)}
5353
msg={text}
5454
/>
5555
)}
5656

5757
{!debug && (version === 'v2') &&
58-
<>
59-
<ThunmbIcon
60-
type='copy'
61-
className={`cursor-pointer ${copied && 'text-primary hover:text-primary'}`}
62-
onClick={handleCopy}
63-
/>
64-
<ThunmbIcon
65-
type='like'
66-
className={`cursor-pointer ${state === ThumbsState.ThumbsUp && 'text-primary hover:text-primary'}`}
67-
onClick={() => handleClick(ThumbsState.ThumbsUp)}
68-
/>
69-
<ThunmbIcon
70-
type='unLike'
71-
className={`cursor-pointer ${state === ThumbsState.ThumbsDown && 'text-primary hover:text-primary'}`}
72-
onClick={() => handleClick(ThumbsState.ThumbsDown)}
73-
/></>
58+
<>
59+
<ThunmbIcon
60+
type='copy'
61+
className={`cursor-pointer ${copied && 'text-primary hover:text-primary'}`}
62+
onClick={handleCopy}
63+
/>
64+
<ThunmbIcon
65+
type='like'
66+
className={`cursor-pointer ${state === ThumbsState.ThumbsUp && 'text-primary hover:text-primary'}`}
67+
onClick={() => handleClick(ThumbsState.ThumbsUp)}
68+
/>
69+
<ThunmbIcon
70+
type='unLike'
71+
className={`cursor-pointer ${state === ThumbsState.ThumbsDown && 'text-primary hover:text-primary'}`}
72+
onClick={() => handleClick(ThumbsState.ThumbsDown)}
73+
/></>
7474
}
75-
75+
7676
</div>
7777
};

src/frontend/platform/src/components/bs-ui/alertDialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const AlertDialogContent = React.forwardRef<
3535
<AlertDialogPrimitive.Content
3636
ref={ref}
3737
className={cname(
38-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-sm translate-x-[-50%] translate-y-[-50%] gap-10 border bg-background-prompt p-3 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
38+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-sm translate-x-[-50%] translate-y-[-50%] gap-10 border bg-background-prompt p-3 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg outline-none",
3939
className
4040
)}
4141
{...props}

src/frontend/platform/src/components/bs-ui/dialog/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const DialogContent = React.forwardRef<
3636
<DialogPrimitive.Content
3737
ref={ref}
3838
className={cname(
39-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background dark:bg-[#303134] p-5 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
39+
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background dark:bg-[#303134] p-5 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg outline-none",
4040
className
4141
)}
4242
{...props}

0 commit comments

Comments
 (0)