"use strict";(self["webpackChunk_quetz_frontend_main_app"]=self["webpackChunk_quetz_frontend_main_app"]||[]).push([[96,1307],{31307:(e,t,a)=>{a.r(t);a.d(t,{CommandIDs:()=>b,default:()=>v});var s=a(85168);var n=a(70027);var o=a(79450);var r=a(98078);var i=a(18303);var l=a(26074);var c=a(71993);var d=a(2411);class u extends o.ReactWidget{constructor(e){super();this._router=e;this.id=o.DOMUtils.createDomID();this.title.label="Jobs main page";this._data=new Array;this._status=l.API_STATUSES.PENDING;this._loadData()}_loadData(){const e=r.ServerConnection.makeSettings();const t=i.URLExt.join(e.baseUrl,"/api/jobs");r.ServerConnection.makeRequest(t,{},e).then((async e=>{e.json().then((e=>{this._data=e.result;this._status=l.API_STATUSES.SUCCESS;this.update()}))}))}render(){const e=[{text:"Home",onClick:()=>{this._router.navigate("/home")}},{text:"Jobs"}];return d.createElement("div",{className:"page-contents-width-limit"},d.createElement(l.Breadcrumbs,{items:e}),d.createElement("h2",{className:"heading2"},"Jobs"),this._status===l.API_STATUSES.PENDING?d.createElement(l.InlineLoader,{text:"Fetching jobs"}):d.createElement(c.Table,{data:this._data,columns:m(),enableSearch:true}))}}const m=()=>[{Header:"Manifest",accessor:"manifest",disableFilters:true,Cell:({row:e})=>d.createElement("div",{onClick:()=>window.route.navigate(`/jobs/:${e.original.id}`)},e.values.manifest)},{Header:"Created",accessor:"created",Cell:({row:e})=>e.values.created},{Header:"Status",accessor:"status",Cell:({row:e})=>e.values.status},{Header:"Owner",accessor:"owner",Cell:({row:e})=>e.values.owner.username}];var b;(function(e){e.jobs="@quetz-frontend/jobs-extensions:open";e.goToJobs="@quetz-frontend/jobs-extensions:navigate-to-jobs"})(b||(b={}));const h={id:"@quetz-frontend/jobs-extension:plugin",autoStart:true,requires:[s.IRouter,n.IMenu],activate:(e,t,a)=>{const{shell:s,commands:n}=e;n.addCommand(b.jobs,{label:"Open Jobs Panel",execute:()=>{s.add(new u(t),"main")}});n.addCommand(b.goToJobs,{label:"Jobs",isVisible:()=>a.profile!==null,execute:()=>{t.navigate("/jobs")}});t.register({pattern:/^\/jobs.*/,command:b.jobs});a.addItem({command:b.goToJobs,rank:100})}};const v=h}}]);