import{n as e,o as t,s as a}from"./store6.js?v=20260328163632";import{k as s,Y as l,r as c,c as r,o as i,V as o,W as n,_ as p,a3 as u,X as d,j as m,Z as A,a1 as y,O as g}from"./base-lib.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";const x={class:"tx_key_bind px-20px py-40px"},I={class:"flex items-center"},v={class:"tx_key_title"},D={class:"flex items-center justify-center"},k={class:"leading-20px text-12px mb-[5px] px-[20px]",style:{color:"red"}},f={class:"leading-20px text-12px px-[20px]"},h=s({__name:"config",props:{compData:{default:()=>({})}},setup(s){const h=s,{BtInput:w,BtInputIcon:b,NFormItem:j,NForm:E,NAlert:P,NButton:Y,BtLink:Z}=l(h.compData.dependencies.components),{useAxios:F,useMessage:T,useConfirm:B,useForm:R,langI18n:C,isAaPanel:K}=l(h.compData.dependencies.hooks);l(h.compData.dependencies.utils);const H=T(),J=c({formAttrs:{labelWidth:"100px"},formItems:[]}),W=c({label:"APPID",ruleKey:"appid",rules:[{required:!0,message:C("请输入APPID"),trigger:["blur","input"]}],children:[{key:"appid",type:"input",attrs:{class:"!w-300px"}}]}),Q=c({label:"SecretId",ruleKey:"secretId",rules:[{required:!0,message:C("请输入SecretId"),trigger:["blur","input"]}],children:[{key:"secretId",type:"input",attrs:{class:"!w-300px"}}]}),V=c({label:"SecretKey",ruleKey:"secretKey",rules:[{required:!0,message:C("请输入SecretKey"),trigger:["blur","input"]}],children:[{key:"secretKey",type:"input",attrs:{class:"!w-300px"}}]}),M=c({label:" ",children:[{key:"save",type:"button",style:"min-width: auto",attrs:{buttonText:C("关联API密钥"),type:"primary",class:"mr-10px",onClick:()=>X()}},...h.compData.isEdit||h.compData.tips?[{key:"cancel",type:"button",attrs:{buttonText:C("取消"),type:"default",onClick:()=>S()}}]:[]]}),G=r((()=>(J.value.formItems=[W.value,Q.value,V.value,M.value],J.value))),[N,U,L]=R(G),X=async()=>{await L.value.validate();try{const t=H.load(C("正在关联密钥，请稍后...")),a=await e({appid:U.value.appid,secretId:U.value.secretId,secretKey:U.value.secretKey});t.close(),H.request(a),a.status&&window.location.reload()}catch(t){}},S=async()=>{try{await B({title:C("解绑腾讯云API密钥"),content:C("是否取消关联腾讯云API密钥,是否继续？")});const e=H.load(C("正在取消关联密钥，请稍后...")),a=await t();e.close(),H.request(a),a.status&&window.location.reload()}catch(e){}};return i((()=>{a(F),Object.assign(U.value,{appid:h.compData.appId||"",secretId:h.compData.secretId||"",secretKey:h.compData.secretKey||""})})),(e,t)=>(o(),n("div",x,[e.compData.tips||e.compData.alert?(o(),p(l(P),{key:0,type:"error","show-icon":!1,class:"!mb-16px",closable:!1},{default:u((()=>[d("div",I,[t[0]||(t[0]=d("i",{class:"svgtofont-el-warning-filled text-[var(--text-color-38)] mr-[4px] !text-[16px]"},null,-1)),m(" "+A(e.compData.tips||e.compData.alert),1)])])),_:1})):y("",!0),d("div",v,[d("span",D,[t[1]||(t[1]=d("img",{class:"w-[35px] h-[25px] mr-4x",src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAZCAYAAAC/zUevAAADk0lEQVRIS62WXWxTZRjHf88pqxIjIjXxA4k4nCLGTEagg0SF6IWYYEBCL8hgDjPR8O1HxCu3GyBe6NhClJigWPBmQYyIMXwkM4R1JUHDyJiDTpBGjVlWErMLieM85j3nrJx2bU/38d40fd//8+/vPM9znrfCWNcWnY+wBJgP1Hif3cBFIIXFflrkr7HYStni7Todm3dR3kG4s0Tcn8DnY4EpD2KzrsRiF/Bk2dDQh8XrtMjZoJhgiO36DDangRk+s6MIpxjmF/ZJgh1aic08lDeAFT7dDZR62uRYKZDSEG4JfgSijolwHGUXrdJZ1HSbrkbZD0Q8TQaLBbTItWIxpSG2aiuwxQv+HXiOVrkelF7c5v0eeMiD/5K90jBeiDTwsBOsrKZNvgkEGBFs1Z3AbuAm0I1FrFg2imdisy7H4gcPoIM2WVY2wIhwk9YQ5hqfSGZ8PbHD/o57/htkKPQAFfbX7A7HxwxhAg7rvdhUE6KXtfJ3IY/cTHRdmQYcAFkEzMoN0CNIaC/RyjOBMHF9EJuNWLwKPJ3VK2mEcwgbqJN/RvZvQyR6ZyMVXwHPlvwR1WYWVzUV1RzUJkI0ol5TFhaeYZj1NLhvjAuR7I2gU06DVOfFdACPZ7t85LAYiAGw+DAwU67gAjYvUC+DHkTqU5Q3fcEbCetRaqoGnL1EqhFxJuZ9WY1IE9E5zdnv+QBKPxYfc4tT2FyngkrgFdR5Y9wlfEadvCUkU+tRDmYPah8r/MYkf6tG7RZgqae9jNyKEX3iAvkAQjthNhET9yHyV1zVt1UvdKW+AF7z0D6gds6eounsTE9F/m0FWQf6EourOgoC1EmsZEniasa7maomG3EhkTLdutDZCFlzWVjZF1jTc1efZ9GjP40LwJgfUnPP9Di/o3QLyf4hVO9yNoqVohBVoRIEZcDv4yuJKcdVYLZLpcucFAetiQL4MyH0GIjjwMseROkZYEQTBTAecTWX2QGvJ9oNxEfAe7cfvuIpah+5VDAZkwHgQgwBbgvYNAud6RlYN89nS+KUxW5Ap55kyaw/sjATBTik07B5EcH8PZjp+X7LOlnlzoTE5ShidY1+eukGzZCJDDA4fY3vPLhvcs3uBhaM8r+DCDHJ+O6O/vcRHT0jMpH2PICgti3nvI9hVtIgvxpx7nRMXlmDytvmZXWcJh/gBDYJ6iXnAiw8ont6wqTvb2Qg4g6UyVjCz/7r22/5P8qBPGWz9M1HAAAAAElFTkSuQmCC"},null,-1)),m(A(l(C)("关联腾讯云API密钥")),1)]),t[2]||(t[2]=d("span",null,null,-1))]),g(l(N)),d("div",k,A(l(C)("温馨提示：请确保当前关联的密钥是本服务器的，如果不一致，将会导致数据获取异常和不正确，请须知")),1),d("div",f,[m(A(l(C)("您正在使用{0}面板腾讯云联合定制版，请关联您的腾讯云API密钥，如何获取腾讯云API密钥，",l(K)?"aaPanel":l(C)("宝塔"))),1),g(l(Z),{href:"https://console.cloud.tencent.com/cam/capi",target:"_blank",class:"btlink"},{default:u((()=>[m(A(l(C)("点击查看")),1)])),_:1})])]))}});export{h as default};
