diff --git a/README.md b/README.md index f99c5a74..e94c2d5f 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ git clone git@github.com:usual2970/certimate.git && cd certimate/docker && docke ```bash git clone EMAIL:usual2970/certimate.git cd certimate +go mod vendor go run main.go serve ``` diff --git a/README_EN.md b/README_EN.md index 6dd766af..5a0cc551 100644 --- a/README_EN.md +++ b/README_EN.md @@ -56,6 +56,7 @@ git clone git@github.com:usual2970/certimate.git && cd certimate/docker && docke ```bash git clone EMAIL:usual2970/certimate.git cd certimate +go mod vendor go run main.go serve ``` diff --git a/ui/dist/assets/index-CnO7gXFE.js b/ui/dist/assets/index-5t0OlkS6.js similarity index 95% rename from ui/dist/assets/index-CnO7gXFE.js rename to ui/dist/assets/index-5t0OlkS6.js index 972fe4ce..1884dd60 100644 --- a/ui/dist/assets/index-CnO7gXFE.js +++ b/ui/dist/assets/index-5t0OlkS6.js @@ -310,4 +310,4 @@ https://github.com/nodeca/pako/blob/main/LICENSE key=val; key2=val2;`,..._,className:"placeholder:whitespace-pre-wrap"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:f.control,name:"nameservers",render:({field:_})=>a.jsxs(we,{hidden:i!="advance",children:[a.jsx(_e,{children:"域名服务器"}),a.jsx(be,{children:a.jsx(Sa,{placeholder:`自定义域名服务器,多个用分号隔开,如: 8.8.8.8; -8.8.4.4;`,..._,className:"placeholder:whitespace-pre-wrap"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})})},sN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sN.displayName="Card";const oN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex flex-col space-y-1.5 p-6",e),...t}));oN.displayName="CardHeader";const iN=g.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));iN.displayName="CardTitle";const aN=g.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));aN.displayName="CardDescription";const lN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("p-6 pt-0",e),...t}));lN.displayName="CardContent";const cN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex items-center p-6 pt-0",e),...t}));cN.displayName="CardFooter";const Es=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",KU=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=Ar(),{toast:r}=Pn(),n=Pr(),s=async i=>{try{await U3(i),t()}catch(l){r({title:"删除失败",description:Es(l),variant:"destructive"});return}},o=()=>{n("/access")};return a.jsxs("div",{className:"mt-10",children:[a.jsx(ia,{when:e.length==0,children:a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(C0,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),a.jsx(Ey,{trigger:a.jsx(He,{children:"新增授权组"}),className:"mt-3"})]})})}),a.jsx(ih,{className:"h-[75vh] overflow-hidden",children:a.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(i=>a.jsxs(sN,{className:"w-full md:w-[350px]",children:[a.jsxs(oN,{children:[a.jsx(iN,{children:i.name}),a.jsxs(aN,{children:["共有",i.expand?i.expand.access.length:0,"个部署授权配置"]})]}),a.jsx(lN,{className:"min-h-[180px]",children:i.expand?a.jsx(a.Fragment,{children:i.expand.access.slice(0,3).map(l=>a.jsx("div",{className:"flex flex-col mb-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"",children:a.jsx("img",{src:Ew(l.configType)[1],alt:"provider",className:"w-8 h-8"})}),a.jsxs("div",{className:"ml-3",children:[a.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.name}),a.jsx("div",{className:"text-xs text-muted-foreground",children:Ew(l.configType)[0]})]})]})},l.id))}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[a.jsx("div",{children:a.jsx(C0,{size:40})}),a.jsx("div",{className:"ml-2",children:"暂无部署授权配置,请添加后开始使用吧"})]})})}),a.jsx(cN,{children:a.jsxs("div",{className:"flex justify-end w-full",children:[a.jsx(ia,{when:!!(i.expand&&i.expand.access.length>0),children:a.jsx("div",{children:a.jsx(He,{size:"sm",variant:"link",onClick:()=>{n(`/access?accessGroupId=${i.id}&tab=access`,{replace:!0})},children:"所有授权"})})}),a.jsx(ia,{when:!i.expand||i.expand.access.length==0,children:a.jsx("div",{children:a.jsx(He,{size:"sm",onClick:o,children:"新增授权"})})}),a.jsx("div",{className:"ml-3",children:a.jsxs(GC,{children:[a.jsx(ZC,{asChild:!0,children:a.jsx(He,{variant:"destructive",size:"sm",children:"删除"})}),a.jsxs(ty,{children:[a.jsxs(ry,{children:[a.jsx(sy,{className:"dark:text-gray-200",children:"删除组"}),a.jsx(oy,{children:"确定要删除部署授权组吗?"})]}),a.jsxs(ny,{children:[a.jsx(ay,{className:"dark:text-gray-200",children:"取消"}),a.jsx(iy,{onClick:()=>{s(i.id?i.id:"")},children:"确认"})]})]})]})})]})})]}))})})]})};var Ny="Tabs",[GU,iV]=sr(Ny,[Oa]),uN=Oa(),[ZU,Ty]=GU(Ny),dN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=di(l),[f,m]=Yr({prop:n,onChange:s,defaultProp:o});return a.jsx(ZU,{scope:r,baseId:$r(),value:f,onValueChange:m,orientation:i,dir:d,activationMode:c,children:a.jsx(Re.div,{dir:d,"data-orientation":i,...u,ref:t})})});dN.displayName=Ny;var fN="TabsList",hN=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Ty(fN,r),i=uN(r);return a.jsx(nv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:a.jsx(Re.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});hN.displayName=fN;var pN="TabsTrigger",mN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Ty(pN,r),l=uN(r),c=yN(i.baseId,n),u=xN(i.baseId,n),d=n===i.value;return a.jsx(sv,{asChild:!0,...l,focusable:!s,active:d,children:a.jsx(Re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ue(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:ue(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:ue(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(n)})})})});mN.displayName=pN;var gN="TabsContent",vN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,l=Ty(gN,r),c=yN(l.baseId,n),u=xN(l.baseId,n),d=n===l.value,f=g.useRef(d);return g.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(or,{present:s||d,children:({present:m})=>a.jsx(Re.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&o})})});vN.displayName=gN;function yN(e,t){return`${e}-trigger-${t}`}function xN(e,t){return`${e}-content-${t}`}var qU=dN,wN=hN,_N=mN,bN=vN;const SN=qU,Ry=g.forwardRef(({className:e,...t},r)=>a.jsx(wN,{ref:r,className:oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ry.displayName=wN.displayName;const Yo=g.forwardRef(({className:e,...t},r)=>a.jsx(_N,{ref:r,className:oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Yo.displayName=_N.displayName;const qd=g.forwardRef(({className:e,...t},r)=>a.jsx(bN,{ref:r,className:oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qd.displayName=bN.displayName;const XU=()=>{const{config:e,deleteAccess:t}=Ar(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Pr(),i=Nn(),l=new URLSearchParams(i.search),c=l.get("page"),u=c?Number(c):1,d=l.get("tab"),f=l.get("accessGroupId"),m=(u-1)*n,v=m+n,x=async _=>{const p=await z3(_);t(p.id)},y=_=>{l.set("tab",_),o({search:l.toString()})};return a.jsxs("div",{className:"",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),d!="access_group"?a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add"}):a.jsx(Ey,{trigger:a.jsx(He,{children:"添加授权组"})})]}),a.jsxs(SN,{defaultValue:d||"access",value:d||"access",className:"w-full mt-5",children:[a.jsxs(Ry,{className:"space-x-5 px-3",children:[a.jsx(Yo,{value:"access",onClick:()=>{y("access")},children:"授权管理"}),a.jsx(Yo,{value:"access_group",onClick:()=>{y("access_group")},children:"授权组管理"})]}),a.jsx(qd,{value:"access",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(RA,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add",className:"mt-3"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"名称"}),a.jsx("div",{className:"w-48",children:"服务商"}),a.jsx("div",{className:"w-52",children:"创建时间"}),a.jsx("div",{className:"w-52",children:"更新时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.filter(_=>f?_.group==f:!0).slice(m,v).map(_=>{var p,h;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:_.name}),a.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[a.jsx("img",{src:(p=mo.get(_.configType))==null?void 0:p[1],className:"w-6"}),a.jsx("div",{children:(h=mo.get(_.configType))==null?void 0:h[0]})]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于"," ",_.created&&ya(_.created)]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于"," ",_.updated&&ya(_.updated)]}),a.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[a.jsx(Tl,{trigger:a.jsx(He,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:_}),a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>{x(_)},children:"删除"})]})]},_.id)}),a.jsx(NC,{totalPages:s,currentPage:u,onPageChange:_=>{l.set("page",_.toString()),o({search:l.toString()})}})]})}),a.jsx(qd,{value:"access_group",children:a.jsx(KU,{})})]})]})},QU=Sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Py=g.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:oe(QU({variant:t}),e),...r}));Py.displayName="Alert";const Ay=g.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:oe("mb-1 font-medium leading-none tracking-tight",e),...t}));Ay.displayName="AlertTitle";const Dy=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("text-sm [&_p]:leading-relaxed",e),...t}));Dy.displayName="AlertDescription";const kN=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await st().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},JU=()=>{const e=Pr(),[t,r]=g.useState(),[n]=vA(),s=n.get("domain");return g.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const l=await kN(i);r(l.items)})()},[s]),a.jsxs(ih,{className:"h-[80vh] overflow-hidden",children:[a.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]}):a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mx-auto mt-20",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},e$=ce.object({username:ce.string().email({message:"请输入正确的邮箱地址"}),password:ce.string().min(10,{message:"密码至少10个字符"})}),t$=()=>{const e=fr({resolver:hr(e$),defaultValues:{username:"",password:""}}),t=async n=>{try{await st().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=Es(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Pr();return a.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[a.jsx("div",{className:"flex justify-center mb-10",children:a.jsx("img",{src:"/vite.svg",className:"w-16"})}),a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"username",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"用户名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"email",...n})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"password",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"shadcn",...n,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"登录"})})]})})]})},r$=()=>st().authStore.isValid&&st().authStore.isAdmin?a.jsx(ib,{to:"/"}):a.jsxs("div",{className:"container",children:[a.jsx(Lg,{}),a.jsx(pC,{})]}),n$=ce.object({oldPassword:ce.string().min(10,{message:"密码至少10个字符"}),newPassword:ce.string().min(10,{message:"密码至少10个字符"}),confirmPassword:ce.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),s$=()=>{const{toast:e}=Pn(),t=Pr(),r=fr({resolver:hr(n$),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await st().admins.authWithPassword((o=st().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(l){const c=Es(l);r.setError("oldPassword",{message:c})}try{await st().admins.update((i=st().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),st().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(l){const c=Es(l);e({title:"修改密码失败",description:c,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...r,children:a.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:r.control,name:"oldPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"当前密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"当前密码",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"newPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"新密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"newPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"confirmPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"确认密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"confirmPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},o$=()=>{const e=Nn(),[t,r]=g.useState("account"),n=Pr();return g.useEffect(()=>{const o=e.pathname.split("/")[2];r(o)},[e]),a.jsxs("div",{children:[a.jsx(hy,{}),a.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"偏好设置"}),a.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:a.jsxs(SN,{defaultValue:"account",className:"w-full",value:t,children:[a.jsxs(Ry,{className:"mx-auto",children:[a.jsxs(Yo,{value:"account",onClick:()=>{n("/setting/account")},className:"px-5",children:[a.jsx(FA,{size:14}),a.jsx("div",{className:"ml-1",children:"账户"})]}),a.jsxs(Yo,{value:"password",onClick:()=>{n("/setting/password")},className:"px-5",children:[a.jsx(TA,{size:14}),a.jsx("div",{className:"ml-1",children:"密码"})]}),a.jsxs(Yo,{value:"notify",onClick:()=>{n("/setting/notify")},className:"px-5",children:[a.jsx(AA,{size:14}),a.jsx("div",{className:"ml-1",children:"消息推送"})]}),a.jsxs(Yo,{value:"ssl-provider",onClick:()=>{n("/setting/ssl-provider")},className:"px-5",children:[a.jsx(MA,{size:14}),a.jsx("div",{className:"ml-1",children:"证书厂商"})]})]}),a.jsx(qd,{value:t,children:a.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:a.jsx(Lg,{})})})]})})]})},i$=()=>{const[e,t]=g.useState(),[r,n]=g.useState(),s=Pr();return g.useEffect(()=>{(async()=>{const i=await gz();t(i)})()},[]),g.useEffect(()=>{(async()=>{const l=await kN({perPage:8});n(l.items)})()},[]),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),a.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(IA,{size:48,strokeWidth:1,className:"text-blue-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?a.jsx(gr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(SA,{size:48,strokeWidth:1,className:"text-red-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?a.jsx(gr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(PA,{size:48,strokeWidth:1,className:"text-green-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?a.jsx(gr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(_A,{size:48,strokeWidth:1,className:"text-gray-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?a.jsx(gr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mt-10",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{s("/edit")},children:"添加域名"})})]})]})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]})]})]})},a$=ce.object({email:ce.string().email("请输入正确的邮箱")}),l$=()=>{var i;const{toast:e}=Pn(),t=Pr(),[r,n]=g.useState(!1),s=fr({resolver:hr(a$),defaultValues:{email:(i=st().authStore.model)==null?void 0:i.email}}),o=async l=>{var c;try{await st().admins.update((c=st().authStore.model)==null?void 0:c.id,{email:l.email}),st().authStore.clear(),e({title:"修改账户邮箱功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(u){const d=Es(u);e({title:"修改账户邮箱失败",description:d,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...s,children:a.jsxs("form",{onSubmit:s.handleSubmit(o),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:s.control,name:"email",render:({field:l})=>a.jsxs(we,{children:[a.jsx(_e,{children:"邮箱"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入邮箱",...l,type:"email",onChange:c=>{n(!0),s.setValue("email",c.target.value)}})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:r?a.jsx(He,{type:"submit",children:"确认修改"}):a.jsx(He,{type:"submit",disabled:!0,variant:"secondary",children:"确认修改"})})]})})})})},c$=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const r=t.payload.channel;return{...e,content:{...e.content,[r]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},CN=g.createContext({}),Oy=()=>g.useContext(CN),u$=({children:e})=>{const[t,r]=g.useReducer(c$,{});g.useEffect(()=>{(async()=>{const i=await Zv("notifyChannels");r({type:"SET_CHANNELS",payload:i})})()},[]);const n=g.useCallback(o=>{r({type:"SET_CHANNEL",payload:o})},[]),s=g.useCallback(o=>{r({type:"SET_CHANNELS",payload:o})},[]);return a.jsx(CN.Provider,{value:{config:t,setChannel:n,setChannels:s},children:e})},d$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={accessToken:"",secret:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.dingtalk?u.dingtalk:c})();n({id:e.id??"",name:"dingtalk",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"AccessToken",value:r.data.accessToken,onChange:i=>{n({...r,data:{...r.data,accessToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"加签的签名",className:"mt-2",value:r.data.secret,onChange:i=>{n({...r,data:{...r.data,secret:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})},f$={title:"您有{COUNT}张证书即将过期",content:"有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!"},h$=()=>{const[e,t]=g.useState(""),[r,n]=g.useState([f$]),{toast:s}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("templates");u.content&&(n(u.content.notifyTemplates),t(u.id?u.id:""))})()},[]);const o=c=>{const u=r[0];n([{...u,title:c}])},i=c=>{const u=r[0];n([{...u,content:c}])},l=async()=>{const c=await Fa({id:e,content:{notifyTemplates:r},name:"templates"});c.id&&t(c.id),s({title:"保存成功",description:"通知模板保存成功"})};return a.jsxs("div",{children:[a.jsx(Ne,{value:r[0].title,onChange:c=>{o(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数"}),a.jsx(Sa,{className:"mt-2",value:r[0].content,onChange:c=>{i(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数,DOMAINS:域名列表"}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:l,children:"保存"})})]})},p$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={apiToken:"",chatId:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.telegram?u.telegram:c})();n({id:e.id??"",name:"telegram",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"ApiToken",value:r.data.apiToken,onChange:i=>{n({...r,data:{...r.data,apiToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"ChatId",value:r.data.chatId,onChange:i=>{n({...r,data:{...r.data,chatId:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};function m$(e){try{return new URL(e),!0}catch{return!1}}const g$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={url:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.webhook?u.webhook:c})();n({id:e.id??"",name:"webhook",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{if(r.data.url=r.data.url.trim(),!m$(r.data.url)){s({title:"保存失败",description:"Url格式不正确",variant:"destructive"});return}const i=await Fa({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"Url",value:r.data.url,onChange:i=>{n({...r,data:{...r.data,url:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};var My="Collapsible",[v$,jN]=sr(My),[y$,Iy]=v$(My),EN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...l}=e,[c=!1,u]=Yr({prop:n,defaultProp:s,onChange:i});return a.jsx(y$,{scope:r,disabled:o,contentId:$r(),open:c,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),children:a.jsx(Re.div,{"data-state":Fy(c),"data-disabled":o?"":void 0,...l,ref:t})})});EN.displayName=My;var NN="CollapsibleTrigger",TN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=Iy(NN,r);return a.jsx(Re.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Fy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:ue(e.onClick,s.onOpenToggle)})});TN.displayName=NN;var Ly="CollapsibleContent",RN=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Iy(Ly,e.__scopeCollapsible);return a.jsx(or,{present:r||s.open,children:({present:o})=>a.jsx(x$,{...n,ref:t,present:o})})});RN.displayName=Ly;var x$=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,i=Iy(Ly,r),[l,c]=g.useState(n),u=g.useRef(null),d=Ke(t,u),f=g.useRef(0),m=f.current,v=g.useRef(0),x=v.current,y=i.open||l,_=g.useRef(y),p=g.useRef();return g.useEffect(()=>{const h=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(h)},[]),Jt(()=>{const h=u.current;if(h){p.current=p.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const w=h.getBoundingClientRect();f.current=w.height,v.current=w.width,_.current||(h.style.transitionDuration=p.current.transitionDuration,h.style.animationName=p.current.animationName),c(n)}},[i.open,n]),a.jsx(Re.div,{"data-state":Fy(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:y&&s})});function Fy(e){return e?"open":"closed"}var w$=EN,_$=TN,b$=RN,zs="Accordion",S$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zy,k$,C$]=kc(zs),[ah,aV]=sr(zs,[C$,jN]),Uy=jN(),PN=Be.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,o=n;return a.jsx(zy.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(T$,{...o,ref:t}):a.jsx(N$,{...s,ref:t})})});PN.displayName=zs;var[AN,j$]=ah(zs),[DN,E$]=ah(zs,{collapsible:!1}),N$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[l,c]=Yr({prop:r,defaultProp:n,onChange:s});return a.jsx(AN,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:c,onItemClose:Be.useCallback(()=>o&&c(""),[o,c]),children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:o,children:a.jsx(ON,{...i,ref:t})})})}),T$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...o}=e,[i=[],l]=Yr({prop:r,defaultProp:n,onChange:s}),c=Be.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=Be.useCallback(d=>l((f=[])=>f.filter(m=>m!==d)),[l]);return a.jsx(AN,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(ON,{...o,ref:t})})})}),[R$,lh]=ah(zs),ON=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:o="vertical",...i}=e,l=Be.useRef(null),c=Ke(l,t),u=k$(r),f=di(s)==="ltr",m=ue(e.onKeyDown,v=>{var P;if(!S$.includes(v.key))return;const x=v.target,y=u().filter(A=>{var L;return!((L=A.ref.current)!=null&&L.disabled)}),_=y.findIndex(A=>A.ref.current===x),p=y.length;if(_===-1)return;v.preventDefault();let h=_;const w=0,C=p-1,j=()=>{h=_+1,h>C&&(h=w)},E=()=>{h=_-1,h{const{__scopeAccordion:r,value:n,...s}=e,o=lh(Xd,r),i=j$(Xd,r),l=Uy(r),c=$r(),u=n&&i.value.includes(n)||!1,d=o.disabled||e.disabled;return a.jsx(P$,{scope:r,open:u,disabled:d,triggerId:c,children:a.jsx(w$,{"data-orientation":o.orientation,"data-state":$N(u),...l,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(n):i.onItemClose(n)}})})});MN.displayName=Xd;var IN="AccordionHeader",LN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(IN,r);return a.jsx(Re.h3,{"data-orientation":s.orientation,"data-state":$N(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});LN.displayName=IN;var Im="AccordionTrigger",FN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(Im,r),i=E$(Im,r),l=Uy(r);return a.jsx(zy.ItemSlot,{scope:r,children:a.jsx(_$,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...l,...n,ref:t})})});FN.displayName=Im;var zN="AccordionContent",UN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(zN,r),i=Uy(r);return a.jsx(b$,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});UN.displayName=zN;function $N(e){return e?"open":"closed"}var A$=PN,D$=MN,O$=LN,VN=FN,BN=UN;const Nw=A$,hl=g.forwardRef(({className:e,...t},r)=>a.jsx(D$,{ref:r,className:oe("border-b",e),...t}));hl.displayName="AccordionItem";const pl=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(O$,{className:"flex",children:a.jsxs(VN,{ref:n,className:oe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(Fg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));pl.displayName=VN.displayName;const ml=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(BN,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:oe("pb-4 pt-0",e),children:t})}));ml.displayName=BN.displayName;const M$=()=>a.jsx(a.Fragment,{children:a.jsxs(u$,{children:[a.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:a.jsx(Nw,{type:"multiple",className:"dark:text-stone-200",children:a.jsxs(hl,{value:"item-1",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"模板"}),a.jsx(ml,{children:a.jsx(h$,{})})]})})}),a.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:a.jsxs(Nw,{type:"single",className:"dark:text-stone-200",children:[a.jsxs(hl,{value:"item-2",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"钉钉"}),a.jsx(ml,{children:a.jsx(d$,{})})]}),a.jsxs(hl,{value:"item-4",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Telegram"}),a.jsx(ml,{children:a.jsx(p$,{})})]}),a.jsxs(hl,{value:"item-5",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Webhook"}),a.jsx(ml,{children:a.jsx(g$,{})})]})]})})]})});var Vy="Radio",[I$,WN]=sr(Vy),[L$,F$]=I$(Vy),HN=g.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:l="on",onCheck:c,...u}=e,[d,f]=g.useState(null),m=Ke(t,y=>f(y)),v=g.useRef(!1),x=d?!!d.closest("form"):!0;return a.jsxs(L$,{scope:r,checked:s,disabled:i,children:[a.jsx(Re.button,{type:"button",role:"radio","aria-checked":s,"data-state":GN(s),"data-disabled":i?"":void 0,disabled:i,value:l,...u,ref:m,onClick:ue(e.onClick,y=>{s||c==null||c(),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&a.jsx(z$,{control:d,bubbles:!v.current,name:n,value:l,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});HN.displayName=Vy;var YN="RadioIndicator",KN=g.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=F$(YN,r);return a.jsx(or,{present:n||o.checked,children:a.jsx(Re.span,{"data-state":GN(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});KN.displayName=YN;var z$=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),l=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),a.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GN(e){return e?"checked":"unchecked"}var U$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],By="RadioGroup",[$$,lV]=sr(By,[Oa,WN]),ZN=Oa(),qN=WN(),[V$,B$]=$$(By),XN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,v=ZN(r),x=di(u),[y,_]=Yr({prop:o,defaultProp:s,onChange:f});return a.jsx(V$,{scope:r,name:n,required:i,disabled:l,value:y,onValueChange:_,children:a.jsx(nv,{asChild:!0,...v,orientation:c,dir:x,loop:d,children:a.jsx(Re.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...m,ref:t})})})});XN.displayName=By;var QN="RadioGroupItem",JN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=B$(QN,r),i=o.disabled||n,l=ZN(r),c=qN(r),u=g.useRef(null),d=Ke(t,u),f=o.value===s.value,m=g.useRef(!1);return g.useEffect(()=>{const v=y=>{U$.includes(y.key)&&(m.current=!0)},x=()=>m.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",x)}},[]),a.jsx(sv,{asChild:!0,...l,focusable:!i,active:f,children:a.jsx(HN,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ue(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:ue(s.onFocus,()=>{var v;m.current&&((v=u.current)==null||v.click())})})})});JN.displayName=QN;var W$="RadioGroupIndicator",eT=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=qN(r);return a.jsx(KN,{...s,...n,ref:t})});eT.displayName=W$;var tT=XN,rT=JN,H$=eT;const nT=g.forwardRef(({className:e,...t},r)=>a.jsx(tT,{className:oe("grid gap-2",e),...t,ref:r}));nT.displayName=tT.displayName;const Lm=g.forwardRef(({className:e,...t},r)=>a.jsx(rT,{ref:r,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(H$,{className:"flex items-center justify-center",children:a.jsx(cb,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Lm.displayName=rT.displayName;const Y$=ce.object({provider:ce.enum(["letsencrypt","zerossl"],{message:"请选择SSL提供商"}),eabKid:ce.string().optional(),eabHmacKey:ce.string().optional()}),K$=()=>{const e=fr({resolver:hr(Y$),defaultValues:{provider:"letsencrypt"}}),[t,r]=g.useState("letsencrypt"),[n,s]=g.useState(),{toast:o}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("ssl-provider");if(u){s(u);const d=u.content;e.setValue("provider",d.provider),e.setValue("eabKid",d.config[d.provider].eabKid),e.setValue("eabHmacKey",d.config[d.provider].eabHmacKey),r(d.provider)}else e.setValue("provider","letsencrypt"),r("letsencrypt")})()},[]);const i=c=>t===c?"border-primary":"",l=async c=>{if(c.provider==="zerossl"&&(c.eabKid||e.setError("eabKid",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),c.eabHmacKey||e.setError("eabHmacKey",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),!c.eabKid||!c.eabHmacKey))return;const u={id:n==null?void 0:n.id,name:"ssl-provider",content:{provider:c.provider,config:{letsencrypt:{},zerossl:{eabKid:c.eabKid??"",eabHmacKey:c.eabHmacKey??""}}}};try{await Fa(u),o({title:"修改成功",description:"修改成功"})}catch(d){const f=Es(d);o({title:"修改失败",description:f,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(l),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"provider",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"证书厂商"}),a.jsx(be,{children:a.jsxs(nT,{...c,className:"flex",onValueChange:u=>{r(u),e.setValue("provider",u)},value:t,children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"letsencrypt",id:"letsencrypt"}),a.jsx(Co,{htmlFor:"letsencrypt",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("letsencrypt")),children:[a.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),a.jsx("div",{children:"Let's Encrypt"})]})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"zerossl",id:"zerossl"}),a.jsx(Co,{htmlFor:"zerossl",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("zerossl")),children:[a.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),a.jsx("div",{children:"ZeroSSL"})]})})]})]})}),a.jsx(Se,{control:e.control,name:"eabKid",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_KID"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_KID",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"eabHmacKey",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_HMAC_KEY"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_HMAC_KEY",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},G$=rA([{path:"/",element:a.jsx(J3,{}),children:[{path:"/",element:a.jsx(i$,{})},{path:"/domains",element:a.jsx(_z,{})},{path:"/edit",element:a.jsx(YU,{})},{path:"/access",element:a.jsx(XU,{})},{path:"/history",element:a.jsx(JU,{})},{path:"/setting",element:a.jsx(o$,{}),children:[{path:"/setting/password",element:a.jsx(s$,{})},{path:"/setting/account",element:a.jsx(l$,{})},{path:"/setting/notify",element:a.jsx(M$,{})},{path:"/setting/ssl-provider",element:a.jsx(K$,{})}]}]},{path:"/login",element:a.jsx(r$,{}),children:[{path:"/login",element:a.jsx(t$,{})}]},{path:"/about",element:a.jsx("div",{children:"About"})}]);ip.createRoot(document.getElementById("root")).render(a.jsx(Be.StrictMode,{children:a.jsx(Y3,{defaultTheme:"system",storageKey:"vite-ui-theme",children:a.jsx(dA,{router:G$})})}))});export default Z$(); +8.8.4.4;`,..._,className:"placeholder:whitespace-pre-wrap"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"保存"})})]})})})]})]})})},sN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));sN.displayName="Card";const oN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex flex-col space-y-1.5 p-6",e),...t}));oN.displayName="CardHeader";const iN=g.forwardRef(({className:e,...t},r)=>a.jsx("h3",{ref:r,className:oe("text-2xl font-semibold leading-none tracking-tight",e),...t}));iN.displayName="CardTitle";const aN=g.forwardRef(({className:e,...t},r)=>a.jsx("p",{ref:r,className:oe("text-sm text-muted-foreground",e),...t}));aN.displayName="CardDescription";const lN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("p-6 pt-0",e),...t}));lN.displayName="CardContent";const cN=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("flex items-center p-6 pt-0",e),...t}));cN.displayName="CardFooter";const Es=e=>e instanceof Error?e.message:typeof e=="object"&&e!==null&&"message"in e?String(e.message):typeof e=="string"?e:"Something went wrong",KU=()=>{const{config:{accessGroups:e},reloadAccessGroups:t}=Ar(),{toast:r}=Pn(),n=Pr(),s=async i=>{try{await U3(i),t()}catch(l){r({title:"删除失败",description:Es(l),variant:"destructive"});return}},o=()=>{n("/access")};return a.jsxs("div",{className:"mt-10",children:[a.jsx(ia,{when:e.length==0,children:a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(C0,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加域名开始部署证书吧。"}),a.jsx(Ey,{trigger:a.jsx(He,{children:"新增授权组"}),className:"mt-3"})]})})}),a.jsx(ih,{className:"h-[75vh] overflow-hidden",children:a.jsx("div",{className:"flex gap-5 flex-wrap",children:e.map(i=>a.jsxs(sN,{className:"w-full md:w-[350px]",children:[a.jsxs(oN,{children:[a.jsx(iN,{children:i.name}),a.jsxs(aN,{children:["共有",i.expand?i.expand.access.length:0,"个部署授权配置"]})]}),a.jsx(lN,{className:"min-h-[180px]",children:i.expand?a.jsx(a.Fragment,{children:i.expand.access.slice(0,3).map(l=>a.jsx("div",{className:"flex flex-col mb-3",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"",children:a.jsx("img",{src:Ew(l.configType)[1],alt:"provider",className:"w-8 h-8"})}),a.jsxs("div",{className:"ml-3",children:[a.jsx("div",{className:"text-sm font-semibold text-gray-700 dark:text-gray-200",children:l.name}),a.jsx("div",{className:"text-xs text-muted-foreground",children:Ew(l.configType)[0]})]})]})},l.id))}):a.jsx(a.Fragment,{children:a.jsxs("div",{className:"flex text-gray-700 dark:text-gray-200 items-center",children:[a.jsx("div",{children:a.jsx(C0,{size:40})}),a.jsx("div",{className:"ml-2",children:"暂无部署授权配置,请添加后开始使用吧"})]})})}),a.jsx(cN,{children:a.jsxs("div",{className:"flex justify-end w-full",children:[a.jsx(ia,{when:!!(i.expand&&i.expand.access.length>0),children:a.jsx("div",{children:a.jsx(He,{size:"sm",variant:"link",onClick:()=>{n(`/access?accessGroupId=${i.id}&tab=access`,{replace:!0})},children:"所有授权"})})}),a.jsx(ia,{when:!i.expand||i.expand.access.length==0,children:a.jsx("div",{children:a.jsx(He,{size:"sm",onClick:o,children:"新增授权"})})}),a.jsx("div",{className:"ml-3",children:a.jsxs(GC,{children:[a.jsx(ZC,{asChild:!0,children:a.jsx(He,{variant:"destructive",size:"sm",children:"删除"})}),a.jsxs(ty,{children:[a.jsxs(ry,{children:[a.jsx(sy,{className:"dark:text-gray-200",children:"删除组"}),a.jsx(oy,{children:"确定要删除部署授权组吗?"})]}),a.jsxs(ny,{children:[a.jsx(ay,{className:"dark:text-gray-200",children:"取消"}),a.jsx(iy,{onClick:()=>{s(i.id?i.id:"")},children:"确认"})]})]})]})})]})})]}))})})]})};var Ny="Tabs",[GU,iV]=sr(Ny,[Oa]),uN=Oa(),[ZU,Ty]=GU(Ny),dN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:s,defaultValue:o,orientation:i="horizontal",dir:l,activationMode:c="automatic",...u}=e,d=di(l),[f,m]=Yr({prop:n,onChange:s,defaultProp:o});return a.jsx(ZU,{scope:r,baseId:$r(),value:f,onValueChange:m,orientation:i,dir:d,activationMode:c,children:a.jsx(Re.div,{dir:d,"data-orientation":i,...u,ref:t})})});dN.displayName=Ny;var fN="TabsList",hN=g.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...s}=e,o=Ty(fN,r),i=uN(r);return a.jsx(nv,{asChild:!0,...i,orientation:o.orientation,dir:o.dir,loop:n,children:a.jsx(Re.div,{role:"tablist","aria-orientation":o.orientation,...s,ref:t})})});hN.displayName=fN;var pN="TabsTrigger",mN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,i=Ty(pN,r),l=uN(r),c=yN(i.baseId,n),u=xN(i.baseId,n),d=n===i.value;return a.jsx(sv,{asChild:!0,...l,focusable:!s,active:d,children:a.jsx(Re.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:c,...o,ref:t,onMouseDown:ue(e.onMouseDown,f=>{!s&&f.button===0&&f.ctrlKey===!1?i.onValueChange(n):f.preventDefault()}),onKeyDown:ue(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&i.onValueChange(n)}),onFocus:ue(e.onFocus,()=>{const f=i.activationMode!=="manual";!d&&!s&&f&&i.onValueChange(n)})})})});mN.displayName=pN;var gN="TabsContent",vN=g.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:s,children:o,...i}=e,l=Ty(gN,r),c=yN(l.baseId,n),u=xN(l.baseId,n),d=n===l.value,f=g.useRef(d);return g.useEffect(()=>{const m=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(m)},[]),a.jsx(or,{present:s||d,children:({present:m})=>a.jsx(Re.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":c,hidden:!m,id:u,tabIndex:0,...i,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:m&&o})})});vN.displayName=gN;function yN(e,t){return`${e}-trigger-${t}`}function xN(e,t){return`${e}-content-${t}`}var qU=dN,wN=hN,_N=mN,bN=vN;const SN=qU,Ry=g.forwardRef(({className:e,...t},r)=>a.jsx(wN,{ref:r,className:oe("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));Ry.displayName=wN.displayName;const Yo=g.forwardRef(({className:e,...t},r)=>a.jsx(_N,{ref:r,className:oe("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));Yo.displayName=_N.displayName;const qd=g.forwardRef(({className:e,...t},r)=>a.jsx(bN,{ref:r,className:oe("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));qd.displayName=bN.displayName;const XU=()=>{const{config:e,deleteAccess:t}=Ar(),{accesses:r}=e,n=10,s=Math.ceil(r.length/n),o=Pr(),i=Nn(),l=new URLSearchParams(i.search),c=l.get("page"),u=c?Number(c):1,d=l.get("tab"),f=l.get("accessGroupId"),m=(u-1)*n,v=m+n,x=async _=>{const p=await z3(_);t(p.id)},y=_=>{l.set("tab",_),o({search:l.toString()})};return a.jsxs("div",{className:"",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("div",{className:"text-muted-foreground",children:"授权管理"}),d!="access_group"?a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add"}):a.jsx(Ey,{trigger:a.jsx(He,{children:"添加授权组"})})]}),a.jsxs(SN,{defaultValue:d||"access",value:d||"access",className:"w-full mt-5",children:[a.jsxs(Ry,{className:"space-x-5 px-3",children:[a.jsx(Yo,{value:"access",onClick:()=>{y("access")},children:"授权管理"}),a.jsx(Yo,{value:"access_group",onClick:()=>{y("access_group")},children:"授权组管理"})]}),a.jsx(qd,{value:"access",children:r.length===0?a.jsxs("div",{className:"flex flex-col items-center mt-10",children:[a.jsx("span",{className:"bg-orange-100 p-5 rounded-full",children:a.jsx(RA,{size:40,className:"text-primary"})}),a.jsx("div",{className:"text-center text-sm text-muted-foreground mt-3",children:"请添加授权开始部署证书吧。"}),a.jsx(Tl,{trigger:a.jsx(He,{children:"添加授权"}),op:"add",className:"mt-3"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"名称"}),a.jsx("div",{className:"w-48",children:"服务商"}),a.jsx("div",{className:"w-52",children:"创建时间"}),a.jsx("div",{className:"w-52",children:"更新时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"授权列表"}),r.filter(_=>f?_.group==f:!0).slice(m,v).map(_=>{var p,h;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:_.name}),a.jsxs("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center space-x-2",children:[a.jsx("img",{src:(p=mo.get(_.configType))==null?void 0:p[1],className:"w-6"}),a.jsx("div",{children:(h=mo.get(_.configType))==null?void 0:h[0]})]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["创建于"," ",_.created&&ya(_.created)]}),a.jsxs("div",{className:"sm:w-52 w-full pt-1 sm:pt-0 flex items-center",children:["更新于"," ",_.updated&&ya(_.updated)]}),a.jsxs("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0",children:[a.jsx(Tl,{trigger:a.jsx(He,{variant:"link",className:"p-0",children:"编辑"}),op:"edit",data:_}),a.jsx(Bt,{orientation:"vertical",className:"h-4 mx-2"}),a.jsx(He,{variant:"link",className:"p-0",onClick:()=>{x(_)},children:"删除"})]})]},_.id)}),a.jsx(NC,{totalPages:s,currentPage:u,onPageChange:_=>{l.set("page",_.toString()),o({search:l.toString()})}})]})}),a.jsx(qd,{value:"access_group",children:a.jsx(KU,{})})]})]})},QU=Sc("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),Py=g.forwardRef(({className:e,variant:t,...r},n)=>a.jsx("div",{ref:n,role:"alert",className:oe(QU({variant:t}),e),...r}));Py.displayName="Alert";const Ay=g.forwardRef(({className:e,...t},r)=>a.jsx("h5",{ref:r,className:oe("mb-1 font-medium leading-none tracking-tight",e),...t}));Ay.displayName="AlertTitle";const Dy=g.forwardRef(({className:e,...t},r)=>a.jsx("div",{ref:r,className:oe("text-sm [&_p]:leading-relaxed",e),...t}));Dy.displayName="AlertDescription";const kN=async e=>{let t=1;e.page&&(t=e.page);let r=50;e.perPage&&(r=e.perPage);let n="domain!=null";return e.domain&&(n=`domain="${e.domain}"`),await st().collection("deployments").getList(t,r,{filter:n,sort:"-deployedAt",expand:"domain"})},JU=()=>{const e=Pr(),[t,r]=g.useState(),[n]=vA(),s=n.get("domain");return g.useEffect(()=>{(async()=>{const i={};s&&(i.domain=s);const l=await kN(i);r(l.items)})()},[s]),a.jsxs(ih,{className:"h-[80vh] overflow-hidden",children:[a.jsx("div",{className:"text-muted-foreground",children:"部署历史"}),t!=null&&t.length?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),t==null?void 0:t.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]}):a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mx-auto mt-20",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{e("/")},children:"添加域名"})})]})]})})]})},e$=ce.object({username:ce.string().email({message:"请输入正确的邮箱地址"}),password:ce.string().min(10,{message:"密码至少10个字符"})}),t$=()=>{const e=fr({resolver:hr(e$),defaultValues:{username:"",password:""}}),t=async n=>{try{await st().admins.authWithPassword(n.username,n.password),r("/")}catch(s){const o=Es(s);e.setError("username",{message:o}),e.setError("password",{message:o})}},r=Pr();return a.jsxs("div",{className:"max-w-[35em] border dark:border-stone-500 mx-auto mt-32 p-10 rounded-md shadow-md",children:[a.jsx("div",{className:"flex justify-center mb-10",children:a.jsx("img",{src:"/vite.svg",className:"w-16"})}),a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(t),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"username",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"用户名"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"email",...n})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"password",render:({field:n})=>a.jsxs(we,{children:[a.jsx(_e,{children:"密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"password",...n,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"登录"})})]})})]})},r$=()=>st().authStore.isValid&&st().authStore.isAdmin?a.jsx(ib,{to:"/"}):a.jsxs("div",{className:"container",children:[a.jsx(Lg,{}),a.jsx(pC,{})]}),n$=ce.object({oldPassword:ce.string().min(10,{message:"密码至少10个字符"}),newPassword:ce.string().min(10,{message:"密码至少10个字符"}),confirmPassword:ce.string().min(10,{message:"密码至少10个字符"})}).refine(e=>e.newPassword===e.confirmPassword,{message:"两次密码不一致",path:["confirmPassword"]}),s$=()=>{const{toast:e}=Pn(),t=Pr(),r=fr({resolver:hr(n$),defaultValues:{oldPassword:"",newPassword:"",confirmPassword:""}}),n=async s=>{var o,i;try{await st().admins.authWithPassword((o=st().authStore.model)==null?void 0:o.email,s.oldPassword)}catch(l){const c=Es(l);r.setError("oldPassword",{message:c})}try{await st().admins.update((i=st().authStore.model)==null?void 0:i.id,{password:s.newPassword,passwordConfirm:s.confirmPassword}),st().authStore.clear(),e({title:"修改密码成功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(l){const c=Es(l);e({title:"修改密码失败",description:c,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...r,children:a.jsxs("form",{onSubmit:r.handleSubmit(n),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:r.control,name:"oldPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"当前密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"当前密码",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"newPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"新密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"newPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:r.control,name:"confirmPassword",render:({field:s})=>a.jsxs(we,{children:[a.jsx(_e,{children:"确认密码"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"confirmPassword",...s,type:"password"})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},o$=()=>{const e=Nn(),[t,r]=g.useState("account"),n=Pr();return g.useEffect(()=>{const o=e.pathname.split("/")[2];r(o)},[e]),a.jsxs("div",{children:[a.jsx(hy,{}),a.jsx("div",{className:"text-muted-foreground border-b dark:border-stone-500 py-5",children:"偏好设置"}),a.jsx("div",{className:"w-full mt-5 p-0 md:p-3 flex justify-center",children:a.jsxs(SN,{defaultValue:"account",className:"w-full",value:t,children:[a.jsxs(Ry,{className:"mx-auto",children:[a.jsxs(Yo,{value:"account",onClick:()=>{n("/setting/account")},className:"px-5",children:[a.jsx(FA,{size:14}),a.jsx("div",{className:"ml-1",children:"账户"})]}),a.jsxs(Yo,{value:"password",onClick:()=>{n("/setting/password")},className:"px-5",children:[a.jsx(TA,{size:14}),a.jsx("div",{className:"ml-1",children:"密码"})]}),a.jsxs(Yo,{value:"notify",onClick:()=>{n("/setting/notify")},className:"px-5",children:[a.jsx(AA,{size:14}),a.jsx("div",{className:"ml-1",children:"消息推送"})]}),a.jsxs(Yo,{value:"ssl-provider",onClick:()=>{n("/setting/ssl-provider")},className:"px-5",children:[a.jsx(MA,{size:14}),a.jsx("div",{className:"ml-1",children:"证书厂商"})]})]}),a.jsx(qd,{value:t,children:a.jsx("div",{className:"mt-5 w-full md:w-[45em]",children:a.jsx(Lg,{})})})]})})]})},i$=()=>{const[e,t]=g.useState(),[r,n]=g.useState(),s=Pr();return g.useEffect(()=>{(async()=>{const i=await gz();t(i)})()},[]),g.useEffect(()=>{(async()=>{const l=await kN({perPage:8});n(l.items)})()},[]),a.jsxs("div",{className:"flex flex-col",children:[a.jsx("div",{className:"flex justify-between items-center",children:a.jsx("div",{className:"text-muted-foreground",children:"控制面板"})}),a.jsxs("div",{className:"flex mt-10 gap-5 flex-col flex-wrap md:flex-row",children:[a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(IA,{size:48,strokeWidth:1,className:"text-blue-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"所有"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.total?a.jsx(gr,{to:"/domains",className:"hover:underline",children:e==null?void 0:e.total}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg border",children:[a.jsx("div",{className:"p-3",children:a.jsx(SA,{size:48,strokeWidth:1,className:"text-red-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"即将过期"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.expired?a.jsx(gr,{to:"/domains?state=expired",className:"hover:underline",children:e==null?void 0:e.expired}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(PA,{size:48,strokeWidth:1,className:"text-green-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"启用中"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.enabled?a.jsx(gr,{to:"/domains?state=enabled",className:"hover:underline",children:e==null?void 0:e.enabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]}),a.jsxs("div",{className:"border w-full md:w-[250px] 3xl:w-[300px] flex items-center rounded-md p-3 shadow-lg",children:[a.jsx("div",{className:"p-3",children:a.jsx(_A,{size:48,strokeWidth:1,className:"text-gray-400"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground font-semibold",children:"未启用"}),a.jsxs("div",{className:"flex items-baseline",children:[a.jsx("div",{className:"text-3xl text-stone-700 dark:text-stone-200",children:e!=null&&e.disabled?a.jsx(gr,{to:"/domains?state=disabled",className:"hover:underline",children:e==null?void 0:e.disabled}):0}),a.jsx("div",{className:"ml-1 text-stone-700 dark:text-stone-200",children:"个"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-muted-foreground mt-5 text-sm",children:"部署历史"}),(r==null?void 0:r.length)==0?a.jsx(a.Fragment,{children:a.jsxs(Py,{className:"max-w-[40em] mt-10",children:[a.jsx(Ay,{children:"暂无数据"}),a.jsxs(Dy,{children:[a.jsxs("div",{className:"flex items-center mt-5",children:[a.jsx("div",{children:a.jsx(ub,{className:"text-yellow-400",size:36})}),a.jsxs("div",{className:"ml-2",children:[" ","你暂未创建任何部署,请先添加域名进行部署吧!"]})]}),a.jsx("div",{className:"mt-2 flex justify-end",children:a.jsx(He,{onClick:()=>{s("/edit")},children:"添加域名"})})]})]})}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"hidden sm:flex sm:flex-row text-muted-foreground text-sm border-b dark:border-stone-500 sm:p-2 mt-5",children:[a.jsx("div",{className:"w-48",children:"域名"}),a.jsx("div",{className:"w-24",children:"状态"}),a.jsx("div",{className:"w-56",children:"阶段"}),a.jsx("div",{className:"w-56 sm:ml-2 text-center",children:"最近执行时间"}),a.jsx("div",{className:"grow",children:"操作"})]}),a.jsx("div",{className:"sm:hidden flex text-sm text-muted-foreground",children:"部署历史"}),r==null?void 0:r.map(o=>{var i,l;return a.jsxs("div",{className:"flex flex-col sm:flex-row text-secondary-foreground border-b dark:border-stone-500 sm:p-2 hover:bg-muted/50 text-sm",children:[a.jsx("div",{className:"sm:w-48 w-full pt-1 sm:pt-0 flex items-center",children:(i=o.expand.domain)==null?void 0:i.domain}),a.jsx("div",{className:"sm:w-24 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(ey,{deployment:o})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center",children:a.jsx(qv,{phase:o.phase,phaseSuccess:o.phaseSuccess})}),a.jsx("div",{className:"sm:w-56 w-full pt-1 sm:pt-0 flex items-center sm:justify-center",children:ya(o.deployedAt)}),a.jsx("div",{className:"flex items-center grow justify-start pt-1 sm:pt-0 sm:ml-2",children:a.jsxs(bv,{children:[a.jsx(Sv,{asChild:!0,children:a.jsx(He,{variant:"link",className:"p-0",children:"日志"})}),a.jsxs(Rf,{className:"sm:max-w-5xl",children:[a.jsx(kv,{children:a.jsxs(Cv,{children:[(l=o.expand.domain)==null?void 0:l.domain,"-",o.id,"部署详情"]})}),a.jsxs("div",{className:"bg-gray-950 text-stone-100 p-5 text-sm h-[80dvh]",children:[o.log.check&&a.jsx(a.Fragment,{children:o.log.check.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.apply&&a.jsx(a.Fragment,{children:o.log.apply.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.info&&c.info.map(u=>a.jsx("div",{className:"mt-1 text-green-600",children:u})),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))}),o.log.deploy&&a.jsx(a.Fragment,{children:o.log.deploy.map(c=>a.jsxs("div",{className:"flex flex-col mt-2",children:[a.jsxs("div",{className:"flex",children:[a.jsxs("div",{children:["[",c.time,"]"]}),a.jsx("div",{className:"ml-2",children:c.message})]}),c.error&&a.jsx("div",{className:"mt-1 text-red-600",children:c.error})]}))})]})]})]})})]},o.id)})]})]})]})},a$=ce.object({email:ce.string().email("请输入正确的邮箱")}),l$=()=>{var i;const{toast:e}=Pn(),t=Pr(),[r,n]=g.useState(!1),s=fr({resolver:hr(a$),defaultValues:{email:(i=st().authStore.model)==null?void 0:i.email}}),o=async l=>{var c;try{await st().admins.update((c=st().authStore.model)==null?void 0:c.id,{email:l.email}),st().authStore.clear(),e({title:"修改账户邮箱功",description:"请重新登录"}),setTimeout(()=>{t("/login")},500)}catch(u){const d=Es(u);e({title:"修改账户邮箱失败",description:d,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...s,children:a.jsxs("form",{onSubmit:s.handleSubmit(o),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:s.control,name:"email",render:({field:l})=>a.jsxs(we,{children:[a.jsx(_e,{children:"邮箱"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入邮箱",...l,type:"email",onChange:c=>{n(!0),s.setValue("email",c.target.value)}})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:r?a.jsx(He,{type:"submit",children:"确认修改"}):a.jsx(He,{type:"submit",disabled:!0,variant:"secondary",children:"确认修改"})})]})})})})},c$=(e,t)=>{switch(t.type){case"SET_CHANNEL":{const r=t.payload.channel;return{...e,content:{...e.content,[r]:t.payload.data}}}case"SET_CHANNELS":return{...t.payload};default:return e}},CN=g.createContext({}),Oy=()=>g.useContext(CN),u$=({children:e})=>{const[t,r]=g.useReducer(c$,{});g.useEffect(()=>{(async()=>{const i=await Zv("notifyChannels");r({type:"SET_CHANNELS",payload:i})})()},[]);const n=g.useCallback(o=>{r({type:"SET_CHANNEL",payload:o})},[]),s=g.useCallback(o=>{r({type:"SET_CHANNELS",payload:o})},[]);return a.jsx(CN.Provider,{value:{config:t,setChannel:n,setChannels:s},children:e})},d$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{accessToken:"",secret:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={accessToken:"",secret:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.dingtalk?u.dingtalk:c})();n({id:e.id??"",name:"dingtalk",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,dingtalk:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"AccessToken",value:r.data.accessToken,onChange:i=>{n({...r,data:{...r.data,accessToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"加签的签名",className:"mt-2",value:r.data.secret,onChange:i=>{n({...r,data:{...r.data,secret:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})},f$={title:"您有{COUNT}张证书即将过期",content:"有{COUNT}张证书即将过期,域名分别为{DOMAINS},请保持关注!"},h$=()=>{const[e,t]=g.useState(""),[r,n]=g.useState([f$]),{toast:s}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("templates");u.content&&(n(u.content.notifyTemplates),t(u.id?u.id:""))})()},[]);const o=c=>{const u=r[0];n([{...u,title:c}])},i=c=>{const u=r[0];n([{...u,content:c}])},l=async()=>{const c=await Fa({id:e,content:{notifyTemplates:r},name:"templates"});c.id&&t(c.id),s({title:"保存成功",description:"通知模板保存成功"})};return a.jsxs("div",{children:[a.jsx(Ne,{value:r[0].title,onChange:c=>{o(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数"}),a.jsx(Sa,{className:"mt-2",value:r[0].content,onChange:c=>{i(c.target.value)}}),a.jsx("div",{className:"text-muted-foreground text-sm mt-1",children:"可选的变量, COUNT:即将过期张数,DOMAINS:域名列表"}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:l,children:"保存"})})]})},p$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{apiToken:"",chatId:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={apiToken:"",chatId:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.telegram?u.telegram:c})();n({id:e.id??"",name:"telegram",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{const i=await Fa({...e,name:"notifyChannels",content:{...e.content,telegram:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"ApiToken",value:r.data.apiToken,onChange:i=>{n({...r,data:{...r.data,apiToken:i.target.value}})}}),a.jsx(Ne,{placeholder:"ChatId",value:r.data.chatId,onChange:i=>{n({...r,data:{...r.data,chatId:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};function m$(e){try{return new URL(e),!0}catch{return!1}}const g$=()=>{const{config:e,setChannels:t}=Oy(),[r,n]=g.useState({id:e.id??"",name:"notifyChannels",data:{url:"",enabled:!1}});g.useEffect(()=>{const l=(()=>{const c={url:"",enabled:!1};if(!e.content)return c;const u=e.content;return u.webhook?u.webhook:c})();n({id:e.id??"",name:"webhook",data:l})},[e]);const{toast:s}=Pn(),o=async()=>{try{if(r.data.url=r.data.url.trim(),!m$(r.data.url)){s({title:"保存失败",description:"Url格式不正确",variant:"destructive"});return}const i=await Fa({...e,name:"notifyChannels",content:{...e.content,webhook:{...r.data}}});t(i),s({title:"保存成功",description:"配置保存成功"})}catch(i){const l=Es(i);s({title:"保存失败",description:"配置保存失败:"+l,variant:"destructive"})}};return a.jsxs("div",{children:[a.jsx(Ne,{placeholder:"Url",value:r.data.url,onChange:i=>{n({...r,data:{...r.data,url:i.target.value}})}}),a.jsxs("div",{className:"flex items-center space-x-1 mt-2",children:[a.jsx(Fc,{id:"airplane-mode",checked:r.data.enabled,onCheckedChange:()=>{n({...r,data:{...r.data,enabled:!r.data.enabled}})}}),a.jsx(Co,{htmlFor:"airplane-mode",children:"是否启用"})]}),a.jsx("div",{className:"flex justify-end mt-2",children:a.jsx(He,{onClick:()=>{o()},children:"保存"})})]})};var My="Collapsible",[v$,jN]=sr(My),[y$,Iy]=v$(My),EN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...l}=e,[c=!1,u]=Yr({prop:n,defaultProp:s,onChange:i});return a.jsx(y$,{scope:r,disabled:o,contentId:$r(),open:c,onOpenToggle:g.useCallback(()=>u(d=>!d),[u]),children:a.jsx(Re.div,{"data-state":Fy(c),"data-disabled":o?"":void 0,...l,ref:t})})});EN.displayName=My;var NN="CollapsibleTrigger",TN=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,...n}=e,s=Iy(NN,r);return a.jsx(Re.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Fy(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:t,onClick:ue(e.onClick,s.onOpenToggle)})});TN.displayName=NN;var Ly="CollapsibleContent",RN=g.forwardRef((e,t)=>{const{forceMount:r,...n}=e,s=Iy(Ly,e.__scopeCollapsible);return a.jsx(or,{present:r||s.open,children:({present:o})=>a.jsx(x$,{...n,ref:t,present:o})})});RN.displayName=Ly;var x$=g.forwardRef((e,t)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=e,i=Iy(Ly,r),[l,c]=g.useState(n),u=g.useRef(null),d=Ke(t,u),f=g.useRef(0),m=f.current,v=g.useRef(0),x=v.current,y=i.open||l,_=g.useRef(y),p=g.useRef();return g.useEffect(()=>{const h=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(h)},[]),Jt(()=>{const h=u.current;if(h){p.current=p.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const w=h.getBoundingClientRect();f.current=w.height,v.current=w.width,_.current||(h.style.transitionDuration=p.current.transitionDuration,h.style.animationName=p.current.animationName),c(n)}},[i.open,n]),a.jsx(Re.div,{"data-state":Fy(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!y,...o,ref:d,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":x?`${x}px`:void 0,...e.style},children:y&&s})});function Fy(e){return e?"open":"closed"}var w$=EN,_$=TN,b$=RN,zs="Accordion",S$=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[zy,k$,C$]=kc(zs),[ah,aV]=sr(zs,[C$,jN]),Uy=jN(),PN=Be.forwardRef((e,t)=>{const{type:r,...n}=e,s=n,o=n;return a.jsx(zy.Provider,{scope:e.__scopeAccordion,children:r==="multiple"?a.jsx(T$,{...o,ref:t}):a.jsx(N$,{...s,ref:t})})});PN.displayName=zs;var[AN,j$]=ah(zs),[DN,E$]=ah(zs,{collapsible:!1}),N$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},collapsible:o=!1,...i}=e,[l,c]=Yr({prop:r,defaultProp:n,onChange:s});return a.jsx(AN,{scope:e.__scopeAccordion,value:l?[l]:[],onItemOpen:c,onItemClose:Be.useCallback(()=>o&&c(""),[o,c]),children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:o,children:a.jsx(ON,{...i,ref:t})})})}),T$=Be.forwardRef((e,t)=>{const{value:r,defaultValue:n,onValueChange:s=()=>{},...o}=e,[i=[],l]=Yr({prop:r,defaultProp:n,onChange:s}),c=Be.useCallback(d=>l((f=[])=>[...f,d]),[l]),u=Be.useCallback(d=>l((f=[])=>f.filter(m=>m!==d)),[l]);return a.jsx(AN,{scope:e.__scopeAccordion,value:i,onItemOpen:c,onItemClose:u,children:a.jsx(DN,{scope:e.__scopeAccordion,collapsible:!0,children:a.jsx(ON,{...o,ref:t})})})}),[R$,lh]=ah(zs),ON=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,disabled:n,dir:s,orientation:o="vertical",...i}=e,l=Be.useRef(null),c=Ke(l,t),u=k$(r),f=di(s)==="ltr",m=ue(e.onKeyDown,v=>{var P;if(!S$.includes(v.key))return;const x=v.target,y=u().filter(A=>{var L;return!((L=A.ref.current)!=null&&L.disabled)}),_=y.findIndex(A=>A.ref.current===x),p=y.length;if(_===-1)return;v.preventDefault();let h=_;const w=0,C=p-1,j=()=>{h=_+1,h>C&&(h=w)},E=()=>{h=_-1,h{const{__scopeAccordion:r,value:n,...s}=e,o=lh(Xd,r),i=j$(Xd,r),l=Uy(r),c=$r(),u=n&&i.value.includes(n)||!1,d=o.disabled||e.disabled;return a.jsx(P$,{scope:r,open:u,disabled:d,triggerId:c,children:a.jsx(w$,{"data-orientation":o.orientation,"data-state":$N(u),...l,...s,ref:t,disabled:d,open:u,onOpenChange:f=>{f?i.onItemOpen(n):i.onItemClose(n)}})})});MN.displayName=Xd;var IN="AccordionHeader",LN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(IN,r);return a.jsx(Re.h3,{"data-orientation":s.orientation,"data-state":$N(o.open),"data-disabled":o.disabled?"":void 0,...n,ref:t})});LN.displayName=IN;var Im="AccordionTrigger",FN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(Im,r),i=E$(Im,r),l=Uy(r);return a.jsx(zy.ItemSlot,{scope:r,children:a.jsx(_$,{"aria-disabled":o.open&&!i.collapsible||void 0,"data-orientation":s.orientation,id:o.triggerId,...l,...n,ref:t})})});FN.displayName=Im;var zN="AccordionContent",UN=Be.forwardRef((e,t)=>{const{__scopeAccordion:r,...n}=e,s=lh(zs,r),o=$y(zN,r),i=Uy(r);return a.jsx(b$,{role:"region","aria-labelledby":o.triggerId,"data-orientation":s.orientation,...i,...n,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});UN.displayName=zN;function $N(e){return e?"open":"closed"}var A$=PN,D$=MN,O$=LN,VN=FN,BN=UN;const Nw=A$,hl=g.forwardRef(({className:e,...t},r)=>a.jsx(D$,{ref:r,className:oe("border-b",e),...t}));hl.displayName="AccordionItem";const pl=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(O$,{className:"flex",children:a.jsxs(VN,{ref:n,className:oe("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...r,children:[t,a.jsx(Fg,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));pl.displayName=VN.displayName;const ml=g.forwardRef(({className:e,children:t,...r},n)=>a.jsx(BN,{ref:n,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...r,children:a.jsx("div",{className:oe("pb-4 pt-0",e),children:t})}));ml.displayName=BN.displayName;const M$=()=>a.jsx(a.Fragment,{children:a.jsxs(u$,{children:[a.jsx("div",{className:"border rounded-sm p-5 shadow-lg",children:a.jsx(Nw,{type:"multiple",className:"dark:text-stone-200",children:a.jsxs(hl,{value:"item-1",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"模板"}),a.jsx(ml,{children:a.jsx(h$,{})})]})})}),a.jsx("div",{className:"border rounded-md p-5 mt-7 shadow-lg",children:a.jsxs(Nw,{type:"single",className:"dark:text-stone-200",children:[a.jsxs(hl,{value:"item-2",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"钉钉"}),a.jsx(ml,{children:a.jsx(d$,{})})]}),a.jsxs(hl,{value:"item-4",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Telegram"}),a.jsx(ml,{children:a.jsx(p$,{})})]}),a.jsxs(hl,{value:"item-5",className:"dark:border-stone-200",children:[a.jsx(pl,{children:"Webhook"}),a.jsx(ml,{children:a.jsx(g$,{})})]})]})})]})});var Vy="Radio",[I$,WN]=sr(Vy),[L$,F$]=I$(Vy),HN=g.forwardRef((e,t)=>{const{__scopeRadio:r,name:n,checked:s=!1,required:o,disabled:i,value:l="on",onCheck:c,...u}=e,[d,f]=g.useState(null),m=Ke(t,y=>f(y)),v=g.useRef(!1),x=d?!!d.closest("form"):!0;return a.jsxs(L$,{scope:r,checked:s,disabled:i,children:[a.jsx(Re.button,{type:"button",role:"radio","aria-checked":s,"data-state":GN(s),"data-disabled":i?"":void 0,disabled:i,value:l,...u,ref:m,onClick:ue(e.onClick,y=>{s||c==null||c(),x&&(v.current=y.isPropagationStopped(),v.current||y.stopPropagation())})}),x&&a.jsx(z$,{control:d,bubbles:!v.current,name:n,value:l,checked:s,required:o,disabled:i,style:{transform:"translateX(-100%)"}})]})});HN.displayName=Vy;var YN="RadioIndicator",KN=g.forwardRef((e,t)=>{const{__scopeRadio:r,forceMount:n,...s}=e,o=F$(YN,r);return a.jsx(or,{present:n||o.checked,children:a.jsx(Re.span,{"data-state":GN(o.checked),"data-disabled":o.disabled?"":void 0,...s,ref:t})})});KN.displayName=YN;var z$=e=>{const{control:t,checked:r,bubbles:n=!0,...s}=e,o=g.useRef(null),i=ly(r),l=qg(t);return g.useEffect(()=>{const c=o.current,u=window.HTMLInputElement.prototype,f=Object.getOwnPropertyDescriptor(u,"checked").set;if(i!==r&&f){const m=new Event("click",{bubbles:n});f.call(c,r),c.dispatchEvent(m)}},[i,r,n]),a.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:o,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GN(e){return e?"checked":"unchecked"}var U$=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],By="RadioGroup",[$$,lV]=sr(By,[Oa,WN]),ZN=Oa(),qN=WN(),[V$,B$]=$$(By),XN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,name:n,defaultValue:s,value:o,required:i=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:f,...m}=e,v=ZN(r),x=di(u),[y,_]=Yr({prop:o,defaultProp:s,onChange:f});return a.jsx(V$,{scope:r,name:n,required:i,disabled:l,value:y,onValueChange:_,children:a.jsx(nv,{asChild:!0,...v,orientation:c,dir:x,loop:d,children:a.jsx(Re.div,{role:"radiogroup","aria-required":i,"aria-orientation":c,"data-disabled":l?"":void 0,dir:x,...m,ref:t})})})});XN.displayName=By;var QN="RadioGroupItem",JN=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,disabled:n,...s}=e,o=B$(QN,r),i=o.disabled||n,l=ZN(r),c=qN(r),u=g.useRef(null),d=Ke(t,u),f=o.value===s.value,m=g.useRef(!1);return g.useEffect(()=>{const v=y=>{U$.includes(y.key)&&(m.current=!0)},x=()=>m.current=!1;return document.addEventListener("keydown",v),document.addEventListener("keyup",x),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keyup",x)}},[]),a.jsx(sv,{asChild:!0,...l,focusable:!i,active:f,children:a.jsx(HN,{disabled:i,required:o.required,checked:f,...c,...s,name:o.name,ref:d,onCheck:()=>o.onValueChange(s.value),onKeyDown:ue(v=>{v.key==="Enter"&&v.preventDefault()}),onFocus:ue(s.onFocus,()=>{var v;m.current&&((v=u.current)==null||v.click())})})})});JN.displayName=QN;var W$="RadioGroupIndicator",eT=g.forwardRef((e,t)=>{const{__scopeRadioGroup:r,...n}=e,s=qN(r);return a.jsx(KN,{...s,...n,ref:t})});eT.displayName=W$;var tT=XN,rT=JN,H$=eT;const nT=g.forwardRef(({className:e,...t},r)=>a.jsx(tT,{className:oe("grid gap-2",e),...t,ref:r}));nT.displayName=tT.displayName;const Lm=g.forwardRef(({className:e,...t},r)=>a.jsx(rT,{ref:r,className:oe("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:a.jsx(H$,{className:"flex items-center justify-center",children:a.jsx(cb,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Lm.displayName=rT.displayName;const Y$=ce.object({provider:ce.enum(["letsencrypt","zerossl"],{message:"请选择SSL提供商"}),eabKid:ce.string().optional(),eabHmacKey:ce.string().optional()}),K$=()=>{const e=fr({resolver:hr(Y$),defaultValues:{provider:"letsencrypt"}}),[t,r]=g.useState("letsencrypt"),[n,s]=g.useState(),{toast:o}=Pn();g.useEffect(()=>{(async()=>{const u=await Zv("ssl-provider");if(u){s(u);const d=u.content;e.setValue("provider",d.provider),e.setValue("eabKid",d.config[d.provider].eabKid),e.setValue("eabHmacKey",d.config[d.provider].eabHmacKey),r(d.provider)}else e.setValue("provider","letsencrypt"),r("letsencrypt")})()},[]);const i=c=>t===c?"border-primary":"",l=async c=>{if(c.provider==="zerossl"&&(c.eabKid||e.setError("eabKid",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),c.eabHmacKey||e.setError("eabHmacKey",{message:"请输入EAB_KID和EAB_HMAC_KEY"}),!c.eabKid||!c.eabHmacKey))return;const u={id:n==null?void 0:n.id,name:"ssl-provider",content:{provider:c.provider,config:{letsencrypt:{},zerossl:{eabKid:c.eabKid??"",eabHmacKey:c.eabHmacKey??""}}}};try{await Fa(u),o({title:"修改成功",description:"修改成功"})}catch(d){const f=Es(d);o({title:"修改失败",description:f,variant:"destructive"})}};return a.jsx(a.Fragment,{children:a.jsx("div",{className:"w-full md:max-w-[35em]",children:a.jsx(pr,{...e,children:a.jsxs("form",{onSubmit:e.handleSubmit(l),className:"space-y-8 dark:text-stone-200",children:[a.jsx(Se,{control:e.control,name:"provider",render:({field:c})=>a.jsxs(we,{children:[a.jsx(_e,{children:"证书厂商"}),a.jsx(be,{children:a.jsxs(nT,{...c,className:"flex",onValueChange:u=>{r(u),e.setValue("provider",u)},value:t,children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"letsencrypt",id:"letsencrypt"}),a.jsx(Co,{htmlFor:"letsencrypt",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("letsencrypt")),children:[a.jsx("img",{src:"/imgs/providers/letsencrypt.svg",className:"h-6"}),a.jsx("div",{children:"Let's Encrypt"})]})})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(Lm,{value:"zerossl",id:"zerossl"}),a.jsx(Co,{htmlFor:"zerossl",children:a.jsxs("div",{className:oe("flex items-center space-x-2 border p-2 rounded cursor-pointer",i("zerossl")),children:[a.jsx("img",{src:"/imgs/providers/zerossl.svg",className:"h-6"}),a.jsx("div",{children:"ZeroSSL"})]})})]})]})}),a.jsx(Se,{control:e.control,name:"eabKid",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_KID"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_KID",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(Se,{control:e.control,name:"eabHmacKey",render:({field:u})=>a.jsxs(we,{hidden:t!=="zerossl",children:[a.jsx(_e,{children:"EAB_HMAC_KEY"}),a.jsx(be,{children:a.jsx(Ne,{placeholder:"请输入EAB_HMAC_KEY",...u,type:"text"})}),a.jsx(ge,{})]})}),a.jsx(ge,{})]})}),a.jsx("div",{className:"flex justify-end",children:a.jsx(He,{type:"submit",children:"确认修改"})})]})})})})},G$=rA([{path:"/",element:a.jsx(J3,{}),children:[{path:"/",element:a.jsx(i$,{})},{path:"/domains",element:a.jsx(_z,{})},{path:"/edit",element:a.jsx(YU,{})},{path:"/access",element:a.jsx(XU,{})},{path:"/history",element:a.jsx(JU,{})},{path:"/setting",element:a.jsx(o$,{}),children:[{path:"/setting/password",element:a.jsx(s$,{})},{path:"/setting/account",element:a.jsx(l$,{})},{path:"/setting/notify",element:a.jsx(M$,{})},{path:"/setting/ssl-provider",element:a.jsx(K$,{})}]}]},{path:"/login",element:a.jsx(r$,{}),children:[{path:"/login",element:a.jsx(t$,{})}]},{path:"/about",element:a.jsx("div",{children:"About"})}]);ip.createRoot(document.getElementById("root")).render(a.jsx(Be.StrictMode,{children:a.jsx(Y3,{defaultTheme:"system",storageKey:"vite-ui-theme",children:a.jsx(dA,{router:G$})})}))});export default Z$(); diff --git a/ui/dist/index.html b/ui/dist/index.html index 49f74186..fc176b7e 100644 --- a/ui/dist/index.html +++ b/ui/dist/index.html @@ -5,7 +5,7 @@ Certimate - Your Trusted SSL Automation Partner - + diff --git a/ui/package-lock.json b/ui/package-lock.json index 12c292c6..408326c3 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -53,7 +53,7 @@ "eslint-plugin-react-refresh": "^0.4.7", "postcss": "^8.4.40", "tailwindcss": "^3.4.7", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vite": "^5.3.4" } }, @@ -2100,9 +2100,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.0.tgz", - "integrity": "sha512-JlPfZ/C7yn5S5p0yKk7uhHTTnFlvTgLetl2VxqE518QgyM7C9bSfFTYvB/Q/ftkq0RIPY4ySxTz+/wKJ/dXC0w==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.22.4.tgz", + "integrity": "sha512-Fxamp4aEZnfPOcGA8KSNEohV8hX7zVHOemC8jVBoBUHu5zpJK/Eu3uJwt6BMgy9fkvzxDaurgj96F/NiLukF2w==", "cpu": [ "arm" ], @@ -2113,9 +2113,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.0.tgz", - "integrity": "sha512-RDxUSY8D1tWYfn00DDi5myxKgOk6RvWPxhmWexcICt/MEC6yEMr4HNCu1sXXYLw8iAsg0D44NuU+qNq7zVWCrw==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.22.4.tgz", + "integrity": "sha512-VXoK5UMrgECLYaMuGuVTOx5kcuap1Jm8g/M83RnCHBKOqvPPmROFJGQaZhGccnsFtfXQ3XYa4/jMCJvZnbJBdA==", "cpu": [ "arm64" ], @@ -2126,9 +2126,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz", - "integrity": "sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.22.4.tgz", + "integrity": "sha512-xMM9ORBqu81jyMKCDP+SZDhnX2QEVQzTcC6G18KlTQEzWK8r/oNZtKuZaCcHhnsa6fEeOBionoyl5JsAbE/36Q==", "cpu": [ "arm64" ], @@ -2139,9 +2139,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.0.tgz", - "integrity": "sha512-fO28cWA1dC57qCd+D0rfLC4VPbh6EOJXrreBmFLWPGI9dpMlER2YwSPZzSGfq11XgcEpPukPTfEVFtw2q2nYJg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.22.4.tgz", + "integrity": "sha512-aJJyYKQwbHuhTUrjWjxEvGnNNBCnmpHDvrb8JFDbeSH3m2XdHcxDd3jthAzvmoI8w/kSjd2y0udT+4okADsZIw==", "cpu": [ "x64" ], @@ -2152,9 +2152,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.0.tgz", - "integrity": "sha512-2Rn36Ubxdv32NUcfm0wB1tgKqkQuft00PtM23VqLuCUR4N5jcNWDoV5iBC9jeGdgS38WK66ElncprqgMUOyomw==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.22.4.tgz", + "integrity": "sha512-j63YtCIRAzbO+gC2L9dWXRh5BFetsv0j0va0Wi9epXDgU/XUi5dJKo4USTttVyK7fGw2nPWK0PbAvyliz50SCQ==", "cpu": [ "arm" ], @@ -2165,9 +2165,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.0.tgz", - "integrity": "sha512-gJuzIVdq/X1ZA2bHeCGCISe0VWqCoNT8BvkQ+BfsixXwTOndhtLUpOg0A1Fcx/+eA6ei6rMBzlOz4JzmiDw7JQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.22.4.tgz", + "integrity": "sha512-dJnWUgwWBX1YBRsuKKMOlXCzh2Wu1mlHzv20TpqEsfdZLb3WoJW2kIEsGwLkroYf24IrPAvOT/ZQ2OYMV6vlrg==", "cpu": [ "arm" ], @@ -2178,9 +2178,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.0.tgz", - "integrity": "sha512-0EkX2HYPkSADo9cfeGFoQ7R0/wTKb7q6DdwI4Yn/ULFE1wuRRCHybxpl2goQrx4c/yzK3I8OlgtBu4xvted0ug==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.22.4.tgz", + "integrity": "sha512-AdPRoNi3NKVLolCN/Sp4F4N1d98c4SBnHMKoLuiG6RXgoZ4sllseuGioszumnPGmPM2O7qaAX/IJdeDU8f26Aw==", "cpu": [ "arm64" ], @@ -2191,9 +2191,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.0.tgz", - "integrity": "sha512-GlIQRj9px52ISomIOEUq/IojLZqzkvRpdP3cLgIE1wUWaiU5Takwlzpz002q0Nxxr1y2ZgxC2obWxjr13lvxNQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.22.4.tgz", + "integrity": "sha512-Gl0AxBtDg8uoAn5CCqQDMqAx22Wx22pjDOjBdmG0VIWX3qUBHzYmOKh8KXHL4UpogfJ14G4wk16EQogF+v8hmA==", "cpu": [ "arm64" ], @@ -2204,9 +2204,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.0.tgz", - "integrity": "sha512-N6cFJzssruDLUOKfEKeovCKiHcdwVYOT1Hs6dovDQ61+Y9n3Ek4zXvtghPPelt6U0AH4aDGnDLb83uiJMkWYzQ==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.22.4.tgz", + "integrity": "sha512-3aVCK9xfWW1oGQpTsYJJPF6bfpWfhbRnhdlyhak2ZiyFLDaayz0EP5j9V1RVLAAxlmWKTDfS9wyRyY3hvhPoOg==", "cpu": [ "ppc64" ], @@ -2217,9 +2217,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.0.tgz", - "integrity": "sha512-2DnD3mkS2uuam/alF+I7M84koGwvn3ZVD7uG+LEWpyzo/bq8+kKnus2EVCkcvh6PlNB8QPNFOz6fWd5N8o1CYg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.22.4.tgz", + "integrity": "sha512-ePYIir6VYnhgv2C5Xe9u+ico4t8sZWXschR6fMgoPUK31yQu7hTEJb7bCqivHECwIClJfKgE7zYsh1qTP3WHUA==", "cpu": [ "riscv64" ], @@ -2230,9 +2230,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.0.tgz", - "integrity": "sha512-D6pkaF7OpE7lzlTOFCB2m3Ngzu2ykw40Nka9WmKGUOTS3xcIieHe82slQlNq69sVB04ch73thKYIWz/Ian8DUA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.22.4.tgz", + "integrity": "sha512-GqFJ9wLlbB9daxhVlrTe61vJtEY99/xB3C8e4ULVsVfflcpmR6c8UZXjtkMA6FhNONhj2eA5Tk9uAVw5orEs4Q==", "cpu": [ "s390x" ], @@ -2243,9 +2243,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz", - "integrity": "sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.22.4.tgz", + "integrity": "sha512-87v0ol2sH9GE3cLQLNEy0K/R0pz1nvg76o8M5nhMR0+Q+BBGLnb35P0fVz4CQxHYXaAOhE8HhlkaZfsdUOlHwg==", "cpu": [ "x64" ], @@ -2256,9 +2256,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz", - "integrity": "sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.22.4.tgz", + "integrity": "sha512-UV6FZMUgePDZrFjrNGIWzDo/vABebuXBhJEqrHxrGiU6HikPy0Z3LfdtciIttEUQfuDdCn8fqh7wiFJjCNwO+g==", "cpu": [ "x64" ], @@ -2269,9 +2269,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.0.tgz", - "integrity": "sha512-HxDMKIhmcguGTiP5TsLNolwBUK3nGGUEoV/BO9ldUBoMLBssvh4J0X8pf11i1fTV7WShWItB1bKAKjX4RQeYmg==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.22.4.tgz", + "integrity": "sha512-BjI+NVVEGAXjGWYHz/vv0pBqfGoUH0IGZ0cICTn7kB9PyjrATSkX+8WkguNjWoj2qSr1im/+tTGRaY+4/PdcQw==", "cpu": [ "arm64" ], @@ -2282,9 +2282,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.0.tgz", - "integrity": "sha512-xItlIAZZaiG/u0wooGzRsx11rokP4qyc/79LkAOdznGRAbOFc+SfEdfUOszG1odsHNgwippUJavag/+W/Etc6Q==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.22.4.tgz", + "integrity": "sha512-SiWG/1TuUdPvYmzmYnmd3IEifzR61Tragkbx9D3+R8mzQqDBz8v+BvZNDlkiTtI9T15KYZhP0ehn3Dld4n9J5g==", "cpu": [ "ia32" ], @@ -2295,9 +2295,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.0.tgz", - "integrity": "sha512-xNo5fV5ycvCCKqiZcpB65VMR11NJB+StnxHz20jdqRAktfdfzhgjTiJ2doTDQE/7dqGaV5I7ZGqKpgph6lCIag==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.22.4.tgz", + "integrity": "sha512-j8pPKp53/lq9lMXN57S8cFz0MynJk8OWNuUnXct/9KCpKU7DgU3bYMJhwWmcqC0UU29p8Lr0/7KEVcaM6bf47Q==", "cpu": [ "x64" ], @@ -2350,7 +2350,7 @@ }, "node_modules/@types/estree": { "version": "1.0.5", - "resolved": "https://registry.npmmirror.com/@types/estree/-/estree-1.0.5.tgz", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", "dev": true }, @@ -4032,9 +4032,9 @@ } }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmmirror.com/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -4290,9 +4290,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmmirror.com/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==" + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -4327,9 +4327,9 @@ "integrity": "sha512-WJHyaqdAt95JgZ1OCRD099+DST4IIG0M/jMrCckWYDSN/6ocp61qsz7m6h0xI0J2N79ScBljceEC0fFAaQrrAw==" }, "node_modules/postcss": { - "version": "8.4.40", - "resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.40.tgz", - "integrity": "sha512-YF2kKIUzAofPMpfH6hOi2cGnv/HrUlfucspc7pDyvv7kGdqXrfj8SCl/t8owkEgKEuu8ZcRjSOxFxVLqwChZ2Q==", + "version": "8.4.47", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.47.tgz", + "integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==", "funding": [ { "type": "opencollective", @@ -4346,8 +4346,8 @@ ], "dependencies": { "nanoid": "^3.3.7", - "picocolors": "^1.0.1", - "source-map-js": "^1.2.0" + "picocolors": "^1.1.0", + "source-map-js": "^1.2.1" }, "engines": { "node": "^10 || ^12 || >=14" @@ -4743,9 +4743,9 @@ } }, "node_modules/rollup": { - "version": "4.19.0", - "resolved": "https://registry.npmmirror.com/rollup/-/rollup-4.19.0.tgz", - "integrity": "sha512-5r7EYSQIowHsK4eTZ0Y81qpZuJz+MUuYeqmmYmRMl1nwhdmbiYqt5jwzf6u7wyOzJgYqtCRMtVRKOtHANBz7rA==", + "version": "4.22.4", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.22.4.tgz", + "integrity": "sha512-vD8HJ5raRcWOyymsR6Z3o6+RzfEPCnVLMFJ6vRslO1jt4LO6dUo5Qnpg7y4RkZFM2DMe3WUirkI5c16onjrc6A==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -4758,22 +4758,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.19.0", - "@rollup/rollup-android-arm64": "4.19.0", - "@rollup/rollup-darwin-arm64": "4.19.0", - "@rollup/rollup-darwin-x64": "4.19.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.19.0", - "@rollup/rollup-linux-arm-musleabihf": "4.19.0", - "@rollup/rollup-linux-arm64-gnu": "4.19.0", - "@rollup/rollup-linux-arm64-musl": "4.19.0", - "@rollup/rollup-linux-powerpc64le-gnu": "4.19.0", - "@rollup/rollup-linux-riscv64-gnu": "4.19.0", - "@rollup/rollup-linux-s390x-gnu": "4.19.0", - "@rollup/rollup-linux-x64-gnu": "4.19.0", - "@rollup/rollup-linux-x64-musl": "4.19.0", - "@rollup/rollup-win32-arm64-msvc": "4.19.0", - "@rollup/rollup-win32-ia32-msvc": "4.19.0", - "@rollup/rollup-win32-x64-msvc": "4.19.0", + "@rollup/rollup-android-arm-eabi": "4.22.4", + "@rollup/rollup-android-arm64": "4.22.4", + "@rollup/rollup-darwin-arm64": "4.22.4", + "@rollup/rollup-darwin-x64": "4.22.4", + "@rollup/rollup-linux-arm-gnueabihf": "4.22.4", + "@rollup/rollup-linux-arm-musleabihf": "4.22.4", + "@rollup/rollup-linux-arm64-gnu": "4.22.4", + "@rollup/rollup-linux-arm64-musl": "4.22.4", + "@rollup/rollup-linux-powerpc64le-gnu": "4.22.4", + "@rollup/rollup-linux-riscv64-gnu": "4.22.4", + "@rollup/rollup-linux-s390x-gnu": "4.22.4", + "@rollup/rollup-linux-x64-gnu": "4.22.4", + "@rollup/rollup-linux-x64-musl": "4.22.4", + "@rollup/rollup-win32-arm64-msvc": "4.22.4", + "@rollup/rollup-win32-ia32-msvc": "4.22.4", + "@rollup/rollup-win32-x64-msvc": "4.22.4", "fsevents": "~2.3.2" } }, @@ -4869,9 +4869,9 @@ } }, "node_modules/source-map-js": { - "version": "1.2.0", - "resolved": "https://registry.npmmirror.com/source-map-js/-/source-map-js-1.2.0.tgz", - "integrity": "sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", "engines": { "node": ">=0.10.0" } @@ -5187,9 +5187,9 @@ } }, "node_modules/typescript": { - "version": "5.5.4", - "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.5.4.tgz", - "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", + "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5303,14 +5303,14 @@ } }, "node_modules/vite": { - "version": "5.3.5", - "resolved": "https://registry.npmmirror.com/vite/-/vite-5.3.5.tgz", - "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==", + "version": "5.4.8", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.8.tgz", + "integrity": "sha512-FqrItQ4DT1NC4zCUqMB4c4AZORMKIa0m8/URVCZ77OZ/QSNeJ54bU1vrFADbDsuwfIPcgknRkmqakQcgnL4GiQ==", "dev": true, "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.39", - "rollup": "^4.13.0" + "postcss": "^8.4.43", + "rollup": "^4.20.0" }, "bin": { "vite": "bin/vite.js" @@ -5329,6 +5329,7 @@ "less": "*", "lightningcss": "^1.21.0", "sass": "*", + "sass-embedded": "*", "stylus": "*", "sugarss": "*", "terser": "^5.4.0" @@ -5346,6 +5347,9 @@ "sass": { "optional": true }, + "sass-embedded": { + "optional": true + }, "stylus": { "optional": true }, diff --git a/ui/package.json b/ui/package.json index 1c954e65..d151ae32 100644 --- a/ui/package.json +++ b/ui/package.json @@ -55,7 +55,7 @@ "eslint-plugin-react-refresh": "^0.4.7", "postcss": "^8.4.40", "tailwindcss": "^3.4.7", - "typescript": "^5.2.2", + "typescript": "^5.6.2", "vite": "^5.3.4" } } diff --git a/ui/src/pages/login/Login.tsx b/ui/src/pages/login/Login.tsx index d023a9b9..23e2f9d2 100644 --- a/ui/src/pages/login/Login.tsx +++ b/ui/src/pages/login/Login.tsx @@ -78,7 +78,7 @@ const Login = () => { 密码 - +