feat: 수집 실패건 로그 페이징 기능 상세화
This commit is contained in:
부모
f559b3959b
커밋
1192a1117f
@ -575,13 +575,18 @@ export default function ExecutionDetail() {
|
||||
);
|
||||
}
|
||||
|
||||
const FAILED_PAGE_SIZE = 10;
|
||||
|
||||
function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: FailedRecordDto[]; jobName: string; stepExecutionId: number }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [showConfirm, setShowConfirm] = useState(false);
|
||||
const [retrying, setRetrying] = useState(false);
|
||||
const [page, setPage] = useState(0);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const failedRecords = records.filter((r) => r.status === 'FAILED');
|
||||
const totalPages = Math.ceil(records.length / FAILED_PAGE_SIZE);
|
||||
const pagedRecords = records.slice(page * FAILED_PAGE_SIZE, (page + 1) * FAILED_PAGE_SIZE);
|
||||
|
||||
const statusColor = (status: string) => {
|
||||
switch (status) {
|
||||
@ -637,9 +642,10 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</div>
|
||||
|
||||
{open && (
|
||||
<div className="mt-2 overflow-x-auto max-h-80 overflow-y-auto">
|
||||
<div className="mt-2">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-xs text-left">
|
||||
<thead className="bg-red-100 text-red-700 sticky top-0">
|
||||
<thead className="bg-red-100 text-red-700">
|
||||
<tr>
|
||||
<th className="px-2 py-1.5 font-medium">Record Key</th>
|
||||
<th className="px-2 py-1.5 font-medium">에러 메시지</th>
|
||||
@ -649,7 +655,7 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-red-100">
|
||||
{records.map((record) => (
|
||||
{pagedRecords.map((record) => (
|
||||
<tr
|
||||
key={record.id}
|
||||
className="bg-white hover:bg-red-50"
|
||||
@ -676,6 +682,14 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Pagination
|
||||
page={page}
|
||||
totalPages={totalPages}
|
||||
totalElements={records.length}
|
||||
pageSize={FAILED_PAGE_SIZE}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 확인 다이얼로그 */}
|
||||
|
||||
@ -626,13 +626,18 @@ export default function RecollectDetail() {
|
||||
);
|
||||
}
|
||||
|
||||
const FAILED_PAGE_SIZE = 10;
|
||||
|
||||
function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: FailedRecordDto[]; jobName: string; stepExecutionId: number }) {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [showConfirm, setShowConfirm] = useState(false);
|
||||
const [retrying, setRetrying] = useState(false);
|
||||
const [page, setPage] = useState(0);
|
||||
const navigate = useNavigate();
|
||||
|
||||
const failedRecords = records.filter((r) => r.status === 'FAILED');
|
||||
const totalPages = Math.ceil(records.length / FAILED_PAGE_SIZE);
|
||||
const pagedRecords = records.slice(page * FAILED_PAGE_SIZE, (page + 1) * FAILED_PAGE_SIZE);
|
||||
|
||||
const statusColor = (status: string) => {
|
||||
switch (status) {
|
||||
@ -688,9 +693,10 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</div>
|
||||
|
||||
{open && (
|
||||
<div className="mt-2 overflow-x-auto max-h-80 overflow-y-auto">
|
||||
<div className="mt-2">
|
||||
<div className="overflow-x-auto">
|
||||
<table className="w-full text-xs text-left">
|
||||
<thead className="bg-red-100 text-red-700 sticky top-0">
|
||||
<thead className="bg-red-100 text-red-700">
|
||||
<tr>
|
||||
<th className="px-2 py-1.5 font-medium">Record Key</th>
|
||||
<th className="px-2 py-1.5 font-medium">에러 메시지</th>
|
||||
@ -700,7 +706,7 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className="divide-y divide-red-100">
|
||||
{records.map((record) => (
|
||||
{pagedRecords.map((record) => (
|
||||
<tr
|
||||
key={record.id}
|
||||
className="bg-white hover:bg-red-50"
|
||||
@ -727,6 +733,14 @@ function FailedRecordsToggle({ records, jobName, stepExecutionId }: { records: F
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Pagination
|
||||
page={page}
|
||||
totalPages={totalPages}
|
||||
totalElements={records.length}
|
||||
pageSize={FAILED_PAGE_SIZE}
|
||||
onPageChange={setPage}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 확인 다이얼로그 */}
|
||||
|
||||
불러오는 중...
Reference in New Issue
Block a user