feat:格式化代码

This commit is contained in:
lsy committed 2026-02-21 19:09:16 +08:00
1 parent 584b5c3bda
commit d199609bc6
10 files changed
+44 -38

No files matched your search

-1
View File
@@ -18,4 +18,3 @@
"hono": "^4.11.9"
}
}
+4 -2
View File
@@ -162,7 +162,9 @@ export const ChannelsView = ({
</div>
<div class="mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-stone-500">
<div class="flex flex-wrap items-center gap-2">
<span class="text-xs text-stone-500">共 {channelTotalPages} 页</span>
<span class="text-xs text-stone-500">
共 {channelTotal} 条 · {channelTotalPages} 页
</span>
<button
class="h-8 w-8 rounded-full border border-stone-200 bg-white text-xs font-semibold text-stone-600 transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:text-stone-900 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-60"
type="button"
@@ -178,7 +180,7 @@ export const ChannelsView = ({
</span>
) : (
<button
class={`h-8 min-w-[32px] rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
class={`h-8 min-w-8 rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
item === channelPage
? "border-stone-900 bg-stone-900 text-white shadow-md"
: "border-stone-200 bg-white text-stone-600 hover:-translate-y-0.5 hover:text-stone-900 hover:shadow-md"
+4 -2
View File
@@ -146,7 +146,9 @@ export const TokensView = ({
</div>
<div class="mt-4 flex flex-wrap items-center justify-between gap-3 text-xs text-stone-500">
<div class="flex flex-wrap items-center gap-2">
<span class="text-xs text-stone-500">共 {tokenTotalPages} 页</span>
<span class="text-xs text-stone-500">
共 {tokenTotal} 条 · {tokenTotalPages} 页
</span>
<button
class="h-8 w-8 rounded-full border border-stone-200 bg-white text-xs font-semibold text-stone-600 transition-all duration-200 ease-in-out hover:-translate-y-0.5 hover:text-stone-900 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-60"
type="button"
@@ -162,7 +164,7 @@ export const TokensView = ({
</span>
) : (
<button
class={`h-8 min-w-[32px] rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
class={`h-8 min-w-8 rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
item === tokenPage
? "border-stone-900 bg-stone-900 text-white shadow-md"
: "border-stone-200 bg-white text-stone-600 hover:-translate-y-0.5 hover:text-stone-900 hover:shadow-md"
+5 -2
View File
@@ -19,10 +19,13 @@ const formatSeconds = (value: number | null | undefined) => {
return `${(value / 1000).toFixed(2)} s`;
};
const formatStream = (value: boolean | null | undefined) => {
const formatStream = (value: boolean | number | null | undefined) => {
if (value === null || value === undefined) {
return "-";
}
if (typeof value === "number") {
return value > 0 ? "是" : "否";
}
return value ? "是" : "否";
};
@@ -193,7 +196,7 @@ export const UsageView = ({ usage, onRefresh }: UsageViewProps) => {
</span>
) : (
<button
class={`h-8 min-w-[32px] rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
class={`h-8 min-w-8 rounded-full border px-3 text-xs font-semibold transition-all duration-200 ease-in-out focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400/70 focus-visible:ring-offset-2 focus-visible:ring-offset-white ${
item === page
? "border-stone-900 bg-stone-900 text-white shadow-md"
: "border-stone-200 bg-white text-stone-600 hover:-translate-y-0.5 hover:text-stone-900 hover:shadow-md"
-1
View File
@@ -16,4 +16,3 @@
"wrangler": "^3.48.0"
}
}
+3 -2
View File
@@ -121,8 +121,9 @@ app.notFound((c) => {
) {
return c.json({ error: "Not Found" }, 404);
}
const assets = (c.env as { ASSETS?: { fetch: (input: Request) => Promise<Response> } })
.ASSETS;
const assets = (
c.env as { ASSETS?: { fetch: (input: Request) => Promise<Response> } }
).ASSETS;
return assets ? assets.fetch(c.req.raw) : c.text("Not Found", 404);
});
+1 -3
View File
@@ -16,9 +16,7 @@ function readEffort(value: unknown): string | number | null {
* Returns:
* Reasoning effort value, if present.
*/
export function extractReasoningEffort(
input: unknown,
): string | number | null {
export function extractReasoningEffort(input: unknown): string | number | null {
if (!input || typeof input !== "object") {
return null;
}
+3
View File
@@ -3,6 +3,9 @@
## [Unreleased]
### 微调
- **[docs]**: 补充本地开发流程、API 接口与 GitHub Actions 自动部署说明
- 类型: 微调(无方案包)
- 文件: README.md:12-272
- **[worker]**: 补齐 admin 静态目录占位以通过 wrangler assets 检查
- 类型: 微调(无方案包)
- 文件: apps/ui/dist/.gitkeep
+24 -24
View File
@@ -1,26 +1,26 @@
{
"name": "api-worker",
"private": true,
"packageManager": "bun@1.3.9",
"workspaces": [
"apps/*"
],
"scripts": {
"dev:worker": "bun --cwd apps/worker dev",
"dev:ui": "bun --filter api-worker-ui dev -- --port 4173",
"test": "vitest",
"format": "bunx --bun biome format --write .",
"lint": "bunx --bun biome lint --write .",
"check": "bunx --bun biome check --write .",
"typecheck": "bunx --bun tsc --noEmit"
},
"devDependencies": {
"@biomejs/biome": "2.3.15",
"@types/node": "^20.11.30",
"typescript": "^5.4.5",
"vitest": "^1.5.3"
},
"dependencies": {
"wrangler": "4"
}
"name": "api-worker",
"private": true,
"packageManager": "bun@1.3.9",
"workspaces": [
"apps/*"
],
"scripts": {
"dev:worker": "bun --cwd apps/worker dev",
"dev:ui": "bun --filter api-worker-ui dev -- --port 4173",
"test": "vitest",
"format": "bunx --bun biome format --write .",
"lint": "bunx --bun biome lint --write .",
"check": "bunx --bun biome check --write .",
"typecheck": "bunx --bun tsc --noEmit"
},
"devDependencies": {
"@biomejs/biome": "2.3.15",
"@types/node": "^20.11.30",
"typescript": "^5.4.5",
"vitest": "^1.5.3"
},
"dependencies": {
"wrangler": "4"
}
}
-1
View File
@@ -18,4 +18,3 @@
"skipLibCheck": true
}
}