refactor(routes):

- keep install-mode root redirect to /install and add tests covering install root redirect and install page serving
- change root backend handler from Any("/") to POST("/") so GET / can consistently serve the SPA after install

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
line-6000
2026-04-25 18:48:28 +08:00
parent 485059f60e
commit 95879e33d4
140 changed files with 285 additions and 197 deletions
+1
View File
@@ -0,0 +1 @@
import{$t as e,Fl as t,Pl as n,Qt as r,Qu as i,an as a,cn as o,en as s,in as c,ln as l,nn as u,on as d,rn as f,sn as p,tn as m,un as h}from"./messages-BOl-zx8S.js";import{a as g}from"./auth-store-D_jr_Pei.js";import{t as _}from"./button-D-oR8d6w.js";import{n as v}from"./dist-BNiRpK39.js";import{c as y,s as b}from"./zod-DzRgHmfz.js";import{a as x,c as S,i as C,l as w,n as T,o as E,s as D,t as O}from"./form-uKra2bmF.js";import{t as k}from"./password-input-ZB498Nq4.js";import{t as A}from"./page-header-BRM1dngJ.js";var j=i(),M=b({old_password:y().min(1,h()),new_password:y().min(8,l()),confirm_password:y().min(1,o())}).refine(e=>e.new_password===e.confirm_password,{message:p(),path:[`confirm_password`]});function N(){let t=w({resolver:S(M),defaultValues:{old_password:``,new_password:``,confirm_password:``}}),n=g.useMutation(`post`,`/admin/api/v1/auth/password`);async function i(e){await n.mutateAsync({body:{old_password:e.old_password,new_password:e.new_password}}),v.success(d()),t.reset()}return(0,j.jsx)(O,{...t,children:(0,j.jsxs)(`form`,{className:`max-w-md space-y-4`,onSubmit:t.handleSubmit(i),children:[(0,j.jsx)(C,{control:t.control,name:`old_password`,render:({field:e})=>(0,j.jsxs)(x,{children:[(0,j.jsx)(E,{children:a()}),(0,j.jsx)(T,{children:(0,j.jsx)(k,{placeholder:c(),...e})}),(0,j.jsx)(D,{})]})}),(0,j.jsx)(C,{control:t.control,name:`new_password`,render:({field:e})=>(0,j.jsxs)(x,{children:[(0,j.jsx)(E,{children:f()}),(0,j.jsx)(T,{children:(0,j.jsx)(k,{placeholder:u(),...e})}),(0,j.jsx)(D,{})]})}),(0,j.jsx)(C,{control:t.control,name:`confirm_password`,render:({field:e})=>(0,j.jsxs)(x,{children:[(0,j.jsx)(E,{children:m()}),(0,j.jsx)(T,{children:(0,j.jsx)(k,{placeholder:s(),...e})}),(0,j.jsx)(D,{})]})}),(0,j.jsx)(_,{disabled:n.isPending,type:`submit`,children:n.isPending?e():r()})]})})}function P(){return(0,j.jsx)(A,{description:n(),title:t(),variant:`section`,children:(0,j.jsx)(N,{})})}var F=P;export{F as component};