2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
import{C as v,u as w,P as N,a8 as O,af as F,o as L,d as U,w as u,M as C,f as r,h as I,i as a,j as l,a4 as S,m,t as V,ak as W,e as $,al as B,$ as E}from"./app-dvJP63FL.js";import{t as M}from"./tabs-BVx9tg1F.js";import{u as P}from"./appSettingsUpdater-D1Bq_3WB.js";const j={class:"title is-4"},A={class:"title is-4 pt-4"},z={__name:"Auth",setup(T){const R=v(),{t:f}=w(),y=C("2fauth"),p=E(),s=N(),_=O(y.prefix+"returnTo","accounts"),d=$({restrictList:null,restrictRule:null});async function b(o,e){d.value[o]=null,e==""?B.delete(o,{returnError:!0}).then(i=>{s[o]="",p.success({type:"is-success",text:f("notification.setting_saved")})}).catch(i=>{i.response.status!==404&&R.show(i)}):n(o,e)}async function n(o,e){const{error:i}=await P(o,e,!0);i!=null&&Object.prototype.hasOwnProperty.call(d.value,o)?d.value[o]=i.response.data.message:p.success({text:f("notification.setting_saved")})}return F(o=>{o.name.startsWith("admin.")||p.clear()}),L(async()=>{await s.fetch()}),(o,e)=>{const i=r("FormCheckbox"),g=r("FormField"),c=r("FormWrapper"),h=r("NavigationButton"),D=r("VueFooter"),k=r("StackLayout");return I(),U(k,null,{header:u(()=>[a(l(W),{tabs:l(M),"active-tab":"admin.auth",onTabSelected:e[0]||(e[0]=t=>("router"in o?o.router:l(S)).push({name:t}))},null,8,["tabs"])]),content:u(()=>[a(c,null,{default:u(()=>[m("form",null,[m("h4",j,V(o.$t("heading.single_sign_on")),1),a(i,{modelValue:l(s).enableSso,"onUpdate:modelValue":[e[1]||(e[1]=t=>l(s).enableSso=t),e[2]||(e[2]=t=>n("enableSso",t))],fieldName:"enableSso",label:"field.enable_sso",help:"field.enable_sso.help"},null,8,["modelValue"]),a(i,{modelValue:l(s).useSsoOnly,"onUpdate:modelValue":[e[3]||(e[3]=t=>l(s).useSsoOnly=t),e[4]||(e[4]=t=>n("useSsoOnly",t))],fieldName:"useSsoOnly",label:"field.use_sso_only",help:"field.use_sso_only.help",isDisabled:!l(s).enableSso,isIndented:!0},null,8,["modelValue","isDisabled"]),a(i,{modelValue:l(s).allowPatWhileSsoOnly,"onUpdate:modelValue":[e[5]||(e[5]=t=>l(s).allowPatWhileSsoOnly=t),e[6]||(e[6]=t=>n("allowPatWhileSsoOnly",t))],fieldName:"allowPatWhileSsoOnly",label:"field.allow_pat_in_sso_only",help:"field.allow_pat_in_sso_only.help",isDisabled:!l(s).useSsoOnly,isIndented:!0},null,8,["modelValue","isDisabled"]),m("h4",A,V(o.$t("heading.registrations")),1),a(i,{modelValue:l(s).restrictRegistration,"onUpdate:modelValue":[e[7]||(e[7]=t=>l(s).restrictRegistration=t),e[8]||(e[8]=t=>n("restrictRegistration",t))],fieldName:"restrictRegistration",isDisabled:l(s).disableRegistration,label:"field.restrict_registration",help:"field.restrict_registration.help"},null,8,["modelValue","isDisabled"]),a(g,{modelValue:l(s).restrictList,"onUpdate:modelValue":e[9]||(e[9]=t=>l(s).restrictList=t),"onChange:modelValue":e[10]||(e[10]=t=>b("restrictList",t)),errorMessage:l(d).restrictList,fieldName:"restrictList",isDisabled:!l(s).restrictRegistration||l(s).disableRegistration,label:"field.restrict_list",help:"field.restrict_list.help",isIndented:!0},null,8,["modelValue","errorMessage","isDisabled"]),a(g,{modelValue:l(s).restrictRule,"onUpdate:modelValue":e[11]||(e[11]=t=>l(s).restrictRule=t),"onChange:modelValue":e[12]||(e[12]=t=>b("restrictRule",t)),errorMessage:l(d).restrictRule,fieldName:"restrictRule",isDisabled:!l(s).restrictRegistration||l(s).disableRegistration,label:"field.restrict_rule",help:"field.restrict_rule.help",isIndented:!0,leftIcon:"Slash",rightIcon:"Slash"},null,8,["modelValue","errorMessage","isDisabled"]),a(i,{modelValue:l(s).disableRegistration,"onUpdate:modelValue":[e[13]||(e[13]=t=>l(s).disableRegistration=t),e[14]||(e[14]=t=>n("disableRegistration",t))],fieldName:"disableRegistration",label:"field.disable_registration",help:"field.disable_registration.help"},null,8,["modelValue"]),a(i,{modelValue:l(s).keepSsoRegistrationEnabled,"onUpdate:modelValue":[e[15]||(e[15]=t=>l(s).keepSsoRegistrationEnabled=t),e[16]||(e[16]=t=>n("keepSsoRegistrationEnabled",t))],fieldName:"keepSsoRegistrationEnabled",isDisabled:!l(s).enableSso||!l(s).disableRegistration,label:"field.keep_sso_registration_enabled",help:"field.keep_sso_registration_enabled.help",isIndented:!0},null,8,["modelValue","isDisabled"])])]),_:1})]),footer:u(()=>[a(D,null,{default:u(()=>[a(h,{action:"close",onClosed:e[17]||(e[17]=t=>("router"in o?o.router:l(S)).push({name:l(_)})),"current-page-title":o.$t("title.admin.auth")},null,8,["current-page-title"])]),_:1})]),_:1})}}};export{z as default};
|