Files
Sub-Router/dist/assets/Dashboard-Djts405O.js
T
abingyydsandClaude Sonnet 4.6 cc9a8bcc0e fix: 分站价格单位改为每1M tokens + 移除所有SubRouter主站标识
- 价格表单位从 "per 1K tokens" 改为 "per 1M tokens"(价格×1000显示)
- 移除 footer "Powered by SubRouter" 字样
- 默认站名从 "SubRouter" 改为 "AI Platform"
- HTML title 从 "SubRouter Dist Site" 改为 "AI Platform"
- 分站不再包含任何主站品牌标识

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-21 06:01:43 +09:00

2 lines
5.6 KiB
JavaScript

import{r as n,j as e,u as I,Q as $,L as k,e as L,f as A,z as _}from"./index-CJw6IpTa.js";import{S as R}from"./SpotlightCard-lt5CQbhM.js";import{u as z,a as Q,b as W,m as B,C as S}from"./CountUp-SCQ6rVWn.js";const F=({text:s,disabled:v=!1,speed:a=2,className:w="",color:l="#b5b5b5",shineColor:p="#ffffff",spread:f=120,yoyo:g=!1,pauseOnHover:i=!1,direction:m="left",delay:b=0})=>{const[j,N]=n.useState(!1),r=z(0),t=n.useRef(0),d=n.useRef(null),u=n.useRef(m==="left"?1:-1),o=a*1e3,q=b*1e3;Q(h=>{if(v||j){d.current=null;return}if(d.current===null){d.current=h;return}const E=h-d.current;if(d.current=h,t.current+=E,g){const x=o+q,y=x*2,c=t.current%y;if(c<o){const C=c/o*100;r.set(u.current===1?C:100-C)}else if(c<x)r.set(u.current===1?100:0);else if(c<x+o){const T=100-(c-x)/o*100;r.set(u.current===1?T:100-T)}else r.set(u.current===1?0:100)}else{const x=o+q,y=t.current%x;if(y<o){const c=y/o*100;r.set(u.current===1?c:100-c)}else r.set(u.current===1?100:0)}}),n.useEffect(()=>{u.current=m==="left"?1:-1,t.current=0,r.set(0)},[m]);const P=W(r,h=>`${150-h*2}% center`),D=n.useCallback(()=>{i&&N(!0)},[i]),M=n.useCallback(()=>{i&&N(!1)},[i]),U={backgroundImage:`linear-gradient(${f}deg, ${l} 0%, ${l} 35%, ${p} 50%, ${l} 65%, ${l} 100%)`,backgroundSize:"200% auto",WebkitBackgroundClip:"text",backgroundClip:"text",WebkitTextFillColor:"transparent"};return e.jsx(B.span,{className:`inline-block ${w}`,style:{...U,backgroundPosition:P},onMouseEnter:D,onMouseLeave:M,children:s})};function J(){const{user:s,refreshUser:v}=I(),[a,w]=n.useState(null),[l,p]=n.useState(""),[f,g]=n.useState(!1),i=async()=>{try{const t=await L();t.data.success&&w(t.data.data)}catch{}};n.useEffect(()=>{i()},[]);const m=async t=>{if(t.preventDefault(),!!l.trim()){g(!0);try{(await A(l.trim())).data.success&&(_.success("Code redeemed successfully!"),p(""),await Promise.all([i(),v()]))}catch{}g(!1)}},b=(a==null?void 0:a.quota)??(s==null?void 0:s.quota)??0,j=(a==null?void 0:a.used_quota)??(s==null?void 0:s.used_quota)??0,N=(a==null?void 0:a.request_count)??(s==null?void 0:s.request_count)??0,r=b/$;return e.jsxs("div",{className:"max-w-7xl mx-auto px-6 py-10",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-white mb-1",children:["Welcome, ",e.jsx(F,{text:(s==null?void 0:s.display_name)||(s==null?void 0:s.username)||"User",className:"!inline",speed:3,color:"#a5b4fc",shineColor:"#e0e7ff"})]}),e.jsx("p",{className:"text-sm text-neutral-400",children:"Manage your API usage, keys, and account"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-10",children:[e.jsxs(R,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(34,197,94,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:"Balance"}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(S,{from:0,to:r,duration:1.5})]}),e.jsxs("p",{className:"text-xs text-neutral-500 mt-1",children:[b.toLocaleString()," quota units"]})]}),e.jsxs(R,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(129,140,248,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:"Used"}),e.jsxs("div",{className:"text-3xl font-bold text-white",children:["$",e.jsx(S,{from:0,to:j/$,duration:1.5})]}),e.jsxs("p",{className:"text-xs text-neutral-500 mt-1",children:[j.toLocaleString()," quota units"]})]}),e.jsxs(R,{className:"!bg-neutral-900/60 !border-neutral-800/60 !p-6",spotlightColor:"rgba(244,114,182,0.15)",children:[e.jsx("p",{className:"text-sm text-neutral-400 mb-2",children:"Total Requests"}),e.jsx("div",{className:"text-3xl font-bold text-white",children:e.jsx(S,{from:0,to:N,duration:1.5})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"Redeem Code"}),e.jsxs("form",{onSubmit:m,className:"flex gap-3",children:[e.jsx("input",{type:"text",value:l,onChange:t=>p(t.target.value),className:"input flex-1",placeholder:"Enter redemption code"}),e.jsx("button",{type:"submit",disabled:f,className:"btn-primary whitespace-nowrap",children:f?"Redeeming...":"Redeem"})]})]}),e.jsxs("div",{className:"glass rounded-2xl p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-white mb-4",children:"Quick Links"}),e.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[e.jsxs(k,{to:"/tokens",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:"API Keys"}),e.jsx("p",{className:"text-xs text-neutral-500",children:"Manage your keys"})]}),e.jsxs(k,{to:"/packages",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:"Packages"}),e.jsx("p",{className:"text-xs text-neutral-500",children:"View plans"})]}),e.jsxs(k,{to:"/pricing",className:"glass-sm !rounded-xl px-4 py-3 hover:bg-white/[0.06] transition-colors group",children:[e.jsx("p",{className:"text-sm font-medium text-white group-hover:text-brand-400 transition-colors",children:"Pricing"}),e.jsx("p",{className:"text-xs text-neutral-500",children:"Model prices"})]}),e.jsxs("div",{className:"glass-sm !rounded-xl px-4 py-3 opacity-50",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:"API Docs"}),e.jsx("p",{className:"text-xs text-neutral-500",children:"Coming soon"})]})]})]})]})]})}export{J as default};