/home/ivoiecob/email.hirewise-va.com/adminpanel/js/5738.66f3d15c.js
"use strict";(globalThis["webpackChunkadmin_panel_vue_webclient"]=globalThis["webpackChunkadmin_panel_vue_webclient"]||[]).push([[5738],{15738:(e,t,l)=>{l.r(t),l.d(t,{default:()=>W});var s=l(61758);const i={class:"q-pa-lg"},n={class:"row q-mb-md"},a={class:"col text-h5"},o={class:"row"},r={class:"col-8"},d=["innerHTML"],p={key:0,class:"row q-mt-md"},u={class:"col-8"};function I(e,t,l,I,A,L){const c=(0,s.g2)("q-item-label"),h=(0,s.g2)("q-btn"),m=(0,s.g2)("q-card-section"),g=(0,s.g2)("q-card"),_=(0,s.g2)("q-card-actions"),b=(0,s.g2)("q-dialog"),S=(0,s.g2)("q-linear-progress"),w=(0,s.g2)("q-inner-loading"),E=(0,s.g2)("q-scroll-area"),T=(0,s.gN)("t");return(0,s.uX)(),(0,s.Wv)(E,{class:"full-height full-width"},{default:(0,s.k6)((()=>[(0,s.Lk)("div",i,[(0,s.Lk)("div",n,[(0,s.bo)((0,s.Lk)("div",a,null,512),[[T,"IPALLOWLIST.HEADING_IP_ALLOWLIST"]])]),(0,s.bF)(g,{flat:"",bordered:"",class:"card-edit-settings q-mt-lg"},{default:(0,s.k6)((()=>[(0,s.bF)(m,null,{default:(0,s.k6)((()=>[(0,s.Lk)("div",o,[(0,s.Lk)("div",r,[(0,s.bF)(c,{caption:""},{default:(0,s.k6)((()=>[(0,s.Lk)("div",{innerHTML:L.inscriptionIpAllowlist},null,8,d)])),_:1})])]),A.ipAllowlistEnabled?((0,s.uX)(),(0,s.CE)("div",p,[(0,s.Lk)("div",u,[(0,s.bF)(h,{unelevated:"","no-caps":"","no-wrap":"",dense:"",class:"q-px-xs",ripple:!1,color:"primary",label:e.$t("IPALLOWLIST.ACTION_DISABLE_IP_ALLOWLIST"),onClick:t[0]||(t[0]=e=>A.confirmIpAllowlist=!0)},null,8,["label"])])])):(0,s.Q3)("",!0)])),_:1})])),_:1})]),(0,s.bF)(b,{modelValue:A.confirmIpAllowlist,"onUpdate:modelValue":t[2]||(t[2]=e=>A.confirmIpAllowlist=e),persistent:""},{default:(0,s.k6)((()=>[(0,s.bF)(g,{style:{"min-width":"300px"}},{default:(0,s.k6)((()=>[(0,s.bF)(m,null,{default:(0,s.k6)((()=>[(0,s.bo)((0,s.Lk)("span",null,null,512),[[T,"COREWEBCLIENT.CONFIRM_DISCARD_CHANGES"]])])),_:1}),(0,s.bF)(_,{align:"right"},{default:(0,s.k6)((()=>[(0,s.bF)(h,{unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"primary",onClick:L.disableIpAllowlist,label:e.$t("IPALLOWLIST.ACTION_DISABLE_IP_ALLOWLIST")},null,8,["onClick","label"]),(0,s.bF)(h,{unelevated:"","no-caps":"",dense:"",class:"q-px-sm",ripple:!1,color:"primary",label:e.$t("COREWEBCLIENT.ACTION_CANCEL"),onClick:t[1]||(t[1]=e=>A.confirmIpAllowlist=!1)},null,8,["label"])])),_:1})])),_:1})])),_:1},8,["modelValue"]),(0,s.bF)(w,{style:{"justify-content":"flex-start"},showing:A.loading||A.saving},{default:(0,s.k6)((()=>[(0,s.bF)(S,{query:""})])),_:1},8,["showing"])])),_:1})}var A=l(35118),L=l(43436),c=l.n(L),h=l(64595),m=l(79134),g=l(38176),_=l(36720);const b={name:"IpAllowListAdminSettingsPerUser",data(){return{user:null,loading:!1,saving:!1,ipAllowlistEnabled:!1,confirmIpAllowlist:!1}},computed:{inscriptionIpAllowlist(){return this.ipAllowlistEnabled?this.$t("IPALLOWLIST.INFO_IP_ALLOWLIST_ENABLED_FOR_USER",{USER:this.user?.publicId}):this.$t("IPALLOWLIST.INFO_IP_ALLOWLIST_DISABLED_FOR_USER",{USER:this.user?.publicId})}},watch:{$route(e,t){this.parseRoute()}},mounted(){this.parseRoute()},methods:{parseRoute(){const e=A.A.pPositiveInt(this.$route?.params?.id);this.user?.id!==e&&(this.user={id:e},this.populate())},populate(){this.loading=!0;const e=this.$store.getters["tenants/getCurrentTenantId"];h.A.getUser(e,this.user.id).then((({user:e,userId:t})=>{t===this.user.id&&(this.loading=!1,e&&c().isFunction(e?.getData)?(this.user=e,this.getUserSettings()):this.$emit("no-user-found"))}))},disableIpAllowlist(){const e={UserId:this.user.id,TenantId:this.user.tenantId};m.A.sendRequest({moduleName:"IPAllowList",methodName:"DisableUserIpAllowlist",parameters:e}).then((e=>{this.confirmIpAllowlist=!1,e?(this.populate(),g.A.showReport(this.$t("IPALLOWLIST.REPORT_DISABLE_USER_IP_ALLOWLIST",{USER:this.user.publicId}))):g.A.showError(this.$t("IPALLOWLIST.ERROR_DISABLE_USER_IP_ALLOWLIST",{USER:this.user.publicId}))}),(e=>{this.confirmIpAllowlist=!1,g.A.showError(_.A.getTextFromResponse(e,this.$t("IPALLOWLIST.ERROR_DISABLE_USER_IP_ALLOWLIST",{USER:this.user.publicId})))}))},getUserSettings(){this.loading=!0;const e={UserId:this.user.id,TenantId:this.user.tenantId};m.A.sendRequest({moduleName:"IPAllowList",methodName:"GetUserSettings",parameters:e}).then((e=>{this.loading=!1,e&&(this.ipAllowlistEnabled=e?.IpAllowlistEnabled)}),(e=>{this.loading=!1,g.A.showError(_.A.getTextFromResponse(e))}))}}};var S=l(12807),w=l(48958),E=l(23316),T=l(44189),R=l(13796),O=l(56384),k=l(20558),f=l(62669),C=l(39035),P=l(35859),v=l(98582),U=l.n(v);const q=(0,S.A)(b,[["render",I]]),F=q;U()(b,"components",{QScrollArea:w.A,QCard:E.A,QCardSection:T.A,QItemLabel:R.A,QBtn:O.A,QDialog:k.A,QCardActions:f.A,QInnerLoading:C.A,QLinearProgress:P.A});var N=l(55246);const W={moduleName:"IPAllowList",requiredModules:[],getAdminUserTabs(){const e=N.A.getters["user/isUserSuperAdmin"];return e?[{tabName:"ip-allowlist",tabTitle:"IPALLOWLIST.LABEL_SETTINGS_TAB",tabRouteChildren:[{path:"id/:id/ip-allowlist",component:F},{path:"search/:search/id/:id/ip-allowlist",component:F},{path:"page/:page/id/:id/ip-allowlist",component:F},{path:"search/:search/page/:page/id/:id/ip-allowlist",component:F}]}]:[]}}}}]);