- 新增 DistUserGetLogs 后端接口,支持按模型/令牌筛选和分页 - 新增 dist-site Logs 页面,desktop 表格 + mobile 卡片布局 - 所有 7 个主题 Layout 添加日志导航项 - Dashboard 快捷入口替换为调用日志链接 - 添加中英文 i18n 翻译 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2 lines
4.2 KiB
JavaScript
2 lines
4.2 KiB
JavaScript
import{u as h,a as g,b as u,c as b,r as p,j as e,L as o,O as v}from"./index-wP6q62li.js";import{L as j}from"./LanguageSwitch-CsRv5KE4.js";import{u as y}from"./useTranslation-HmEIwPyi.js";function L(){const{t:a}=y(),{user:l,logout:m}=h(),{site:t}=g(),d=u(),i=b(),[n,c]=p.useState(!1),r=(t==null?void 0:t.name)||"AI Platform",x=[{to:"/",label:a("nav.home"),auth:!1},{to:"/pricing",label:a("nav.pricing"),auth:!1},{to:"/packages",label:a("nav.packages"),auth:!1},{to:"/dashboard",label:a("nav.dashboard"),auth:!0},{to:"/tokens",label:a("nav.apiKeys"),auth:!0},{to:"/logs",label:a("nav.logs"),auth:!0},...t!=null&&t.enable_topup?[{to:"/topup",label:a("nav.topup"),auth:!0}]:[]].filter(s=>!s.auth||l);return e.jsxs("div",{className:"theme-light min-h-screen flex flex-col bg-white text-gray-900",children:[(t==null?void 0:t.announcement)&&e.jsx("div",{className:"bg-blue-50 border-b border-blue-100 text-center py-2.5 px-4",children:e.jsx("p",{className:"text-sm text-blue-700",children:t.announcement})}),e.jsxs("header",{className:"sticky top-0 z-50 bg-white/80 backdrop-blur-xl border-b border-gray-100",children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[e.jsxs(o,{to:"/",className:"flex items-center gap-3 group",children:[t!=null&&t.logo?e.jsx("img",{src:t.logo,alt:r,className:"h-8 w-auto"}):e.jsx("div",{className:"w-9 h-9 rounded-xl bg-gradient-to-br from-blue-600 to-indigo-600 flex items-center justify-center text-white font-bold text-sm shadow-sm",children:r.charAt(0)}),e.jsx("span",{className:"text-lg font-semibold text-gray-900 group-hover:text-blue-600 transition-colors",children:r})]}),e.jsx("nav",{className:"hidden md:flex items-center gap-1",children:x.map(s=>e.jsx(o,{to:s.to,className:`px-3.5 py-2 text-sm rounded-lg transition-all ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(j,{className:"text-gray-400 hover:text-gray-700 hover:bg-gray-50"}),l?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-sm text-gray-500 hidden sm:block",children:l.display_name||l.username}),e.jsx("button",{onClick:async()=>{await m(),d("/")},className:"text-sm text-gray-400 hover:text-gray-700 transition-colors",children:a("nav.logout")})]}):e.jsxs(e.Fragment,{children:[e.jsx(o,{to:"/login",className:"text-sm text-gray-500 hover:text-gray-900 px-3 py-2 hidden sm:block transition-colors",children:a("nav.login")}),e.jsx(o,{to:"/register",className:"px-5 py-2 rounded-lg bg-blue-600 text-white text-sm font-medium hover:bg-blue-700 transition-colors shadow-sm",children:a("nav.signUp")})]}),e.jsx("button",{className:"md:hidden p-2 rounded-lg hover:bg-gray-50 transition-colors",onClick:()=>c(!n),"aria-label":"Toggle menu",children:e.jsx("svg",{className:"w-5 h-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:n?e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"}):e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),n&&e.jsx("div",{className:"md:hidden border-t border-gray-100 bg-white",children:e.jsx("nav",{className:"max-w-6xl mx-auto px-6 py-3 flex flex-col gap-1",children:x.map(s=>e.jsx(o,{to:s.to,onClick:()=>c(!1),className:`px-3 py-2.5 text-sm rounded-lg transition-colors ${i.pathname===s.to?"text-blue-600 bg-blue-50 font-medium":"text-gray-500 hover:text-gray-900 hover:bg-gray-50"}`,children:s.label},s.to))})})]}),e.jsx("main",{className:"flex-1",children:e.jsx(v,{})}),e.jsx("footer",{className:"border-t border-gray-100 mt-auto bg-gray-50/50",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-8 flex flex-col md:flex-row items-center justify-between gap-4",children:[e.jsxs("p",{className:"text-sm text-gray-400",children:["© ",new Date().getFullYear()," ",r,"."]}),e.jsx("div",{className:"flex items-center gap-4",children:(t==null?void 0:t.contact_email)&&e.jsx("a",{href:`mailto:${t.contact_email}`,className:"text-sm text-gray-400 hover:text-gray-600 transition-colors",children:a("nav.contact")})})]})})]})}export{L as default};
|