run history

This commit is contained in:
StyleZhang
2024-03-20 20:27:33 +08:00
parent 17f572f23f
commit 94ca0edb68
7 changed files with 129 additions and 29 deletions

View File

@ -16,9 +16,10 @@ import { useStore as useAppStore } from '@/app/components/app/store'
export type RunProps = {
activeTab?: 'RESULT' | 'TRACING'
runID: string
getResultCallback?: (result: WorkflowRunDetailResponse) => void
}
const RunPanel: FC<RunProps> = ({ activeTab = 'RESULT', runID }) => {
const RunPanel: FC<RunProps> = ({ activeTab = 'RESULT', runID, getResultCallback }) => {
const { t } = useTranslation()
const { notify } = useContext(ToastContext)
const [currentTab, setCurrentTab] = useState<string>(activeTab)
@ -42,6 +43,8 @@ const RunPanel: FC<RunProps> = ({ activeTab = 'RESULT', runID }) => {
runID,
})
setRunDetail(res)
if (getResultCallback)
getResultCallback(res)
}
catch (err) {
notify({
@ -49,7 +52,7 @@ const RunPanel: FC<RunProps> = ({ activeTab = 'RESULT', runID }) => {
message: `${err}`,
})
}
}, [notify])
}, [notify, getResultCallback])
const getTracingList = useCallback(async (appID: string, runID: string) => {
try {