| 1 |
- import{cQ as Z,fL as x,gs as n,fr as ee,fV as s,fW as O,ft as p,cs as y,cw as t,g$ as i,h0 as F,cv as S,gx as _,cp as b,gN as E,e as le,O as ae,B as oe,fM as U,y as G,cq as R,dd as ve,fI as _e,fD as he,k as we,F as X,fS as Y,x as re,cr as Q,ch as be,ac as ue,gV as fe,a6 as pe,h2 as ye,c9 as se,b as ne,dS as Ve,E as me,gT as $e,fX as ke}from"./builder-DygomDiV.js";import{a as L}from"./auth-setting-DOvV3QQS.js";import{e as Ue,d as Ae,c as Pe,b as Ee,a as Se,_ as Ie}from"./logo_wechat-CQWIwUnm.js";const Ce={class:"authentication-setting__main main-calc-height"},Re={class:"form-container p-24"},Me={class:"mr-12"},qe=Z({__name:"LDAP",setup(T){const e=U({id:"",auth_type:"LDAP",config:{ldap_server:"",base_dn:"",password:"",ou:"",ldap_filter:"",ldap_mapping:""},is_active:!0}),k=U(),m=U(!1),$=x({"config.ldap_server":[{required:!0,message:n("views.system.authentication.ldap.serverPlaceholder"),trigger:"blur"}],"config.base_dn":[{required:!0,message:n("views.system.authentication.ldap.bindDNPlaceholder"),trigger:"blur"}],"config.password":[{required:!0,message:n("views.login.loginForm.password.placeholder"),trigger:"blur"}],"config.ou":[{required:!0,message:n("views.system.authentication.ldap.ouPlaceholder"),trigger:"blur"}],"config.ldap_filter":[{required:!0,message:n("views.system.authentication.ldap.ldap_filterPlaceholder"),trigger:"blur"}],"config.ldap_mapping":[{required:!0,message:n("views.system.authentication.ldap.ldap_mappingPlaceholder"),trigger:"blur"}]}),u=async(l,o)=>{l&&await l.validate((c,d)=>{c&&(o?L.postAuthSetting(e.value,m).then(w=>{G(n("views.system.testSuccess"))}):L.putAuthSetting(e.value.auth_type,e.value,m).then(w=>{G(n("common.saveSuccess"))}))})};function g(){L.getAuthSetting(e.value.auth_type,m).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(e.value=l.data,l.data.config.ldap_mapping&&(e.value.config.ldap_mapping=JSON.stringify(JSON.parse(l.data.config.ldap_mapping))))})}return ee(()=>{g()}),(l,o)=>{const c=s("el-input"),d=s("el-form-item"),w=s("el-checkbox"),I=s("el-form"),M=s("el-button"),f=s("el-scrollbar"),V=O("hasPermission"),A=O("loading");return p(),y("div",Ce,[t(f,null,{default:i(()=>[F((p(),y("div",Re,[t(I,{ref_key:"authFormRef",ref:k,rules:$,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:i(()=>[t(d,{label:l.$t("views.system.authentication.ldap.address"),prop:"config.ldap_server"},{default:i(()=>[t(c,{modelValue:e.value.config.ldap_server,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.config.ldap_server=a),placeholder:l.$t("views.system.authentication.ldap.serverPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.ldap.bindDN"),prop:"config.base_dn"},{default:i(()=>[t(c,{modelValue:e.value.config.base_dn,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.config.base_dn=a),placeholder:l.$t("views.system.authentication.ldap.bindDNPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.password"),prop:"config.password"},{default:i(()=>[t(c,{modelValue:e.value.config.password,"onUpdate:modelValue":o[2]||(o[2]=a=>e.value.config.password=a),placeholder:l.$t("views.login.loginForm.password.placeholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.ldap.ou"),prop:"config.ou"},{default:i(()=>[t(c,{modelValue:e.value.config.ou,"onUpdate:modelValue":o[3]||(o[3]=a=>e.value.config.ou=a),placeholder:l.$t("views.system.authentication.ldap.ouPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.ldap.ldap_filter"),prop:"config.ldap_filter"},{default:i(()=>[t(c,{modelValue:e.value.config.ldap_filter,"onUpdate:modelValue":o[4]||(o[4]=a=>e.value.config.ldap_filter=a),placeholder:l.$t("views.system.authentication.ldap.ldap_filterPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.ldap.ldap_mapping"),prop:"config.ldap_mapping"},{default:i(()=>[t(c,{modelValue:e.value.config.ldap_mapping,"onUpdate:modelValue":o[5]||(o[5]=a=>e.value.config.ldap_mapping=a),placeholder:'{"name":"name","email":"mail","username":"cn"}'},null,8,["modelValue"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.is_active,"onUpdate:modelValue":o[6]||(o[6]=a=>e.value.is_active=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.ldap.enableAuthentication")),1)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"]),b("div",null,[F((p(),y("span",Me,[t(M,{onClick:o[7]||(o[7]=a=>u(k.value)),type:"primary",disabled:m.value},{default:i(()=>[S(_(l.$t("common.save")),1)]),_:1},8,["disabled"])])),[[V,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]]),b("span",null,[t(M,{onClick:o[8]||(o[8]=a=>u(k.value,"test")),disabled:m.value},{default:i(()=>[S(_(l.$t("views.system.test")),1)]),_:1},8,["disabled"])])])])),[[A,m.value]])]),_:1})])}}}),Te={class:"authentication-setting__main main-calc-height"},Ne={class:"form-container p-24"},De=Z({__name:"CAS",setup(T){const e=U({id:"",auth_type:"CAS",config:{ldpUri:"",validateUrl:"",redirectUrl:""},is_active:!0}),k=U(),m=U(!1),$=x({"config.ldpUri":[{required:!0,message:n("views.system.authentication.cas.ldpUriPlaceholder"),trigger:"blur"}],"config.validateUrl":[{required:!0,message:n("views.system.authentication.cas.validateUrlPlaceholder"),trigger:"blur"}],"config.redirectUrl":[{required:!0,message:n("views.system.authentication.cas.redirectUrlPlaceholder"),trigger:"blur"}]}),u=async l=>{l&&await l.validate((o,c)=>{o&&L.putAuthSetting(e.value.auth_type,e.value,m).then(d=>{G(n("common.saveSuccess"))})})};function g(){L.getAuthSetting(e.value.auth_type,m).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(l.data.config.validateUrl||(l.data.config.validateUrl=l.data.config.ldpUri),e.value=l.data),e.value.config.redirectUrl||(e.value.config.redirectUrl=window.location.origin+window.MaxKB.prefix+"/api/cas")})}return ee(()=>{g()}),(l,o)=>{const c=s("el-input"),d=s("el-form-item"),w=s("el-checkbox"),I=s("el-form"),M=s("el-button"),f=s("el-scrollbar"),V=O("hasPermission"),A=O("loading");return p(),y("div",Te,[t(f,null,{default:i(()=>[F((p(),y("div",Ne,[t(I,{ref_key:"authFormRef",ref:k,rules:$,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:i(()=>[t(d,{label:l.$t("views.system.authentication.cas.ldpUri"),prop:"config.ldpUri"},{default:i(()=>[t(c,{modelValue:e.value.config.ldpUri,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.config.ldpUri=a),placeholder:l.$t("views.system.authentication.cas.ldpUriPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.cas.validateUrl"),prop:"config.validateUrl"},{default:i(()=>[t(c,{modelValue:e.value.config.validateUrl,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.config.validateUrl=a),placeholder:l.$t("views.system.authentication.cas.validateUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.cas.redirectUrl"),prop:"config.redirectUrl"},{default:i(()=>[t(c,{modelValue:e.value.config.redirectUrl,"onUpdate:modelValue":o[2]||(o[2]=a=>e.value.config.redirectUrl=a),placeholder:l.$t("views.system.authentication.cas.redirectUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.is_active,"onUpdate:modelValue":o[3]||(o[3]=a=>e.value.is_active=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.cas.enableAuthentication")),1)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"]),b("div",null,[F((p(),R(M,{onClick:o[4]||(o[4]=a=>u(k.value)),type:"primary",disabled:m.value},{default:i(()=>[S(_(l.$t("common.save")),1)]),_:1},8,["disabled"])),[[V,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]])])])),[[A,m.value]])]),_:1})])}}}),Oe={class:"authentication-setting__main main-calc-height"},Fe={class:"form-container p-24"},Le=Z({__name:"OIDC",setup(T){const e=U({id:"",auth_type:"OIDC",config:{authEndpoint:"",tokenEndpoint:"",userInfoEndpoint:"",scope:"",state:"",clientId:"",clientSecret:"",fieldMapping:'{"username": "preferred_username", "email": "email"}',redirectUrl:""},is_active:!0}),k=U(),m=U(!1),$=x({"config.authEndpoint":[{required:!0,message:n("views.system.authentication.oidc.authEndpointPlaceholder"),trigger:"blur"}],"config.tokenEndpoint":[{required:!0,message:n("views.system.authentication.oidc.tokenEndpointPlaceholder"),trigger:"blur"}],"config.userInfoEndpoint":[{required:!0,message:n("views.system.authentication.oidc.userInfoEndpointPlaceholder"),trigger:"blur"}],"config.scope":[{required:!0,message:n("views.system.authentication.oidc.scopePlaceholder"),trigger:"blur"}],"config.clientId":[{required:!0,message:n("views.system.authentication.oidc.clientIdPlaceholder"),trigger:"blur"}],"config.clientSecret":[{required:!0,message:n("views.system.authentication.oidc.clientSecretPlaceholder"),trigger:"blur"}],"config.fieldMapping":[{required:!0,message:n("views.system.authentication.oauth2.filedMappingPlaceholder"),trigger:"blur"}],"config.redirectUrl":[{required:!0,message:n("views.system.authentication.oidc.redirectUrlPlaceholder"),trigger:"blur"}],"config.logoutEndpoint":[{required:!0,message:n("views.system.authentication.oidc.logoutEndpointPlaceholder"),trigger:"blur"}]}),u=async(l,o)=>{l&&await l.validate((c,d)=>{c&&L.putAuthSetting(e.value.auth_type,e.value,m).then(w=>{G(n("common.saveSuccess"))})})};function g(){L.getAuthSetting(e.value.auth_type,m).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(e.value=l.data,(e.value.config.fieldMapping===""||e.value.config.fieldMapping===void 0)&&(e.value.config.fieldMapping='{"username": "preferred_username", "email": "email"}')),e.value.config.redirectUrl||(e.value.config.redirectUrl=window.location.origin+window.MaxKB.prefix+"/api/oidc")})}return ee(()=>{g()}),(l,o)=>{const c=s("el-input"),d=s("el-form-item"),w=s("el-checkbox"),I=s("el-form"),M=s("el-button"),f=s("el-scrollbar"),V=O("hasPermission"),A=O("loading");return p(),y("div",Oe,[t(f,null,{default:i(()=>[F((p(),y("div",Fe,[t(I,{ref_key:"authFormRef",ref:k,rules:$,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:i(()=>[t(d,{label:l.$t("views.system.authentication.oidc.authEndpoint"),prop:"config.authEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.authEndpoint,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.config.authEndpoint=a),placeholder:l.$t("views.system.authentication.oidc.authEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oidc.tokenEndpoint"),prop:"config.tokenEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.tokenEndpoint,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.config.tokenEndpoint=a),placeholder:l.$t("views.system.authentication.oidc.tokenEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oidc.userInfoEndpoint"),prop:"config.userInfoEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.userInfoEndpoint,"onUpdate:modelValue":o[2]||(o[2]=a=>e.value.config.userInfoEndpoint=a),placeholder:l.$t("views.system.authentication.oidc.userInfoEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:"Scope",prop:"config.scope"},{default:i(()=>[t(c,{modelValue:e.value.config.scope,"onUpdate:modelValue":o[3]||(o[3]=a=>e.value.config.scope=a),placeholder:"openid+profile+email "},null,8,["modelValue"])]),_:1}),t(d,{label:"State",prop:"config.state"},{default:i(()=>[t(c,{modelValue:e.value.config.state,"onUpdate:modelValue":o[4]||(o[4]=a=>e.value.config.state=a),placeholder:""},null,8,["modelValue"])]),_:1}),t(d,{label:l.$t("views.system.authentication.oidc.clientId"),prop:"config.clientId"},{default:i(()=>[t(c,{modelValue:e.value.config.clientId,"onUpdate:modelValue":o[5]||(o[5]=a=>e.value.config.clientId=a),placeholder:l.$t("views.system.authentication.oidc.clientIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oidc.clientSecret"),prop:"config.clientSecret"},{default:i(()=>[t(c,{modelValue:e.value.config.clientSecret,"onUpdate:modelValue":o[6]||(o[6]=a=>e.value.config.clientSecret=a),placeholder:l.$t("views.system.authentication.oidc.clientSecretPlaceholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.filedMapping"),prop:"config.fieldMapping"},{default:i(()=>[t(c,{modelValue:e.value.config.fieldMapping,"onUpdate:modelValue":o[7]||(o[7]=a=>e.value.config.fieldMapping=a),placeholder:l.$t("views.system.authentication.oauth2.filedMappingPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oidc.redirectUrl"),prop:"config.redirectUrl"},{default:i(()=>[t(c,{modelValue:e.value.config.redirectUrl,"onUpdate:modelValue":o[8]||(o[8]=a=>e.value.config.redirectUrl=a),placeholder:l.$t("views.system.authentication.oidc.redirectUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.is_active,"onUpdate:modelValue":o[9]||(o[9]=a=>e.value.is_active=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.oidc.enableAuthentication")),1)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"]),b("div",null,[F((p(),R(M,{onClick:o[10]||(o[10]=a=>u(k.value)),type:"primary",disabled:m.value},{default:i(()=>[S(_(l.$t("common.save")),1)]),_:1},8,["disabled"])),[[V,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]])])])),[[A,m.value]])]),_:1})])}}}),de="/platform",ze=T=>ve(`${de}/source`,void 0,T),Qe=(T,e)=>he(`${de}/source`,T,void 0,e),Ke=(T,e)=>_e(`${de}/source`,T,void 0,e),ie={getPlatformInfo:ze,updateConfig:Qe,validateConnection:Ke},Be={class:"flex align-center",style:{"margin-left":"-8px"}},Ge={class:"dialog-footer"},He=Z({__name:"EditModal",emits:["refresh"],setup(T,{expose:e,emit:k}){const m=U(!1),$=U(!1),u=U(),g=x({key:"",logoSrc:"",name:"",isActive:!1,isValid:!1,config:{}}),l=a=>({corp_id:"Corp ID",app_key:g?.key!="lark"?"APP Key":"App ID",app_secret:"APP Secret",agent_id:"Agent ID",callback_url:n("views.application.applicationAccess.callback")})[a]||(a?a.charAt(0).toUpperCase()+a.slice(1):""),o=a=>{switch(a){case"app_key":return[{required:!0,message:n("views.system.authentication.scanTheQRCode.appKeyPlaceholder"),trigger:["blur","change"]}];case"app_secret":return[{required:!0,message:n("views.system.authentication.scanTheQRCode.appSecretPlaceholder"),trigger:["blur","change"]}];case"corp_id":return[{required:!0,message:n("views.system.authentication.scanTheQRCode.corpIdPlaceholder"),trigger:["blur","change"]}];case"agent_id":return[{required:!0,message:n("views.system.authentication.scanTheQRCode.agentIdPlaceholder"),trigger:["blur","change"]}];case"callback_url":return[{required:!0,message:n("views.application.applicationAccess.callbackTip"),trigger:["blur","change"]},{pattern:/^https?:\/\/.+/,message:n("views.system.authentication.scanTheQRCode.callbackWarning"),trigger:["blur","change"]}];default:return[]}};e({open:async a=>{m.value=!0,$.value=!0,Object.assign(g,a);const r=window.location.origin+window.MaxKB.prefix;switch(a.key){case"wecom":g.config.app_key&&(g.config.agent_id=g.config.app_key,delete g.config.app_key),g.config.callback_url=`${r}/api/wecom`;break;case"dingtalk":g.config.agent_id&&(g.config.corp_id=g.config.agent_id,delete g.config.agent_id),g.config={corp_id:g.config.corp_id,app_key:g.config.app_key,app_secret:g.config.app_secret,callback_url:r},g.config.callback_url=`${r}/api/dingtalk`;break;case"lark":g.config.callback_url=`${r}/api/lark`;break}u.value?.clearValidate()}});const d=()=>{u.value?.validate(a=>{a?A():re(n("views.system.authentication.scanTheQRCode.validateFailedTip"))})},w=()=>{m.value=!1,u.value?.clearValidate(),V("refresh")};function I(){ie.validateConnection(g,$).then(a=>{a.data?G(n("views.system.authentication.scanTheQRCode.validateSuccess")):re(n("views.system.authentication.scanTheQRCode.validateFailed"))})}const M=new Set(["app_secret","client_secret","secret"]),f=a=>M.has(a),V=k;function A(){ie.updateConfig(g,$).then(a=>{G(n("common.saveSuccess")),V("refresh"),m.value=!1,u.value?.clearValidate()})}return(a,r)=>{const v=s("el-input"),H=s("el-form-item"),J=s("el-button"),z=s("el-drawer");return p(),R(z,{modelValue:m.value,"onUpdate:modelValue":r[0]||(r[0]=W=>m.value=W),size:"60%","append-to-body":!0,"destroy-on-close":!0,onClose:w},{header:i(()=>[b("div",Be,[b("h4",null,_(g.name+a.$t("views.system.authentication.scanTheQRCode.setting")),1)])]),footer:i(()=>[b("span",Ge,[t(J,{onClick:w},{default:i(()=>[S(_(a.$t("common.cancel")),1)]),_:1}),t(J,{onClick:I},{default:i(()=>[S(_(a.$t("views.system.authentication.scanTheQRCode.validate")),1)]),_:1}),t(J,{type:"primary",onClick:d},{default:i(()=>[S(_(a.$t("common.save")),1)]),_:1})])]),default:i(()=>[t(E(we),{model:g.config,"label-width":"120px","label-position":"top","require-asterisk-position":"right",ref_key:"formRef",ref:u},{default:i(()=>[(p(!0),y(X,null,Y(g.config,(W,N)=>(p(),R(H,{key:N,label:l(N),prop:N,rules:o(N)},{default:i(()=>[t(v,{modelValue:g.config[N],"onUpdate:modelValue":K=>g.config[N]=K,type:f(N)?"password":"text","show-password":f(N)},null,8,["modelValue","onUpdate:modelValue","type","show-password"])]),_:2},1032,["label","prop","rules"]))),128))]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),Je={class:"scan-height"},We={class:"flex-between"},je={class:"flex align-center"},Xe=["src"],Ye={class:"ml-8"},Ze={key:1},xe={class:"mr-4"},et={key:0,class:"border-t mt-16"},tt={class:"mt-4 mb-16 flex align-center"},lt={key:0,class:"vertical-middle lighter break-all ellipsis-1"},at={key:1,class:"vertical-middle lighter break-all ellipsis-1"},ot={key:2,class:"vertical-middle lighter break-all ellipsis-1"},it={class:"ml-4"},nt=Z({__name:"SCAN",setup(T){const e=U(),k=U(!1),m=x(u()),$=x({});ee(()=>{o()});function u(){return[g("wecom",n("views.system.authentication.scanTheQRCode.wecom")),g("dingtalk",n("views.system.authentication.scanTheQRCode.dingtalk")),g("lark",n("views.system.authentication.scanTheQRCode.lark"))]}function g(f,V){let A="";switch(f){case"wecom":A="wechat-work";break;case"dingtalk":A="dingtalk";break;case"lark":A="lark";break;default:A="";break}const a={...f==="wecom"?{corp_id:"",agent_id:""}:{app_key:""},app_secret:"",callback_url:""};return{key:f,logoSrc:new URL(Object.assign({"../../../../assets/logo/logo_dingtalk.svg":Ie,"../../../../assets/logo/logo_lark.svg":Se,"../../../../assets/logo/logo_slack.svg":Ee,"../../../../assets/logo/logo_wechat-bot.svg":Pe,"../../../../assets/logo/logo_wechat-work.svg":Ae,"../../../../assets/logo/logo_wechat.svg":Ue})[`../../../../assets/logo/logo_${A}.svg`],import.meta.url).href,name:V,isActive:!1,isValid:!1,config:a}}function l(f,V){return{corp_id:"Corp ID",app_key:V?.key!="lark"?"APP Key":"App ID",app_secret:"APP Secret",agent_id:"Agent ID",callback_url:n("views.application.applicationAccess.callback")}[f]||(f?f.charAt(0).toUpperCase()+f.slice(1):"")}function o(){k.value=!0,ie.getPlatformInfo(k).then(f=>{f&&m.forEach(V=>{const A=f.data.find(a=>a.auth_type===V.key);if(A){if(Object.assign(V,{isValid:A.is_valid,isActive:A.is_active,config:A.config}),V.key==="dingtalk"){const{corp_id:a,app_key:r,app_secret:v}=V.config;V.config={corp_id:a,app_key:r,app_secret:v,callback_url:V.config.callback_url}}$[V.key]={},$[V.key].app_secret=!1}})})}function c(f){ie.validateConnection(f,k).then(V=>{V.data?G(n("views.system.authentication.scanTheQRCode.validateSuccess")):re(n("views.system.authentication.scanTheQRCode.validateFailed"))})}function d(){o()}function w(f){ie.updateConfig(f,k).then(V=>{G(n("common.saveSuccess"))})}function I(f){$[f]||($[f]={}),$[f].app_secret=!$[f].app_secret}function M(f){e.value?.open(f)}return(f,V)=>{const A=s("el-tag"),a=s("el-button"),r=s("el-switch"),v=s("el-text"),H=s("AppIcon"),J=s("View"),z=s("el-icon"),W=s("el-col"),N=s("el-row"),K=s("el-collapse-transition"),j=s("el-card"),q=s("el-scrollbar"),te=O("hasPermission"),C=O("loading");return F((p(),y("div",Je,[t(q,null,{default:i(()=>[(p(!0),y(X,null,Y(m,P=>(p(),y("div",{key:P.key,class:"mb-16"},[t(j,{class:"border-none mb-16",shadow:"never"},{default:i(()=>[b("div",We,[b("div",je,[b("img",{src:P.logoSrc,alt:"",width:"24px"},null,8,Xe),b("h5",Ye,_(P.name),1),P.isValid?(p(),R(A,{key:0,size:"small",type:"success",class:"ml-8"},{default:i(()=>[S(_(f.$t("views.system.authentication.scanTheQRCode.effective")),1)]),_:1})):Q("",!0)]),b("div",null,[P.isValid?Q("",!0):F((p(),R(a,{key:0,type:"primary",onClick:B=>M(P)},{default:i(()=>[S(_(f.$t("views.system.authentication.scanTheQRCode.access")),1)]),_:1},8,["onClick"])),[[te,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]]),P.isValid?(p(),y("span",Ze,[b("span",xe,_(P.isActive?f.$t("views.system.authentication.scanTheQRCode.alreadyTurnedOn"):f.$t("views.system.authentication.scanTheQRCode.notEnabled")),1),t(r,{size:"small",modelValue:P.isActive,"onUpdate:modelValue":B=>P.isActive=B,disabled:!P.isValid,onChange:B=>w(P)},null,8,["modelValue","onUpdate:modelValue","disabled","onChange"])])):Q("",!0)])]),t(K,null,{default:i(()=>[P.isValid?(p(),y("div",et,[t(N,{gutter:12,class:"mt-16"},{default:i(()=>[(p(!0),y(X,null,Y(P.config,(B,D)=>(p(),R(W,{key:D,span:12},{default:i(()=>[t(v,{class:"color-secondary lighter"},{default:i(()=>[S(_(l(D,P)),1)]),_:2},1024),b("div",tt,[D!=="app_secret"?(p(),y("span",lt,_(B),1)):Q("",!0),D==="app_secret"&&!$[P.key]?.[D]?(p(),y("span",at,"************")):Q("",!0),D==="app_secret"&&$[P.key]?.[D]?(p(),y("span",ot,_(B),1)):Q("",!0),b("span",null,[t(a,{type:"primary",text:"",onClick:()=>E(be)(B)},{default:i(()=>[t(H,{iconName:"app-copy"})]),_:1},8,["onClick"])]),b("span",it,[D==="app_secret"?(p(),R(a,{key:0,type:"primary",text:"",onClick:ce=>I(P.key)},{default:i(()=>[D==="app_secret"&&!$[P.key]?.[D]?(p(),R(H,{key:0,iconName:"app-password-hide"})):Q("",!0),D==="app_secret"&&$[P.key]?.[D]?(p(),R(z,{key:1},{default:i(()=>[t(J)]),_:1})):Q("",!0)]),_:2},1032,["onClick"])):Q("",!0)])])]),_:2},1024))),128))]),_:2},1024),t(a,{type:"primary",onClick:B=>M(P)},{default:i(()=>[S(_(f.$t("common.edit")),1)]),_:1},8,["onClick"]),t(a,{onClick:B=>c(P)},{default:i(()=>[S(_(f.$t("views.system.authentication.scanTheQRCode.validate")),1)]),_:1},8,["onClick"])])):Q("",!0)]),_:2},1024)]),_:2},1024)]))),128)),t(He,{ref_key:"EditModelRef",ref:e,onRefresh:d},null,512)]),_:1})])),[[C,k.value]])}}}),st=ue(nt,[["__scopeId","data-v-26b22c7c"]]),rt={class:"authentication-setting__main main-calc-height"},ut={class:"form-container p-24"},dt=Z({__name:"OAuth2",setup(T){const e=U({id:"",auth_type:"OAuth2",config:{authEndpoint:"",tokenEndpoint:"",userInfoEndpoint:"",scope:"",clientId:"",clientSecret:"",redirectUrl:"",fieldMapping:""},is_active:!0}),k=U(),m=U(!1),$=x({"config.authEndpoint":[{required:!0,message:n("views.system.authentication.oauth2.authEndpointPlaceholder"),trigger:"blur"}],"config.tokenEndpoint":[{required:!0,message:n("views.system.authentication.oauth2.tokenEndpointPlaceholder"),trigger:"blur"}],"config.userInfoEndpoint":[{required:!0,message:n("views.system.authentication.oauth2.userInfoEndpointPlaceholder"),trigger:"blur"}],"config.scope":[{required:!0,message:n("views.system.authentication.oauth2.scopePlaceholder"),trigger:"blur"}],"config.clientId":[{required:!0,message:n("views.system.authentication.oauth2.clientIdPlaceholder"),trigger:"blur"}],"config.clientSecret":[{required:!0,message:n("views.system.authentication.oauth2.clientSecretPlaceholder"),trigger:"blur"}],"config.redirectUrl":[{required:!0,message:n("views.system.authentication.oauth2.redirectUrlPlaceholder"),trigger:"blur"}],"config.fieldMapping":[{required:!0,message:n("views.system.authentication.oauth2.filedMappingPlaceholder"),trigger:"blur"}]}),u=async(l,o)=>{l&&await l.validate((c,d)=>{c&&L.putAuthSetting(e.value.auth_type,e.value,m).then(w=>{G(n("common.saveSuccess"))})})};function g(){L.getAuthSetting(e.value.auth_type,m).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(e.value=l.data),e.value.config.redirectUrl||(e.value.config.redirectUrl=window.location.origin+window.MaxKB.prefix+"/api/oauth2")})}return ee(()=>{g()}),(l,o)=>{const c=s("el-input"),d=s("el-form-item"),w=s("el-checkbox"),I=s("el-form"),M=s("el-button"),f=s("el-scrollbar"),V=O("hasPermission"),A=O("loading");return p(),y("div",rt,[t(f,null,{default:i(()=>[F((p(),y("div",ut,[t(I,{ref_key:"authFormRef",ref:k,rules:$,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:i(()=>[t(d,{label:l.$t("views.system.authentication.oauth2.authEndpoint"),prop:"config.authEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.authEndpoint,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.config.authEndpoint=a),placeholder:l.$t("views.system.authentication.oauth2.authEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.tokenEndpoint"),prop:"config.tokenEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.tokenEndpoint,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.config.tokenEndpoint=a),placeholder:l.$t("views.system.authentication.oauth2.tokenEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.userInfoEndpoint"),prop:"config.userInfoEndpoint"},{default:i(()=>[t(c,{modelValue:e.value.config.userInfoEndpoint,"onUpdate:modelValue":o[2]||(o[2]=a=>e.value.config.userInfoEndpoint=a),placeholder:l.$t("views.system.authentication.oauth2.userInfoEndpointPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.scope"),prop:"config.scope"},{default:i(()=>[t(c,{modelValue:e.value.config.scope,"onUpdate:modelValue":o[3]||(o[3]=a=>e.value.config.scope=a),placeholder:l.$t("views.system.authentication.oauth2.scopePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.clientId"),prop:"config.clientId"},{default:i(()=>[t(c,{modelValue:e.value.config.clientId,"onUpdate:modelValue":o[4]||(o[4]=a=>e.value.config.clientId=a),placeholder:l.$t("views.system.authentication.oauth2.clientIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.clientSecret"),prop:"config.clientSecret"},{default:i(()=>[t(c,{modelValue:e.value.config.clientSecret,"onUpdate:modelValue":o[5]||(o[5]=a=>e.value.config.clientSecret=a),placeholder:l.$t("views.system.authentication.oauth2.clientSecretPlaceholder"),"show-password":""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.filedMapping"),prop:"config.fieldMapping"},{default:i(()=>[t(c,{modelValue:e.value.config.fieldMapping,"onUpdate:modelValue":o[6]||(o[6]=a=>e.value.config.fieldMapping=a),placeholder:l.$t("views.system.authentication.oauth2.filedMappingPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.oauth2.redirectUrl"),prop:"config.redirectUrl"},{default:i(()=>[t(c,{modelValue:e.value.config.redirectUrl,"onUpdate:modelValue":o[7]||(o[7]=a=>e.value.config.redirectUrl=a),placeholder:l.$t("views.system.authentication.oauth2.redirectUrlPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.is_active,"onUpdate:modelValue":o[8]||(o[8]=a=>e.value.is_active=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.oauth2.enableAuthentication")),1)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"]),b("div",null,[F((p(),R(M,{onClick:o[9]||(o[9]=a=>u(k.value)),type:"primary",disabled:m.value},{default:i(()=>[S(_(l.$t("common.save")),1)]),_:1},8,["disabled"])),[[V,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]])])])),[[A,m.value]])]),_:1})])}}}),ct={class:"authentication-setting__main main-calc-height"},pt={class:"form-container p-24"},mt={class:"mr-12"},ft=Z({__name:"Saml2",setup(T){const e=U({id:"",auth_type:"SAML2",config:{idpMetaUrl:"",wantAssertionsSigned:!0,wantAuthnRequestsSigned:!0,privateKey:"",certificate:"",mapping:"",spEntityId:window.location.origin+window.MaxKB.prefix+"/api/saml2/metadata",spAcs:window.location.origin+window.MaxKB.prefix+"/api/saml2/sso"},is_active:!0}),k=U(),m=U(!1),$=x({"config.idpMetaUrl":[{required:!0,message:n("views.system.authentication.saml2.ldpPlaceholder"),trigger:"blur"}],"config.privateKey":[{required:!0,message:n("views.system.authentication.saml2.privateKeyPlaceholder"),trigger:"blur"}],"config.certificate":[{required:!0,message:n("views.system.authentication.saml2.certificatePlaceholder"),trigger:"blur"}],"config.mapping":[{required:!0,message:n("views.system.authentication.saml2.filedMappingPlaceholder"),trigger:"blur"}]}),u=async(l,o)=>{l&&await l.validate((c,d)=>{c&&L.putAuthSetting(e.value.auth_type,e.value,m).then(w=>{G(n("common.saveSuccess"))})})};function g(){L.getAuthSetting(e.value.auth_type,m).then(l=>{l.data&&JSON.stringify(l.data)!=="{}"&&(e.value=l.data,l.data.config.mapping&&(e.value.config.mapping=JSON.stringify(JSON.parse(l.data.config.mapping))),e.value.config.spEntityId||(e.value.config.spEntityId=window.location.origin+window.MaxKB.prefix+"/api/saml2/metadata"),e.value.config.spAcs||(e.value.config.spAcs=window.location.origin+window.MaxKB.prefix+"/api/saml2/sso"))})}return ee(()=>{g()}),(l,o)=>{const c=s("el-input"),d=s("el-form-item"),w=s("el-checkbox"),I=s("el-form"),M=s("el-button"),f=s("el-scrollbar"),V=O("hasPermission"),A=O("loading");return p(),y("div",ct,[t(f,null,{default:i(()=>[F((p(),y("div",pt,[t(I,{ref_key:"authFormRef",ref:k,rules:$,model:e.value,"label-position":"top","require-asterisk-position":"right"},{default:i(()=>[t(d,{label:l.$t("views.system.authentication.saml2.ldp"),prop:"config.idpMetaUrl"},{default:i(()=>[t(c,{modelValue:e.value.config.idpMetaUrl,"onUpdate:modelValue":o[0]||(o[0]=a=>e.value.config.idpMetaUrl=a),placeholder:l.$t("views.system.authentication.saml2.ldpPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.config.wantAssertionsSigned,"onUpdate:modelValue":o[1]||(o[1]=a=>e.value.config.wantAssertionsSigned=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.saml2.enableAuthnRequests")),1)]),_:1},8,["modelValue"])]),_:1}),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.config.wantAuthnRequestsSigned,"onUpdate:modelValue":o[2]||(o[2]=a=>e.value.config.wantAuthnRequestsSigned=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.saml2.enableAssertions")),1)]),_:1},8,["modelValue"])]),_:1}),t(d,{label:l.$t("views.system.authentication.saml2.privateKey"),prop:"config.privateKey"},{default:i(()=>[t(c,{modelValue:e.value.config.privateKey,"onUpdate:modelValue":o[3]||(o[3]=a=>e.value.config.privateKey=a),type:"password","show-password":"",placeholder:l.$t("views.system.authentication.saml2.privateKeyPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.saml2.certificate"),prop:"config.certificate"},{default:i(()=>[t(c,{modelValue:e.value.config.certificate,"onUpdate:modelValue":o[4]||(o[4]=a=>e.value.config.certificate=a),type:"password","show-password":"",placeholder:l.$t("views.system.authentication.saml2.certificatePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.saml2.filedMapping"),prop:"config.mapping"},{default:i(()=>[t(c,{modelValue:e.value.config.mapping,"onUpdate:modelValue":o[5]||(o[5]=a=>e.value.config.mapping=a),placeholder:l.$t("views.system.authentication.saml2.filedMappingPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.saml2.spEntityId"),prop:"config.spEntityId"},{default:i(()=>[t(c,{modelValue:e.value.config.spEntityId,"onUpdate:modelValue":o[6]||(o[6]=a=>e.value.config.spEntityId=a),placeholder:l.$t("views.system.authentication.saml2.spEntityIdPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,{label:l.$t("views.system.authentication.saml2.spAcs"),prop:"config.spAcs"},{default:i(()=>[t(c,{modelValue:e.value.config.spAcs,"onUpdate:modelValue":o[7]||(o[7]=a=>e.value.config.spAcs=a),placeholder:l.$t("views.system.authentication.saml2.spAcsPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(d,null,{default:i(()=>[t(w,{modelValue:e.value.is_active,"onUpdate:modelValue":o[8]||(o[8]=a=>e.value.is_active=a)},{default:i(()=>[S(_(l.$t("views.system.authentication.saml2.enableAuthentication")),1)]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["rules","model"]),b("div",null,[F((p(),y("span",mt,[t(M,{onClick:o[9]||(o[9]=a=>u(k.value)),type:"primary",disabled:m.value},{default:i(()=>[S(_(l.$t("common.save")),1)]),_:1},8,["disabled"])])),[[V,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]])])])),[[A,m.value]])]),_:1})])}}}),gt={class:"authentication-setting__main main-calc-height"},vt={class:"form-container p-24"},_t={style:{"font-size":"13px"}},ht={class:"ml-8",style:{"font-size":"13px"}},wt={class:"ml-8 font-small",style:{color:"#909399"}},bt={style:{"font-size":"13px"}},yt={style:{"margin-left":"8px","font-size":"13px"}},Vt={style:{"margin-left":"8px","font-size":"13px"}},$t={class:"flex"},kt={style:{"font-size":"13px","white-space":"nowrap",width:"50px"},class:"text-right mr-8"},Ut={class:"flex"},At={style:{"font-size":"13px","white-space":"nowrap",width:"50px"},class:"text-right mr-8"},Pt={class:"flex"},Et={style:{"font-size":"13px","white-space":"nowrap",width:"50px"},class:"text-right mr-8"},St={style:{"margin-top":"16px"}},It={class:"mr-12"},Ct=Z({__name:"Setting",setup(T){const e=U([]),k=U([]),m=U(!1),$=U(null),u=U({default_value:"LOCAL",max_attempts:1,failed_attempts:5,lock_time:10,role_id:"USER",workspace_id:"default",permission:"NOT_AUTH",login_methods:["LOCAL"]}),g=r=>{let v=typeof r=="number"?Math.trunc(r):NaN;return Number.isFinite(v)||(v=1),v===0?v=1:v<-1&&(v=-1),v},l=r=>{u.value.failed_attempts=g(r)},o=async()=>{const r=$.value;if(r)try{await r.validate(),m.value=!0;const v={default_value:u.value.default_value,max_attempts:u.value.max_attempts,failed_attempts:u.value.failed_attempts,lock_time:u.value.lock_time,role_id:u.value.role_id,workspace_id:u.value.workspace_id,permission:u.value.permission,login_methods:u.value.login_methods};await L.putLoginSetting(v),G(n("common.saveSuccess"))}catch{}finally{m.value=!1}},c=U([]),d=U([]),{user:w}=fe(),I=U(""),M=se(()=>I.value!=="ADMIN"),f=se(()=>I.value==="USER"),V=se(()=>{const r=[{label:n("views.system.resourceAuthorization.setting.check"),value:ne.VIEW,desc:n("views.system.resourceAuthorization.setting.checkDesc")},{label:n("views.system.resourceAuthorization.setting.management"),value:ne.MANAGE,desc:n("views.system.resourceAuthorization.setting.managementDesc")},{label:n("views.system.resourceAuthorization.setting.notAuthorized"),value:ne.NOT_AUTH,desc:""}];return Ve([me.IS_EE,me.IS_PE],"OR")&&r.splice(2,0,{label:n("views.system.resourceAuthorization.setting.role"),value:ne.ROLE,desc:n("views.system.resourceAuthorization.setting.roleDesc")}),r}),A=r=>{const v=c.value.find(H=>H.id===r);I.value=v?.type||"",u.value.workspace_id==="None"&&M&&(u.value.workspace_id="default")},a=r=>{e.value=k.value.filter(v=>r.includes(v.value)),r.length>0&&!r.includes(u.value.default_value)&&(u.value.default_value=r[0]),r.length===0&&(u.value.default_value="",setTimeout(()=>{$.value?.validateField("login_methods")},0))};return ee(async()=>{m.value=!0;try{const r=typeof w?.isEE=="function"?w.isEE():!1,v=pe.getWorkspaceRoleList().then(C=>C).catch(()=>({data:[]})),H=L.getLoginSetting().then(C=>C).catch(()=>({data:{}})),J=[v,H];r&&J.push(pe.getWorkspaceList().then(C=>C).catch(()=>({data:[]})));const z=await Promise.all(J),W=z[0]??{data:[]},N=z[1]??{data:{}},K=r?z[2]??{data:[]}:null,j=Array.isArray(W?.data)?W.data:[];c.value=j.map(C=>({id:C.id,name:C.name,type:C.type}));const q=N?.data??{};if(u.value={...u.value,...q,failed_attempts:q.failed_attempts??u.value.failed_attempts??5,lock_time:q.lock_time??u.value.lock_time??10,role_id:q.role_id??u.value.role_id??"USER",workspace_id:q.workspace_id??u.value.workspace_id??"default",permission:q.permission??u.value.permission??"NOT_AUTH"},e.value=Array.isArray(q.auth_types)?q.auth_types:[],k.value=Array.isArray(q.system_options)?q.system_options:[],r&&K){const C=Array.isArray(K.data)?K.data:[];d.value=C.map(P=>({id:P.id,name:P.name}))}const te=c.value.find(C=>C.id===u.value.role_id);I.value=te?.type||""}catch{}finally{m.value=!1}}),(r,v)=>{const H=s("el-checkbox"),J=s("el-checkbox-group"),z=s("el-form-item"),W=s("el-radio"),N=s("el-radio-group"),K=s("el-input-number"),j=s("el-col"),q=s("el-row"),te=s("el-option"),C=s("el-select"),P=s("el-form"),B=s("el-button"),D=s("el-scrollbar"),ce=O("hasPermission"),ge=O("loading");return p(),y("div",gt,[t(D,null,{default:i(()=>[F((p(),y("div",vt,[t(P,{ref_key:"authFormRef",ref:$,model:u.value,"label-position":"top","require-asterisk-position":"right",onSubmit:v[8]||(v[8]=ye(()=>{},["prevent"]))},{default:i(()=>[t(z,{label:r.$t("views.system.login_method"),rules:[{required:!0,message:r.$t("views.applicationOverview.appInfo.LimitDialog.loginMethodRequired"),trigger:"change"}],prop:"login_methods",style:{"padding-top":"16px"}},{default:i(()=>[t(J,{modelValue:u.value.login_methods,"onUpdate:modelValue":v[0]||(v[0]=h=>u.value.login_methods=h),onChange:a},{default:i(()=>[(p(!0),y(X,null,Y(k.value,h=>(p(),R(H,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),t(z,{label:r.$t("views.system.default_login"),rules:[{required:!0,message:r.$t("views.applicationOverview.appInfo.LimitDialog.loginMethodRequired"),trigger:"change"}],prop:"default_value"},{default:i(()=>[t(N,{modelValue:u.value.default_value,"onUpdate:modelValue":v[1]||(v[1]=h=>u.value.default_value=h),class:"radio-group",style:{"margin-left":"10px"}},{default:i(()=>[(p(!0),y(X,null,Y(e.value,h=>(p(),R(W,{key:h.value,label:h.value,class:"radio-item"},{default:i(()=>[S(_(h.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1},8,["label","rules"]),t(z,{label:r.$t("views.system.display_code"),rules:[{required:!0,message:r.$t("views.applicationOverview.appInfo.LimitDialog.displayCodeRequired"),trigger:"change"}],prop:"max_attempts"},{default:i(()=>[t(q,{gutter:16,style:{"margin-left":"10px"}},{default:i(()=>[t(j,{span:24},{default:i(()=>[b("span",_t,_(r.$t("views.system.loginFailed")),1),t(K,{style:{"margin-left":"8px"},modelValue:u.value.max_attempts,"onUpdate:modelValue":v[2]||(v[2]=h=>u.value.max_attempts=h),min:-1,max:10,step:1,"controls-position":"right"},null,8,["modelValue"]),b("span",ht,_(r.$t("views.system.loginFailedMessage")),1),b("span",wt," ("+_(r.$t("views.system.display_codeTip"))+") ",1)]),_:1}),t(j,{span:24,style:{"margin-top":"8px"}},{default:i(()=>[b("span",bt,_(r.$t("views.system.loginFailed")),1),t(K,{style:{"margin-left":"8px"},modelValue:u.value.failed_attempts,"onUpdate:modelValue":v[3]||(v[3]=h=>u.value.failed_attempts=h),min:-1,max:10,step:1,"controls-position":"right",onChange:l},null,8,["modelValue"]),b("span",yt,_(r.$t("views.system.failedTip")),1),t(K,{style:{"margin-left":"8px"},modelValue:u.value.lock_time,"onUpdate:modelValue":v[4]||(v[4]=h=>u.value.lock_time=h),min:1,step:1,"controls-position":"right"},null,8,["modelValue"]),b("span",Vt,_(r.$t("views.system.minute")),1)]),_:1})]),_:1})]),_:1},8,["label","rules"]),t(z,{label:r.$t("views.system.third_party_user_default_role"),rules:[{required:!0,message:r.$t("views.system.thirdPartyUserDefaultRoleRequired"),trigger:"change"}]},{default:i(()=>[t(q,{gutter:16,style:{"margin-left":"10px"}},{default:i(()=>[t(j,{span:24},{default:i(()=>[b("div",$t,[b("span",kt,_(r.$t("views.role.member.role")),1),t(C,{filterable:"",clearable:"",modelValue:u.value.role_id,"onUpdate:modelValue":v[5]||(v[5]=h=>u.value.role_id=h),placeholder:`${r.$t("common.selectPlaceholder")}${r.$t("views.role.member.role")}`,onChange:A,class:"w-240"},{default:i(()=>[(p(!0),y(X,null,Y(c.value,h=>(p(),R(te,{key:h.id,label:h.name,value:h.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])]),_:1}),E(w).isEE()&&M.value?(p(),R(j,{key:0,span:24,class:"mt-16"},{default:i(()=>[b("div",Ut,[b("span",At,_(r.$t("views.role.member.workspace")),1),t(C,{filterable:"",clearable:"",modelValue:u.value.workspace_id,"onUpdate:modelValue":v[6]||(v[6]=h=>u.value.workspace_id=h),placeholder:`${r.$t("common.selectPlaceholder")}${r.$t("views.role.member.workspace")}`,class:"w-240"},{default:i(()=>[(p(!0),y(X,null,Y(d.value,h=>(p(),R(te,{key:h.id,label:h.name,value:h.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])]),_:1})):Q("",!0),(E(w).isEE()||E(w).isPE())&&f.value?(p(),R(j,{key:1,span:24,class:"mt-16"},{default:i(()=>[b("div",Pt,[b("span",Et,_(r.$t("views.system.resourceAuthorization.title")),1),t(C,{filterable:"",clearable:"",modelValue:u.value.permission,"onUpdate:modelValue":v[7]||(v[7]=h=>u.value.permission=h),placeholder:`${r.$t("common.selectPlaceholder")}${r.$t("views.system.resourceAuthorization.title")}`,class:"w-240"},{default:i(()=>[(p(!0),y(X,null,Y(V.value,h=>(p(),R(te,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder"])])]),_:1})):Q("",!0)]),_:1})]),_:1},8,["label","rules"])]),_:1},8,["model"]),b("div",St,[F((p(),y("span",It,[t(B,{onClick:o,type:"primary",disabled:m.value},{default:i(()=>[S(_(r.$t("common.save")),1)]),_:1},8,["disabled"])])),[[ce,new(E(le))([E(ae).ADMIN],[E(oe).LOGIN_AUTH_EDIT],[],"OR")]])])])),[[ge,m.value]])]),_:1})])}}}),Rt=ue(Ct,[["__scopeId","data-v-85b94adb"]]),Mt={class:"authentication-setting p-16-24"},qt={class:"ml-4 color-text-primary"},Tt=Z({__name:"index",setup(T){const{user:e}=fe(),k=$e(),m=U("SETTING"),$=[{label:n("views.system.setting"),name:"SETTING",component:Rt},{label:n("views.system.authentication.ldap.title"),name:"LDAP",component:qe},{label:n("views.system.authentication.cas.title"),name:"CAS",component:De},{label:n("views.system.authentication.oidc.title"),name:"OIDC",component:Le},{label:n("views.system.authentication.oauth2.title"),name:"OAuth2",component:dt},{label:n("views.system.authentication.saml2.title"),name:"SAML2",component:ft},{label:n("views.system.authentication.scanTheQRCode.title"),name:"SCAN",component:st}];return ee(()=>{e.isExpire()&&k.push({path:"/application"})}),(u,g)=>{const l=s("el-breadcrumb-item"),o=s("el-breadcrumb"),c=s("el-tab-pane"),d=s("el-tabs");return p(),y("div",Mt,[t(o,{"separator-icon":"ArrowRight",class:"mb-16"},{default:i(()=>[t(l,null,{default:i(()=>[S(_(E(n)("views.system.subTitle")),1)]),_:1}),t(l,null,{default:i(()=>[b("h5",qt,_(u.$t("views.system.authentication.title")),1)]),_:1})]),_:1}),t(d,{modelValue:m.value,"onUpdate:modelValue":g[0]||(g[0]=w=>m.value=w),class:"mt-4"},{default:i(()=>[(p(),y(X,null,Y($,(w,I)=>t(c,{key:I,label:w.label,name:w.name},{default:i(()=>[(p(),R(ke(w.component)))]),_:2},1032,["label","name"])),64))]),_:1},8,["modelValue"])])}}}),Ft=ue(Tt,[["__scopeId","data-v-927d4678"]]);export{Ft as default};
|