Fix: Added read-only mode support and optimized navigation logic #9869 (#10370)

### What problem does this PR solve?

Fix: Added read-only mode support and optimized navigation logic #9869

- Added the `isReadonly` property to the parseResult component to
control the enabled state of editing and interactive features
- Added the `navigateToDataFile` navigation method to navigate to the
data file details page
- Refactored the `navigateToDataflowResult` method to use an object
parameter to support more flexible query parameter configuration
- Unified the `var(--accent-primary)` CSS variable format to
`rgb(var(--accent-primary))` to accommodate more styling scenarios
- Extracted the parser initialization logic into a separate hook
(`useParserInit`)

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
chanx
2025-09-30 12:00:29 +08:00
committed by GitHub
parent fb19e24f8a
commit 4d6ff672eb
27 changed files with 468 additions and 253 deletions

View File

@ -1,3 +1,4 @@
import { useHandleFilterSubmit } from '@/components/list-filter-bar/use-handle-filter-submit';
import {
useGetPaginationWithRouter,
useHandleSearchChange,
@ -32,6 +33,7 @@ const useFetchFileLogList = () => {
const [searchParams] = useSearchParams();
const { searchString, handleInputChange } = useHandleSearchChange();
const { pagination, setPagination } = useGetPaginationWithRouter();
const { filterValue, handleFilterSubmit } = useHandleFilterSubmit();
const { id } = useParams();
const [active, setActive] = useState<(typeof LogTabs)[keyof typeof LogTabs]>(
LogTabs.FILE_LOGS,
@ -48,6 +50,7 @@ const useFetchFileLogList = () => {
pagination,
searchString,
active,
filterValue,
],
placeholderData: (previousData) => {
if (previousData === undefined) {
@ -57,13 +60,16 @@ const useFetchFileLogList = () => {
},
enabled: true,
queryFn: async () => {
const { data: res = {} } = await fetchFunc({
kb_id: knowledgeBaseId,
page: pagination.current,
page_size: pagination.pageSize,
keywords: searchString,
// order_by: '',
});
const { data: res = {} } = await fetchFunc(
{
kb_id: knowledgeBaseId,
page: pagination.current,
page_size: pagination.pageSize,
keywords: searchString,
// order_by: '',
},
{ ...filterValue },
);
return res.data || [];
},
});
@ -82,6 +88,8 @@ const useFetchFileLogList = () => {
setPagination,
active,
setActive,
filterValue,
handleFilterSubmit,
};
};