feat: implement authenticated resource handling for image and PDF previews via AuthImage and AuthIframe components
Build and Push Multi-Platform Images / build-and-push (push) Successful in 17s

This commit is contained in:
2026-05-10 22:30:27 +02:00
parent 1ed3afd2e2
commit 76ce4cf900
5 changed files with 129 additions and 23 deletions
@@ -1,5 +1,6 @@
import { useEffect, useState } from 'react';
import { Table, Popover, Image, Button, Space, message, ConfigProvider, Tooltip } from 'antd';
import { Table, Popover, Button, Space, message, ConfigProvider, Tooltip } from 'antd';
import { AuthImage } from '../utils/auth-resource';
import { ReloadOutlined } from '@ant-design/icons';
import dayjs from 'dayjs';
import { posteingangApi } from '../api/posteingang';
@@ -55,10 +56,9 @@ export default function PosteingangPage() {
};
const popoverContent = (id: number) => (
<Image
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${id}`}
width={400}
preview={false}
<AuthImage
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${id}`}
width={400}
/>
);
@@ -69,10 +69,9 @@ export default function PosteingangPage() {
width: 150,
render: (_: any, record: PosteingangDocument) => (
<Popover content={popoverContent(record.id)} placement="right" trigger="hover">
<Image
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
<AuthImage
src={`${getEnv('VITE_API_URL')}/api/paperless/inbox/preview/${record.id}`}
width={100}
preview={false}
style={{ border: '1px solid #d9d9d9', objectFit: 'contain' }}
/>
</Popover>