(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1009],{66050:function(e,t,n){"use strict";var r;n.d(t,{V:function(){return r}}),function(e){e.CANCELLED="cancelled",e.COMPLETED="completed",e.FAILED="failed",e.INITIAL="initial",e.RUNNING="running"}(r||(r={}))},92597:function(e,t,n){"use strict";n.r(t);var r=n(77837),u=n(82394),i=n(38860),s=n.n(i),l=n(82684),a=n(34376),o=n(1210),c=n(67971),p=n(51099),f=n(97496),d=n(41788),v=n(55378),h=n(86673),g=n(19711),j=n(82531),b=n(47409),O=n(66050),m=n(49125),P=n(33766),_=n(59e3),x=n(28598);function w(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?w(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):w(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function y(){var e=(0,a.useRouter)(),t=(0,l.useState)(null),n=t[0],r=t[1],u=(0,_.iV)(),i=null!==u&&void 0!==u&&u.page?u.page:0,s={_limit:p.Q,_offset:i*p.Q};null!==u&&void 0!==u&&u.status&&(s.status=u.status);var d=j.ZP.pipeline_runs.list(s,{refreshInterval:3e3,revalidateOnFocus:!0}),w=d.data,y=d.mutate,Z=(0,l.useMemo)((function(){return(null===w||void 0===w?void 0:w.pipeline_runs)||[]}),[w]),N=(0,l.useMemo)((function(){var e;return(null===w||void 0===w||null===(e=w.metadata)||void 0===e?void 0:e.count)||[]}),[w]);return(0,x.jsxs)(o.Z,{errors:n,setErrors:r,title:"Pipeline runs",uuid:"pipeline_runs/index",children:[(0,x.jsx)(h.Z,{mx:2,my:1,children:(0,x.jsxs)(c.Z,{alignItems:"center",children:[(0,x.jsx)(g.ZP,{bold:!0,default:!0,large:!0,children:"Filter runs by status:"}),(0,x.jsx)(h.Z,{mr:1}),(0,x.jsxs)(v.Z,{compact:!0,defaultColor:!0,fitContent:!0,onChange:function(t){t.preventDefault(),"all"===t.target.value?e.push("/pipeline-runs"):(0,P.u7)({page:0,status:t.target.value})},paddingRight:4*m.iI,placeholder:"Select run status",value:(null===u||void 0===u?void 0:u.status)||"all",children:[(0,x.jsx)("option",{value:"all",children:"All statuses"},"all_statuses"),Object.values(O.V).map((function(e){return(0,x.jsx)("option",{value:e,children:b.D[e]},e)}))]})]})}),(0,x.jsx)(f.Z,{fetchPipelineRuns:y,pipelineRuns:Z,setErrors:r}),(0,x.jsx)(h.Z,{p:2,children:(0,x.jsx)(p.Z,{maxPages:9,onUpdate:function(t){var n=Number(t),r=E(E({},u),{},{page:n>=0?n:0});e.push("/pipeline-runs","/pipeline-runs?".concat((0,_.uM)(r)))},page:Number(i),totalPages:Math.ceil(N/p.Q)})})]})}y.getInitialProps=(0,r.Z)(s().mark((function e(){return s().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)}))),t.default=(0,d.Z)(y)},60710:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/pipeline-runs",function(){return n(92597)}])}},function(e){e.O(0,[3850,5716,2344,4506,6166,8180,4741,9774,2888,179],(function(){return t=60710,e(e.s=t);var t}));var t=e.O();_N_E=t}]);