From 43712ec234fdaec545eb7d4fa6f2b697a1488781 Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Wed, 23 Sep 2026 16:45:08 +0800 Subject: [PATCH 1/2] feat: change playground --- frontend/src/App.tsx | 37 +------ frontend/src/Playground.tsx | 209 ++++++++++++++++++++++++++++++++++++ frontend/src/i18n.tsx | 138 ++++++++++++++++++++++++ frontend/src/index.css | 71 ++++++++++-- 4 files changed, 412 insertions(+), 43 deletions(-) create mode 100644 frontend/src/Playground.tsx diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 5a735e9..bea07b2 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -3,6 +3,7 @@ import { Activity, BookOpen, ChartNoAxesColumn, CircleHelp, Copy, KeyRound, Lang import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { apiErrorMessage, useI18n, type Locale, type MessageKey, type Translate } from "./i18n" +import { Playground, sampleRequest } from "./Playground" type ApiKey = { id: number; name: string; mask: string; created_at: string; revoked_at: string | null; last_used_at: string | null } type Usage = { totals: { requests: number; input_tokens: number; output_tokens: number }; daily: { day: string; requests: number; input_tokens: number; output_tokens: number }[]; sources: { source: string; key_id: number | null; requests: number; input_tokens: number; output_tokens: number }[] } @@ -115,7 +116,7 @@ function App() {
{title}
LAYA SERVER
-
{page === "home" ? : page === "keys" ? : page === "usage" ? : page === "playground" ? : }
+
{page === "home" ? : page === "keys" ? : page === "usage" ? : page === "playground" ? api("/internal/playground", { method: "POST", body }, session.csrf_token)} /> : }
{mobileNav ?