feat: add manual Paperless ID synchronization for email attachments and update default barcode margins to 7mm.
Build and Push Multi-Platform Images / build-and-push (push) Successful in 36s
Build and Push Multi-Platform Images / build-and-push (push) Successful in 36s
This commit is contained in:
1 parent
76ce4cf900
commit
11bed63bad
6 files changed
+78
-34
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState, useCallback } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Table, Card, Typography, Button, Space, Tag, message, Input, Select } from 'antd';
|
||||
import { ReloadOutlined, DownloadOutlined, CheckCircleOutlined, SearchOutlined } from '@ant-design/icons';
|
||||
import { Table, Card, Typography, Button, Space, Tag, message, Input, Select, Dropdown } from 'antd';
|
||||
import { ReloadOutlined, DownloadOutlined, CheckCircleOutlined, SearchOutlined, DownOutlined } from '@ant-design/icons';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import dayjs from 'dayjs';
|
||||
import { emailsApi, type EmailItem } from '../api/emails';
|
||||
@@ -141,26 +141,51 @@ export default function MailpostfachPage() {
|
||||
Aktualisieren
|
||||
</Button>
|
||||
{hasPermission(Permission.MANAGE_ALL) && (
|
||||
<Button
|
||||
icon={<CheckCircleOutlined />}
|
||||
<Dropdown.Button
|
||||
icon={<DownOutlined />}
|
||||
loading={checking}
|
||||
onClick={async () => {
|
||||
setChecking(true);
|
||||
try {
|
||||
const result = await emailsApi.checkAttachments();
|
||||
message.success(`${result.updatedCount} E-Mail(s) wurden als verarbeitet markiert.`);
|
||||
if (result.updatedCount > 0) {
|
||||
await loadData();
|
||||
}
|
||||
const result = await emailsApi.checkAttachments(false);
|
||||
const parts = [];
|
||||
if (result.updatedCount > 0) parts.push(`${result.updatedCount} E-Mail(s) als verarbeitet markiert`);
|
||||
if (result.idsUpdated > 0) parts.push(`${result.idsUpdated} Paperless-ID(s) ergänzt`);
|
||||
message.success(parts.length > 0 ? parts.join(', ') + '.' : 'Keine Änderungen.');
|
||||
if (result.updatedCount > 0 || result.idsUpdated > 0) await loadData();
|
||||
} catch {
|
||||
message.error('Prüfung fehlgeschlagen.');
|
||||
} finally {
|
||||
setChecking(false);
|
||||
}
|
||||
}}
|
||||
loading={checking}
|
||||
menu={{
|
||||
items: [
|
||||
{
|
||||
key: 'includeProcessed',
|
||||
icon: <CheckCircleOutlined />,
|
||||
label: 'Bereits verarbeitete Anhänge prüfen',
|
||||
async onClick() {
|
||||
setChecking(true);
|
||||
try {
|
||||
const result = await emailsApi.checkAttachments(true);
|
||||
const parts = [];
|
||||
if (result.updatedCount > 0) parts.push(`${result.updatedCount} E-Mail(s) aktualisiert`);
|
||||
if (result.idsUpdated > 0) parts.push(`${result.idsUpdated} Paperless-ID(s) ergänzt`);
|
||||
message.success(parts.length > 0 ? parts.join(', ') + '.' : 'Keine Änderungen.');
|
||||
if (result.updatedCount > 0 || result.idsUpdated > 0) await loadData();
|
||||
} catch {
|
||||
message.error('Prüfung fehlgeschlagen.');
|
||||
} finally {
|
||||
setChecking(false);
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
}}
|
||||
>
|
||||
Anhänge prüfen
|
||||
</Button>
|
||||
<CheckCircleOutlined /> Anhänge prüfen
|
||||
</Dropdown.Button>
|
||||
)}
|
||||
</Space>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user