mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-02-01 08:05:07 +08:00
feat: add optional cache busting for image (#12055)
### What problem does this PR solve? Add optional cache busting for image #12003 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -25,6 +25,7 @@ interface IProps {
|
||||
selected: boolean;
|
||||
clickChunkCard: (chunkId: string) => void;
|
||||
textMode: ChunkTextMode;
|
||||
t?: string | number; // Cache-busting key for images
|
||||
}
|
||||
|
||||
const ChunkCard = ({
|
||||
@ -36,6 +37,7 @@ const ChunkCard = ({
|
||||
selected,
|
||||
clickChunkCard,
|
||||
textMode,
|
||||
t: imageCacheKey,
|
||||
}: IProps) => {
|
||||
const available = Number(item.available_int);
|
||||
const [enabled, setEnabled] = useState(false);
|
||||
@ -79,7 +81,11 @@ const ChunkCard = ({
|
||||
onMouseLeave={() => setOpen(false)}
|
||||
>
|
||||
<div>
|
||||
<Image id={item.image_id} className={styles.image}></Image>
|
||||
<Image
|
||||
t={imageCacheKey}
|
||||
id={item.image_id}
|
||||
className={styles.image}
|
||||
/>
|
||||
</div>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent
|
||||
@ -90,6 +96,7 @@ const ChunkCard = ({
|
||||
>
|
||||
<div>
|
||||
<Image
|
||||
t={imageCacheKey}
|
||||
id={item.image_id}
|
||||
className={styles.imagePreview}
|
||||
></Image>
|
||||
|
||||
@ -55,6 +55,7 @@ const Chunk = () => {
|
||||
handleInputChange,
|
||||
available,
|
||||
handleSetAvailable,
|
||||
dataUpdatedAt,
|
||||
} = useFetchNextChunkList();
|
||||
const { handleChunkCardClick, selectedChunkId } = useHandleChunkCardClick();
|
||||
const isPdf = documentInfo?.type === 'pdf';
|
||||
@ -277,6 +278,7 @@ const Chunk = () => {
|
||||
clickChunkCard={handleChunkCardClick}
|
||||
selected={item.chunk_id === selectedChunkId}
|
||||
textMode={textMode}
|
||||
t={dataUpdatedAt}
|
||||
></ChunkCard>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user