feat: inject PAPERLESS_URL environment variable and update document link rendering in MailDetailPage
Build and Push Multi-Platform Images / build-and-push (push) Successful in 18s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 18s
This commit is contained in:
@@ -7,6 +7,7 @@ ENV_JS="/usr/share/nginx/html/env-config.js"
|
||||
cat <<EOF > "$ENV_JS"
|
||||
window.__ENV__ = {
|
||||
VITE_API_URL: "${VITE_API_URL:-}",
|
||||
PAPERLESS_URL: "${PAPERLESS_URL:-}",
|
||||
VITE_OIDC_AUTHORITY: "${VITE_OIDC_AUTHORITY:-}",
|
||||
VITE_OIDC_CLIENT_ID: "${VITE_OIDC_CLIENT_ID:-}",
|
||||
VITE_OIDC_REDIRECT_URI: "${VITE_OIDC_REDIRECT_URI:-}",
|
||||
|
||||
@@ -3,7 +3,7 @@ import { useParams, useNavigate } from 'react-router-dom';
|
||||
import {
|
||||
Card, Button, Space, Spin, Tag, Typography, Table, message, Empty, Popconfirm
|
||||
} from 'antd';
|
||||
import { ArrowLeftOutlined, FileTextOutlined, CloseCircleOutlined } from '@ant-design/icons';
|
||||
import { ArrowLeftOutlined, FileTextOutlined, CloseCircleOutlined, LinkOutlined } from '@ant-design/icons';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import dayjs from 'dayjs';
|
||||
import { emailsApi, type EmailItem, type EmailAttachment } from '../api/emails';
|
||||
@@ -108,22 +108,23 @@ export default function MailDetailPage() {
|
||||
|
||||
return (
|
||||
<Space size={[0, 4]} wrap>
|
||||
{entries.map(([, id]) => (
|
||||
<Tag
|
||||
color="blue"
|
||||
key={id}
|
||||
style={{ cursor: 'pointer' }}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
const paperlessUrl = getEnv('VITE_PAPERLESS_URL');
|
||||
if (paperlessUrl) {
|
||||
window.open(`${paperlessUrl}/documents/${id}`, '_blank');
|
||||
}
|
||||
}}
|
||||
>
|
||||
{id}
|
||||
</Tag>
|
||||
))}
|
||||
{entries.map(([, id]) => {
|
||||
const paperlessUrl = getEnv('PAPERLESS_URL');
|
||||
return (
|
||||
<a
|
||||
key={id}
|
||||
href={paperlessUrl ? `${paperlessUrl}/documents/${id}` : undefined}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<Tag color="blue" style={{ cursor: 'pointer' }}>
|
||||
<LinkOutlined style={{ marginRight: 4 }} />
|
||||
{id}
|
||||
</Tag>
|
||||
</a>
|
||||
);
|
||||
})}
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
@@ -236,7 +237,7 @@ export default function MailDetailPage() {
|
||||
)
|
||||
) : (
|
||||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%', color: '#888' }}>
|
||||
<Space direction="vertical" align="center">
|
||||
<Space vertical align="center">
|
||||
<FileTextOutlined style={{ fontSize: 48 }} />
|
||||
<Text type="secondary">Kein Anhang ausgewählt</Text>
|
||||
</Space>
|
||||
|
||||
Reference in New Issue
Block a user