Files
epusdt/src/www/assets/epay-CSwdoLsE.js
T
line-6000 95879e33d4 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>
2026-04-25 18:48:28 +08:00

1 line
2.1 KiB
JavaScript

import{$u as e,Al as t,Dl as n,Ol as r,Qu as i,gt as a,ht as o,kl as s,mt as c,nd as l}from"./messages-BOl-zx8S.js";import{t as u}from"./button-D-oR8d6w.js";import{c as d,s as f}from"./zod-DzRgHmfz.js";import{a as p,c as m,i as h,l as g,n as _,o as v,s as y,t as b}from"./form-uKra2bmF.js";import{t as x}from"./input-CZHXycLK.js";import{t as S}from"./page-header-BRM1dngJ.js";import{a as C,i as w,n as T,t as E}from"./lib-_PocwKaj.js";var D=l(e(),1),O=i(),k=f({defaultToken:d().min(1,s()),defaultCurrency:d().min(1,r()),defaultNetwork:d().min(1,n())});function A(){let e=w(`epay`),t=C(),i=g({resolver:m(k),defaultValues:{defaultToken:``,defaultCurrency:``,defaultNetwork:``}});(0,D.useEffect)(()=>{let t=e.data?.data;t&&i.reset({defaultToken:E(t,`epay.default_token`),defaultCurrency:E(t,`epay.default_currency`),defaultNetwork:E(t,`epay.default_network`)})},[e.data,i]);async function a(n){await T(t.mutateAsync,[{group:`epay`,key:`epay.default_token`,type:`string`,value:n.defaultToken},{group:`epay`,key:`epay.default_currency`,type:`string`,value:n.defaultCurrency},{group:`epay`,key:`epay.default_network`,type:`string`,value:n.defaultNetwork}],o()),await e.refetch()}return(0,O.jsx)(b,{...i,children:(0,O.jsxs)(`form`,{className:`space-y-6`,onSubmit:i.handleSubmit(a),children:[(0,O.jsx)(h,{control:i.control,name:`defaultToken`,render:({field:e})=>(0,O.jsxs)(p,{children:[(0,O.jsx)(v,{children:s()}),(0,O.jsx)(_,{children:(0,O.jsx)(x,{placeholder:`usdt`,...e})}),(0,O.jsx)(y,{})]})}),(0,O.jsx)(h,{control:i.control,name:`defaultCurrency`,render:({field:e})=>(0,O.jsxs)(p,{children:[(0,O.jsx)(v,{children:r()}),(0,O.jsx)(_,{children:(0,O.jsx)(x,{placeholder:`cny`,...e})}),(0,O.jsx)(y,{})]})}),(0,O.jsx)(h,{control:i.control,name:`defaultNetwork`,render:({field:e})=>(0,O.jsxs)(p,{children:[(0,O.jsx)(v,{children:n()}),(0,O.jsx)(_,{children:(0,O.jsx)(x,{placeholder:`tron`,...e})}),(0,O.jsx)(y,{})]})}),(0,O.jsx)(u,{disabled:t.isPending||e.isLoading,type:`submit`,children:c()})]})})}function j(){return(0,O.jsx)(S,{description:a(),title:t(),variant:`section`,children:(0,O.jsx)(A,{})})}var M=j;export{M as component};