import{a as y}from"./QList.1548b7b0.js";import{_ as u,I as i,J as n,a6 as b,H as c,K as l,L as r,Q as p,t as v,N as d,P as w,S as Q,R as S,T as P}from"./index.f9c30c55.js";import{Q as $,a as x,b as C}from"./QPage.1ebdd4ad.js";import{p as I,q as V,Q as k,o as q}from"./api.7efe3d3e.js";import{P as N,Q as s,a as z}from"./PriorityChip.ad4f92a5.js";import"./QSeparator.f3fa0e56.js";const{capitalize:B}=I,T={name:"ScheduleChip",props:["value"],data(){return{label:"Unknown"}},created(){this.label=this.value.split("_").map(B).join(" ")}};function D(e,o,m,f,t,h){return i(),n($,b({label:t.label},e.$attrs),null,16,["label"])}var R=u(T,[["render",D]]);const U={components:{PriorityChip:N,ScheduleChip:R},name:"ScrapersPage",data(){return{loading:!1,error:!1,columns:[{name:"id",label:"ID",field:"id",align:"left"},{name:"name",label:"Name",field:e=>e,align:"left"},{name:"schedule",label:"Schedule",field:"schedule",align:"center"},{name:"priority",label:"Priority",field:"priority",align:"center"},{name:"actions",label:"Actions",field:e=>e,align:"right"}],rows:[],filter:""}},created(){this.filter=this.$route.query.f||"",this.loading=!0,V().then(e=>this.rows=e).catch(e=>this.error=e).finally(()=>this.loading=!1)},watch:{filter(e){e?this.$router.replace({query:{f:e}}):this.$router.replace({query:{}})}}},j=S("div",{class:"text-h6"},"Scrapers",-1);function A(e,o,m,f,t,h){const _=c("priority-chip"),g=c("schedule-chip");return i(),n(x,{class:"flex flex-center",style:{width:"100%"}},{default:l(()=>[r(z,{rows:t.rows,columns:t.columns,"row-key":"id",style:{width:"100%",height:"100vh"},"virtual-scroll":"","hide-bottom":"",loading:t.loading,"rows-per-page-options":[0],filter:t.filter},{top:l(()=>[j,r(y),r(C,{dense:"",color:"primary",style:{width:"300px"},modelValue:t.filter,"onUpdate:modelValue":o[0]||(o[0]=a=>t.filter=a),placeholder:"Search...",clearable:""},{prepend:l(()=>[r(p,{name:"search"})]),_:1},8,["modelValue"])]),"body-cell-name":l(a=>[r(s,{props:a},{default:l(()=>[v((i(),n(k,{clickable:"",href:e.$router.resolve({name:"ScraperPage",params:{id:a.value.id}}).href},{default:l(()=>[r(q,null,{default:l(()=>[d(w(a.value.name),1)]),_:2},1024)]),_:2},1032,["href"])),[[P]])]),_:2},1032,["props"])]),"body-cell-priority":l(a=>[r(s,{props:a},{default:l(()=>[r(_,{value:a.value,size:"sm"},null,8,["value"])]),_:2},1032,["props"])]),"body-cell-schedule":l(a=>[r(s,{props:a},{default:l(()=>[r(g,{size:"sm",color:"primary","text-color":"white",value:a.value},null,8,["value"])]),_:2},1032,["props"])]),"body-cell-actions":l(a=>[r(s,{props:a},{default:l(()=>[r(Q,{flat:"",size:"sm",to:e.$router.resolve({name:"ScraperPage",params:{id:a.value.id}})},{default:l(()=>[r(p,{name:"fa-solid fa-edit",class:"q-mr-sm"}),d(" Edit ")]),_:2},1032,["to"])]),_:2},1032,["props"])]),_:1},8,["rows","columns","loading","filter"])]),_:1})}var G=u(U,[["render",A]]);export{G as default};
