PageSourceSearch

https://blockroot.com/js/ProjectDumpApp-BylXZUJ0.js

js blockroot.com collected 2026-10-07 00:23:46 UTC 6,699 bytes, 3 lines download raw bytes

1/*! licenses: /vendor.LICENSE.txt */
2import{bJ as J,cl as D,bL as Q,m as a,a4 as h,c9 as _,au as C,bM as V,f2 as K,_ as X,bn as z,L as Y,H as Z,T as ee,cw as te}from"./startReactApp-DF2eC-IB.js";import{j as e,n as u,N as W}from"./echoes-CMhNpn05.js";import"./vendor-DMVab8bq.js";import{V as re,W as A,X as O,ak as l,_ as n,a8 as j,aN as H,l as U,ar as ne}from"./main-Bj6FsM8w.js";import{u as P}from"./ce-CLV4L_rl.js";import"./datefns-GSH1D4xx.js";import"./lodash-BrK95tUn.js";import"./highlightjs-CFvgWmRf.js";function se(t){return re("/api/project_dump/status",{key:t}).catch(A)}function oe(t){return O("/api/project_dump/export",{key:t}).catch(A)}function ae(t){return O("/api/project_dump/import",{key:t}).catch(A)}const B=J(t=>Q({queryKey:["project-dump",t],queryFn:()=>se(t)})),ce=()=>D({mutationFn:t=>oe(t)}),ie=()=>D({mutationFn:t=>ae(t)});const F=(t,r)=>({component:t,type:r,ps:1,status:[a.Pending,a.InProgress,a.Success,a.Failed,a.Canceled].join(",")});const S=[a.Pending,a.InProgress],T=5e3;function de({componentKey:t}){const{data:r,refetch:p}=P(F(t,h.ProjectExport),{refetchInterval:({state:{data:s}})=>s&&S.includes(s.status)?T:void 0}),{data:o,refetch:g}=B(t,{refetchInterval:()=>r&&S.includes(r.status)?T:void 0}),{mutateAsync:f}=ce(),v=!!(o!=null&&o.exportedDump),w=async()=>{try{await f(t),p(),g()}catch{U.noop()}};function m(){return e.jsx(l,{className:"sw-mb-4",variant:"warning","data-component":"render-when-can-not-export",children:n("project_dump.can_not_export")})}function I(s){return e.jsxs("div",{className:"sw-flex sw-gap-2","data-component":"render-when-export-pending",children:[e.jsx(u,{}),e.jsx(_,{date:s.submittedAt,children:i=>e.jsx("output",{children:j("project_dump.pending_export",i)})})]})}function y(s){return e.jsxs("div",{className:"sw-flex sw-gap-2","data-component":"render-when-export-in-progress",children:[e.jsx(u,{}),s.startedAt&&e.jsx(C,{date:s.startedAt,children:i=>e.jsx("output",{children:j("project_dump.in_progress_export",i)})})]})}function E(){const s="/project/background_tasks?id=".concat(encodeURIComponent(t),"&status=FAILED&taskType=PROJECT_EXPORT");return e.jsxs("div",{"data-component":"render-when-export-failed",children:[e.jsxs(l,{className:"sw-mb-4",variant:"error",children:[n("project_dump.failed_export"),e.jsx(H,{className:"sw-ml-1",to:s,children:n("project_dump.see_details")})]}),x()]})}function N(s){return e.jsx(l,{className:"sw-mb-4",variant:"success","data-component":"render-dump",children:e.jsxs("div",{children:[(s==null?void 0:s.executedAt)&&e.jsx(_,{date:s.executedAt,children:i=>e.jsx("div",{children:j("project_dump.latest_export_available",i)})}),e.jsxs("div",{children:[!s&&e.jsx("div",{children:n("project_dump.export_available")}),e.jsx("p",{className:"sw-mt-2",children:o==null?void 0:o.exportedDump})]})]})})}function x(){return e.jsxs(e.Fragment,{children:[e.jsx("div",{children:n("project_dump.export_form_description")}),e.jsx(W,{ariaLabel:n("project_dump.do_export"),className:"sw-mt-4",onClick:w,children:n("project_dump.do_export")})]})}return o===void 0||r===void 0?e.jsx(u,{}):o.canBeExported?(r==null?void 0:r.status)===a.Pending?I(r):(r==null?void 0:r.status)===a.InProgress?y(r):(r==null?void 0:r.status)===a.Failed?E():e.jsxs("div",{"data-component":"export",children:[v&&N(r),x()]}):m()}const L=[a.Pending,a.InProgress],R=5e3;function pe(t){const{componentKey:r,importEnabled:p}=t,{data:o,refetch:g,isLoading:f}=P(F(r,h.ProjectImport),{refetchInterval:({state:{data:c}})=>c&&L.includes(c.status)?R:void 0}),{data:v,isLoading:w}=P(F(r,h.Report),{staleTime:V.SHORT}),{data:m,isLoading:I,refetch:y}=B(r,{refetchInterval:()=>o&&L.includes(o.status)?R:void 0}),{mutateAsync:E}=ie(),N=f||w||I,x=async()=>{try{await E(r),g(),y()}catch{U.noop()}};function s(){return e.jsx("span",{"data-component":"render-when-can-not-import",children:n("project_dump.can_not_import")})}function i(){return e.jsx(l,{variant:"warning","data-component":"render-when-no-dump",children:n("project_dump.no_file_to_import")})}function b(){return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sw-mt-4",children:n("project_dump.import_form_description")}),e.jsx(W,{ariaLabel:n("project_dump.do_import"),className:"sw-mt-4",onClick:x,children:n("project_dump.do_import")})]})}function M(c){return e.jsx(e.Fragment,{children:c.executedAt&&e.jsx(_,{date:c.executedAt,children:d=>e.jsx(l,{variant:"success",children:j("project_dump.import_success",d)})})})}function k(c){return e.jsxs(e.Fragment,{children:[e.jsx(u,{}),e.jsx(_,{date:c.submittedAt,children:d=>e.jsx("span",{children:j("project_dump.pending_import",d)})})]})}function $(c){return e.jsxs(e.Fragment,{children:[e.jsx(u,{}),c.startedAt&&e.jsx(C,{date:c.startedAt,children:d=>e.jsx("span",{children:j("project_dump.in_progress_import",d)})})]})}function q(){const{componentKey:c}=t,d=K(c,a.Failed,h.ProjectImport);return e.jsxs("div",{"data-component":"render-when-import-failed",children:[e.jsxs(l,{variant:"error",children:[n("project_dump.failed_import"),e.jsx(H,{className:"sw-ml-1",to:d,children:n("project_dump.see_details")})]}),b()]})}function G(){switch(o==null?void 0:o.status){case a.Success:if(!v)return M(o);break;case a.Pending:return k(o);case a.InProgress:return $(o);case a.Failed:return q();default:return m&&!m.canBeImported?s():m&&m.dumpToImport===void 0?i():e.jsx("div",{children:b()})}}return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sw-my-4",children:e.jsx("h2",{className:"sw-heading-lg",children:n("project_dump.import")})}),e.jsx(u,{isLoading:N,children:p?G():e.jsx("div",{children:n("project_dump.import_form_description_disabled")})})]})}function me({component:t,hasFeature:r}){const p=r(ne.ProjectImport);return e.jsx(Y,{id:"project-dump","data-component":"project-dump-app",children:e.jsxs("div",{className:"sw-my-8",children:[e.jsxs("header",{className:"sw-mb-5",children:[e.jsx(Z,{defer:!1,title:n("project_dump.page")}),e.jsx(ee,{className:"sw-mb-4",children:n("project_dump.page")}),e.jsx("div",{children:p?e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("project_dump.page.description1")}),e.jsx("p",{children:n("project_dump.page.description2")})]}):e.jsxs(e.Fragment,{children:[e.jsx("p",{children:n("project_dump.page.description_without_import1")}),e.jsx("p",{children:n("project_dump.page.description_without_import2")})]})})]}),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"sw-mb-4",children:e.jsx("h2",{className:"sw-heading-lg",children:n("project_dump.export")})}),e.jsx(de,{componentKey:t.key}),e.jsx(te,{className:"sw-my-8"}),e.jsx(pe,{componentKey:t.key,importEnabled:!!p})]})]})})}const ve=X(z(me));export{me as ProjectDumpApp,ve as default};
3//# sourceMappingURL=ProjectDumpApp-BylXZUJ0.js.map

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.