Files
AIclinicalresearch/frontend-v2/src/modules/rvw/components/BatchToolbar.tsx
HaHafeng 61cdc97eeb feat(platform): Fix pg-boss queue conflict and add safety standards
Summary:
- Fix pg-boss queue conflict (duplicate key violation on queue_pkey)
- Add global error listener to prevent process crash
- Reduce connection pool from 10 to 4
- Add graceful shutdown handling (SIGTERM/SIGINT)
- Fix researchWorker recursive call bug in catch block
- Make screeningWorker idempotent using upsert

Security Standards (v1.1):
- Prohibit recursive retry in Worker catch blocks
- Prohibit payload bloat (only store fileKey/ID in job.data)
- Require Worker idempotency (upsert + unique constraint)
- Recommend task-specific expireInSeconds settings
- Document graceful shutdown pattern

New Features:
- PKB signed URL endpoint for document preview/download
- pg_bigm installation guide for Docker
- Dockerfile.postgres-with-extensions for pgvector + pg_bigm

Documentation:
- Update Postgres-Only async task processing guide (v1.1)
- Add troubleshooting SQL queries
- Update safety checklist

Tested: Local verification passed
2026-01-23 22:07:26 +08:00

64 lines
1.3 KiB
TypeScript

/**
* 批量操作浮动工具栏
*/
import { Play, X } from 'lucide-react';
interface BatchToolbarProps {
selectedCount: number;
onRunBatch: () => void;
onClearSelection: () => void;
}
export default function BatchToolbar({ selectedCount, onRunBatch, onClearSelection }: BatchToolbarProps) {
if (selectedCount === 0) return null;
return (
<div className="fixed bottom-8 left-1/2 transform -translate-x-1/2 bg-slate-800 text-white px-5 py-3 rounded-full shadow-2xl flex items-center gap-6 z-30 fade-in border border-slate-700">
<div className="flex items-center gap-2">
<div className="w-5 h-5 rounded-full bg-indigo-500 flex items-center justify-center text-[10px] font-bold">
{selectedCount}
</div>
<span className="text-sm font-medium"></span>
</div>
<div className="h-4 w-px bg-slate-600" />
<button
onClick={onRunBatch}
className="text-sm font-bold text-white hover:text-indigo-300 flex items-center gap-2 transition-colors"
>
<Play className="w-4 h-4 text-green-400" />
稿
</button>
<button
onClick={onClearSelection}
className="text-slate-400 hover:text-white ml-2"
>
<X className="w-4 h-4" />
</button>
</div>
);
}