(this.webpackJsonpwww=this.webpackJsonpwww||[]).push([[0],{127:function(e,t,n){},128:function(e,t,n){},222:function(e,t,n){"use strict";n.r(t);var a=n(0),i=n.n(a),o=n(29),s=n.n(o),c=(n(127),n(106)),r=n(107),d=n(121),g=n(118),l=(n(128),n(45)),u=n(56),h=n(225),p=n(83),f=n.n(p),w=n(32),b=function(e){Object(d.a)(n,e);var t=Object(g.a)(n);function n(){var e;Object(c.a)(this,n);for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];return(e=t.call.apply(t,[this].concat(i))).state={rows:[],columns:[],loading:!0,showDeleted:!1,descending:!0,pagination:{total:0,current:1,pageSize:5e5}},e.changePage=function(e,t,n){},e.queryTable=function(t,n,a,i,o){return e.setState({loading:!0}),f.a.get("/api/v1/runs",{params:{table:t,limit:n,offset:a,include_deleted:i?"true":"false",order:o?"desc":"asc"}}).then((function(t){var n=t.data.columns.map((function(e){return{title:e,dataIndex:e,key:e}}));n.push({title:"Action",key:"__action__",render:function(t,n){return Object(w.jsx)(l.a,{type:"primary",danger:!0,onClick:e.deleteRecord(n.id),children:"Delete"})}}),e.setState({rows:t.data.records,columns:n,loading:!1})}))},e.deleteRecord=function(t){return function(){return e.setState({loading:!0}),f.a.delete("/api/v1/runs/".concat(t)).then((function(n){e.setState({loading:!1,rows:e.state.rows.filter((function(e){return e.id!==t}))})}))}},e.onToggleDeleted=function(t){t.target.checked!==e.state.showDeleted&&(e.setState({showDeleted:t.target.checked}),e.queryTable(e.tableName,e.state.pagination.pageSize,(e.state.pagination.current-1)*e.state.pagination.pageSize,t.target.checked,e.state.descending))},e.onToggleSearchOrder=function(t){t.target.checked!==e.state.descending&&(e.setState({descending:t.target.checked}),e.queryTable(e.tableName,e.state.pagination.pageSize,(e.state.pagination.current-1)*e.state.pagination.pageSize,e.state.showDeleted,t.target.checked))},e}return Object(r.a)(n,[{key:"tableName",get:function(){return window.location.pathname.replace("/exps/","")}},{key:"componentDidMount",value:function(){this.queryTable(this.tableName,this.state.pagination.pageSize,(this.state.pagination.current-1)*this.state.pagination.pageSize,this.state.showDeleted,this.state.descending)}},{key:"render",value:function(){return Object(w.jsxs)("div",{children:[Object(w.jsxs)("div",{style:{marginTop:8,marginBottom:8},children:[Object(w.jsx)(u.a,{onChange:this.onToggleDeleted,checked:this.state.showDeleted,children:"Show deleted runs"}),Object(w.jsx)(u.a,{onChange:this.onToggleSearchOrder,checked:this.state.descending,children:"Sort Descending"})]}),Object(w.jsx)(h.a,{size:"small",dataSource:this.state.rows,rowKey:"id",pagination:{total:this.state.pagination.total,current:this.state.pagination.current,pageSize:this.state.pagination.pageSize,pageSizeOptions:["5","10","20","50","100","200","500","1000"],showSizeChanger:!0,showTotal:function(e){return"Total ".concat(e," items")}},columns:this.state.columns,loading:this.state.loading,onChange:this.changePage})]})}}]),n}(i.a.Component),S=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,226)).then((function(t){var n=t.getCLS,a=t.getFID,i=t.getFCP,o=t.getLCP,s=t.getTTFB;n(e),a(e),i(e),o(e),s(e)}))};s.a.render(Object(w.jsx)(i.a.StrictMode,{children:Object(w.jsx)(b,{})}),document.getElementById("root")),S()}},[[222,1,2]]]);
//# sourceMappingURL=main.1b6d3ea3.chunk.js.map