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:
@@ -55,6 +55,7 @@ services:
|
|||||||
- "${FRONTEND_PORT:-7600}:80"
|
- "${FRONTEND_PORT:-7600}:80"
|
||||||
environment:
|
environment:
|
||||||
- VITE_API_URL=
|
- VITE_API_URL=
|
||||||
|
- PAPERLESS_URL=${PAPERLESS_URL:-http://paperless:8000}
|
||||||
- VITE_OIDC_AUTHORITY=${VITE_OIDC_AUTHORITY:-https://auth.poettker-holtrup.de/application/o/paperlessmanager/}
|
- VITE_OIDC_AUTHORITY=${VITE_OIDC_AUTHORITY:-https://auth.poettker-holtrup.de/application/o/paperlessmanager/}
|
||||||
- VITE_OIDC_CLIENT_ID=${VITE_OIDC_CLIENT_ID:-ogOeIlrcsf2spjuwyOc7CuAPrRkRSt3RXfYguoLn}
|
- VITE_OIDC_CLIENT_ID=${VITE_OIDC_CLIENT_ID:-ogOeIlrcsf2spjuwyOc7CuAPrRkRSt3RXfYguoLn}
|
||||||
- VITE_OIDC_REDIRECT_URI=${VITE_OIDC_REDIRECT_URI:-https://px-7a9b2.poettker-cloud.de/auth/callback}
|
- VITE_OIDC_REDIRECT_URI=${VITE_OIDC_REDIRECT_URI:-https://px-7a9b2.poettker-cloud.de/auth/callback}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ ENV_JS="/usr/share/nginx/html/env-config.js"
|
|||||||
cat <<EOF > "$ENV_JS"
|
cat <<EOF > "$ENV_JS"
|
||||||
window.__ENV__ = {
|
window.__ENV__ = {
|
||||||
VITE_API_URL: "${VITE_API_URL:-}",
|
VITE_API_URL: "${VITE_API_URL:-}",
|
||||||
|
PAPERLESS_URL: "${PAPERLESS_URL:-}",
|
||||||
VITE_OIDC_AUTHORITY: "${VITE_OIDC_AUTHORITY:-}",
|
VITE_OIDC_AUTHORITY: "${VITE_OIDC_AUTHORITY:-}",
|
||||||
VITE_OIDC_CLIENT_ID: "${VITE_OIDC_CLIENT_ID:-}",
|
VITE_OIDC_CLIENT_ID: "${VITE_OIDC_CLIENT_ID:-}",
|
||||||
VITE_OIDC_REDIRECT_URI: "${VITE_OIDC_REDIRECT_URI:-}",
|
VITE_OIDC_REDIRECT_URI: "${VITE_OIDC_REDIRECT_URI:-}",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { useParams, useNavigate } from 'react-router-dom';
|
|||||||
import {
|
import {
|
||||||
Card, Button, Space, Spin, Tag, Typography, Table, message, Empty, Popconfirm
|
Card, Button, Space, Spin, Tag, Typography, Table, message, Empty, Popconfirm
|
||||||
} from 'antd';
|
} 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 type { ColumnsType } from 'antd/es/table';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { emailsApi, type EmailItem, type EmailAttachment } from '../api/emails';
|
import { emailsApi, type EmailItem, type EmailAttachment } from '../api/emails';
|
||||||
@@ -108,22 +108,23 @@ export default function MailDetailPage() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Space size={[0, 4]} wrap>
|
<Space size={[0, 4]} wrap>
|
||||||
{entries.map(([, id]) => (
|
{entries.map(([, id]) => {
|
||||||
<Tag
|
const paperlessUrl = getEnv('PAPERLESS_URL');
|
||||||
color="blue"
|
return (
|
||||||
key={id}
|
<a
|
||||||
style={{ cursor: 'pointer' }}
|
key={id}
|
||||||
onClick={(e) => {
|
href={paperlessUrl ? `${paperlessUrl}/documents/${id}` : undefined}
|
||||||
e.stopPropagation();
|
target="_blank"
|
||||||
const paperlessUrl = getEnv('VITE_PAPERLESS_URL');
|
rel="noopener noreferrer"
|
||||||
if (paperlessUrl) {
|
onClick={(e) => e.stopPropagation()}
|
||||||
window.open(`${paperlessUrl}/documents/${id}`, '_blank');
|
>
|
||||||
}
|
<Tag color="blue" style={{ cursor: 'pointer' }}>
|
||||||
}}
|
<LinkOutlined style={{ marginRight: 4 }} />
|
||||||
>
|
{id}
|
||||||
{id}
|
</Tag>
|
||||||
</Tag>
|
</a>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -236,7 +237,7 @@ export default function MailDetailPage() {
|
|||||||
)
|
)
|
||||||
) : (
|
) : (
|
||||||
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100%', color: '#888' }}>
|
<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 }} />
|
<FileTextOutlined style={{ fontSize: 48 }} />
|
||||||
<Text type="secondary">Kein Anhang ausgewählt</Text>
|
<Text type="secondary">Kein Anhang ausgewählt</Text>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
Reference in New Issue
Block a user