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
Build and Push Multi-Platform Images / build-and-push (push) Successful in 17s
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user