mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix: pipeline parser log not display (#14251)
### What problem does this PR solve? Fix: pipeline parser log not display ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
// src/pages/dataset/file-logs/file-status-badge.tsx
|
||||
import { RunningStatus } from '@/pages/dataset/dataset/constant';
|
||||
import {
|
||||
RunningStatus,
|
||||
RunningStatusOld,
|
||||
} from '@/pages/dataset/dataset/constant';
|
||||
import { FC } from 'react';
|
||||
/**
|
||||
* params: status: 0 not run yet 1 running, 2 cancel, 3 success, 4 fail
|
||||
*/
|
||||
interface StatusBadgeProps {
|
||||
// status: 'Success' | 'Failed' | 'Running' | 'Pending';
|
||||
status: RunningStatus;
|
||||
status: RunningStatus | RunningStatusOld;
|
||||
name?: string;
|
||||
className?: string;
|
||||
}
|
||||
@@ -19,12 +22,16 @@ const FileStatusBadge: FC<StatusBadgeProps> = ({ status, name, className }) => {
|
||||
// #faad14 → rgb(250, 173, 20) // state-warning
|
||||
switch (status) {
|
||||
case RunningStatus.DONE:
|
||||
case RunningStatusOld.DONE:
|
||||
return `bg-[rgba(59,160,92,0.1)] text-state-success`;
|
||||
case RunningStatus.FAIL:
|
||||
case RunningStatusOld.FAIL:
|
||||
return `bg-[rgba(216,73,75,0.1)] text-state-error`;
|
||||
case RunningStatus.RUNNING:
|
||||
case RunningStatusOld.RUNNING:
|
||||
return `bg-[rgba(0,190,180,0.1)] text-accent-primary`;
|
||||
case RunningStatus.UNSTART:
|
||||
case RunningStatusOld.UNSTART:
|
||||
return `bg-[rgba(250,173,20,0.1)] text-state-warning`;
|
||||
default:
|
||||
return 'bg-gray-500/10 text-text-secondary';
|
||||
@@ -38,12 +45,16 @@ const FileStatusBadge: FC<StatusBadgeProps> = ({ status, name, className }) => {
|
||||
// #faad14 → rgb(250, 173, 20) // state-warning
|
||||
switch (status) {
|
||||
case RunningStatus.DONE:
|
||||
case RunningStatusOld.DONE:
|
||||
return `bg-[rgba(59,160,92,1)] text-state-success`;
|
||||
case RunningStatus.FAIL:
|
||||
case RunningStatusOld.FAIL:
|
||||
return `bg-[rgba(216,73,75,1)] text-state-error`;
|
||||
case RunningStatus.RUNNING:
|
||||
case RunningStatusOld.RUNNING:
|
||||
return `bg-[rgba(0,190,180,1)] text-accent-primary`;
|
||||
case RunningStatus.UNSTART:
|
||||
case RunningStatusOld.UNSTART:
|
||||
return `bg-[rgba(250,173,20,1)] text-state-warning`;
|
||||
default:
|
||||
return `bg-[rgba(117,120,122,1)] text-text-secondary`;
|
||||
|
||||
@@ -16,6 +16,15 @@ export enum RunningStatus {
|
||||
SCHEDULE = 'SCHEDULE',
|
||||
}
|
||||
|
||||
export enum RunningStatusOld {
|
||||
UNSTART = '0', // need to run
|
||||
RUNNING = '1', // need to cancel
|
||||
CANCEL = '2', // need to refresh
|
||||
DONE = '3', // need to refresh
|
||||
FAIL = '4', // need to refresh
|
||||
SCHEDULE = '5',
|
||||
}
|
||||
|
||||
export const RunningStatusMap = {
|
||||
[RunningStatus.UNSTART]: 'Pending',
|
||||
[RunningStatus.RUNNING]: 'Running',
|
||||
@@ -23,6 +32,13 @@ export const RunningStatusMap = {
|
||||
[RunningStatus.DONE]: 'Success',
|
||||
[RunningStatus.FAIL]: 'Failed',
|
||||
[RunningStatus.SCHEDULE]: 'Schedule',
|
||||
|
||||
[RunningStatusOld.UNSTART]: 'Pending',
|
||||
[RunningStatusOld.RUNNING]: 'Running',
|
||||
[RunningStatusOld.CANCEL]: 'Cancel',
|
||||
[RunningStatusOld.DONE]: 'Success',
|
||||
[RunningStatusOld.FAIL]: 'Failed',
|
||||
[RunningStatusOld.SCHEDULE]: 'Schedule',
|
||||
};
|
||||
|
||||
export enum ModelVariableType {
|
||||
|
||||
@@ -46,7 +46,7 @@ export const useFetchPipelineFileLogDetail = ({
|
||||
enabled: !isAgent,
|
||||
queryFn: async () => {
|
||||
if (isEdit) {
|
||||
const { data } = await kbService.get_pipeline_detail({
|
||||
const { data } = await kbService.getPipelineDetail({
|
||||
log_id: logId,
|
||||
});
|
||||
return data?.data ?? {};
|
||||
|
||||
@@ -23,7 +23,6 @@ import { Button } from '@/components/ui/button';
|
||||
import { Modal } from '@/components/ui/modal/modal';
|
||||
import { AgentCategory, AgentQuery } from '@/constants/agent';
|
||||
import { Images } from '@/constants/common';
|
||||
import { useNavigatePage } from '@/hooks/logic-hooks/navigate-hooks';
|
||||
import { useGetKnowledgeSearchParams } from '@/hooks/route-hook';
|
||||
import { Routes } from '@/routes';
|
||||
import { LucideArrowBigLeft } from 'lucide-react';
|
||||
@@ -34,7 +33,7 @@ import { IDslComponent, IPipelineFileLogDetail } from './interface';
|
||||
import ParserContainer from './parser';
|
||||
|
||||
const DataflowResult = () => {
|
||||
const { isReadOnly, knowledgeId, agentId, agentTitle, documentExtension } =
|
||||
const { isReadOnly, knowledgeId, agentId, documentExtension } =
|
||||
useGetPipelineResultSearchParams();
|
||||
|
||||
const isAgent = !!agentId;
|
||||
@@ -56,12 +55,6 @@ const DataflowResult = () => {
|
||||
agentId ? (pipelineResult as IPipelineFileLogDetail) : dataset,
|
||||
);
|
||||
|
||||
const {
|
||||
navigateToDatasetOverview,
|
||||
navigateToDatasetList,
|
||||
navigateToAgents,
|
||||
navigateToAgent,
|
||||
} = useNavigatePage();
|
||||
const fileUrl = useGetDocumentUrl(isAgent);
|
||||
|
||||
const { highlights, setWidthAndHeight } =
|
||||
|
||||
Reference in New Issue
Block a user