PageSourceSearch

https://pdf2epub.ai/assets/HistoryPage-BNUJ-4q7.js

js pdf2epub.ai collected 2026-10-05 12:24:31 UTC 8,726 bytes, 1 lines download raw bytes

1import{a as g,j as e}from"./vendor-query-DdYYqZOr.js";import{r as n}from"./vendor-react-Dm5djFS-.js";import{T as p,L as u,r as f,R as y}from"./index-CUsdGunI.js";import{T as w}from"./TaskCard-BOjV11ov.js";import{a as j}from"./formatDate-DkbfMcqq.js";import{u as b}from"./vendor-i18n-BYSLZ8MU.js";import"./vendor-supabase-ClVc2H6D.js";import"./vendor-sentry-Cg5bi1Nt.js";import"./checkoutContext-bQj-mHmZ.js";import"./taskStatus-DhkErayQ.js";function B(){const{t:s}=b(["tasks","common"]),[r,l]=n.useState(1),[i,m]=n.useState(!1),[o,d]=n.useState("card");n.useEffect(()=>{const t=localStorage.getItem("historyViewMode");(t==="list"||t==="card")&&d(t)},[]);const c=t=>{d(t),localStorage.setItem("historyViewMode",t)},{data:a,isLoading:h,error:x}=g({queryKey:["history",r,i],queryFn:()=>y(r,50,i)});return e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center mb-6 gap-4",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:s("tasks:history.title")}),e.jsxs("div",{className:"flex items-center space-x-6",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("button",{type:"button",className:`${i?"bg-blue-600":"bg-gray-200"} relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-blue-600 focus:ring-offset-2`,role:"switch","aria-checked":i,onClick:()=>{m(!i),l(1)},children:e.jsx("span",{"aria-hidden":"true",className:`${i?"translate-x-5":"translate-x-0"} pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out`})}),e.jsx("span",{className:"ml-3 text-sm font-medium text-gray-900",children:s("tasks:history.showDeleted")})]}),e.jsxs("div",{className:"bg-gray-100 p-1 rounded-lg hidden md:flex items-center",children:[e.jsx("button",{onClick:()=>c("list"),className:`p-1.5 rounded-md transition-all ${o==="list"?"bg-white shadow text-blue-600":"text-gray-500 hover:text-gray-700"}`,title:s("tasks:list.listView"),children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx("button",{onClick:()=>c("card"),className:`p-1.5 rounded-md transition-all ${o==="card"?"bg-white shadow text-blue-600":"text-gray-500 hover:text-gray-700"}`,title:s("tasks:list.cardView"),children:e.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})})]})]})]}),h&&e.jsx(p,{variant:"inline",context:"data"}),x&&e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-red-600",children:s("common:loadFailed",{message:x.message})})}),a&&e.jsxs(e.Fragment,{children:[a.items.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx("svg",{className:"mx-auto h-12 w-12 text-gray-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})}),e.jsx("p",{className:"mt-4 text-gray-500",children:s("tasks:history.empty")})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:`${o==="list"?"md:hidden":""} grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4`,children:a.items.map(t=>e.jsx(w,{task:t},t.id))}),o==="list"&&e.jsx("div",{className:"hidden md:block bg-white rounded-lg shadow-sm border overflow-hidden",children:e.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[e.jsx("thead",{className:"bg-gray-50",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("tasks:history.filename")}
1),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("tasks:history.status")}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("tasks:history.pages")}),e.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("tasks:history.completedAt")}),e.jsx("th",{className:"px-6 py-3 text-right text-xs font-medium text-gray-500 uppercase tracking-wider",children:s("tasks:history.actions")})]})}),e.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:a.items.map(t=>e.jsxs("tr",{className:`hover:bg-gray-50 ${t.deleted_at?"bg-gray-50 opacity-60":""}`,children:[e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 truncate max-w-xs",children:e.jsx(u,{to:`/tasks/${t.id}`,className:"hover:text-blue-600 cursor-pointer",title:t.filename,children:t.filename})}),!!t.autofix_count&&e.jsxs("span",{className:"flex-shrink-0 inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-medium bg-amber-50 text-amber-700 border border-amber-200",title:s("tasks:list.autofixedHint"),children:[e.jsx(f,{className:"w-3 h-3"}),s("tasks:list.autofixed")]})]})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:e.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${t.deleted_at?"bg-gray-100 text-gray-800":t.status==="completed"?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:t.deleted_at?s("common:status.deleted"):t.status==="completed"?s("tasks:history.success"):s("tasks:history.failed")})}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.total_pages||"-"}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:t.completed_at?j(t.completed_at):"-"}),e.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-right text-sm font-medium",children:!t.deleted_at&&e.jsxs("div",{className:"flex items-center justify-end space-x-2",children:[t.markdown_download_url&&e.jsxs("button",{onClick:()=>window.open(t.markdown_download_url,"_blank"),className:"inline-flex items-center px-2 py-1 border border-gray-300 shadow-sm text-xs font-medium rounded text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",title:s("tasks:detail.downloadMarkdown","Download Markdown"),children:[e.jsx("svg",{className:"mr-1 h-3 w-3 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"MD"]}),t.status==="completed"&&t.download_url&&e.jsxs("button",{onClick:()=>window.open(t.download_url,"_blank"),className:"inline-flex items-center px-2 py-1 border border-gray-300 shadow-sm text-xs font-medium rounded text-green-700 bg-white hover:bg-green-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-green-500",title:s("tasks:detail.downloadEpub","Download EPUB"),children:[e.jsx("svg",{className:"mr-1 h-3 w-3 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})}),"EPUB"]})]})})]},t.id))})]})})]}),a.pages>1&&e.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row items-center justify-between gap-3",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("tasks:history.totalRecords",{total:a.total})}),e.jsxs("div",{className:"flex space-x-2",children:[e.jsx("button",{onClick:()=>l(t=>Math.max(1,t-1)),disabled:r===1,className:`px-3 py-1 rounded text-sm ${r===1?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:s("common:pagination.prevPage")}),e.jsx("button",{onClick:()=>l(t=>Math.min(a.pages,t+1)),disabled:r===a.pages,className:`px-3 py-1 rounded text-sm ${r===a.pages?"bg-gray-100 text-gray-400 cursor-not-allowed":"bg-gray-200 text-gray-700 hover:bg-gray-300"}`,children:s("common:pagination.nextPage")})]})]})]})]})}export{B as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.