import{e}from"./utils-lib.js?v=1761009159";import{s as a,w as t,x as s}from"./api.js?v=1761009159";import{c as r,y as l,r as o,o as c,q as i,v as d,x as p,N as m,D as n,z as u,C as A,e as g,B as I}from"./base-lib.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const D={class:"tx_key_bind px-[2rem] py-[4rem]"},f={class:"flex items-center gap-1rem"},y={class:"leading-2rem text-base px-[2rem]"},h=r({__name:"config",props:{compData:{default:()=>({})}},setup(r){const h=r,{BtInput:w,BtInputIcon:k,ElFormItem:E,ElForm:v,ElAlert:b,ElButton:P}=l(h.compData.dependencies.components),{useAxios:j,useMessage:x,useConfirm:V}=l(h.compData.dependencies.hooks);l(h.compData.dependencies.utils);const F=x(),Y=o(),Z=c({appid:h.compData.appId||"",secretId:h.compData.secretId||"",secretKey:h.compData.secretKey||""}),R=c({appid:[{required:!0,message:"请输入APPID",trigger:"blur"}],secretId:[{required:!0,message:"请输入SecretId",trigger:"blur"}],secretKey:[{required:!0,message:"请输入SecretKey",trigger:"blur"}]}),B=async()=>{await Y.value.validate();try{const e=F.load("正在关联密钥，请稍后..."),a=await t({appid:Z.appid,secretId:Z.secretId,secretKey:Z.secretKey});e.close(),F.request(a),a.status&&window.location.reload()}catch(e){}};return i(()=>{a(j)}),(a,t)=>{const r=e;return d(),p("div",D,[a.compData.tips||a.compData.alert?(d(),m(l(b),{key:0,type:"error",description:a.compData.tips||a.compData.alert,class:"!mb-1.6rem",closable:!1},null,8,["description"])):n("",!0),t[8]||(t[8]=u("div",{class:"tx_key_title"},[u("span",{class:"flex items-center justify-center"},[u("img",{class:"w-[3.5rem] h-[2.5rem] mr-4x",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZCAYAAAC/zUevAAADk0lEQVRIS62WXWxTZRjHf88pqxIjIjXxA4k4nCLGTEagg0SF6IWYYEBCL8hgDjPR8O1HxCu3GyBe6NhClJigWPBmQYyIMXwkM4R1JUHDyJiDTpBGjVlWErMLieM85j3nr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Tvb2Qg4g6UyVjCz/7r22/5P8qBPGWz9M1HAAAAAElFTkSuQmCC"}),A("关联腾讯云API密钥")]),u("span")],-1)),g(l(v),{ref_key:"configFormRef",ref:Y,rules:l(R),"label-position":"right","label-width":"100px","hide-required-asterisk":true,"show-message":true,model:l(Z),class:"demo-form-inline mb-2rem"},{default:I(()=>[g(l(E),{label:"APPID",prop:"appid"},{default:I(()=>[g(l(w),{modelValue:l(Z).appid,"onUpdate:modelValue":t[0]||(t[0]=e=>l(Z).appid=e),width:"24.8rem",placeholder:"请输入APPID"},null,8,["modelValue"])]),_:1}),g(l(E),{label:"SecretId",prop:"secretId"},{default:I(()=>[g(l(w),{modelValue:l(Z).secretId,"onUpdate:modelValue":t[1]||(t[1]=e=>l(Z).secretId=e),width:"24.8rem",placeholder:"请输入SecretId"},null,8,["modelValue"])]),_:1}),g(l(E),{label:"SecretKey",prop:"secretKey"},{default:I(()=>[g(l(w),{modelValue:l(Z).secretKey,"onUpdate:modelValue":t[2]||(t[2]=e=>l(Z).secretKey=e),width:"24.8rem",class:"password",placeholder:"请输入SecretKey"},null,8,["modelValue"])]),_:1}),g(l(E),{label:" "},{default:I(()=>[u("div",f,[g(l(P),{type:"primary",onClick:B},{default:I(()=>t[4]||(t[4]=[A("关联API密钥",-1)])),_:1,__:[4]}),h.compData.isEdit||a.compData.tips?(d(),m(l(P),{key:0,type:"define",onClick:t[3]||(t[3]=e=>(async()=>{try{await V({title:"解绑腾讯云API密钥",content:"是否取消关联腾讯云API密钥,是否继续？"});const e=F.load("正在取消关联密钥，请稍后..."),a=await s();e.close(),F.request(a),a.status&&window.location.reload()}catch(e){}})())},{default:I(()=>t[5]||(t[5]=[A("取消关联密钥",-1)])),_:1,__:[5]})):n("",!0)])]),_:1})]),_:1},8,["rules","model"]),t[9]||(t[9]=u("div",{class:"leading-2rem text-base mb-[0.5rem] px-[2rem]",style:{color:"red"}},"温馨提示：请确保当前关联的密钥是本服务器的，如果不一致，将会导致数据获取异常和不正确，请须知",-1)),u("div",y,[t[7]||(t[7]=A("您正在使用宝塔面板腾讯云联合定制版，请关联您的腾讯云API密钥，如何获取腾讯云API密钥，",-1)),g(r,{href:"https://console.cloud.tencent.com/cam/capi",target:"_blank",class:"btlink"},{default:I(()=>t[6]||(t[6]=[A("点击查看",-1)])),_:1,__:[6]})])])}}});export{h as default};
