import{_ as u,M as f,c,a as t,w as o,Z as b,R as g,H as _,r as v,o as d,$ as r,K as n,I as w,a3 as x,aj as y,N as p,a1 as k,Q as C}from"./app-DzAYC6xy.js";import{Q as S,a as m}from"./QTable-98FMMxUQ.js";import{Q}from"./QTr-BZRxhYsi.js";import{d as E}from"./utils-wZ-HUk39.js";import"./externalHosting.js";import"./QList-ClLOsgaS.js";import"./QMarkupTable-z27wCkH-.js";import"./QSelect-CKpWbBmC.js";import"./QChip-BlQVc6fr.js";import"./QItemLabel-DrLwH6Mx.js";import"./position-engine-BoHh6ymb.js";import"./selection-vu7NfHfB.js";import"./rtl-DFPa-2ov.js";import"./use-fullscreen-Bv2HJD5x.js";const V={name:"DevStashList",data(){return{ACTION:_,RESOURCE:g,rows:[],loading:!0,filter:"",columns:[{name:"index",align:"left",label:"#",field:e=>e.index,sortable:!0},{name:"name",align:"left",label:"Name",field:e=>e.name||"",sortable:!0},{name:"label",align:"left",label:"Label",field:e=>e.label||"",sortable:!0}],pagination:{sortBy:"index",descending:!1,page:1,rowsPerPage:0}}},methods:{can:E,open(e){this.$router.push({name:"dev-stash-detail",params:{index:e.index}})},updatePagination(e){this.loading||(this.pagination=e)}},mounted(){this.$axios.get("/api/dev/stashes").then(e=>{this.rows=e.data.stashes||[],this.loading=!1}).catch(()=>{this.loading=!1,this.$q.notify({message:this.$i18n.t("general.error"),color:"red"})})}},N={key:0,class:"row q-pa-sm"},T={class:"row"},L={class:"col-12"},q={class:"q-mx-md q-my-sm row items-center"},B={class:"text-caption text-sub"},D={class:"q-ml-auto"};function I(e,l,R,$,s,i){const h=v("router-view");return e.$route.name==="dev-stash-list"?(d(),f("div",N,[t(b,{class:"dashboard-card full-width"},{default:o(()=>[r("div",T,[r("div",L,[r("div",q,[r("div",B,n(e.$t("components.devStashList.subheader")),1),r("div",D,[i.can(s.ACTION.DEV.STASH.CREATE,s.RESOURCE.DEV)?(d(),c(x,{key:0,color:"primary",onClick:l[0]||(l[0]=a=>e.$router.push({name:"dev-stash-create"})),label:e.$t("components.devStashList.create"),class:"q-ma-sm",icon:"add"},null,8,["label"])):w("",!0)])]),t(y),t(S,{color:"primary","card-class":"stash-list-card text-main","table-class":"stash-list-table","table-header-class":"stash-list-table-header text-main",flat:"",rows:s.rows,columns:s.columns,"row-key":"index",pagination:s.pagination,"hide-bottom":"","no-results-label":e.$t("components.devShopList.noData"),"loading-label":e.$t("components.devShopList.loadData"),loading:s.loading,filter:s.filter,"onUpdate:pagination":i.updatePagination},{"top-right":o(()=>[t(k,{borderless:"",dense:"",debounce:"300",modelValue:s.filter,"onUpdate:modelValue":l[1]||(l[1]=a=>s.filter=a),placeholder:e.$t("general.search"),"input-class":"text-main"},{append:o(()=>[t(C,{class:"text-white search-icon",name:"search"})]),_:1},8,["modelValue","placeholder"])]),body:o(a=>[t(Q,{props:a,class:"cursor-pointer",onClick:U=>i.open(a.row)},{default:o(()=>[t(m,{key:"index",props:a},{default:o(()=>[p(n(a.row.index),1)]),_:2},1032,["props"]),t(m,{key:"name",props:a},{default:o(()=>[p(n(a.row.name),1)]),_:2},1032,["props"]),t(m,{key:"label",props:a},{default:o(()=>[p(n(a.row.label),1)]),_:2},1032,["props"])]),_:2},1032,["props","onClick"])]),_:1},8,["rows","columns","pagination","no-results-label","loading-label","loading","filter","onUpdate:pagination"])])])]),_:1})])):(d(),c(h,{key:1}))}const Y=u(V,[["render",I],["__scopeId","data-v-1d340b26"]]);export{Y as default};
