1import{d as j,u as J,B as k,F as w,e as C,g as U}from"./index-Dx3_aswN.js";import{u as Q}from"./vendor-i18n-BAJQGTf1.js";import{d as W,f as X,p as l,k as d,u as s,G as o,y as g,E as c,x as z,aw as Y,av as Z,r as v,c as I,B as ee,C as m,F,L as te,ar as se,m as i}from"./vendor-D7HY6vXs.js";import{s as ae,b,d as ne}from"./vendor-servebolt-BwnDPTSW.js";import{_ as oe}from"./BreadcrumbWrapper.vue_vue_type_script_setup_true_lang-C_IMLSFP.js";import{_ as ie}from"./TransferInProgressMessage.vue_vue_type_script_setup_true_lang-9IvrhIjm.js";import{I as V}from"./inactive-E9UtwCz1.js";import{u as le}from"./useCronAntComponents-DeVBZY2i.js";import"./vendor-auth0-B88dyU-W.js";import"./vendor-toast-BA6wVAZy.js";import"./boltTransfer-DTlTqgFx.js";import"./vendor-antdv-base-QySV-hqZ.js";import"./vendor-lodash-BvL3EwUt.js";import"./vendor-antdv-slider-CkgCtKC6.js";import"./vendor-antdv-table-DFhwV24V.js";const{t:$}=j.global,re=[{title:$("name"),dataIndex:"name",key:"name",responsive:["md"]},{title:$("role"),dataIndex:"role",key:"role",responsive:["md"]},{title:$("mail"),dataIndex:"mail",key:"mail",responsive:["md"]},{title:"",dataIndex:"operation",key:"operation",responsive:["md"]},{title:"",dataIndex:"mobile",key:"mobile",responsive:["xs","sm"]}],de={class:"mb-[50px] md:mb-[86px] flex flex-col"},ce={class:"border border-solid border-border rounded-base p-[16px] md:p-[24px]"},me={key:0,class:"flex-1 w-full flex flex-col mb-[24px]"},ue={key:0},pe={key:1,class:"flex flex-col items-start"},ve={class:"flex"},be={class:"flex mt-2 items-center"},ge={class:"ml-2 text-14"},fe={key:0},xe=["onClick"],_e={key:1},he={key:0},ke={key:0,class:"border border-border p-[16px] mb-[10px] rounded-[5px]"},ye={class:"flex flex-col mb-[40px]"},we={class:"mobile-header-table-block"},Ce={class:"grid grid-cols-2 gap-4"},Ie={key:0},$e={class:"mb-4"},Se={class:"text-[9px] mb-[4px]"},Be={class:"text-[13px] mb-[4px]"},Ne={key:1,class:"flex"},Ae={class:"ml-2 text-14"},je=W({__name:"UsersAndAccessList",setup(Pe){le();const f=Y(),q=se(),{t:u}=Q({useScope:"global"}),S=Z(),B=v({}),x=v(!0);let N=v(),E=v({});const _=J("tailwind");let A=v([]);const y=v(!1),P=v(!1);X(()=>{D()});const h=I(()=>Number(q.params.boltId)),T=I(()=>_.breakpoint==="md"||_.breakpoint==="lg"||_.breakpoint==="xl"||_.breakpoint==="2xl"),G=I(()=>0);async function D(){x.value=!0;const a=[];await f.replace({query:{...E.value}});const n=await new k().get(h.value,w());P.value=n.getData().attributes?.hasTransferRequest||!1;const t=await new k().getUsers(h.value);a.push(n,t);try{const[e,r]=await Promise.all(a);y.value=S.getters.getAccountId===e.data?.attributes?.customerId||w(),S.dispatch("addBoltIformation",e?.data);const p=e.name()||"";A.value=[{name:p,route:{name:"specific-bolt",params:{boltId:e.id()}}}],B.value=r.meta,M(r.data)}catch(e){C(e.response)}finally{x.value=!1}}function M(a){N.value=a.map(n=>({name:n.attributes.name||"-",role:n.attributes.role||"-",mail:n.attributes.email||"-",pending:n.attributes.pending||!1,id:n.id}))}async function L(a,n){try{const t={data:{attributes:{mail:a,role:n}}};await new k().createUser(h.value,t),U(u("inviteSent"))}catch(t){C(t.response)}}async function H(a){try{await new k().deleteUser(h.value,Number(a)),U(u("inviteCancelled")),D()}catch(n){C(n.response)}}function K(){f.push({name:"users-and-access.create"})}function R(a){f.push({name:"users-and-access.edit",params:{userId:a}})}function O(a){f.push({name:"customers-bolts",params:{userId:a}})}return(a,n)=>(i(),l("div",null,[d(ie,{status:P.value},null,8,["status"]),d(oe,{loading:x.value,items:s(A),count:1},null,8,["loading","items"]),o("div",de,[d(s(ae),{class:"md:mt-0"},{default:g(()=>[ee(m(s(u)("usersAndAccess")),1)]),_:1})]),n[0]||(n[0]=o("p",null," The Servebolt Admin Portal is your platform management hub. Various users can access this portal to make changes to sites or settings, such as ordering an SSL, mapping a domain, or even connecting to SSH. ",-1)),n[1]||(n[1]=o("p",null,"Managing users is easy, and any extra user can be assigned different roles for the websites (and Bolts).",-1)),o("div",ce,[y.value?(i(),l("div",me,[o("div",null,[d(s(b),{class:"self
1-start md:mr-[24px]",text:s(u)("addNewUser"),iconAnimated:"",type:"outline",onClick:K},null,8,["text"])])])):c("",!0),(i(),z(s(ne),{data:s(N),key:String(T.value),loading:x.value,scheme:s(re),meta:B.value,scroll:G.value},{operation:g(({column:t,record:e})=>[t&&t.key==="operation"&&e.role!=="owner"&&!e.pending&&y.value?(i(),l("div",ue,[d(s(b),{size:"sm",type:"outline",text:a.$t("change"),onClick:r=>R(e.id)},null,8,["text","onClick"])])):c("",!0),t&&t.key==="operation"&&e.pending?(i(),l("div",pe,[o("div",ve,[d(s(b),{class:"mr-2",size:"sm",type:"outline",text:a.$t("resend"),onClick:r=>L(e.mail,e.role)},null,8,["text","onClick"]),d(s(b),{size:"sm",type:"outline",text:a.$t("cancel"),onClick:r=>H(e.id)},null,8,["text","onClick"])]),o("div",be,[d(s(V),{width:"18",height:"18"}),o("span",ge,m(s(u)("invitePending")),1)])])):c("",!0)]),name:g(({column:t,record:e})=>[t&&t.key==="name"?(i(),l("div",fe,[s(w)()?(i(),l("a",{key:0,class:"text-primary block whitespace-nowrap leading-none underline",onClick:r=>O(e.id)},m(e.name),9,xe)):(i(),l("span",_e,m(e.name),1))])):c("",!0)]),role:g(({column:t,record:e})=>[t&&t.key==="role"?(i(),l("div",he,m(s(u)(e.role)),1)):c("",!0)]),mobile:g(({column:t,record:e})=>[t&&t.key==="mobile"&&!T.value?(i(),l("div",ke,[o("div",ye,[o("div",we,m(e.name),1)]),o("div",Ce,[(i(!0),l(F,null,te(e,(r,p)=>(i(),l(F,{key:p},[String(p)!=="name"&&String(p)!=="id"&&String(p)!=="pending"?(i(),l("div",Ie,[o("div",$e,[o("div",Se,m(p),1),o("div",Be,m(r),1)])])):c("",!0)],64))),128)),e.pending?c("",!0):(i(),z(s(b),{key:0,size:"lg",type:"outline",text:a.$t("change"),onClick:r=>R(e.id)},null,8,["text","onClick"])),e.pending?(i(),l("div",Ne,[d(s(b),{class:"mr-4",size:"lg",type:"outline",text:a.$t("resend"),onClick:r=>L(e.mail,e.role)},null,8,["text","onClick"]),d(s(V),{width:"18",height:"18"}),o("span",Ae,m(s(u)("invitePending")),1)])):c("",!0)])])):c("",!0)]),_:1},8,["data","loading","scheme","meta","scroll"]))])]))}});export{je as default}; 2//# sourceMappingURL=UsersAndAccessList-DuDutaX2.js.map
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.