1import{a as $,m as h,j as u}from"./-W1VOijv.js";import q from"./B8Ry3j3y.js";import B from"./Dc6hFrXi.js";import{d as C}from"./BmaaQ1Wp.js";import{bg as s,b3 as p,Q as _,a0 as e,b_ as t,I as n,bs as c,Z as l,aL as b,O as I,F as P,be as U,J as N}from"./PW_UF68a.js";import"./Bz2dEcw7.js";import"./CIhhRri8.js";import"./Bs5_TFWz.js";import"./B_aewNsK.js";import"./fgnZjpTr.js";import"./CH7vd0UB.js";import"./206wqFYJ.js";const R={name:"Index",components:{ResetFiltersButton:B,TextFieldFilter:q},mixins:[C],data(){return{headers:[{title:this.$t("fields.name"),align:"start",key:"name"},{title:this.$t("fields.permissions"),key:"permissions"},{title:"",sortable:!1,align:"end",key:"action"}]}},async mounted(){await this.fetchInitialData()},head(){return{title:"Roluri Utilizatori"}},computed:{...u("roles",["roles"]),...u("loader",["loading"]),...u("query",["queryParams"]),currentScope(){return"roles"}},methods:{...h("resources",["deleteResource","getData"]),...h("query",["resetScopeFilters","setVuetifyPagination"]),async fetchInitialData(){await this.getData(this.currentScope)},handleOptionsUpdate(o){this.setVuetifyPagination({scope:this.currentScope,pagination:o}),this.getData(this.currentScope)}}},O={class:"d-flex flex-column flex-grow-1"},T={class:"text-h5 text-md-h4"},j={class:"filter-row"},E={class:"text-end"},L={class:"permission-chips"},A={key:0,class:"d-flex no-wrap justify-end"},H={class:"font-weight-bold"},J={class:"font-weight-bold"};function Q(o,a,Z,G,y,d){const x=s("v-divider"),k=s("v-spacer"),m=s("v-btn"),S=s("v-card-title"),f=s("text-field-filter"),w=s("reset-filters-button"),z=s("v-chip"),v=s("v-icon"),g=s("v-tooltip"),D=s("v-data-table"),F=s("v-card-text"),V=s("v-card");return p(),_("div",O,[e(V,{elevation:"5"},{default:t(()=>[e(S,{class:"d-flex align-center"},{default:t(()=>[n("div",T,c(o.$t("menu.roles")),1),e(x,{class:"mx-2 d-none d-md-inline",vertical:""}),e(k),e(m,{class:"mt-2 mt-md-0 create-button",color:"primary",size:"large",to:"/roles/create"},{default:t(()=>[l(c(o.$t("buttons.create_role")),1)]),_:1})]),_:1}),e(F,null,{default:t(()=>[e(D,{options:o.pagination,"onUpdate:options":[a[0]||(a[0]=i=>o.pagination=i),d.handleOptionsUpdate],headers:y.headers,items:o.roles,"items-length":o.queryParams[d.currentScope]?.pagination?.total||0,"items-per-page-options":[10,15,30,60],loading:o.loading,class:"flex-grow-1 v2-style-table"},{"body.prepend":t(()=>[n("tr",j,[n("td",null,[e(f,{label:o.$t("fields.name"),scope:d.currentScope,class:"filter-field","hide-details":"","scope-key":"name"},null,8,["label","scope"])]),n("td",null,[e(f,{label:o.$t("fields.name"),scope:d.currentScope,class:"filter-field","hide-details":"","scope-key":"perm"},null,8,["label","scope"])]),n("td",E,[e(w,{class:"filter-reset-button",scope:"users"})])])]),"item.permissions":t(({item:i})=>[n("div",L,[(p(!0),_(P,null,U(i.permissions,r=>(p(),N(z,{key:r.id,class:"mr-2 mb-2",size:"small"},{default:t(()=>[l(c(r.name),1)]),_:2},1024))),128))])]),"item.action":t(({item:i})=>[i.id!==1?(p(),_("div",A,[e(g,{location:"bottom"},{activator:t(({props:r})=>[e(m,b({to:`/roles/edit/${i.id}`,density:"compact",icon:"",size:"medium"},r,{variant:"text",style:{color:"rgba(0, 0, 0, 0.7) !important"}}),{default:t(()=>[e(v,{size:"large"},{default:t(()=>[...a[1]||(a[1]=[l("mdi-square-edit-outline",-1)])]),_:1})]),_:1},16,["to"])]),default:t(()=>[n("span",null,[a[2]||(a[2]=l(" EditeazÄ rolul ",-1)),n("i",H,c(i.name),1)])]),_:2},1024),e(g,{location:"bottom"},{activator:t(({props:r})=>[e(m,b({density:"compact",icon:"",size:"medium"},r,{variant:"text",onClick:K=>o.deleteResource({data:i,scope:d.currentScope})}),{default:t(()=>[e(v,{size:"large"},{default:t(()=>[...a[3]||(a[3]=[l("mdi-delete",-1)])]),_:1})]),_:1},16,["onClick"])]),default:t(()=>[n("span",null,[a[4]||(a[4]=l(" Èterge rolul ",-1)),n("i",J,c(i.name),1)])]),_:2},1024)])):I("",!0)]),_:1},8,["options","headers","items","items-length","loading","onUpdate:options"])]),_:1})]),_:1})])}const le=$(R,[["render",Q],["__scopeId","data-v-b5659509"]]);export{le as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.