mirror of
https://gitee.com/mirrors/AllinSSL.git
synced 2026-03-08 15:51:11 +08:00
2 lines
21 KiB
JavaScript
2 lines
21 KiB
JavaScript
import{e,s as a,r as t,$ as s,f as n,d as o,c as r,g as l,o as c,N as i,h as u,B as p,j as d,i as g,k as _,l as f,m as y,n as w,b as m,p as h,q as k,t as v,v as b,w as I,x,y as A,z as P,a as S}from"./main-DorqzikP.js";import{u as O,E as q}from"./index-Ba9GG_-7.js";import{u as j,a as C,b as K}from"./index-DvYuWcNS.js";import{w as E,O as T,H as R,T as U,d as z}from"./business-B1S1HhRD.js";import{g as M,a as F,u as V,d as N,t as L,b as D}from"./access-DUH5sOPN.js";import{A as B}from"./data-C4-AnG3Z.js";import{S as H}from"./index-wrQAT3t3.js";import{T as J}from"./index-CwUoGLXj.js";import{n as W}from"./utils-CRt-4gJj.js";import{N as G}from"./text-BdL9Ely1.js";import{N as $}from"./Alert-CWEySism.js";import{N as Q}from"./Flex-9ufLU0NO.js";import{B as X}from"./index-BD4ZqnpR.js";const Y=n(),Z=e("auth-api-manage-store",()=>{const{handleError:e}=j(),a=t({name:"",type:"btpanel",config:{url:"",api_key:"",ignore_ssl:"0"}}),n={dns:s("t_3_1745735765112"),host:s("t_0_1746754500246"),plugin:"插件"},o=()=>{a.value={name:"",type:"btpanel",config:{url:"",api_key:"",ignore_ssl:"0"}}};return{apiFormProps:a,accessTypeMap:n,fetchAccessList:async a=>{try{const e=await M(a).fetch();return{list:e.data||[],total:e.count}}catch(t){return e(t),{list:[],total:0}}},addNewAccess:async a=>{try{const{fetch:e,message:t}=F(a);t.value=!0,await e(),o()}catch(t){throw e(t)&&Y.error(s("t_8_1745289354902")),t}},updateExistingAccess:async a=>{try{const{fetch:e,message:t}=V(a);t.value=!0,await e(),o()}catch(t){throw e(t)&&Y.error(s("t_40_1745227838872")),t}},deleteExistingAccess:async a=>{try{const{fetch:e,message:t}=N({id:a});t.value=!0,await e(),o()}catch(t){throw e(t)&&Y.error(s("t_40_1745227838872")),t}},resetApiForm:o}}),ee=o({name:"ApiManageForm",props:{data:{type:Object,default:()=>{}}},setup(e){const{ApiManageForm:a}=pe(e);return()=>r("div",{class:"p-4"},[r(a,{labelPlacement:"top",requireMarkPlacement:"right-hanging"},null)])}});function ae(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!g(e)}const{accessTypeMap:te,apiFormProps:se,fetchAccessList:ne,deleteExistingAccess:oe,addNewAccess:re,updateExistingAccess:le,resetApiForm:ce}=(()=>{const e=Z();return{...e,...a(e)}})(),{handleError:ie}=j(),ue=()=>{const{TableComponent:e,PageComponent:a,loading:t,param:n,fetch:o}=l({config:[{title:s("t_2_1745289353944"),key:"name",width:200,ellipsis:{tooltip:!0}},{title:s("t_1_1746754499371"),key:"type",width:140,render:e=>r(J,{icon:e.type,type:"success"},null)},{title:s("t_2_1746754500270"),key:"type",width:200,render:e=>r(u,null,{default:()=>{var a;return[null==(a=e.access_type)?void 0:a.map(e=>r(i,{key:e,type:"dns"===e?"success":"info",size:"small"},{default:()=>[te[e]]}))]}})},{title:s("t_7_1745215914189"),key:"create_time",width:180},{title:s("t_0_1745295228865"),key:"update_time",width:180},{title:s("t_8_1745215914610"),key:"actions",width:200,align:"right",fixed:"right",render:e=>{let a,t,n;return r(u,{justify:"end"},{default:()=>[r(p,{size:"tiny",strong:!0,secondary:!0,type:"primary",onClick:()=>(async e=>{try{const{fetch:a,message:t}=L({id:e.id,type:e.type});t.value=!0,a()}catch(a){ie(a)}})(e)},ae(a=s("t_16_1746676855270"))?a:{default:()=>[a]}),r(p,{size:"tiny",strong:!0,secondary:!0,type:"primary",onClick:()=>_(e)},ae(t=s("t_11_1745215915429"))?t:{default:()=>[t]}),r(p,{size:"tiny",strong:!0,secondary:!0,type:"error",onClick:()=>f(e.id)},ae(n=s("t_12_1745215914312"))?n:{default:()=>[n]})]})}}],request:ne,watchValue:["p","limit"],storage:"authApiManage",alias:{page:"p",pageSize:"limit"},defaultValue:{p:1,limit:10,search:""}}),{SearchComponent:g}=O({onSearch:e=>{n.value.search=e,o()}}),_=e=>{d({title:s("t_4_1745289354902"),area:500,component:ee,componentProps:{data:e},footer:!0,onUpdateShow:e=>{e||o(),ce()}})},f=e=>{C({title:s("t_5_1745289355718"),content:s("t_6_1745289358340"),confirmText:s("t_5_1744870862719"),cancelText:s("t_4_1744870861589"),onPositiveClick:async()=>{await oe(e),await o()}})};return c(o),{loading:t,fetch:o,TableComponent:e,PageComponent:a,SearchComponent:g,param:n,openAddForm:()=>{d({title:s("t_0_1745289355714"),area:500,component:ee,footer:!0,onUpdateShow:e=>{e||o(),ce()}})}}},pe=e=>{var a;const{confirm:n}=P(),{open:o,close:l}=K({text:s("t_0_1746667592819")}),{useFormInput:u,useFormRadioButton:p,useFormSwitch:d,useFormTextarea:g,useFormCustom:S,useFormSelect:O}=f(),q=(null==(a=e.data)?void 0:a.id)?t({...e.data,config:JSON.parse(e.data.config)}):se,j=t(""),C=t([]),M={name:{required:!0,message:s("t_27_1745289355721"),trigger:"input"},type:{required:!0,message:s("t_28_1745289356040"),trigger:"change"},config:{host:{required:!0,trigger:"input",validator:(e,a,t)=>{if(!U(a)&&!z(a))return t(new Error(s("t_0_1749119980577")));t()}},port:{required:!0,trigger:"input",validator:(e,a,t)=>{if(!R(a.toString()))return t(new Error(s("t_1_1745317313096")));t()}},user:{required:!0,trigger:"input",message:s("t_3_1744164839524")},username:{trigger:"input",validator:(e,a,t)=>{if(!a){const e={westcn:s("t_0_1747365600180"),namedotcom:"请输入用户名",lecdn:"请输入用户名"};return t(new Error(e[q.value.type]||s("t_0_1747365600180")))}t()}},password:{trigger:"input",validator:(e,a,t)=>{if("ssh"===q.value.type){const e=q.value.config;return"password"!==(null==e?void 0:e.mode)||a?void t():t(new Error(s("t_0_1747711335067")))}if(!a){const e={westcn:s("t_1_1747365603108"),lecdn:"请输入密码"};return t(new Error(e[q.value.type]))}t()}},key:{required:!0,message:s("t_31_1745289355715"),trigger:"input"},url:{required:!0,trigger:"input",validator:(e,a,t)=>{if(!T(a)){const e={btpanel:s("t_2_1745317314362"),btwaf:s("t_0_1747271295174"),safeline:s("t_0_1747300383756"),lecdn:"请输入正确的URL地址"};return t(new Error(e[q.value.type]))}t()}},api_key:{trigger:"input",validator:(e,a,t)=>{if(!a.length){const e={cloudflare:s("t_0_1747042966820"),btpanel:s("t_1_1747042969705"),btwaf:s("t_1_1747300384579"),godaddy:s("t_0_1747984137443"),ns1:"请输入API Key",namecheap:"请输入API Key",constellix:"请输入API Key",spaceship:"请输入 Spaceship API Key"};return t(new Error(e[q.value.type]))}t()}},api_secret:{trigger:"input",validator:(e,a,t)=>{if(!a){const e={godaddy:s("t_1_1747984133312"),spaceship:"请输入 Spaceship API Secret"};return t(new Error(e[q.value.type]))}t()}},access_secret:{required:!0,message:s("t_2_1747984134626"),trigger:"input"},api_token:{required:!0,message:s("t_0_1747617113090"),trigger:"input"},secret_access_key:{required:!0,message:"请输入Secret Access Key",trigger:"input"},api_user:{required:!0,message:"请输入API User",trigger:"input"},auth_id:{required:!0,message:"请输入Auth ID",trigger:"input"},auth_password:{required:!0,message:"请输入Auth Password",trigger:"input"},tenant_id:{required:!0,message:"请输入Tenant ID",trigger:"input"},client_id:{required:!0,message:"请输入Client ID",trigger:"input"},client_secret:{required:!0,message:"请输入Client Secret",trigger:"input"},secret_id:{required:!0,message:s("t_6_1745317313383"),trigger:"input"},access_key:{trigger:"input",validator:(e,a,t)=>{if(!a){const e={huawei:s("t_2_1747271295877"),baidu:s("t_3_1747271294475"),volcengine:s("t_3_1747365600828"),qiniu:s("t_3_1747984134586"),doge:s("t_0_1750320239265")};return t(new Error(e[q.value.type]))}t()}},secret_key:{trigger:"input",validator:(e,a,t)=>{if(!a.length){const e={tencentcloud:s("t_2_1747042967277"),huawei:s("t_3_1747042967608"),baidu:s("t_4_1747271294621"),volcengine:s("t_4_1747365600137"),doge:s("t_1_1750320241427"),constellix:"请输入Secret Key"};return t(new Error(e[q.value.type]))}t()}},email:{trigger:"input",validator:(e,a,t)=>"cloudflare"!==q.value.type||a&&""!==a.trim()?E(a)?void t():t(new Error(s("t_5_1747042965911"))):t()},region:{required:!0,message:"请输入Region",trigger:"input"},"config.name":{required:!0,message:s("t_0_1750144125193"),trigger:"change"}}},F=Object.entries(B).filter(([e,a])=>!("boolean"==typeof a.notApi&&!a.notApi)).map(([e,a])=>({label:a.name,value:e,access:a.type||[]})),V=new Map([["btwaf","宝塔WAF-URL"],["btpanel","宝塔面板-URL"],["1panel","1Panel-URL"],["safeline","雷池WAF-URL"]]),N=_(()=>{var a,t;const n=[u(s("t_2_1745289353944"),"name"),S(()=>r(w,{label:s("t_41_1745289354902"),path:"type"},{default:()=>{var a;return[r(y,{class:"w-full",options:F,renderLabel:J,renderTag:L,disabled:!!(null==(a=e.data)?void 0:a.id),filterable:!0,placeholder:s("t_0_1745833934390"),value:q.value.type,"onUpdate:value":e=>q.value.type=e},{empty:()=>r("span",{class:"text-[1.4rem]"},[s("t_0_1745833934390")])})]}}))];switch(q.value.type){case"ssh":{const e=[S(()=>r(I,{cols:24,xGap:4},{default:()=>[r(v,{label:s("t_1_1747711335336"),span:16,path:"config.host"},{default:()=>[r(k,{value:q.value.config.host,"onUpdate:value":e=>q.value.config.host=e,placeholder:s("t_2_1747711337958"),"allow-input":W},null)]}),r(v,{label:s("t_2_1745833931404"),span:8,path:"config.port"},{default:()=>[r(b,{value:q.value.config.port,"onUpdate:value":e=>q.value.config.port=e,showButton:!1},null)]})]})),u(s("t_44_1745289354583"),"config.user"),p(s("t_45_1745289355714"),"config.mode",[{label:s("t_48_1745289355714"),value:"password"},{label:s("t_1_1746667588689"),value:"key"}])],o=[];"password"===(null==(a=q.value.config)?void 0:a.mode)?o.push(u(s("t_48_1745289355714"),"config.password",{type:"password",showPasswordOn:"click",allowInput:W})):"key"===(null==(t=q.value.config)?void 0:t.mode)&&o.push(g(s("t_1_1746667588689"),"config.key",{rows:3,placeholder:s("t_0_1747709067998")}),u("私钥密码","config.password",{type:"password",showPasswordOn:"click",allowInput:W,placeholder:"请输入私钥密码(可选)"},{showRequireMark:!1})),n.push(...e,...o);break}case"1panel":n.push(S(()=>{const e=q.value.config.version||"v1";return r(w,{label:"版本",path:"config.version",showRequireMark:!1},{default:()=>[r(y,{class:"w-full",options:[{label:"v1",value:"v1"},{label:"v2",value:"v2"}],placeholder:"请选择版本",value:e,onUpdateValue:e=>{q.value.config.version=e}},null)]})}),u(V.get(q.value.type)||"","config.url",{allowInput:W}),u(s("t_55_1745289355715"),"config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}),d(s("t_3_1746667592270"),"config.ignore_ssl",{checkedValue:"1",uncheckedValue:"0"},{showRequireMark:!1}));break;case"btpanel":case"btwaf":case"safeline":n.push(u(V.get(q.value.type)||"","config.url",{allowInput:W}),u("safeline"===q.value.type?s("t_1_1747617105179"):s("t_55_1745289355715"),"safeline"===q.value.type?"config.api_token":"config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}),d(s("t_3_1746667592270"),"config.ignore_ssl",{checkedValue:"1",uncheckedValue:"0"},{showRequireMark:!1}));break;case"aliyun":n.push(u("AccessKeyId","config.access_key_id",{allowInput:W}),u("AccessKeySecret","config.access_key_secret",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"tencentcloud":n.push(u("SecretId","config.secret_id",{allowInput:W}),u("SecretKey","config.secret_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"huaweicloud":case"baidu":case"volcengine":case"doge":n.push(u("AccessKey","config.access_key",{allowInput:W}),u("SecretKey","config.secret_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"cloudflare":n.push(u("邮箱","config.email",{allowInput:W},{showRequireMark:!1}),u("APIKey","config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}),S(()=>r($,{type:"error",class:"mt-[1.2rem] whitespace-nowrap",showIcon:!1},{default:()=>[r("span",{class:"text-[1.3rem]"},[m("使用API令牌时不要填写邮箱,否则将作为Global Key请求Cloudflare")])]})));break;case"westcn":n.push(u("Username","config.username",{allowInput:W}),u("Password","config.password",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"godaddy":n.push(u("API Key","config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}),u("API Secret","config.api_secret",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"qiniu":n.push(u("AccessKey","config.access_key",{allowInput:W}),u("AccessSecret","config.access_secret",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"namecheap":n.push(u("API User","config.api_user",{allowInput:W}),u("API Key","config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"ns1":case"namesilo":case"bunny":n.push(u("API Key","config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"cloudns":n.push(u("Auth ID","config.auth_id",{allowInput:W}),u("Auth Password","config.auth_password",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"aws":n.push(u("Access Key ID","config.access_key_id",{allowInput:W}),u("Secret Access Key","config.secret_access_key",{type:"password",showPasswordOn:"click",allowInput:W}),u("Region","config.region",{allowInput:W}));break;case"azure":n.push(u("Tenant ID","config.tenant_id",{allowInput:W}),u("Client ID","config.client_id",{allowInput:W}),u("Client Secret","config.client_secret",{type:"password",showPasswordOn:"click",allowInput:W}),u("Environment","config.environment",{allowInput:W,placeholder:"public"}));break;case"namedotcom":n.push(u("Username","config.username",{allowInput:W}),u("API Token","config.api_token",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"gcore":n.push(u("API Token","config.api_token",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"jdcloud":n.push(u("Access Key ID","config.access_key_id",{allowInput:W}),u("Secret Access Key","config.secret_access_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"lecdn":n.push(u("URL","config.url",{allowInput:W}),u("Username","config.username",{allowInput:W}),u("Password","config.password",{type:"password",showPasswordOn:"click",allowInput:W}),d(s("t_3_1746667592270"),"config.ignore_ssl",{checkedValue:"1",uncheckedValue:"0"},{showRequireMark:!1}));break;case"constellix":n.push(u("API Key","config.api_key",{type:"password",showPasswordOn:"click",allowInput:W}),u("Secret Key","config.secret_key",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"webhook":n.push(u("WebHook回调地址","config.url"),O("请求方式","config.method",[{label:"POST",value:"POST"},{label:"GET",value:"GET"}]),g("WebHook请求头(可选)","config.headers",{rows:3,placeholder:"Content-Type: application/json"},{showRequireMark:!1}),g("WebHook推送通知回调数据(可选)","config.data",{rows:3,placeholder:'请使用JSON格式,例如:{"title":"test","content":"test"}'},{showRequireMark:!1}),d(s("t_3_1746667592270"),"config.ignore_ssl",{checkedValue:"1",uncheckedValue:"0"},{showRequireMark:!1}),S(()=>r("div",{class:"mt-4 p-4 bg-gray-50 rounded-md"},[r("div",{class:"text-gray-600 space-y-4 text-lg"},[r("div",null,[r("div",{class:"font-medium text-gray-700 mb-3 text-xl"},[m("用于部署时可用的模板变量:")]),r("div",{class:"space-y-2 ml-4"},[r("div",null,[r("code",{class:"px-2 py-1 bg-gray-200 rounded text-lg font-mono"},[m("__cert__")]),m(":证书内容")]),r("div",null,[r("code",{class:"px-2 py-1 bg-gray-200 rounded text-lg font-mono"},[m("__key__")]),m(":私钥内容")])])]),r("div",null,[r("div",{class:"font-medium text-gray-700 mb-3 text-xl"},[m("用于申请时可用的模板变量:")]),r("div",{class:"space-y-2 ml-4"},[r("div",null,[r("code",{class:"px-2 py-1 bg-gray-200 rounded text-lg font-mono"},[m("__domain__")]),m(":完整域名,如:_acme-challenge.allinssl.com")]),r("div",null,[r("code",{class:"px-2 py-1 bg-gray-200 rounded text-lg font-mono"},[m("__keyAuth__")]),m(":域名解析值")]),r("div",null,[r("code",{class:"px-2 py-1 bg-gray-200 rounded text-lg font-mono"},[m("__action__")]),m(":执行的操作,需要自行根据参数值判断,为present时执行写入,cleanup清理记录")])])])])])));break;case"spaceship":n.push(u("API Key","config.api_key",{allowInput:W}),u("API Secret","config.api_secret",{type:"password",showPasswordOn:"click",allowInput:W}));break;case"plugin":n.push(S(()=>r(w,{label:s("t_1_1750144122230"),path:"config.name",showRequireMark:!0},{default:()=>[r(y,{class:"w-full",options:C.value,placeholder:s("t_2_1750144123753"),filterable:!0,renderLabel:X,renderTag:Y,value:q.value.config.name,"onUpdate:value":e=>q.value.config.name=e,onUpdateValue:(e,a)=>{q.value.config.name=e,j.value=Z(a.config||{})}},{empty:()=>r("span",{class:"text-[1.4rem]"},[s("t_0_1750210698345")])})]})),S(()=>{const e=q.value.config,a=e=>{q.value.config.config=e};return r(w,{path:"config.params"},{default:()=>[r(k,{type:"textarea",value:"string"==typeof e.config?e.config:JSON.stringify(e.config,null,2),onUpdateValue:a,placeholder:j.value,rows:4},null)],label:()=>r("div",null,[r(G,null,{default:()=>[m("自定义参数")]}),r(h,null,{default:()=>[j.value],trigger:()=>r("span",{class:"inline-flex ml-2 -mt-1 cursor-pointer text-base rounded-full w-[14px] h-[14px] justify-center items-center text-orange-600 border border-orange-600"},[m("?")])})])})}))}return n});x(()=>q.value.type,e=>{var a;switch(e){case"ssh":q.value.config={host:"",port:22,user:"root",mode:"password",password:""};break;case"1panel":q.value.config={url:"",api_key:"",ignore_ssl:"0",version:"v1"};break;case"btpanel":case"btwaf":q.value.config={url:"",api_key:"",ignore_ssl:"0"};break;case"aliyun":q.value.config={access_key_id:"",access_key_secret:""};break;case"baidu":case"huaweicloud":case"doge":q.value.config={access_key:"",secret_key:""};break;case"cloudflare":q.value.config={email:"",api_key:""};break;case"tencentcloud":q.value.config={secret_id:"",secret_key:""};break;case"godaddy":case"spaceship":q.value.config={api_key:"",api_secret:""};break;case"qiniu":q.value.config={access_key:"",access_secret:""};break;case"namecheap":q.value.config={api_user:"",api_key:""};break;case"ns1":case"namesilo":case"bunny":q.value.config={api_key:""};break;case"cloudns":q.value.config={auth_id:"",auth_password:""};break;case"aws":q.value.config={access_key_id:"",secret_access_key:"",region:""};break;case"azure":q.value.config={tenant_id:"",client_id:"",client_secret:"",environment:""};break;case"namedotcom":q.value.config={username:"",api_token:""};break;case"gcore":q.value.config={api_token:""};break;case"jdcloud":q.value.config={access_key_id:"",secret_access_key:""};break;case"lecdn":q.value.config={url:"",username:"",password:"",ignore_ssl:"0"};break;case"constellix":q.value.config={api_key:"",secret_key:""};break;case"webhook":q.value.config={url:"",method:"POST",headers:"Content-Type: application/json",data:"",ignore_ssl:"0"};break;case"plugin":q.value.config={name:(null==(a=C.value[0])?void 0:a.value)||"",config:""}}});const L=({option:e})=>r(Q,{class:"w-full"},{default:()=>[e.label?J(e):r("span",{class:"text-[1.4rem] text-gray-400"},[s("t_0_1745833934390")])]}),J=e=>{let a;const t={dns:s("t_3_1745735765112"),host:s("t_0_1746754500246"),plugin:"插件"};return r(Q,{align:"center",size:"small",class:"w-full py-1"},{default:()=>[r(H,{icon:`resources-${e.value}`,size:"1.6rem"},null),r(G,{class:"flex-1"},{default:()=>[e.label]}),e.access&&e.access.length>0&&r(Q,{size:"small",class:"ml-auto"},ae(a=e.access.map(e=>r(i,{key:e,type:"dns"===e?"success":"info",size:"small"},{default:()=>[t[e]||e]})))?a:{default:()=>[a]})]})},X=e=>r(Q,{justify:"space-between",class:"w-[38rem]"},{default:()=>[r(Q,{align:"center",size:"small"},{default:()=>[r(H,{icon:`resources-${e.value}`,size:"1.6rem"},null),r(G,null,{default:()=>[e.label]}),e.description&&r("div",{class:"text-[1.2rem] text-gray-500 mt-[0.2rem]"},[e.description])]})]}),Y=e=>{const{option:a}=e;return r(Q,{class:"w-full"},{default:()=>[(null==a?void 0:a.label)?r(Q,{align:"center",size:"small"},{default:()=>[r(H,{icon:`resources-${a.value}`,size:"1.4rem"},null),r(G,null,{default:()=>[a.label]})]}):r("span",{class:"text-[1.4rem] text-gray-400"},[s("t_2_1750210698518")])]})},Z=e=>s("t_3_1750210706775")+JSON.stringify(e||{}),{component:ee,fetch:te}=A({config:N,defaultValue:q,request:async e=>{try{const a={...e,config:JSON.stringify(e.config)};if("id"in e){const{id:e,name:t,config:s}=a;await le({id:e.toString(),name:t,config:s})}else await re(a)}catch(a){throw ie(new Error(s("t_4_1746667590873")))}},rules:M});return n(async e=>{try{o(),await te(),ce(),e()}catch(a){return ie(a)}finally{l()}}),c(async()=>{var e;try{const{data:a}=await D().fetch();if(a&&Array.isArray(a)){const t=[];a.forEach(e=>{t.push({label:e.name,value:e.name,description:e.actions.map(e=>e.description).join("、"),pluginName:e.name,config:e.config})}),C.value=t,j.value=Z((null==(e=t[0])?void 0:e.config)||{})}}catch(a){}}),{ApiManageForm:ee}};const de=o({name:"AuthApiManage",setup(){const{TableComponent:e,PageComponent:a,SearchComponent:t,openAddForm:n}=ue(),o=S(["contentPadding","borderColor","headerHeight","iconColorHover"]);return()=>r("div",{class:"h-full flex flex-col",style:o.value},[r("div",{class:"mx-auto max-w-[1600px] w-full p-6"},[r(X,null,{headerLeft:()=>{let e;return r(p,{type:"primary",size:"large",class:"px-5",onClick:n},"function"==typeof(a=e=s("t_0_1745289355714"))||"[object Object]"===Object.prototype.toString.call(a)&&!g(a)?e:{default:()=>[e]});var a},headerRight:()=>r(t,{placeholder:s("t_0_1745289808449")},null),content:()=>r("div",{class:"rounded-lg"},[r(e,{size:"medium","scroll-x":"1560"},{empty:()=>r(q,{addButtonText:s("t_0_1745289355714"),onAddClick:n},null)})]),footerRight:()=>r("div",{class:"mt-4 flex justify-end"},[r(a,null,null)])})])])}});export{de as default};
|