瀏覽代碼

Chore/cleanup warnings (#17974)

tags/1.3.0
crazywoola 6 月之前
父節點
當前提交
8f9cbe1c49
沒有連結到貢獻者的電子郵件帳戶。
共有 69 個檔案被更改,包括 89 行新增117 行删除
  1. 1
    3
      web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/api/page.tsx
  2. 1
    1
      web/app/(commonLayout)/datasets/DatasetCard.tsx
  3. 5
    5
      web/app/components/app-sidebar/app-info.tsx
  4. 1
    1
      web/app/components/app/annotation/add-annotation-modal/index.tsx
  5. 1
    1
      web/app/components/app/annotation/index.tsx
  6. 1
    1
      web/app/components/app/annotation/view-annotation-modal/index.tsx
  7. 1
    1
      web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx
  8. 1
    1
      web/app/components/app/configuration/dataset-config/settings-modal/index.tsx
  9. 1
    1
      web/app/components/app/create-app-dialog/app-list/index.tsx
  10. 1
    2
      web/app/components/app/create-app-modal/index.tsx
  11. 1
    1
      web/app/components/app/log-annotation/index.tsx
  12. 4
    4
      web/app/components/app/log/list.tsx
  13. 1
    1
      web/app/components/app/switch-app-modal/index.tsx
  14. 1
    1
      web/app/components/base/audio-btn/audio.player.manager.ts
  15. 1
    1
      web/app/components/base/audio-btn/audio.ts
  16. 1
    1
      web/app/components/base/audio-gallery/AudioPlayer.tsx
  17. 2
    2
      web/app/components/base/chat/chat/thought/index.tsx
  18. 1
    10
      web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx
  19. 0
    1
      web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx
  20. 1
    1
      web/app/components/base/markdown.tsx
  21. 1
    1
      web/app/components/base/svg-gallery/index.tsx
  22. 1
    1
      web/app/components/base/tag-management/index.tsx
  23. 3
    3
      web/app/components/base/tag-management/selector.tsx
  24. 2
    2
      web/app/components/base/tag-management/tag-item-editor.tsx
  25. 2
    2
      web/app/components/base/voice-input/index.tsx
  26. 1
    1
      web/app/components/browser-initor.tsx
  27. 1
    3
      web/app/components/datasets/api/index.tsx
  28. 1
    1
      web/app/components/datasets/create/embedding-process/index.tsx
  29. 1
    1
      web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx
  30. 2
    2
      web/app/components/datasets/create/website/jina-reader/index.tsx
  31. 1
    1
      web/app/components/datasets/documents/detail/embedding/index.tsx
  32. 1
    2
      web/app/components/datasets/documents/detail/index.tsx
  33. 1
    1
      web/app/components/datasets/hit-testing/components/child-chunks-item.tsx
  34. 1
    1
      web/app/components/datasets/rename-modal/index.tsx
  35. 1
    1
      web/app/components/datasets/settings/form/index.tsx
  36. 1
    1
      web/app/components/explore/app-list/index.tsx
  37. 1
    4
      web/app/components/header/account-about/index.tsx
  38. 1
    1
      web/app/components/header/account-dropdown/workplace-selector/index.tsx
  39. 0
    2
      web/app/components/header/account-setting/data-source-page/index.tsx
  40. 2
    2
      web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx
  41. 1
    1
      web/app/components/header/account-setting/members-page/invite-modal/index.tsx
  42. 2
    2
      web/app/components/header/account-setting/members-page/operation/index.tsx
  43. 0
    1
      web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx
  44. 1
    1
      web/app/components/plugins/install-plugin/install-from-github/index.tsx
  45. 2
    2
      web/app/components/plugins/plugin-page/index.tsx
  46. 3
    3
      web/app/components/share/utils.ts
  47. 1
    1
      web/app/components/swr-initor.tsx
  48. 2
    2
      web/app/components/tools/edit-custom-collection-modal/index.tsx
  49. 2
    2
      web/app/components/tools/edit-custom-collection-modal/modal.tsx
  50. 1
    1
      web/app/components/tools/provider/detail.tsx
  51. 2
    2
      web/app/components/workflow/hooks/use-workflow-interactions.ts
  52. 1
    1
      web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx
  53. 1
    1
      web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx
  54. 1
    3
      web/app/components/workflow/nodes/code/utils.ts
  55. 1
    1
      web/app/components/workflow/nodes/if-else/components/condition-files-list-value.tsx
  56. 1
    1
      web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx
  57. 1
    1
      web/app/components/workflow/nodes/if-else/use-config.ts
  58. 1
    3
      web/app/components/workflow/nodes/question-classifier/utils.ts
  59. 1
    1
      web/app/components/workflow/note-node/note-editor/context.tsx
  60. 1
    1
      web/app/components/workflow/panel/chat-record/index.tsx
  61. 2
    2
      web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx
  62. 0
    2
      web/app/components/workflow/panel/global-variable-panel/index.tsx
  63. 1
    1
      web/app/forgot-password/ChangePasswordForm.tsx
  64. 2
    2
      web/app/forgot-password/ForgotPasswordForm.tsx
  65. 1
    1
      web/i18n/auto-gen-i18n.js
  66. 1
    1
      web/service/base.ts
  67. 1
    1
      web/service/fetch.ts
  68. 1
    1
      web/service/refresh-token.ts
  69. 2
    2
      web/service/use-plugins.ts

+ 1
- 3
web/app/(commonLayout)/datasets/(datasetDetailLayout)/[datasetId]/api/page.tsx 查看文件

import React from 'react' import React from 'react'


type Props = {}

const page = (props: Props) => {
const page = () => {
return ( return (
<div>dataset detail api</div> <div>dataset detail api</div>
) )

+ 1
- 1
web/app/(commonLayout)/datasets/DatasetCard.tsx 查看文件

if (onSuccess) if (onSuccess)
onSuccess() onSuccess()
} }
catch (e: any) {
catch {
} }
setShowConfirmDelete(false) setShowConfirmDelete(false)
}, [dataset.id, notify, onSuccess, t]) }, [dataset.id, notify, onSuccess, t])

+ 5
- 5
web/app/components/app-sidebar/app-info.tsx 查看文件

setAppDetail(app) setAppDetail(app)
mutateApps() mutateApps()
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.editFailed') }) notify({ type: 'error', message: t('app.editFailed') })
} }
}, [appDetail, mutateApps, notify, setAppDetail, t]) }, [appDetail, mutateApps, notify, setAppDetail, t])
onPlanInfoChanged() onPlanInfoChanged()
getRedirection(true, newApp, replace) getRedirection(true, newApp, replace)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
} }
} }
a.download = `${appDetail.name}.yml` a.download = `${appDetail.name}.yml`
a.click() a.click()
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })
} }
} }
} }
setSecretEnvList(list) setSecretEnvList(list)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })
} }
} }
}) })
} }
setShowConfirmDelete(false) setShowConfirmDelete(false)
}, [appDetail, mutateApps, notify, onPlanInfoChanged, replace, t])
}, [appDetail, mutateApps, notify, onPlanInfoChanged, replace, setAppDetail, t])


const { isCurrentWorkspaceEditor } = useAppContext() const { isCurrentWorkspaceEditor } = useAppContext()



+ 1
- 1
web/app/components/app/annotation/add-annotation-modal/index.tsx 查看文件

try { try {
await onAdd(payload) await onAdd(payload)
} }
catch (e) {
catch {
} }
setIsSaving(false) setIsSaving(false)



+ 1
- 1
web/app/components/app/annotation/index.tsx 查看文件

setList(data as AnnotationItem[]) setList(data as AnnotationItem[])
setTotal(total) setTotal(total)
} }
catch (e) {
catch {


} }
setIsLoading(false) setIsLoading(false)

+ 1
- 1
web/app/components/app/annotation/view-annotation-modal/index.tsx 查看文件

setHitHistoryList(data as HitHistoryItem[]) setHitHistoryList(data as HitHistoryItem[])
setTotal(total) setTotal(total)
} }
catch (e) {
catch {
} }
} }



+ 1
- 1
web/app/components/app/configuration/config/agent/agent-tools/setting-built-in-tool.tsx 查看文件

setTempSetting(addDefaultValue(setting, formSchemas)) setTempSetting(addDefaultValue(setting, formSchemas))
} }
} }
catch (e) { }
catch { }
setIsLoading(false) setIsLoading(false)
})() })()
}, [collection?.name, collection?.id, collection?.type]) }, [collection?.name, collection?.id, collection?.type])

+ 1
- 1
web/app/components/app/configuration/dataset-config/settings-modal/index.tsx 查看文件

retrieval_model_dict: retrievalConfig, retrieval_model_dict: retrievalConfig,
}) })
} }
catch (e) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
finally { finally {

+ 1
- 1
web/app/components/app/create-app-dialog/app-list/index.tsx 查看文件

localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id!, mode }, push) getRedirection(isCurrentWorkspaceEditor, { id: app.app_id!, mode }, push)
} }
catch (e) {
catch {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
} }
} }

+ 1
- 2
web/app/components/app/create-app-modal/index.tsx 查看文件

localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, app, push) getRedirection(isCurrentWorkspaceEditor, app, push)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
} }
isCreatingRef.current = false isCreatingRef.current = false
onClick: () => void onClick: () => void
} }
function AppTypeCard({ icon, title, description, active, onClick }: AppTypeCardProps) { function AppTypeCard({ icon, title, description, active, onClick }: AppTypeCardProps) {
const { t } = useTranslation()
return <div return <div
className={ className={
cn(`relative box-content h-[84px] w-[191px] cursor-pointer rounded-xl cn(`relative box-content h-[84px] w-[191px] cursor-pointer rounded-xl

+ 1
- 1
web/app/components/app/log-annotation/index.tsx 查看文件

{ value: PageType.log, text: t('appLog.title') }, { value: PageType.log, text: t('appLog.title') },
{ value: PageType.annotation, text: t('appAnnotation.title') }, { value: PageType.annotation, text: t('appAnnotation.title') },
] ]
}, [appDetail])
}, [appDetail?.mode, t])


if (!appDetail) { if (!appDetail) {
return ( return (

+ 4
- 4
web/app/components/app/log/list.tsx 查看文件

notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true return true
} }
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false return false
} }
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true return true
} }
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false return false
} }
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true return true
} }
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false return false
} }
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
return true return true
} }
catch (err) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
return false return false
} }

+ 1
- 1
web/app/components/app/switch-app-modal/index.tsx 查看文件

removeOriginal ? replace : push, removeOriginal ? replace : push,
) )
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
} }
} }

+ 1
- 1
web/app/components/base/audio-btn/audio.player.manager.ts 查看文件

this.audioPlayers.cacheBuffers = [] this.audioPlayers.cacheBuffers = []
this.audioPlayers.sourceBuffer?.abort() this.audioPlayers.sourceBuffer?.abort()
} }
catch (e) {
catch {
} }
} }



+ 1
- 1
web/app/components/base/audio-btn/audio.ts 查看文件

this.receiveAudioData(value) this.receiveAudioData(value)
} }
} }
catch (error) {
catch {
this.isLoadData = false this.isLoadData = false
this.callback && this.callback('error') this.callback && this.callback('error')
} }

+ 1
- 1
web/app/components/base/audio-gallery/AudioPlayer.tsx 查看文件

setWaveformData(normalizedWaveform) setWaveformData(normalizedWaveform)
setIsAudioAvailable(true) setIsAudioAvailable(true)
} }
catch (error) {
catch {
const waveform: number[] = [] const waveform: number[] = []
let prevValue = Math.random() let prevValue = Math.random()



+ 2
- 2
web/app/components/base/chat/chat/thought/index.tsx 查看文件

try { try {
return JSON.parse(value)[index] return JSON.parse(value)[index]
} }
catch (e) {
catch {
} }
} }
return value return value
if (Array.isArray(JSON.parse(thought.tool))) if (Array.isArray(JSON.parse(thought.tool)))
return [JSON.parse(thought.tool), true] return [JSON.parse(thought.tool), true]
} }
catch (e) {
catch {
} }
return [[thought.tool], false] return [[thought.tool], false]
})() })()

+ 1
- 10
web/app/components/base/chat/embedded-chatbot/chat-wrapper.tsx 查看文件

isPublicAPI: !isInstalledApp, isPublicAPI: !isInstalledApp,
}, },
) )
}, [
chatList,
handleNewConversationCompleted,
handleSend,
currentConversationId,
currentConversationItem,
newConversationInputs,
isInstalledApp,
appId,
])
}, [currentConversationId, currentConversationInputs, newConversationInputs, chatList, handleSend, isInstalledApp, appId, handleNewConversationCompleted])


const doRegenerate = useCallback((chatItem: ChatItemInTree) => { const doRegenerate = useCallback((chatItem: ChatItemInTree) => {
const question = chatList.find(item => item.id === chatItem.parentMessageId)! const question = chatList.find(item => item.id === chatItem.parentMessageId)!

+ 0
- 1
web/app/components/base/chat/embedded-chatbot/inputs-form/content.tsx 查看文件

handleNewConversationInputsChange, handleNewConversationInputsChange,
} = useEmbeddedChatbotContext() } = useEmbeddedChatbotContext()
const inputsFormValue = currentConversationId ? currentConversationInputs : newConversationInputs const inputsFormValue = currentConversationId ? currentConversationInputs : newConversationInputs
const readonly = !!currentConversationId


const handleFormChange = useCallback((variable: string, value: any) => { const handleFormChange = useCallback((variable: string, value: any) => {
setCurrentConversationInputs({ setCurrentConversationInputs({

+ 1
- 1
web/app/components/base/markdown.tsx 查看文件

try { try {
return JSON.parse(String(children).replace(/\n$/, '')) return JSON.parse(String(children).replace(/\n$/, ''))
} }
catch (error) { }
catch { }
} }
return JSON.parse('{"title":{"text":"ECharts error - Wrong JSON format."}}') return JSON.parse('{"title":{"text":"ECharts error - Wrong JSON format."}}')
}, [language, children]) }, [language, children])

+ 1
- 1
web/app/components/base/svg-gallery/index.tsx 查看文件

setImagePreview(svgToDataURL(svgElement as Element)) setImagePreview(svgToDataURL(svgElement as Element))
}) })
} }
catch (error) {
catch {
if (svgRef.current) if (svgRef.current)
svgRef.current.innerHTML = '<span style="padding: 1rem;">Error rendering SVG. Wait for the image content to complete.</span>' svgRef.current.innerHTML = '<span style="padding: 1rem;">Error rendering SVG. Wait for the image content to complete.</span>'
} }

+ 1
- 1
web/app/components/base/tag-management/index.tsx 查看文件

setName('') setName('')
setPending(false) setPending(false)
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.tag.failed') }) notify({ type: 'error', message: t('common.tag.failed') })
setPending(false) setPending(false)
} }

+ 3
- 3
web/app/components/base/tag-management/selector.tsx 查看文件

setCreating(false) setCreating(false)
onCreate() onCreate()
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.tag.failed') }) notify({ type: 'error', message: t('common.tag.failed') })
setCreating(false) setCreating(false)
} }
await bindTag(tagIDs, targetID, type) await bindTag(tagIDs, targetID, type)
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
} }
await unBindTag(tagID, targetID, type) await unBindTag(tagID, targetID, type)
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
} }

+ 2
- 2
web/app/components/base/tag-management/tag-item-editor.tsx 查看文件

notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
setName(name) setName(name)
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
setName(tag.name) setName(tag.name)
const recoverList = tagList.map((tag) => { const recoverList = tagList.map((tag) => {
]) ])
setPending(false) setPending(false)
} }
catch (e: any) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
setPending(false) setPending(false)
} }

+ 2
- 2
web/app/components/base/voice-input/index.tsx 查看文件

onConverted(audioResponse.text) onConverted(audioResponse.text)
onCancel() onCancel()
} }
catch (e) {
catch {
onConverted('') onConverted('')
onCancel() onCancel()
} }
if (canvasRef.current && ctxRef.current) if (canvasRef.current && ctxRef.current)
drawRecord() drawRecord()
} }
catch (e) {
catch {
onCancel() onCancel()
} }
} }

+ 1
- 1
web/app/components/browser-initor.tsx 查看文件

localStorage = globalThis.localStorage localStorage = globalThis.localStorage
sessionStorage = globalThis.sessionStorage sessionStorage = globalThis.sessionStorage
} }
catch (e) {
catch {
localStorage = new StorageMock() localStorage = new StorageMock()
sessionStorage = new StorageMock() sessionStorage = new StorageMock()
} }

+ 1
- 3
web/app/components/datasets/api/index.tsx 查看文件

import React from 'react' import React from 'react'


type Props = {}

const index = (props: Props) => {
const index = () => {
return ( return (
<div>index</div> <div>index</div>
) )

+ 1
- 1
web/app/components/datasets/create/embedding-process/index.tsx 查看文件

await sleep(2500) await sleep(2500)
await startQueryStatus() await startQueryStatus()
} }
catch (e) {
catch {
await sleep(2500) await sleep(2500)
await startQueryStatus() await startQueryStatus()
} }

+ 1
- 1
web/app/components/datasets/create/empty-dataset-creation-modal/index.tsx 查看文件

onHide() onHide()
router.push(`/datasets/${dataset.id}/documents`) router.push(`/datasets/${dataset.id}/documents`)
} }
catch (err) {
catch {
notify({ type: 'error', message: t('datasetCreation.stepOne.modal.failed') }) notify({ type: 'error', message: t('datasetCreation.stepOne.modal.failed') })
} }
} }

+ 2
- 2
web/app/components/datasets/create/website/jina-reader/index.tsx 查看文件

}, },
} }
} }
}, [crawlOptions.limit])
}, [crawlOptions.limit, onCheckedCrawlResultChange])


const handleRun = useCallback(async (url: string) => { const handleRun = useCallback(async (url: string) => {
const { isValid, errorMsg } = checkValid(url) const { isValid, errorMsg } = checkValid(url)
finally { finally {
setStep(Step.finished) setStep(Step.finished)
} }
}, [checkValid, crawlOptions, onJobIdChange, t, waitForCrawlFinished])
}, [checkValid, crawlOptions, onCheckedCrawlResultChange, onJobIdChange, t, waitForCrawlFinished])


return ( return (
<div> <div>

+ 1
- 1
web/app/components/datasets/documents/detail/embedding/index.tsx 查看文件

await sleep(2500) await sleep(2500)
await startQueryStatus() await startQueryStatus()
} }
catch (e) {
catch {
await sleep(2500) await sleep(2500)
await startQueryStatus() await startQueryStatus()
} }

+ 1
- 2
web/app/components/datasets/documents/detail/index.tsx 查看文件

params: { metadata: 'without' }, params: { metadata: 'without' },
}) })


const { data: documentMetadata, error: metadataErr, refetch: metadataMutate } = useDocumentMetadata({
const { data: documentMetadata } = useDocumentMetadata({
datasetId, datasetId,
documentId, documentId,
params: { metadata: 'only' }, params: { metadata: 'only' },
} }


const isDetailLoading = !documentDetail && !error const isDetailLoading = !documentDetail && !error
const isMetadataLoading = !documentMetadata && !metadataErr


const embedding = ['queuing', 'indexing', 'paused'].includes((documentDetail?.display_status || '').toLowerCase()) const embedding = ['queuing', 'indexing', 'paused'].includes((documentDetail?.display_status || '').toLowerCase())



+ 1
- 1
web/app/components/datasets/hit-testing/components/child-chunks-item.tsx 查看文件

payload, payload,
isShowAll, isShowAll,
}) => { }) => {
const { id, score, content, position } = payload
const { score, content, position } = payload
return ( return (
<div <div
className={!isShowAll ? 'line-clamp-2 break-all' : ''} className={!isShowAll ? 'line-clamp-2 break-all' : ''}

+ 1
- 1
web/app/components/datasets/rename-modal/index.tsx 查看文件

onSuccess() onSuccess()
onClose() onClose()
} }
catch (e) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
finally { finally {

+ 1
- 1
web/app/components/datasets/settings/form/index.tsx 查看文件

mutate(unstable_serialize(getKey)) mutate(unstable_serialize(getKey))
} }
} }
catch (e) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
finally { finally {

+ 1
- 1
web/app/components/explore/app-list/index.tsx 查看文件

localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1') localStorage.setItem(NEED_REFRESH_APP_LIST_KEY, '1')
getRedirection(isCurrentWorkspaceEditor, { id: app.app_id!, mode }, push) getRedirection(isCurrentWorkspaceEditor, { id: app.app_id!, mode }, push)
} }
catch (e) {
catch {
Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') }) Toast.notify({ type: 'error', message: t('app.newApp.appCreateFailed') })
} }
} }

+ 1
- 4
web/app/components/header/account-about/index.tsx 查看文件

langeniusVersionInfo: LangGeniusVersionResponse langeniusVersionInfo: LangGeniusVersionResponse
onCancel: () => void onCancel: () => void
} }
const buttonClassName = `
shrink-0 flex items-center h-8 px-3 rounded-lg border border-gray-200
text-xs text-gray-800 font-medium
`

export default function AccountAbout({ export default function AccountAbout({
langeniusVersionInfo, langeniusVersionInfo,
onCancel, onCancel,

+ 1
- 1
web/app/components/header/account-dropdown/workplace-selector/index.tsx 查看文件

notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
location.assign(`${location.origin}`) location.assign(`${location.origin}`)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('common.provider.saveFailed') }) notify({ type: 'error', message: t('common.provider.saveFailed') })
} }
} }

+ 0
- 2
web/app/components/header/account-setting/data-source-page/index.tsx 查看文件

import useSWR from 'swr' import useSWR from 'swr'
import { useTranslation } from 'react-i18next'
import DataSourceNotion from './data-source-notion' import DataSourceNotion from './data-source-notion'
import DataSourceWebsite from './data-source-website' import DataSourceWebsite from './data-source-website'
import { fetchDataSource } from '@/service/common' import { fetchDataSource } from '@/service/common'
import { DataSourceProvider } from '@/models/common' import { DataSourceProvider } from '@/models/common'


export default function DataSourcePage() { export default function DataSourcePage() {
const { t } = useTranslation()
const { data } = useSWR({ url: 'data-source/integrates' }, fetchDataSource) const { data } = useSWR({ url: 'data-source/integrates' }, fetchDataSource)
const notionWorkspaces = data?.data.filter(item => item.provider === 'notion') || [] const notionWorkspaces = data?.data.filter(item => item.provider === 'notion') || []



+ 2
- 2
web/app/components/header/account-setting/members-page/edit-workspace-modal/index.tsx 查看文件

}: IEditWorkspaceModalProps) => { }: IEditWorkspaceModalProps) => {
const { t } = useTranslation() const { t } = useTranslation()
const { notify } = useContext(ToastContext) const { notify } = useContext(ToastContext)
const { currentWorkspace, isCurrentWorkspaceOwner, mutateCurrentWorkspace } = useAppContext()
const { currentWorkspace, isCurrentWorkspaceOwner } = useAppContext()
const [name, setName] = useState<string>(currentWorkspace.name) const [name, setName] = useState<string>(currentWorkspace.name)


const changeWorkspaceInfo = async (name: string) => { const changeWorkspaceInfo = async (name: string) => {
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
location.assign(`${location.origin}`) location.assign(`${location.origin}`)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') }) notify({ type: 'error', message: t('common.actionMsg.modifiedUnsuccessfully') })
} }
} }

+ 1
- 1
web/app/components/header/account-setting/members-page/invite-modal/index.tsx 查看文件

onSend(invitation_results) onSend(invitation_results)
} }
} }
catch (e) { }
catch { }
} }
else { else {
notify({ type: 'error', message: t('common.members.emailInvalid') }) notify({ type: 'error', message: t('common.members.emailInvalid') })

+ 2
- 2
web/app/components/header/account-setting/members-page/operation/index.tsx 查看文件

onOperate() onOperate()
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
} }
catch (e) {
catch {


} }
} }
onOperate() onOperate()
notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') }) notify({ type: 'success', message: t('common.actionMsg.modifiedSuccessfully') })
} }
catch (e) {
catch {


} }
} }

+ 0
- 1
web/app/components/header/account-setting/model-provider-page/model-parameter-modal/index.tsx 查看文件

renderTrigger, renderTrigger,
readonly, readonly,
isInWorkflow, isInWorkflow,
scope = 'text-generation',
}) => { }) => {
const { t } = useTranslation() const { t } = useTranslation()
const { isAPIKeySet } = useProviderContext() const { isAPIKeySet } = useProviderContext()

+ 1
- 1
web/app/components/plugins/install-plugin/install-from-github/index.tsx 查看文件

}) })
} }
} }
catch (error) {
catch {
Toast.notify({ Toast.notify({
type: 'error', type: 'error',
message: t('plugin.error.fetchReleasesError'), message: t('plugin.error.fetchReleasesError'),

+ 2
- 2
web/app/components/plugins/plugin-page/index.tsx 查看文件

try { try {
return idStrings ? JSON.parse(idStrings)[0] : '' return idStrings ? JSON.parse(idStrings)[0] : ''
} }
catch (e) {
catch {
return '' return ''
} }
}, [searchParams]) }, [searchParams])
try { try {
return info ? JSON.parse(info) : undefined return info ? JSON.parse(info) : undefined
} }
catch (e) {
catch {
return undefined return undefined
} }
}, [searchParams]) }, [searchParams])

+ 3
- 3
web/app/components/share/utils.ts 查看文件

try { try {
accessTokenJson = JSON.parse(accessToken) accessTokenJson = JSON.parse(accessToken)
} }
catch (e) {
catch {


} }
if (!accessTokenJson[sharedToken]) { if (!accessTokenJson[sharedToken]) {
try { try {
accessTokenJson = JSON.parse(accessToken) accessTokenJson = JSON.parse(accessToken)
} }
catch (e) {
catch {


} }


try { try {
accessTokenJson = JSON.parse(accessToken) accessTokenJson = JSON.parse(accessToken)
} }
catch (e) {
catch {


} }



+ 1
- 1
web/app/components/swr-initor.tsx 查看文件



setInit(true) setInit(true)
} }
catch (error) {
catch {
router.replace('/signin') router.replace('/signin')
} }
})() })()

+ 2
- 2
web/app/components/tools/edit-custom-collection-modal/index.tsx 查看文件

setCustomCollection(newCollection) setCustomCollection(newCollection)
setParamsSchemas(parameters_schema) setParamsSchemas(parameters_schema)
} }
catch (e) {
catch {
const customCollection = getCustomCollection() const customCollection = getCustomCollection()
const newCollection = produce(customCollection, (draft) => { const newCollection = produce(customCollection, (draft) => {
draft.schema_type = '' draft.schema_type = ''
const path = decodeURI(new URL(url).pathname) const path = decodeURI(new URL(url).pathname)
return path || '' return path || ''
} }
catch (e) {
catch {
return url return url
} }
} }

+ 2
- 2
web/app/components/tools/edit-custom-collection-modal/modal.tsx 查看文件

setCustomCollection(newCollection) setCustomCollection(newCollection)
setParamsSchemas(parameters_schema) setParamsSchemas(parameters_schema)
} }
catch (e) {
catch {
const customCollection = getCustomCollection() const customCollection = getCustomCollection()
const newCollection = produce(customCollection, (draft) => { const newCollection = produce(customCollection, (draft) => {
draft.schema_type = '' draft.schema_type = ''
const path = decodeURI(new URL(url).pathname) const path = decodeURI(new URL(url).pathname)
return path || '' return path || ''
} }
catch (e) {
catch {
return url return url
} }
} }

+ 1
- 1
web/app/components/tools/provider/detail.tsx 查看文件

setToolList(list) setToolList(list)
} }
} }
catch (e) { }
catch { }
setIsDetailLoading(false) setIsDetailLoading(false)
}, [collection.name, collection.type]) }, [collection.name, collection.type])



+ 2
- 2
web/app/components/workflow/hooks/use-workflow-interactions.ts 查看文件

a.download = `${appDetail.name}.yml` a.download = `${appDetail.name}.yml`
a.click() a.click()
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })
} }
finally { finally {
}, },
} as any) } as any)
} }
catch (e) {
catch {
notify({ type: 'error', message: t('app.exportFailed') }) notify({ type: 'error', message: t('app.exportFailed') })
} }
}, [appDetail, eventEmitter, handleExportDSL, notify, t]) }, [appDetail, eventEmitter, handleExportDSL, notify, t])

+ 1
- 1
web/app/components/workflow/nodes/_base/components/before-run-form/index.tsx 查看文件

const value = formatValue(form.values[input.variable], input.type) const value = formatValue(form.values[input.variable], input.type)
submitData[input.variable] = value submitData[input.variable] = value
} }
catch (e) {
catch {
parseErrorJsonField = input.variable parseErrorJsonField = input.variable
} }
}) })

+ 1
- 1
web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx 查看文件

try { try {
return JSON.stringify(value as object, null, 2) return JSON.stringify(value as object, null, 2)
} }
catch (e) {
catch {
return value as string return value as string
} }
})() })()

+ 1
- 3
web/app/components/workflow/nodes/code/utils.ts 查看文件

import type { CodeNodeType } from './types'

export const checkNodeValid = (payload: CodeNodeType) => {
export const checkNodeValid = () => {
return true return true
} }

+ 1
- 1
web/app/components/workflow/nodes/if-else/components/condition-files-list-value.tsx 查看文件

: '' : ''
} }
return '' return ''
}, [])
}, [t])


return ( return (
<div className='rounded-md bg-workflow-block-parma-bg'> <div className='rounded-md bg-workflow-block-parma-bg'>

+ 1
- 1
web/app/components/workflow/nodes/if-else/components/condition-list/condition-item.tsx 查看文件

value: isArrayValue ? [value] : value, value: isArrayValue ? [value] : value,
} }
doUpdateCondition(newCondition) doUpdateCondition(newCondition)
}, [condition, doUpdateCondition, fileAttr])
}, [condition, doUpdateCondition, isArrayValue])


const isSelect = condition.comparison_operator && [ComparisonOperator.in, ComparisonOperator.notIn].includes(condition.comparison_operator) const isSelect = condition.comparison_operator && [ComparisonOperator.in, ComparisonOperator.notIn].includes(condition.comparison_operator)
const selectOptions = useMemo(() => { const selectOptions = useMemo(() => {

+ 1
- 1
web/app/components/workflow/nodes/if-else/use-config.ts 查看文件

}) })
setInputs(newInputs) setInputs(newInputs)
updateNodeInternals(id) updateNodeInternals(id)
}, [inputs, setInputs])
}, [id, inputs, setInputs, updateNodeInternals])


const handleAddCondition = useCallback<HandleAddCondition>((caseId, valueSelector, varItem) => { const handleAddCondition = useCallback<HandleAddCondition>((caseId, valueSelector, varItem) => {
const newInputs = produce(inputs, (draft) => { const newInputs = produce(inputs, (draft) => {

+ 1
- 3
web/app/components/workflow/nodes/question-classifier/utils.ts 查看文件

import type { QuestionClassifierNodeType } from './types'

export const checkNodeValid = (payload: QuestionClassifierNodeType) => {
export const checkNodeValid = () => {
return true return true
} }

+ 1
- 1
web/app/components/workflow/note-node/note-editor/context.tsx 查看文件

try { try {
initialValue = JSON.parse(value) initialValue = JSON.parse(value)
} }
catch (e) {
catch {


} }



+ 1
- 1
web/app/components/workflow/panel/chat-record/index.tsx 查看文件

setChatItemTree(tree) setChatItemTree(tree)
setThreadChatItems(getThreadMessages(tree, newAllChatItems.at(-1)?.id)) setThreadChatItems(getThreadMessages(tree, newAllChatItems.at(-1)?.id))
} }
catch (e) {
catch {
} }
finally { finally {
setFetched(true) setFetched(true)

+ 2
- 2
web/app/components/workflow/panel/chat-variable-panel/components/variable-modal.tsx 查看文件

}) })
setObjectValue(newObjectValue) setObjectValue(newObjectValue)
} }
catch (e) {
catch {
// ignore JSON.parse errors // ignore JSON.parse errors
} }
} }
const newValue = JSON.parse(content) const newValue = JSON.parse(content)
setValue(newValue) setValue(newValue)
} }
catch (e) {
catch {
// ignore JSON.parse errors // ignore JSON.parse errors
} }
} }

+ 0
- 2
web/app/components/workflow/panel/global-variable-panel/index.tsx 查看文件

} from 'react' } from 'react'


import { RiCloseLine } from '@remixicon/react' import { RiCloseLine } from '@remixicon/react'
import { useTranslation } from 'react-i18next'
import type { GlobalVariable } from '../../types' import type { GlobalVariable } from '../../types'
import Item from './item' import Item from './item'
import { useStore } from '@/app/components/workflow/store' import { useStore } from '@/app/components/workflow/store'
import cn from '@/utils/classnames' import cn from '@/utils/classnames'


const Panel = () => { const Panel = () => {
const { t } = useTranslation()
const setShowPanel = useStore(s => s.setShowGlobalVariablePanel) const setShowPanel = useStore(s => s.setShowGlobalVariablePanel)


const globalVariableList: GlobalVariable[] = [ const globalVariableList: GlobalVariable[] = [

+ 1
- 1
web/app/forgot-password/ChangePasswordForm.tsx 查看文件

catch { catch {
await revalidateToken() await revalidateToken()
} }
}, [password, revalidateToken, token, valid])
}, [confirmPassword, password, revalidateToken, searchParams, valid])


return ( return (
<div className={ <div className={

+ 2
- 2
web/app/forgot-password/ForgotPasswordForm.tsx 查看文件

fetchSetupStatus, fetchSetupStatus,
sendForgotPasswordEmail, sendForgotPasswordEmail,
} from '@/service/common' } from '@/service/common'
import type { InitValidateStatusResponse, SetupStatusResponse } from '@/models/common'
import type { InitValidateStatusResponse } from '@/models/common'


const accountFormSchema = z.object({ const accountFormSchema = z.object({
email: z email: z
} }


useEffect(() => { useEffect(() => {
fetchSetupStatus().then((res: SetupStatusResponse) => {
fetchSetupStatus().then(() => {
fetchInitValidateStatus().then((res: InitValidateStatusResponse) => { fetchInitValidateStatus().then((res: InitValidateStatusResponse) => {
if (res.status === 'not_started') if (res.status === 'not_started')
window.location.href = '/init' window.location.href = '/init'

+ 1
- 1
web/i18n/auto-gen-i18n.js 查看文件

const { translation } = await translate(sourceObj[key], null, languageKeyMap[toLanguage]) const { translation } = await translate(sourceObj[key], null, languageKeyMap[toLanguage])
targetObject[key] = translation targetObject[key] = translation
} }
catch (e) {
catch {
console.error(`Error translating ${sourceObj[key]}(${key}) to ${toLanguage}`) console.error(`Error translating ${sourceObj[key]}(${key}) to ${toLanguage}`)
} }
} }

+ 1
- 1
web/service/base.ts 查看文件

try { try {
bufferObj = JSON.parse(message.substring(6)) as Record<string, any>// remove data: and parse as json bufferObj = JSON.parse(message.substring(6)) as Record<string, any>// remove data: and parse as json
} }
catch (e) {
catch {
// mute handle message cut off // mute handle message cut off
onData('', isFirstMessage, { onData('', isFirstMessage, {
conversationId: bufferObj?.conversation_id, conversationId: bufferObj?.conversation_id,

+ 1
- 1
web/service/fetch.ts 查看文件

try { try {
accessTokenJson = JSON.parse(accessToken) accessTokenJson = JSON.parse(accessToken)
} }
catch (e) {
catch {


} }
return accessTokenJson[sharedToken] return accessTokenJson[sharedToken]

+ 1
- 1
web/service/refresh-token.ts 查看文件



let isRefreshing = false let isRefreshing = false
function waitUntilTokenRefreshed() { function waitUntilTokenRefreshed() {
return new Promise<void>((resolve, reject) => {
return new Promise<void>((resolve) => {
function _check() { function _check() {
const isRefreshingSign = globalThis.localStorage.getItem(LOCAL_STORAGE_KEY) const isRefreshingSign = globalThis.localStorage.getItem(LOCAL_STORAGE_KEY)
if ((isRefreshingSign && isRefreshingSign === '1') || isRefreshing) { if ((isRefreshingSign && isRefreshingSign === '1') || isRefreshing) {

+ 2
- 2
web/service/use-plugins.ts 查看文件

const modelsData = await fetchModelProviderModelList(`/workspaces/current/model-providers/${currentProvider?.provider}/models`) const modelsData = await fetchModelProviderModelList(`/workspaces/current/model-providers/${currentProvider?.provider}/models`)
return !!modelId && !!modelsData.data.find(item => item.model === modelId) return !!modelId && !!modelsData.data.find(item => item.model === modelId)
} }
catch (error) {
catch {
return false return false
} }
}, },
const response = await fetchPluginInfoFromMarketPlace({ org, name }) const response = await fetchPluginInfoFromMarketPlace({ org, name })
return response.data.plugin.category === PluginTypeEnum.model ? response.data.plugin : null return response.data.plugin.category === PluginTypeEnum.model ? response.data.plugin : null
} }
catch (error) {
catch {
return null return null
} }
}, },

Loading…
取消
儲存