import{_ as k}from"./admin-5dcdcef5.js";import{r as a,o as i,k as d,h as t,w as r,p as f,i as n,F as m,l as g,t as u,f as y}from"./vendor-cf98dd49.js";import{_ as E}from"./_plugin-vue_export-helper-c27b6911.js";const N=y(()=>k(()=>import("./NewUser-93a4e7d8.js"),["assets/NewUser-93a4e7d8.js","assets/vendor-cf98dd49.js","assets/vendor-112efa54.css","assets/_plugin-vue_export-helper-c27b6911.js","assets/NewUser-e016133c.css"])),C={components:{newUserDialog:N},data:()=>({loading:!1,users:[],headers:[{key:"name",title:"Name"},{key:"role",title:"Role"},{key:"setupDone",title:"Setup Status"}],addTooltip:!1,moreTooltip:!1}),mounted(){this.loadUsers()},watch:{},methods:{redirectToMore(){window.location.href="/users-manager"},showNewUserDialog(){this.$refs.newUserDialog.showDialog()},loadUsers(){this.loading=!0,this.$root.axiosGet("/users-manager-load/amount/5").then(e=>{this.loading=!1,this.users=e.response.data.data})},getColor(e){return e===0||e===3?"yellow":e===1?"green":e===2?"red":"grey"},getText(e){return e===0?"INCOMPLETED":e===1?"COMPLETED":e===2?"PENDING DELETE":e===3?"PENDING UPDATE":"UNKNOWN"}}},x=n("span",null,"Add new user",-1),V=n("span",{class:"pl-1"},null,-1),z=n("span",null,"Show more",-1),P={class:"text-left"},b={class:"text-left"},L={class:"text-left"};function M(e,l,I,A,O,s){const p=a("v-icon"),c=a("v-avatar"),_=a("v-tooltip"),v=a("v-chip"),h=a("v-table"),D=a("v-card-text"),w=a("v-card"),T=a("newUserDialog");return i(),d(m,null,[t(w,{loading:e.loading,elevation:"10",class:"mx-auto",width:"100%",height:"420px",title:"User Manager",subtitle:"Controls creating, editing users."},{prepend:r(()=>[t(c,{color:"blue-darken-2",size:"40"},{default:r(()=>[t(p,{size:"large",icon:"mdi-account-group"})]),_:1})]),append:r(()=>[t(_,{modelValue:e.addTooltip,"onUpdate:modelValue":l[1]||(l[1]=o=>e.addTooltip=o),location:"top"},{activator:r(({props:o})=>[t(c,f(o,{color:e.addTooltip?"green-darken-3":"green-darken-1",size:"20",onClick:l[0]||(l[0]=U=>s.showNewUserDialog())}),{default:r(()=>[t(p,{size:"small",icon:"mdi-plus",style:{cursor:"pointer"}})]),_:2},1040,["color"])]),default:r(()=>[x]),_:1},8,["modelValue"]),V,t(_,{modelValue:e.moreTooltip,"onUpdate:modelValue":l[3]||(l[3]=o=>e.moreTooltip=o),location:"top"},{activator:r(({props:o})=>[t(c,f(o,{color:e.moreTooltip?"grey-darken-3":"grey-darken-1",size:"20",onClick:l[2]||(l[2]=U=>s.redirectToMore())}),{default:r(()=>[t(p,{size:"small",icon:"mdi-dots-horizontal",style:{cursor:"pointer"}})]),_:2},1040,["color"])]),default:r(()=>[z]),_:1},8,["modelValue"])]),default:r(()=>[t(D,{class:"pa-0 ma-0"},{default:r(()=>[t(h,null,{default:r(()=>[n("thead",null,[n("tr",null,[(i(!0),d(m,null,g(e.headers,o=>(i(),d("th",{class:"text-left",key:o.key},u(o.title),1))),128))])]),n("tbody",null,[(i(!0),d(m,null,g(e.users,o=>(i(),d("tr",{key:o.ID},[n("td",P,u(o.firstname)+" "+u(o.lastname),1),n("td",b,u(o.jobRole),1),n("td",L,[t(v,{color:s.getColor(o.setupDone),text:s.getText(o.setupDone),class:"text-uppercase",labelsize:"small"},null,8,["color","text"])])]))),128))])]),_:1})]),_:1})]),_:1},8,["loading"]),t(T,{ref:"newUserDialog",onLoadUsers:l[4]||(l[4]=o=>s.loadUsers())},null,512)],64)}const G=E(C,[["render",M]]);export{G as default};
