PageSourceSearch

https://app.nimbushosting.co.uk/build/assets/Users-3aaa7565.js

js nimbushosting.co.uk collected 2026-10-03 19:30:33 UTC 26,259 bytes, 2 lines download raw bytes

1import{A as f}from"./AdminLayout-34876992.js";import{l as p}from"./lodash-31c3f368.js";import{T as h}from"./Timeago-e7e7d413.js";import{T as _}from"./Toggle-1b526314.js";import{P as b}from"./Panel-219ae608.js";import{P as v}from"./Pagination-cce84c05.js";import{n as d,M as c,T as g,d as u}from"./TinyLoader-66ac2a92.js";import{E as k}from"./EventBus-b3d0efef.js";import{E as y}from"./Error-e90019a0.js";import{V as w}from"./ValidationErrorMixin-f5bbcb4b.js";import{C}from"./Copy-725fa5f7.js";import{F as m}from"./form-f6445c19.js";import{F as U}from"./FormRow-70301bd4.js";import{F as x}from"./FormLabel-bd8220b7.js";import{F as A}from"./FormButton-04252412.js";import{F as I}from"./FormInputText-281da728.js";import{F as M}from"./FormPassword-936ead66.js";import"./SlugMixin-e16ab9e0.js";import"./ContextNav-12bd9b5d.js";import"./NavigationMixin-11509f8b.js";import"./PermissionHelper-e3ac23ca.js";import"./ConfirmedModal-544b3ad5.js";import"./CheckBoxIcon-aaee2db9.js";import"./FormSelect-5bebc9ef.js";import"./errors-e65562d9.js";const S={components:{Modal:c},props:{user:Object},data(){return{isLoading:!1,firstName:"",lastName:"",password:"",isCopied:!1,errors:new y}},computed:{isVisible(){return this.user===void 0?!1:this.user.hasOwnProperty("email")},email(){if(this.user!==void 0&&this.user.hasOwnProperty("email"))return this.user.email}},created(){this.password=Math.random().toString(36).slice(-10)},methods:{onSubmit(){this.isLoading=!0,this.$http.post(Storm.admin.apiUrl+"/user/"+this.user.id+"/verification",{first_name:this.firstName,last_name:this.lastName,email:this.email,password:this.password}).then(()=>{this.$emit("on-close"),this.$emit("on-verified")}).catch(a=>this.errors.set(a.response.data.errors)).finally(()=>{this.isLoading=!1})}}};var F=function(){var t=this,e=t._self._c;return e("modal",{attrs:{show:t.isVisible},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" Verify User ")]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"w-full flex justify-between"},[e("button",{staticClass:"button button-secondary",attrs:{type:"button"},on:{click:function(s){return t.$emit("on-close")}}},[t._v(" Close ")]),e("button",{staticClass:"button",attrs:{type:"button",disabled:t.isLoading||!t.isCopied},on:{click:t.onSubmit}},[t.isLoading?e("tiny-loader"):[t._v(" Verify ")]],2)])]},proxy:!0}])},[e("form",[e("div",{staticClass:"mb-2"},[e("label",{staticClass:"form-label text-left pl-0 is-required",attrs:{for:"first_name"}},[t._v("First Name")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.firstName,expression:"firstName"}],staticClass:"form-input w-full",attrs:{id:"first_name",type:"text",name:"first_name"},domProps:{value:t.firstName},on:{input:function(s){s.target.composing||(t.firstName=s.target.value)}}}),t.errors.has("first_name")?e("span",{staticClass:"text-sm text-labels-warning block mt-1"},[t._v(" "+t._s(t.errors.first("first_name"))+" ")]):t._e()]),e("div",{staticClass:"mb-2"},[e("label",{staticClass:"form-label text-left pl-0 is-required",attrs:{for:"last_name"}},[t._v("Last Name")]),e("input",{directives:[{name:"model",rawName:"v-model",value:t.lastName,expression:"lastName"}],staticClass:"form-input w-full",attrs:{id:"last_name",type:"text",name:"last_name"},domProps:{value:t.lastName},on:{input:function(s){s.target.composing||(t.lastName=s.target.value)}}}),t.errors.has("last_name")?e("span",{staticClass:"text-sm text-labels-warning block mt-1"},[t._v(" "+t._s(t.errors.first("last_name"))+" ")]):t._e()]),e("div",{staticClass:"mb-2"},[e("label",{staticClass:"form-label text-left pl-0",attrs:{for:"email"}},[t._v("Email Address")]),e("input",{staticClass:"form-input w-full",attrs:{id:"email",type:"email",name:"email",readonly:""},domProps:{value:t.email}})]),e("div",{staticClass:"mb-5"},[e("label",{staticClass:"form-label text-left pl-0",attrs:{for:"password"}},[t._v("Password")]),e("input",{staticClass:"form-input w-full",attrs:{id:"password",type:"text",name:"password",readonly:""},domProps:{value:t.password}})]),e("div",[e("label",{staticClass:"form-checkbox ml-0",attrs:{for:"copied"}},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.isCopied,expression:"isCopied"}
1],staticClass:"form-checkbox-input",attrs:{id:"copied",type:"checkbox",name:"copied"},domProps:{checked:Array.isArray(t.isCopied)?t._i(t.isCopied,null)>-1:t.isCopied},on:{change:function(s){var r=t.isCopied,n=s.target,i=!!n.checked;if(Array.isArray(r)){var l=null,o=t._i(r,l);n.checked?o<0&&(t.isCopied=r.concat([l])):o>-1&&(t.isCopied=r.slice(0,o).concat(r.slice(o+1)))}else t.isCopied=i}}}),e("div",{staticClass:"form-checkbox-box"}),e("p",{staticClass:"form-checkbox-label"},[t._v("I have copied the credentials to send to the client.")])])])])])},B=[],N=d(S,F,B,!1,null,null,null,null);const D=N.exports;const P={name:"AdminUsers",components:{UserVerification:D,Timeago:h,Toggle:_,Panel:b,Pagination:v,Modal:c,TinyLoader:g,Copy:C},mixins:[w],data(){return{modalUserInfo:!1,isModalVisible:!1,selectedAdmin:void 0,dnsZones:[],organisations:[],currentWhmcsId:null,lookingForAccountDetails:!0,lookingForDnsZones:!0,lookingForOrganisations:!0,currentStormUserId:null,currentUserFullName:"",currentUserBetaSince:!1,client:{},url:Storm.admin.url,users:[],currentUser:void 0,meta:[],params:{page:1,search:""},isLoading:!1,onlyBeta:0,onlyAdmin:0,onlyUnregistered:0,modalViewingUserId:null,whmcsUserIdError:null,newWhmcsUserId:null,canAdministerZendesk:null,modalViewingUserIsAdmin:null,tfa:{modal:!1,user:null,codes:null}}},computed:{totalUsers(){return this.meta.total_users},recentUsers(){return this.meta.recent_users}},methods:{openTfaBackupCodesModal(a,t){this.tfa.user=a,this.tfa.codes=t,this.tfa.modal=!0},closeTfaBackupCodesModal(){this.tfa.modal=!1,this.tfa.user=null,this.tfa.codes=null},getBackupCodes(a){let t={user_id:a.id};this.$http.get(Storm.admin.apiUrl+"/two-factor/backup-codes",{params:t}).then(e=>{this.tfa.codes=e.data.backupCodes,this.openTfaBackupCodesModal(a,e.data.backupCodes)})},setLoading(a){this.isLoading=a},onInput(a){this.params.page=1,this.params.search=encodeURI(a.target.value),this.fetch({beta:this.onlyBeta,admin:this.onlyAdmin,...this.params})},onChange(a){this.onlyBeta=0,this.onlyAdmin=0,this.onlyUnregistered=0,this.onlyRbacOprphans=0,a.target.value==="beta"&&(this.onlyBeta=1),a.target.value==="admin"&&(this.onlyAdmin=1),a.target.value==="unregistered"&&(this.onlyUnregistered=1),a.target.value==="without_rbac_memberships"&&(this.onlyRbacOprphans=1),this.fetch({beta:this.onlyBeta,admin:this.onlyAdmin,unregistered:this.onlyUnregistered,without_rbac_memberships:this.onlyRbacOprphans,...this.params})},onPageChange(a){this.params.page=a,this.fetch({beta:this.onlyBeta,admin:this.onlyAdmin,unregistered:this.onlyUnregistered,...this.params})},fetch:p.debounce(function(a){this.setLoading(!0),this.$http.get(Storm.admin.apiUrl+"/users",{params:a}).then(({data:{data:t,meta:e}})=>{this.users=t,this.meta=e}).finally(()=>this.setLoading(!1))},300),setCanAdministerZendesk(a,t){this.$http.put(Storm.admin.apiUrl+"/users/"+a+"/zendesk-admin",{zendesk_admin:t})},setWhmcsAccountId(a,t){this.whmcsUserIdError=null,t&&this.$http.put(Storm.admin.apiUrl+"/users/"+a+"/whmcs-id",{whmcs_user_id:t}).then(()=>{this.getWhmcsAccountInformation(a,t)}).catch(e=>{e.response?this.whmcsUserIdError=this.extractValidationErrorsToString(e.response.data):this.whmcsUserIdError=e})},removeWhmcsAccountId(a){confirm("Are you sure?")&&(this.whmcsUserIdError=null,this.$http.delete(Storm.admin.apiUrl+"/users/"+a+"/whmcs-id").then(()=>{this.newWhmcsUserId=null,this.getWhmcsAccountInformation(a,null)}).catch(t=>{this.whmcsUserIdError=t}))},toggleBeta(a){this.$http.patch(Storm.apiUrl+"/account/"+a.id+"/toggle-beta").then(t=>{for(let e=0;e<this.users.length;e++)if(this.users[e].id===a.id)return this.users[e].beta=t.data.beta,!1})},getWhmcsAccountInformation(a,t){if(this.currentWhmcsId=t,this.currentStormUserId=a,!t){this.client={};return}this.$http.get(Storm.admin.apiUrl+"/"+t+"/whmcs-account-info").then(e=>{this.client={id:e.data.id,company:e.data.company,phone:e.data.phone,email:e.data.email}})},getUsersDnsZones(a,t,e){this.currentUserFullName=t,this.currentUserBetaSince=e,this.$http.get(Storm.admin.apiUrl+"/"+a+"/zones").then(s=>{"zones"in s.data&&(this.dnsZones=s.data.zones),this.lookingForDnsZones=!1}).catch(()=>{this.lookingForDnsZones=!1})},getUserOrganisation(a){this.$http.get(Storm.admin.apiUrl+"/organisations",{params:{user_id:a}}).then(t=>{this.organisations=t.data.data,this.lookingForOrganisations=!1}).catch(()=>{this.lookingForOrganisations=!1})},closeUserInfoModal(){this.modalUserInfo=!1,this.lookingForDnsZones=!0,this.dnsZones=[],this.currentUserBetaSince=!1},openDeleteModal(a){this.selectedAdmin=a,this.isModalVisible=!0},closeDeleteModal(){this.selectedAdmin=void 0,this.isModalVisible=!1},deleteAdmin(){this.$http.delete(Storm.admin.apiUrl+"/admins/"+this.selectedAdmin.id).then(a=>{this.users=this.users.filter(t=>t.id!==this.selectedAdmin.id),this.selectedAdmin=void 0,this.isModalVisible=!1,k.$emit("notify",{message:a.data.success,mode:"success",interval:5e3})}).catch(a=>{this.isModalVisible=!1})},onUserVerification(){this.fetch({beta:this.onlyBeta,admin:this.onlyAdmin,unregistered:this.onlyUnregistered,...this.params})}},created(){this.fetch({beta:this.onlyBeta,admin:this.onlyAdmin,unregistered:this.onlyUnregistered,...this.params}),this.$echo.private("admin.users").listen("profile-updated",a=>{const t=find(this.users,{id:a.user.id});t&&(t.first_name=a.user.first_name,t.last_name=a.user.last_name)}).listen("email-address-changed",a=>{const t=find(this.users,{id:a.user.id});t&&(t.email=a.user.email)})}};var Z=function(){var t=this,e=t._self._c;return e("div",[e("panel",{attrs:{"hide-title":"","hide-subtitle":"","hide-info":""}},[e("div",{staticClass:"flex px-6 items-center"},[e("i",{staticClass:"fas fa-search text-platform-icon"}),e("input",{staticClass:"admin-search",attrs:{type:"text",placeholder:"Search",autocomplete:"off","aria-label":"Search Beta Users"},on:{input:t.onInput}}),e("select",{staticClass:"form-select cursor-pointer w-2/5",attrs:{id:"userOptions",name:"userOptions"},on:{change:function(s){return t.onChange(s)}}},[e("option",{attrs:{value:"all"}},[t._v(" All Users ")]),e("option",{attrs:{value:"unregistered"}},[t._v(" Unregistered Users ")]),e("option",{attrs:{value:"beta"}},[t._v(" Beta Users ")]),e("option",{attrs:{value:"admin"}},[t._v(" Admin Users ")]),e("option",{attrs:{value:"without_rbac_memberships"}},[t._v(" Users Without Organisations ")])])]),e("table",{staticClass:"storm-table table-fixed md:table-auto"},[e("thead",[e("tr",[e("th",[t._v(t._s(t._f("trans")("components/
1admin/users.table.name")))]),e("th",[t._v(t._s(t._f("trans")("components/admin/users.table.email")))]),e("th",[t._v(t._s(t._f("trans")("components/admin/users.table.profile_type")))]),e("th",{staticClass:"mobile-none"},[t._v(" "+t._s(t._f("trans")("components/admin/users.table.last-login"))+" ")]),e("th",[t._v("Beta")]),e("th",[t._v("2FA")]),e("th",{staticClass:"mobile-none"})])]),e("tbody",[t._l(t.users,function(s,r){return t.isLoading?t._e():e("tr",{key:r},[e("td",{staticClass:"mobile-only break-all"},[e("inertia-link",{attrs:{href:t.url+"/users/"+s.id+"/impersonate","aria-label":"Impersonate"}},[t._v(" "+t._s(s.first_name)+" "+t._s(s.last_name)+" ")])],1),e("td",{staticClass:"mobile-none"},[t._v(" "+t._s(s.first_name)+" "+t._s(s.last_name)+" "),s.admin?e("sup",{staticClass:"block mt-1 text-labels-success text-xs font-bold"},[t._v("ADMIN")]):t._e()]),e("td",{staticClass:"break-all"},[t._v(" "+t._s(s.email)+" ")]),e("td",{staticClass:"mobile-none"},[t._v(" "+t._s(s.profile_type)+" ")]),e("td",{staticClass:"mobile-none"},[s.last_login?e("timeago",{attrs:{since:s.last_login}}):e("span",[t._v("Never")])],1),e("td",[e("div",{staticClass:"mb-2"},[e("toggle",{attrs:{minimised:"",enabled:s.beta,"disabled-toggle":s.admin},on:{enabled:function(n){return t.toggleBeta(s)},disabled:function(n){return t.toggleBeta(s)}}})],1)]),e("td",{staticClass:"mobile-none"},[e("tooltip",{attrs:{label:t.translate("components/admin/users.tfa.tooltip")}},[s.tfa_enabled?e("i",{staticClass:"table-button ml-0 fas fa-check-circle fa-lg text-labels-success cursor-pointer",on:{click:function(n){return t.getBackupCodes(s)}}}):t._e()])],1),e("td",{staticClass:"mobile-none"},[e("div",{staticClass:"table-buttons"},[s.unregistered?e("button",{staticClass:"table-button tooltip",attrs:{type:"button","aria-label":"Verify User"},on:{click:function(n){t.currentUser=s}}},[e("i",{staticClass:"fas fa-user-check text-platform-icon hover:text-platform-icon-hover"})]):t._e(),s.admin?t._e():e("a",{staticClass:"table-button tooltip outline-none",attrs:{href:t.url+"/users/"+s.id+"/impersonate","aria-label":"Impersonate"}},[e("i",{staticClass:"fa-solid fa-user text-admin"})]),e("a",{staticClass:"table-button tooltip outline-none mobile-none",attrs:{"aria-label":"Account Details"},on:{click:function(n){n.preventDefault(),t.modalUserInfo=!0,t.modalViewingUserId=s.id,t.newWhmcsUserId=s.whmcsID,t.modalViewingUserIsAdmin=s.admin,t.canAdministerZendesk=s.zendesk_admin,t.getUsersDnsZones(s.id,s.first_name+" "+s.last_name,s.beta_created_at),t.getWhmcsAccountInformation(s.id,s.whmcsID),t.getUserOrganisation(s.id)}}},[e("i",{staticClass:"fa-solid fa-circle-info text-platform-icon hover:text-platform-icon-hover"})]),s.admin?e("button",{staticClass:"table-button tooltip",attrs:{type:"button","aria-label":"Remove"},on:{click:function(n){return n.preventDefault(),t.openDeleteModal(s)}}},[e("i",{staticClass:"fas fa-trash text-platform-icon hover:text-platform-icon-hover"})]):t._e()])])])}),t.isLoading?e("tr",[e("td",{attrs:{colspan:"4"}},[t._v(" "+t._s(t._f("trans")("components/admin/users.checking"))+" ")])]):t._e()],2),t.users.length?e("tfoot",[e("tr",[e("td",{attrs:{colspan:"6"}},[e("span",{domProps:{innerHTML:t._s(t.translate("components/admin/users.users.total",{users:t.totalUsers}))}}),e("span",{domProps:{innerHTML:t._s(t.translate("components/admin/users.users.lastmonth",{users:t.recentUsers}))}})])])]):t._e()])]),e("pagination",{attrs:{pages:t.meta.last_page,"current-page":t.params.page},on:{"page-changed":t.onPageChange}}),e("modal",{attrs:{show:t.modalUserInfo,wide:""},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" "+t._s(t.currentUserFullName)+" User Information "),t.currentUserBetaSince?e("span",[t._v("(Beta since "+t._s(t.currentUserBetaSince)+")")]):t._e()]},proxy:!0},{key:"footer",fn:function(){return[e("button",{staticClass:"button-secondary",on:{click:t.closeUserInfoModal}},[t._v(" Close ")])]},proxy:!0}])},[e("h3",[t._v("WHMCS Details")]),e("table",{staticClass:"storm-table mt-4"},[e("thead",[e("tr",[e("th",[t._v("WHMCS ID")]),e("th",[t._v("Platform ID")]),e("th",[t._v("Company")]
1),e("th",[t._v("Email")]),e("th",[t._v("Phone")])])]),e("tbody",[e("tr",[e("td",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.newWhmcsUserId,expression:"newWhmcsUserId"}],staticClass:"bg-platform-panel-color",attrs:{type:"number",min:"1",placeholder:"Enter WHMCS ID"},domProps:{value:t.newWhmcsUserId},on:{input:function(s){s.target.composing||(t.newWhmcsUserId=s.target.value)}}})]),e("td",[t._v(t._s(t.currentStormUserId))]),e("td",[t._v(t._s(t.client.company))]),e("td",[t._v(t._s(t.client.email))]),e("td",[t._v(t._s(t.client.phone))])])])]),e("button",{staticClass:"button mt-4",attrs:{disabled:!t.newWhmcsUserId,type:"button"},on:{click:function(s){return t.setWhmcsAccountId(t.modalViewingUserId,t.newWhmcsUserId)}}},[t._v(" Save WHMCS ID ")]),t.client.id?e("button",{staticClass:"button-secondary mt-4",attrs:{type:"button"},on:{click:function(s){return t.removeWhmcsAccountId(t.modalViewingUserId)}}},[t._v(" Unlink WHMCS profile ")]):t._e(),t.whmcsUserIdError?e("p",{staticClass:"text-labels-warning mt-3"},[t._v(" "+t._s(t.whmcsUserIdError)+" ")]):t._e(),t.modalViewingUserIsAdmin?[e("h3",{staticClass:"mt-10"},[t._v(" Zendesk ")]),e("label",[e("input",{directives:[{name:"model",rawName:"v-model",value:t.canAdministerZendesk,expression:"canAdministerZendesk"}],attrs:{type:"checkbox"},domProps:{checked:Array.isArray(t.canAdministerZendesk)?t._i(t.canAdministerZendesk,null)>-1:t.canAdministerZendesk},on:{change:[function(s){var r=t.canAdministerZendesk,n=s.target,i=!!n.
1checked;if(Array.isArray(r)){var l=null,o=t._i(r,l);n.checked?o<0&&(t.canAdministerZendesk=r.concat([l])):o>-1&&(t.canAdministerZendesk=r.slice(0,o).concat(r.slice(o+1)))}else t.canAdministerZendesk=i},function(s){return t.setCanAdministerZendesk(t.modalViewingUserId,t.canAdministerZendesk)}]}}),t._v(" Can administer Zendesk")])]:t._e(),e("h3",{staticClass:"mt-10"},[t._v(" DNS Zones assigned to "+t._s(t.currentUserFullName)+" ")]),e("table",{staticClass:"storm-table mt-4"},[e("thead",[e("tr",[e("th",[t._v("Name")]),e("th",[t._v("Owner")]),e("th",[t._v("Serial")]),e("th",[t._v("TTL")])])]),e("tbody",[t._l(t.dnsZones,function(s,r){return e("tr",{key:r},[e("td",[t._v(t._s(s.name))]),e("td",[t._v(t._s(s.owner))]),e("td",[t._v(t._s(s.serial))]),e("td",[t._v(t._s(s.ttl))])])}),t.lookingForDnsZones?e("tr",[e("td",{staticClass:"flex"},[e("tiny-loader",{staticClass:"mr-2"}),t._v(" Looking for dns zones... ")],1)]):!t.lookingForDnsZones&&t.dnsZones.length===0?e("tr",[e("td",[t._v("There are no DNS Zones assigned to this user.")])]):t._e()],2)]),e("h3",{staticClass:"mt-10"},[t._v(" Organisations to "+t._s(t.currentUserFullName)+" ")]),e("table",{staticClass:"storm-table mt-4"},[e("thead",[e("tr",[e("th",[t._v(t._s(t._f("trans")("components/admin/organisations.table.header.name")))]),e("th",[t._v(t._s(t._f("trans")("components/admin/organisations.table.header.role")))])])]),e("tbody",[t._l(t.organisations,function(s,r){return e("tr",{key:r},[e("td",[e("inertia-link",{attrs:{href:"/organisations/"+s.id+"/profile","aria-label":"Impersonate"}},[t._v(" "+t._s(s.name)+" ")])],1),e("td",[t._l(s.roles,function(n,i){return[t._v(" "+t._s(n.name)),i<s.roles.length-1?[t._v(" - ")]:t._e()]})],2)])}),t.lookingForOrganisations?e("tr",[e("td",{staticClass:"flex"},[e("tiny-loader",{staticClass:"mr-2"}),t._v(" "+t._s(t._f("trans")("components/admin/organisations.table.checking"))+" ")],1)]):!t.lookingForOrganisations&&t.organisations.length===0?e("tr",[e("td",[t._v(t._s(t._f("trans")("components/admin/organisations.table.none")))])]):t._e()],2)])],2),e("modal",{attrs:{show:t.isModalVisible,mode:"danger"},on:{"close-modal":t.closeDeleteModal},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" Confirm ")]},proxy:!0},{key:"footer",fn:function(){return[e("div",{staticClass:"flex justify-between w-full"},[e("button",{staticClass:"button-secondary",attrs:{type:"button"},on:{click:t.closeDeleteModal}},[t._v(" Cancel ")]),e("button",{staticClass:"button danger",attrs:{type:"submit"},on:{click:function(s){return s.preventDefault(),t.deleteAdmin.apply(null,arguments)}}},[t._v(" Confirm Delete ")])])]},proxy:!0}])},[e("p",{staticClass:"m-0"},[t._v(" Are you sure you wish to remove this admin? ")])]),t.currentUser?e("user-verification",{attrs:{user:t.currentUser},on:{"on-verified":t.onUserVerification,"on-close":function(s){t.currentUser=void 0}}}):t._e(),t.tfa.modal?e("modal",{attrs:{show:t.tfa.modal,"show-cross":""},on:{"close-modal":t.closeTfaBackupCodesModal},scopedSlots:t._u([{key:"title",fn:function(){return[e("span",{domProps:{innerHTML:t._s(t.translate("components/admin/users.tfa.modal.title",{full_name:t.tfa.user.full_name}))}})]},proxy:!0},{key:"footer",fn:function(){return[e("button",{staticClass:"button ml-auto",on:{click:t.closeTfaBackupCodesModal}},[e("span",{domProps:{innerHTML:t._s(t.translate("components/admin/users.tfa.modal.button"))}})])]},proxy:!0}],null,!1,1625671585)},[e("ul",[e("li",[e("copy",{attrs:{value:t.tfa.codes[0]}})],1)])]):t._e()],1)},$=[],E=d(P,Z,$,!1,null,null,null,null);const V=E.exports;const W={name:"Users",components:{AdminLayout:f,AdminUsers:V,Modal:c,Form:m,FormButton:A,FormLabel:x,FormInputText:I,FormRow:U,FormPassword:M},props:{url:{required:!0,type:String}},data(){return{csrf:Storm.csrfToken,modal:{show:!1,mode:"",body:"",confirm:!1},bulkModal:{show:!1,mode:"",body:"",confirm:!1},updated:!1,bulkEmails:"",bulkForm:new m({first_name:"Admin",last_name:"User",email:"",password:"",password_confirmation:""}),form:new m({first_name:"",last_name:"",email:"",password:"",password_confirmation:""})}},methods:{generateRandomPassword(a=12){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+[]{}|;:,.<>?";return Array.from({length:a},()=>t[Math.floor(Math.random()*t.length)]).join("")},openBulkModal(){this.bulkModal.mode="info",this.bulkModal.confirm=!0,this.bulkModal.show=!0},closeBulkModal(){this.bulkModal.show=!1,this.bulkModal.mode="",this.bulkModal.confirm=!1},openModal(){this.modal.mode="info",this.modal.confirm=!0,this.modal.show=!0},closeModal(){this.modal.show=!1,this.modal.mode="",this.modal.confirm=!1}
1,createBulkAdminUsers(){if(!this.bulkEmails){this.bulkForm.errors.set({email:[this.translate("create-admin-user.bulk.errors.required")]});return}if(this.bulkEmails.includes(",")){this.bulkForm.errors.set({email:[this.translate("create-admin-user.bulk.errors.newlines")]});return}const t=this.bulkEmails.split(`
2`).map(e=>e.trim()).filter(e=>e).map(e=>{const s=this.generateRandomPassword();return this.bulkForm.email=e,this.bulkForm.password=s,this.bulkForm.password_confirmation=s,this.bulkForm.submit(Storm.admin.apiUrl+"/admins")});Promise.all(t).then(()=>{this.bulkForm.errors.get("email")||(this.bulkForm.resetFields(),this.closeBulkModal(),u.Inertia.reload())})},createAdminUser(){this.form.submit(Storm.admin.apiUrl+"/admins").then(a=>{this.closeModal(),u.Inertia.reload()})}}};var T=function(){var t=this,e=t._self._c;return e("admin-layout",[e("div",{staticClass:"flex justify-content-end mb-3"},[e("a",{staticClass:"ml-auto button",attrs:{href:t.url},on:{click:function(s){return s.preventDefault(),t.openBulkModal.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-user-plus mr-2"}),t._v(" "+t._s(t._f("trans")("create-admin-user.bulk.button"))+" ")]),e("a",{staticClass:"ml-4 button",attrs:{href:t.url},on:{click:function(s){return s.preventDefault(),t.openModal.apply(null,arguments)}}},[e("i",{staticClass:"fas fa-user-plus mr-2"}),t._v(" "+t._s(t._f("trans")("create-admin-user.button"))+" ")]),e("a",{staticClass:"button ml-4",attrs:{href:"/admin/export-marketing-users"}},[e("i",{staticClass:"fa-solid fa-file-csv mr-2"}),t._v(" "+t._s(t.translate("components/admin/users.download-marketing-users"))+" ")])]),e("modal",{attrs:{"show-cross":"","max-pixels":860,show:t.bulkModal.show,mode:t.bulkModal.mode},on:{"close-modal":t.closeBulkModal},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" "+t._s(t._f("trans")("create-admin-user.bulk.button"))+" ")]},proxy:!0}])},[e("form",{staticClass:"border-0 form section-form",attrs:{method:"POST"},on:{submit:function(s){s.preventDefault(),t.create-t.bulk-t.admin-t.user}}},[e("form-row",[e("form-label"),e("p",{staticClass:"w-full text-labels-warning",domProps:{innerHTML:t._s(t.bulkForm.errors.get("email"))}}
2)],1),e("form-row",[e("form-label",{attrs:{name:"email"}},[t._v(" "+t._s(t._f("trans")("create-admin-user.bulk.email"))+" ")]),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.bulkEmails,expression:"bulkEmails"}],staticClass:"form-textarea fs-hide",class:{"form-textarea--error":t.bulkForm.errors.has("email")},attrs:{id:"emails",name:"emails",spellcheck:"false"},domProps:{value:t.bulkEmails},on:{input:function(s){s.target.composing||(t.bulkEmails=s.target.value)}}})],1),e("form-row",[e("form-button",{attrs:{type:"submit",right:!0},on:{click:t.createBulkAdminUsers}},[t._v(" "+t._s(t._f("trans")("create-admin-user.bulk.button"))+" ")])],1)],1)]),e("modal",{attrs:{"show-cross":"","max-pixels":860,show:t.modal.show,mode:t.modal.mode},on:{"close-modal":t.closeModal},scopedSlots:t._u([{key:"title",fn:function(){return[t._v(" "+t._s(t._f("trans")("create-admin-user.button"))+" ")]},proxy:!0}])},[e("form",{staticClass:"border-0 form section-form",attrs:{method:"POST"},on:{submit:function(s){s.preventDefault(),t.create-t.admin-t.user}}},[e("form-row",[e("form-label",{attrs:{name:"first-name",required:""}},[t._v(" "+t._s(t._f("trans")("create-admin-user.firstname"))+" ")]),e("form-input-text",{attrs:{id:"first-name",error:t.form.errors.get("firstName"),type:"text",name:"first_name"},model:{value:t.form.first_name,callback:function(s){t.$set(t.form,"first_name",s)},expression:"form.first_name"}})],1),e("form-row",[e("form-label",{attrs:{name:"last-name"}},[t._v(" "+t._s(t._f("trans")("create-admin-user.lastname"))+" ")]),e("form-input-text",{attrs:{id:"last-name",error:t.form.errors.get("lastName"),type:"text",name:"last_name"},model:{value:t.form.last_name,callback:function(s){t.$set(t.form,"last_name",s)},expression:"form.last_name"}})],1),e("form-row",[e("form-label",{attrs:{name:"email"}},[t._v(" "+t._s(t._f("trans")("create-admin-user.email"))+" ")]),e("form-input-text",{attrs:{id:"email",error:t.form.errors.get("email"),type:"email",name:"email"},model:{value:t.form.email,callback:function(s){t.$set(t.form,"email",s)},expression:"form.email"}})],1),e("form-row",[e("form-label",{attrs:{name:"password"}},[t._v(" "+t._s(t._f("trans")("create-admin-user.password"))+" ")]),e("form-password",{attrs:{id:"password",error:t.form.errors.get("password"),type:"password",name:"password"},model:{value:t.form.password,callback:function(s){t.$set(t.form,"password",s)},expression:"form.password"}})],1),e("form-row",[e("form-label",{attrs:{name:"password-confirmation"}},[t._v(" "+t._s(t._f("trans")("create-admin-user.passwordconfirmation"))+" ")]),e("form-password",{attrs:{id:"password_confirmation",error:t.form.errors.get("password"),type:"password",name:"password_confirmation"},model:{value:t.form.password_confirmation,callback:function(s){t.$set(t.form,"password_confirmation",s)},expression:"form.password_confirmation"}})],1),e("form-row",[e("form-button",{attrs:{type:"submit",right:!0},on:{click:t.createAdminUser}},[t._v(" "+t._s(t._f("trans")("create-admin-user.button"))+" ")])],1)],1)]),e("admin-users")],1)},L=[],O=d(W,T,L,!1,null,"b4a7cf83",null,null);const pt=O.exports;export{pt 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.