1import{H as u,a2 as m,a5 as J,p as w,s as F,q as S,u as C,d as q,r as s,j as e,L as E,c as M,v as $,bX as h}from"./index-CNagSlXC.js";import{C as A}from"./ContentWide-index-CRfP4tTu.js";const R=`query JobQuery($id: ID!) { 2 job(id: $id) { 3 id 4 state 5 created 6 updatedAt 7 type 8 assetId 9 videoId 10 logs 11 parentJob 12 error 13 } 14} 15`,_={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"JobQuery"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"job"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"state"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"created"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"updatedAt"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"type"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"assetId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"videoId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"logs"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"parentJob"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"error"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:197,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:R}}},v=u.div.withConfig({componentId:"sc-fa63146d-0"})(["display:flex;flex-direction:column;gap:0.5rem;align-items:flex-start;padding:25px 0 0;border-radius:5px;margin-top:15px;padding:1.5rem;border:0.5px solid ",";width:100%;max-height:30rem;overflow-y:auto;@media (min-width:","){width:65%;}"],({theme:n})=>n.colors.buttonDisabled,({theme:n})=>`${n.newScreenBreakpoints.large}px`),o=u.div.withConfig({componentId:"sc-fa63146d-1"})(["float:right;margin-left:0;@media (min-width:","){margin-left:3rem;}"],({theme:n})=>`${n.newScreenBreakpoints.small}px`),r=u(m).withConfig({componentId:"sc-fa63146d-2"})(["width:100%;justify-content:space-between;"]),L=u.hr.withConfig({componentId:"sc-fa63146d-3"})(["margin:0.5rem 0 0.5rem -0.5rem;border-color:grey;width:inherit;"]),T=`mutation RestartJobMutation($jobId: ID!) { 16 restartJob(jobId: $jobId) 17} 18`,V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"RestartJobMutation"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"jobId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"ID"}}},directives:[]}],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"restartJob"},arguments:[{kind:"Argument",name:{kind:"Name",value:"jobId"},value:{kind:"Variable",name:{kind:"Name",value:"jobId"}}}],directives:[]}]}}],loc:{start:0,end:111,source:{name:"GraphQL request",locationOffset:{line:1,column:1},body:T}}},Q=/\[(.*?)\]/,B=()=>{const{jobId:n}=J(),j=w(),{graphqlError:f,success:x}=F(),y=S(),{data:i,loading:g}=C(_,{variables:{id:n}}),[p]=q(V,{onError:f,onCompleted:()=>x("Job successfully restarted")}),d=s.useCallback(t=>new Intl.DateTimeFormat(j.locale,{year:"numeric",month:"2-digit",day:"numeric",hour:"2-digit",minute:"numeric",second:"numeric",fractionalSecondDigits:3}).format(new Date(t)),[j]),N=s.useCallback(()=>{p({variables:{jobId:n}})},[p,n]),b=s.useMemo(()=>i?.job?.error?{message:i.job.error.split(` 19`)[0]}:null,[i?.job?.error]),l=s.useMemo(()=>i?.job?.logs?i?.job?.logs.map(a=>{const c=a.match(Q);return c?d(c[1]):""}):void 0,[i?.job,d]),k=s.useMemo(()=>{const t=[];return l&&i?.job?.logs&&i.job.logs.forEach((a,c)=>{t.push({timestamp:l[c],message:a.slice(28,a.length),isError:!1})}),b&&t.push({message:b.message,isError:!0}),t},[l,i?.job?.logs,b]),D=s.useMemo(()=>
19{if(i?.job?.created)return d(i.job.created)},[i?.job?.created,d]),I=s.useMemo(()=>{if(i?.job?.updatedAt)return d(i.job.updatedAt)},[i?.job?.updatedAt,d]);return g?e.jsx(E,{}):!i||!i.job?e.jsx("h2",{children:"No job data found"}):e.jsxs(A,{children:[e.jsx("h2",{children:"Kju job details"}),e.jsxs(v,{children:[e.jsxs(r,{children:[e.jsx("span",{children:"Id: "}),e.jsx(o,{children:i.job.id})]}),e.jsxs(r,{children:["Parent Job:"," ",e.jsx(M,{to:y.toJobDetailsPage(i.job.parentJob||""),children:i.job.parentJob||""})]}),e.jsxs(r,{children:["Type: ",e.jsx(o,{children:i.job.type})]}),e.jsxs(r,{children:["State: ",e.jsx(o,{children:i.job.state})]}),e.jsxs(r,{children:["Creation Date: ",e.jsx(o,{children:D})]}),e.jsxs(r,{children:["Modification Date: ",e.jsx(o,{children:I})]}),e.jsxs(r,{children:["Asset ID: ",e.jsx(o,{children:i.job.assetId||""})]}),e.jsxs(r,{children:["Video ID: ",e.jsx(o,{children:i.job.videoId||""})]})]}),e.jsx(v,{children:k&&k.map((t,a)=>e.jsx(e.Fragment,{children:t.isError?e.jsxs(e.Fragment,{children:[l&&l.length>0&&e.jsx(L,{}),e.jsx(m,{style:{color:"#d4a574"},children:t.message},a)]}):e.jsxs(e.Fragment,{children:[e.jsx(m,{style:{color:"grey"},children:t.timestamp},`dates-${a}`),e.jsx(m,{children:t.message},a)]})}))}),e.jsx($,{type:"button",variant:"contained",disabled:g||i.job.state!==h.Completed&&i.job.state!==h.Failed,style:{marginLeft:"0",marginTop:"1rem"},onClick:N,children:"Restart Job"})]})};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.