auto-sync: 2026-05-22 13:12:03
This commit is contained in:
@@ -136,8 +136,8 @@ export default function MailPanel() {
|
||||
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: '#6a9eff22', color: '#6a9eff' }}>
|
||||
{detail.type || 'text'}
|
||||
</span>
|
||||
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: detail.is_read ? '#2a3550' : '#f59e0b22', color: detail.is_read ? '#6b7280' : '#f59e0b' }}>
|
||||
{detail.is_read ? '已读' : '未读'}
|
||||
<span style={{ fontSize: 10, padding: '2px 6px', borderRadius: 4, background: STATUS_COLORS[detail.status] || '#2a3550', color: '#dde4f8' }}>
|
||||
{STATUS_LABELS[detail.status] || detail.status}
|
||||
</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 18, fontWeight: 700, lineHeight: 1.3 }}>{detail.title}</div>
|
||||
@@ -180,31 +180,18 @@ export default function MailPanel() {
|
||||
|
||||
{/* 操作 */}
|
||||
<div style={{ marginTop: 16, display: 'flex', gap: 8 }}>
|
||||
{!detail.is_read && (
|
||||
<button onClick={async () => {
|
||||
await fetch(`/api/mail/${detail.id}`, {
|
||||
method: 'PATCH', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ is_read: true }),
|
||||
});
|
||||
loadMails();
|
||||
setDetail({ ...detail, is_read: true });
|
||||
}} style={{
|
||||
padding: '6px 14px', borderRadius: 6, fontSize: 11,
|
||||
border: '1px solid var(--acc)', background: 'var(--acc)22', color: 'var(--acc)', cursor: 'pointer',
|
||||
}}>✓ 标记已读</button>
|
||||
)}
|
||||
{detail.status !== 'done' && (
|
||||
{detail.status === 'failed' && (
|
||||
<button onClick={async () => {
|
||||
await fetch(`/api/mail/${detail.id}`, {
|
||||
method: 'PATCH', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ mark_executed: true }),
|
||||
await fetch(`/api/projects/_mail/tasks/${detail.id}/status`, {
|
||||
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ status: 'pending' }),
|
||||
});
|
||||
loadMails();
|
||||
setDetail({ ...detail, is_read: true, status: 'done' });
|
||||
setDetail({ ...detail, status: 'pending' });
|
||||
}} style={{
|
||||
padding: '6px 14px', borderRadius: 6, fontSize: 11,
|
||||
border: '1px solid #2ecc8a', background: '#2ecc8a22', color: '#2ecc8a', cursor: 'pointer',
|
||||
}}>✅ 标记已执行</button>
|
||||
border: '1px solid #f59e0b', background: '#f59e0b22', color: '#f59e0b', cursor: 'pointer',
|
||||
}}>🔄 重试</button>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user