xithead 1.5.1 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/xithead.js +486 -226
- package/index.d.ts +57 -0
- package/index.js +139 -0
- package/package.json +44 -63
- package/postinstall.js +43 -0
- package/LICENSE +0 -190
- package/README.md +0 -108
- package/app/api/config/route.ts +0 -22
- package/app/api/export/route.ts +0 -83
- package/app/api/models/route.ts +0 -12
- package/app/api/stats/route.ts +0 -46
- package/app/dashboard/page.tsx +0 -445
- package/app/globals.css +0 -35
- package/app/installation/page.tsx +0 -293
- package/app/layout.tsx +0 -35
- package/app/master-design-system.css +0 -2076
- package/app/master-design-system.source.css +0 -8
- package/app/page.tsx +0 -187
- package/app/rechtliches/agb/page.tsx +0 -165
- package/app/rechtliches/datenschutz/page.tsx +0 -128
- package/app/rechtliches/impressum/page.tsx +0 -122
- package/app/rechtliches/widerruf/page.tsx +0 -185
- package/components/layout/AppShell.tsx +0 -25
- package/components/layout/Footer.tsx +0 -120
- package/components/layout/Header.tsx +0 -145
- package/components/marketing/LegalHighlights.tsx +0 -45
- package/components/marketing/LegalPageShell.tsx +0 -49
- package/components/marketing/LegalPanel.tsx +0 -41
- package/components/marketing/index.ts +0 -3
- package/design-system/README.md +0 -80
- package/design-system/base.css +0 -127
- package/design-system/components.css +0 -1943
- package/design-system/fonts.css +0 -17
- package/design-system/tailwind-preset.js +0 -95
- package/design-system/tokens.css +0 -48
- package/design-system/utilities.css +0 -53
- package/lib/config/index.ts +0 -12
- package/lib/hooks/index.ts +0 -4
- package/lib/hooks/use-mounted.ts +0 -13
- package/lib/hooks/use-session.ts +0 -34
- package/lib/hooks/use-settings.ts +0 -49
- package/lib/utils/index.ts +0 -1
- package/lib/utils/settings.ts +0 -162
- package/lib/utils/utils.ts +0 -6
- package/middleware.ts +0 -26
- package/next-env.d.ts +0 -7
- package/next.config.ts +0 -12
- package/postcss.config.mjs +0 -7
- package/public/apple-touch-icon.png +0 -0
- package/public/logo-transparent.png +0 -0
- package/public/xithead.ps1 +0 -937
- package/scripts/README.md +0 -77
- package/scripts/audit_wheel_glibc_symbols.py +0 -217
- package/scripts/build-master-design-system.cjs +0 -33
- package/scripts/build_rust_extension.sh +0 -58
- package/scripts/changelog-gen.py +0 -203
- package/scripts/eval_output_shaper.py +0 -235
- package/scripts/export_kompress_v2_onnx.py +0 -267
- package/scripts/fixtures/anthropic_replay_body.json +0 -133
- package/scripts/fixtures/codex_response_create_frame.json +0 -52
- package/scripts/install-git-hooks.sh +0 -104
- package/scripts/install.ps1 +0 -1809
- package/scripts/install.sh +0 -1673
- package/scripts/pr-governance.py +0 -297
- package/scripts/record_fixtures.py +0 -59
- package/scripts/refresh_model_limits.sh +0 -48
- package/scripts/replay_codex_ws_load.py +0 -445
- package/scripts/repro_codex_replay.py +0 -699
- package/scripts/smoke_issue_327.py +0 -233
- package/scripts/sync-plugin-versions.py +0 -116
- package/scripts/tests/test_changelog_gen.py +0 -302
- package/scripts/tests/test_pr_governance.py +0 -163
- package/scripts/tests/test_pr_health_labels.py +0 -94
- package/scripts/tests/test_pr_health_workflow.py +0 -14
- package/scripts/tests/test_sync_plugin_versions.py +0 -131
- package/scripts/tests/test_version_sync.py +0 -291
- package/scripts/validate-workflows.sh +0 -39
- package/scripts/verify-versions.py +0 -106
- package/scripts/version-sync.py +0 -207
- package/tailwind.config.js +0 -31
- package/tailwind.master.config.cjs +0 -47
- package/tsconfig.json +0 -84
- package/types/api.ts +0 -12
- package/types/config.ts +0 -9
- package/types/index.ts +0 -2
package/app/api/export/route.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
|
|
3
|
-
export async function GET(request: Request) {
|
|
4
|
-
try {
|
|
5
|
-
const { searchParams } = new URL(request.url)
|
|
6
|
-
const format = searchParams.get("format") || "json"
|
|
7
|
-
|
|
8
|
-
// Fetch current config and stats
|
|
9
|
-
const configRes = await fetch("http://localhost:8787/api/config", {
|
|
10
|
-
cache: "no-store",
|
|
11
|
-
}).catch(() => null)
|
|
12
|
-
const statsRes = await fetch("http://localhost:8787/api/stats", {
|
|
13
|
-
cache: "no-store",
|
|
14
|
-
}).catch(() => null)
|
|
15
|
-
const logsRes = await fetch("http://localhost:8787/api/logs", {
|
|
16
|
-
cache: "no-store",
|
|
17
|
-
}).catch(() => null)
|
|
18
|
-
|
|
19
|
-
const config = configRes ? await configRes.json() : {}
|
|
20
|
-
const stats = statsRes ? await statsRes.json() : {}
|
|
21
|
-
const logs = logsRes ? await logsRes.json() : {}
|
|
22
|
-
|
|
23
|
-
const exportData = {
|
|
24
|
-
version: "1.5.0",
|
|
25
|
-
exported_at: new Date().toISOString(),
|
|
26
|
-
config,
|
|
27
|
-
stats,
|
|
28
|
-
logs: logs.logs || [],
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (format === "json") {
|
|
32
|
-
return new NextResponse(JSON.stringify(exportData, null, 2), {
|
|
33
|
-
headers: {
|
|
34
|
-
"Content-Type": "application/json",
|
|
35
|
-
"Content-Disposition": `attachment; filename="xithead-export-${Date.now()}.json"`,
|
|
36
|
-
},
|
|
37
|
-
})
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (format === "csv") {
|
|
41
|
-
const csv = convertToCSV(exportData)
|
|
42
|
-
return new NextResponse(csv, {
|
|
43
|
-
headers: {
|
|
44
|
-
"Content-Type": "text/csv",
|
|
45
|
-
"Content-Disposition": `attachment; filename="xithead-export-${Date.now()}.csv"`,
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return NextResponse.json({ error: "Invalid format" }, { status: 400 })
|
|
51
|
-
} catch (error) {
|
|
52
|
-
return NextResponse.json({ error: "Export failed" }, { status: 500 })
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function convertToCSV(data: any): string {
|
|
57
|
-
const lines: string[] = []
|
|
58
|
-
|
|
59
|
-
// Config section
|
|
60
|
-
lines.push("=== Configuration ===")
|
|
61
|
-
lines.push(`Model,${data.config.model || "N/A"}`)
|
|
62
|
-
lines.push(`Cache Enabled,${data.config.cacheEnabled || false}`)
|
|
63
|
-
lines.push(`Auto Update,${data.config.autoUpdate || false}`)
|
|
64
|
-
|
|
65
|
-
lines.push("")
|
|
66
|
-
lines.push("=== Statistics ===")
|
|
67
|
-
lines.push(`Requests,${data.stats.requests || 0}`)
|
|
68
|
-
lines.push(`Tokens Saved,${data.stats.tokensSaved || 0}`)
|
|
69
|
-
lines.push(`Cost Saved,${data.stats.costSaved || 0}`)
|
|
70
|
-
lines.push(`Cache Hit Rate,${((data.stats.cacheHitRate || 0) * 100).toFixed(1)}%`)
|
|
71
|
-
|
|
72
|
-
if (data.logs && data.logs.length > 0) {
|
|
73
|
-
lines.push("")
|
|
74
|
-
lines.push("=== Recent Activity ===")
|
|
75
|
-
lines.push("Timestamp,Type,Message")
|
|
76
|
-
data.logs.slice(0, 20).forEach((log: any) => {
|
|
77
|
-
const timestamp = new Date(log.timestamp).toLocaleString()
|
|
78
|
-
lines.push(`"${timestamp}","${log.type}","${log.message}"`)
|
|
79
|
-
})
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return lines.join("\n")
|
|
83
|
-
}
|
package/app/api/models/route.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
|
|
3
|
-
export async function GET() {
|
|
4
|
-
const models = [
|
|
5
|
-
{ id: "claude-opus-5-5", name: "Claude Opus 5.5", description: "Most capable, for complex tasks" },
|
|
6
|
-
{ id: "claude-sonnet-5", name: "Claude Sonnet 5", description: "Balanced, fast and capable" },
|
|
7
|
-
{ id: "claude-haiku-4-5-20251001", name: "Claude Haiku 4.5", description: "Fastest, for simple tasks" },
|
|
8
|
-
{ id: "claude-fable-5-1", name: "Claude Fable 5.1", description: "Lightweight, experimental" },
|
|
9
|
-
]
|
|
10
|
-
|
|
11
|
-
return NextResponse.json({ models })
|
|
12
|
-
}
|
package/app/api/stats/route.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server"
|
|
2
|
-
|
|
3
|
-
// In-memory stats (in production would use database)
|
|
4
|
-
let stats = {
|
|
5
|
-
requests: 0,
|
|
6
|
-
tokensSaved: 0,
|
|
7
|
-
costSaved: 0,
|
|
8
|
-
cacheHitRate: 0,
|
|
9
|
-
uptime: Date.now(),
|
|
10
|
-
lastRequest: new Date(),
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function GET() {
|
|
14
|
-
const uptime = Math.floor((Date.now() - stats.uptime) / 1000)
|
|
15
|
-
|
|
16
|
-
return NextResponse.json({
|
|
17
|
-
...stats,
|
|
18
|
-
uptime,
|
|
19
|
-
uptime_formatted: formatUptime(uptime),
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export async function POST(request: Request) {
|
|
24
|
-
try {
|
|
25
|
-
const body = await request.json()
|
|
26
|
-
|
|
27
|
-
if (body.requests !== undefined) stats.requests = body.requests
|
|
28
|
-
if (body.tokensSaved !== undefined) stats.tokensSaved = body.tokensSaved
|
|
29
|
-
if (body.costSaved !== undefined) stats.costSaved = body.costSaved
|
|
30
|
-
if (body.cacheHitRate !== undefined) stats.cacheHitRate = body.cacheHitRate
|
|
31
|
-
|
|
32
|
-
stats.lastRequest = new Date()
|
|
33
|
-
|
|
34
|
-
return NextResponse.json({ success: true, stats })
|
|
35
|
-
} catch (error) {
|
|
36
|
-
return NextResponse.json({ error: "Invalid request" }, { status: 400 })
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function formatUptime(seconds: number): string {
|
|
41
|
-
const hours = Math.floor(seconds / 3600)
|
|
42
|
-
const minutes = Math.floor((seconds % 3600) / 60)
|
|
43
|
-
|
|
44
|
-
if (hours === 0) return `${minutes}m`
|
|
45
|
-
return `${hours}h ${minutes}m`
|
|
46
|
-
}
|
package/app/dashboard/page.tsx
DELETED
|
@@ -1,445 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import { useEffect, useState } from "react"
|
|
4
|
-
import Image from "next/image"
|
|
5
|
-
import { ChevronDown, Settings, Zap, Shield, Activity, TrendingUp, Clock } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
interface Model {
|
|
8
|
-
id: string
|
|
9
|
-
name: string
|
|
10
|
-
description: string
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface Config {
|
|
14
|
-
model: string
|
|
15
|
-
theme: string
|
|
16
|
-
autoUpdate: boolean
|
|
17
|
-
cacheEnabled: boolean
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface Stats {
|
|
21
|
-
requests: number
|
|
22
|
-
tokensSaved: number
|
|
23
|
-
costSaved: number
|
|
24
|
-
cacheHitRate: number
|
|
25
|
-
uptime: number
|
|
26
|
-
uptime_formatted: string
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface LogEntry {
|
|
30
|
-
timestamp: string
|
|
31
|
-
type: "request" | "cache_hit" | "cache_miss" | "config_change" | "error"
|
|
32
|
-
message: string
|
|
33
|
-
details?: Record<string, any>
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export default function Dashboard() {
|
|
37
|
-
const [models, setModels] = useState<Model[]>([])
|
|
38
|
-
const [config, setConfig] = useState<Config | null>(null)
|
|
39
|
-
const [stats, setStats] = useState<Stats | null>(null)
|
|
40
|
-
const [logs, setLogs] = useState<LogEntry[]>([])
|
|
41
|
-
const [loading, setLoading] = useState(true)
|
|
42
|
-
const [modelOpen, setModelOpen] = useState(false)
|
|
43
|
-
const [saving, setSaving] = useState(false)
|
|
44
|
-
|
|
45
|
-
useEffect(() => {
|
|
46
|
-
const loadData = async () => {
|
|
47
|
-
try {
|
|
48
|
-
const [modelsRes, configRes, statsRes, logsRes] = await Promise.all([
|
|
49
|
-
fetch("/api/models"),
|
|
50
|
-
fetch("/api/config"),
|
|
51
|
-
fetch("/api/stats"),
|
|
52
|
-
fetch("/api/logs?limit=10"),
|
|
53
|
-
])
|
|
54
|
-
|
|
55
|
-
if (modelsRes.ok) {
|
|
56
|
-
const data = await modelsRes.json()
|
|
57
|
-
setModels(data.models || [])
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (configRes.ok) {
|
|
61
|
-
const data = await configRes.json()
|
|
62
|
-
setConfig(data)
|
|
63
|
-
// Persist to localStorage
|
|
64
|
-
localStorage.setItem("xithead-config", JSON.stringify(data))
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
if (statsRes.ok) {
|
|
68
|
-
const data = await statsRes.json()
|
|
69
|
-
setStats(data)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (logsRes.ok) {
|
|
73
|
-
const data = await logsRes.json()
|
|
74
|
-
setLogs(data.logs || [])
|
|
75
|
-
}
|
|
76
|
-
} catch (error) {
|
|
77
|
-
console.error("Failed to load data:", error)
|
|
78
|
-
} finally {
|
|
79
|
-
setLoading(false)
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
loadData()
|
|
84
|
-
|
|
85
|
-
// Refresh stats every 5 seconds
|
|
86
|
-
const interval = setInterval(loadData, 5000)
|
|
87
|
-
return () => clearInterval(interval)
|
|
88
|
-
}, [])
|
|
89
|
-
|
|
90
|
-
const handleModelChange = async (modelId: string) => {
|
|
91
|
-
if (!config) return
|
|
92
|
-
|
|
93
|
-
setSaving(true)
|
|
94
|
-
try {
|
|
95
|
-
const res = await fetch("/api/config", {
|
|
96
|
-
method: "POST",
|
|
97
|
-
headers: { "Content-Type": "application/json" },
|
|
98
|
-
body: JSON.stringify({ ...config, model: modelId }),
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
if (res.ok) {
|
|
102
|
-
const data = await res.json()
|
|
103
|
-
setConfig(data.config)
|
|
104
|
-
}
|
|
105
|
-
} finally {
|
|
106
|
-
setSaving(false)
|
|
107
|
-
setModelOpen(false)
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const handleToggleSetting = async (key: keyof Config, value: boolean) => {
|
|
112
|
-
if (!config) return
|
|
113
|
-
|
|
114
|
-
setSaving(true)
|
|
115
|
-
try {
|
|
116
|
-
const res = await fetch("/api/config", {
|
|
117
|
-
method: "POST",
|
|
118
|
-
headers: { "Content-Type": "application/json" },
|
|
119
|
-
body: JSON.stringify({ ...config, [key]: value }),
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
if (res.ok) {
|
|
123
|
-
const data = await res.json()
|
|
124
|
-
setConfig(data.config)
|
|
125
|
-
}
|
|
126
|
-
} finally {
|
|
127
|
-
setSaving(false)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const currentModel = models.find((m) => m.id === config?.model)
|
|
132
|
-
|
|
133
|
-
return (
|
|
134
|
-
<div className="min-h-screen bg-gradient-to-br from-slate-950 via-blue-950 to-slate-950">
|
|
135
|
-
{/* Header with Logo */}
|
|
136
|
-
<div className="border-b border-border bg-card/50 backdrop-blur-sm sticky top-0 z-40">
|
|
137
|
-
<div className="layout-content py-4 sm:py-5">
|
|
138
|
-
<div className="flex items-center justify-between">
|
|
139
|
-
<div className="flex items-center gap-3">
|
|
140
|
-
<div className="h-12 w-12 rounded-lg overflow-hidden shadow-lg border border-primary/20 flex items-center justify-center bg-white">
|
|
141
|
-
<img
|
|
142
|
-
src="https://cdn.xtream-itsolutions.com/r/Pc1hfX"
|
|
143
|
-
alt="Xtream Solutions"
|
|
144
|
-
className="h-10 w-10 object-contain"
|
|
145
|
-
/>
|
|
146
|
-
</div>
|
|
147
|
-
<div>
|
|
148
|
-
<h1 className="text-lg font-bold text-foreground">xtream-head</h1>
|
|
149
|
-
<p className="text-xs text-muted-foreground">Development Dashboard</p>
|
|
150
|
-
</div>
|
|
151
|
-
</div>
|
|
152
|
-
<Settings className="w-5 h-5 text-muted-foreground" />
|
|
153
|
-
</div>
|
|
154
|
-
</div>
|
|
155
|
-
</div>
|
|
156
|
-
|
|
157
|
-
{/* Main Content */}
|
|
158
|
-
<div className="layout-content py-8 sm:py-10">
|
|
159
|
-
{loading ? (
|
|
160
|
-
<div className="flex items-center justify-center py-16">
|
|
161
|
-
<div className="animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent"></div>
|
|
162
|
-
</div>
|
|
163
|
-
) : (
|
|
164
|
-
<div className="space-y-8">
|
|
165
|
-
{/* Model Selection Card */}
|
|
166
|
-
<div className="glass-card p-6 sm:p-8 rounded-xl border border-border/50">
|
|
167
|
-
<h2 className="text-2xl font-bold text-foreground mb-2">AI Model</h2>
|
|
168
|
-
<p className="text-muted-foreground mb-6">
|
|
169
|
-
Select which Claude model to use for your tasks
|
|
170
|
-
</p>
|
|
171
|
-
|
|
172
|
-
<div className="space-y-4">
|
|
173
|
-
{/* Model Selector */}
|
|
174
|
-
<div className="relative">
|
|
175
|
-
<button
|
|
176
|
-
onClick={() => setModelOpen(!modelOpen)}
|
|
177
|
-
disabled={saving}
|
|
178
|
-
className="w-full px-4 py-3 bg-card border border-border rounded-lg text-left font-medium text-foreground hover:bg-card/80 transition-colors flex items-center justify-between disabled:opacity-50"
|
|
179
|
-
>
|
|
180
|
-
<div>
|
|
181
|
-
<div className="font-semibold">{currentModel?.name || "Select Model"}</div>
|
|
182
|
-
<div className="text-sm text-muted-foreground">{currentModel?.description}</div>
|
|
183
|
-
</div>
|
|
184
|
-
<ChevronDown
|
|
185
|
-
className={`w-5 h-5 transition-transform ${modelOpen ? "rotate-180" : ""}`}
|
|
186
|
-
/>
|
|
187
|
-
</button>
|
|
188
|
-
|
|
189
|
-
{/* Dropdown Menu */}
|
|
190
|
-
{modelOpen && (
|
|
191
|
-
<div className="absolute top-full left-0 right-0 mt-2 bg-card border border-border rounded-lg shadow-xl z-50 overflow-hidden">
|
|
192
|
-
{models.map((model) => (
|
|
193
|
-
<button
|
|
194
|
-
key={model.id}
|
|
195
|
-
onClick={() => handleModelChange(model.id)}
|
|
196
|
-
className={`w-full px-4 py-3 text-left border-b border-border/30 last:border-0 transition-colors ${
|
|
197
|
-
config?.model === model.id
|
|
198
|
-
? "bg-primary/10 border-l-2 border-l-primary"
|
|
199
|
-
: "hover:bg-card/50"
|
|
200
|
-
}`}
|
|
201
|
-
>
|
|
202
|
-
<div className="font-semibold text-foreground">{model.name}</div>
|
|
203
|
-
<div className="text-sm text-muted-foreground">{model.description}</div>
|
|
204
|
-
</button>
|
|
205
|
-
))}
|
|
206
|
-
</div>
|
|
207
|
-
)}
|
|
208
|
-
</div>
|
|
209
|
-
|
|
210
|
-
{/* Model Info */}
|
|
211
|
-
<div className="grid grid-cols-1 sm:grid-cols-3 gap-4 mt-6">
|
|
212
|
-
<div className="bg-gradient-to-br from-primary/10 to-secondary/10 border border-primary/30 rounded-lg p-4">
|
|
213
|
-
<div className="flex items-center gap-2 mb-2">
|
|
214
|
-
<Zap className="w-4 h-4 text-primary" />
|
|
215
|
-
<span className="text-sm font-semibold text-primary">Fast</span>
|
|
216
|
-
</div>
|
|
217
|
-
<p className="text-xs text-muted-foreground">
|
|
218
|
-
{currentModel?.id === "claude-haiku-4-5-20251001"
|
|
219
|
-
? "Blazing fast responses"
|
|
220
|
-
: "Balanced speed & quality"}
|
|
221
|
-
</p>
|
|
222
|
-
</div>
|
|
223
|
-
|
|
224
|
-
<div className="bg-gradient-to-br from-primary/10 to-secondary/10 border border-primary/30 rounded-lg p-4">
|
|
225
|
-
<div className="flex items-center gap-2 mb-2">
|
|
226
|
-
<Shield className="w-4 h-4 text-primary" />
|
|
227
|
-
<span className="text-sm font-semibold text-primary">Secure</span>
|
|
228
|
-
</div>
|
|
229
|
-
<p className="text-xs text-muted-foreground">Enterprise-grade security</p>
|
|
230
|
-
</div>
|
|
231
|
-
|
|
232
|
-
<div className="bg-gradient-to-br from-primary/10 to-secondary/10 border border-primary/30 rounded-lg p-4">
|
|
233
|
-
<div className="flex items-center gap-2 mb-2">
|
|
234
|
-
<Activity className="w-4 h-4 text-primary" />
|
|
235
|
-
<span className="text-sm font-semibold text-primary">Active</span>
|
|
236
|
-
</div>
|
|
237
|
-
<p className="text-xs text-muted-foreground">Real-time monitoring</p>
|
|
238
|
-
</div>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
</div>
|
|
242
|
-
|
|
243
|
-
{/* Settings Card */}
|
|
244
|
-
<div className="glass-card p-6 sm:p-8 rounded-xl border border-border/50">
|
|
245
|
-
<h2 className="text-2xl font-bold text-foreground mb-6">Settings</h2>
|
|
246
|
-
|
|
247
|
-
<div className="space-y-4">
|
|
248
|
-
{/* Cache Toggle */}
|
|
249
|
-
<div className="flex items-center justify-between p-4 bg-card/50 rounded-lg border border-border/30">
|
|
250
|
-
<div>
|
|
251
|
-
<p className="font-semibold text-foreground">Response Caching</p>
|
|
252
|
-
<p className="text-sm text-muted-foreground">Store and reuse API responses</p>
|
|
253
|
-
</div>
|
|
254
|
-
<button
|
|
255
|
-
onClick={() => handleToggleSetting("cacheEnabled", !config?.cacheEnabled)}
|
|
256
|
-
disabled={saving}
|
|
257
|
-
className={`relative inline-flex h-8 w-14 items-center rounded-full transition-colors ${
|
|
258
|
-
config?.cacheEnabled ? "bg-primary" : "bg-muted"
|
|
259
|
-
} disabled:opacity-50`}
|
|
260
|
-
>
|
|
261
|
-
<span
|
|
262
|
-
className={`inline-block h-6 w-6 transform rounded-full bg-white transition-transform ${
|
|
263
|
-
config?.cacheEnabled ? "translate-x-7" : "translate-x-1"
|
|
264
|
-
}`}
|
|
265
|
-
/>
|
|
266
|
-
</button>
|
|
267
|
-
</div>
|
|
268
|
-
|
|
269
|
-
{/* Auto-Update Toggle */}
|
|
270
|
-
<div className="flex items-center justify-between p-4 bg-card/50 rounded-lg border border-border/30">
|
|
271
|
-
<div>
|
|
272
|
-
<p className="font-semibold text-foreground">Auto-Update</p>
|
|
273
|
-
<p className="text-sm text-muted-foreground">Automatically check for updates</p>
|
|
274
|
-
</div>
|
|
275
|
-
<button
|
|
276
|
-
onClick={() => handleToggleSetting("autoUpdate", !config?.autoUpdate)}
|
|
277
|
-
disabled={saving}
|
|
278
|
-
className={`relative inline-flex h-8 w-14 items-center rounded-full transition-colors ${
|
|
279
|
-
config?.autoUpdate ? "bg-primary" : "bg-muted"
|
|
280
|
-
} disabled:opacity-50`}
|
|
281
|
-
>
|
|
282
|
-
<span
|
|
283
|
-
className={`inline-block h-6 w-6 transform rounded-full bg-white transition-transform ${
|
|
284
|
-
config?.autoUpdate ? "translate-x-7" : "translate-x-1"
|
|
285
|
-
}`}
|
|
286
|
-
/>
|
|
287
|
-
</button>
|
|
288
|
-
</div>
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
|
|
292
|
-
{/* Activity Log */}
|
|
293
|
-
<div className="glass-card p-6 sm:p-8 rounded-xl border border-border/50">
|
|
294
|
-
<h2 className="text-2xl font-bold text-foreground mb-6">📋 Activity Log</h2>
|
|
295
|
-
|
|
296
|
-
{logs.length === 0 ? (
|
|
297
|
-
<p className="text-center text-muted-foreground py-8">No activity yet</p>
|
|
298
|
-
) : (
|
|
299
|
-
<div className="space-y-2 max-h-64 overflow-y-auto">
|
|
300
|
-
{logs.map((entry, idx) => (
|
|
301
|
-
<div
|
|
302
|
-
key={idx}
|
|
303
|
-
className="flex items-start gap-3 p-3 bg-card/50 rounded-lg border border-border/30"
|
|
304
|
-
>
|
|
305
|
-
<div className="text-lg flex-shrink-0">
|
|
306
|
-
{entry.type === "request"
|
|
307
|
-
? "→"
|
|
308
|
-
: entry.type === "cache_hit"
|
|
309
|
-
? "✓"
|
|
310
|
-
: entry.type === "cache_miss"
|
|
311
|
-
? "✗"
|
|
312
|
-
: entry.type === "config_change"
|
|
313
|
-
? "⚙️"
|
|
314
|
-
: "⚠️"}
|
|
315
|
-
</div>
|
|
316
|
-
<div className="flex-1 min-w-0">
|
|
317
|
-
<p className="text-sm text-foreground">{entry.message}</p>
|
|
318
|
-
<p className="text-xs text-muted-foreground">
|
|
319
|
-
{new Date(entry.timestamp).toLocaleTimeString()}
|
|
320
|
-
</p>
|
|
321
|
-
</div>
|
|
322
|
-
</div>
|
|
323
|
-
))}
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
</div>
|
|
327
|
-
|
|
328
|
-
{/* Export & Tools */}
|
|
329
|
-
<div className="glass-card p-6 sm:p-8 rounded-xl border border-border/50">
|
|
330
|
-
<h2 className="text-2xl font-bold text-foreground mb-6">📦 Export & Tools</h2>
|
|
331
|
-
|
|
332
|
-
<div className="grid grid-cols-1 sm:grid-cols-2 gap-4">
|
|
333
|
-
<a
|
|
334
|
-
href="/api/export?format=json"
|
|
335
|
-
download
|
|
336
|
-
className="flex items-center gap-3 p-4 bg-primary/10 border border-primary/30 rounded-lg hover:bg-primary/20 transition-colors"
|
|
337
|
-
>
|
|
338
|
-
<span className="text-xl">📄</span>
|
|
339
|
-
<div>
|
|
340
|
-
<div className="font-semibold text-foreground">Export JSON</div>
|
|
341
|
-
<div className="text-xs text-muted-foreground">
|
|
342
|
-
Config + Stats + Logs
|
|
343
|
-
</div>
|
|
344
|
-
</div>
|
|
345
|
-
</a>
|
|
346
|
-
|
|
347
|
-
<a
|
|
348
|
-
href="/api/export?format=csv"
|
|
349
|
-
download
|
|
350
|
-
className="flex items-center gap-3 p-4 bg-secondary/10 border border-secondary/30 rounded-lg hover:bg-secondary/20 transition-colors"
|
|
351
|
-
>
|
|
352
|
-
<span className="text-xl">📊</span>
|
|
353
|
-
<div>
|
|
354
|
-
<div className="font-semibold text-foreground">Export CSV</div>
|
|
355
|
-
<div className="text-xs text-muted-foreground">
|
|
356
|
-
Spreadsheet format
|
|
357
|
-
</div>
|
|
358
|
-
</div>
|
|
359
|
-
</a>
|
|
360
|
-
|
|
361
|
-
<button
|
|
362
|
-
onClick={async () => {
|
|
363
|
-
if (confirm("Reset all data and settings?")) {
|
|
364
|
-
await fetch("/api/logs", { method: "DELETE" })
|
|
365
|
-
setLogs([])
|
|
366
|
-
}
|
|
367
|
-
}}
|
|
368
|
-
className="flex items-center gap-3 p-4 bg-destructive/10 border border-destructive/30 rounded-lg hover:bg-destructive/20 transition-colors cursor-pointer"
|
|
369
|
-
>
|
|
370
|
-
<span className="text-xl">🔄</span>
|
|
371
|
-
<div>
|
|
372
|
-
<div className="font-semibold text-foreground">Clear Logs</div>
|
|
373
|
-
<div className="text-xs text-muted-foreground">
|
|
374
|
-
Delete all activity
|
|
375
|
-
</div>
|
|
376
|
-
</div>
|
|
377
|
-
</button>
|
|
378
|
-
|
|
379
|
-
<a
|
|
380
|
-
href="https://discord.gg/xtream-itsolutions"
|
|
381
|
-
target="_blank"
|
|
382
|
-
rel="noopener"
|
|
383
|
-
className="flex items-center gap-3 p-4 bg-primary/10 border border-primary/30 rounded-lg hover:bg-primary/20 transition-colors"
|
|
384
|
-
>
|
|
385
|
-
<span className="text-xl">💬</span>
|
|
386
|
-
<div>
|
|
387
|
-
<div className="font-semibold text-foreground">Discord</div>
|
|
388
|
-
<div className="text-xs text-muted-foreground">Get support</div>
|
|
389
|
-
</div>
|
|
390
|
-
</a>
|
|
391
|
-
</div>
|
|
392
|
-
</div>
|
|
393
|
-
|
|
394
|
-
{/* Stats Card */}
|
|
395
|
-
{stats && (
|
|
396
|
-
<div className="glass-card p-6 sm:p-8 rounded-xl border border-border/50">
|
|
397
|
-
<h2 className="text-2xl font-bold text-foreground mb-6">📊 Statistics</h2>
|
|
398
|
-
|
|
399
|
-
<div className="grid grid-cols-2 sm:grid-cols-4 gap-4">
|
|
400
|
-
<div className="bg-card/50 rounded-lg p-4 text-center">
|
|
401
|
-
<div className="text-2xl font-bold text-primary">{stats.requests}</div>
|
|
402
|
-
<p className="text-xs text-muted-foreground mt-1">Requests</p>
|
|
403
|
-
</div>
|
|
404
|
-
|
|
405
|
-
<div className="bg-card/50 rounded-lg p-4 text-center">
|
|
406
|
-
<div className="text-2xl font-bold text-secondary">{stats.tokensSaved.toLocaleString()}</div>
|
|
407
|
-
<p className="text-xs text-muted-foreground mt-1">Tokens Saved</p>
|
|
408
|
-
</div>
|
|
409
|
-
|
|
410
|
-
<div className="bg-card/50 rounded-lg p-4 text-center">
|
|
411
|
-
<div className="text-2xl font-bold text-primary">${stats.costSaved.toFixed(2)}</div>
|
|
412
|
-
<p className="text-xs text-muted-foreground mt-1">Cost Saved</p>
|
|
413
|
-
</div>
|
|
414
|
-
|
|
415
|
-
<div className="bg-card/50 rounded-lg p-4 text-center">
|
|
416
|
-
<div className="text-2xl font-bold text-secondary">{(stats.cacheHitRate * 100).toFixed(1)}%</div>
|
|
417
|
-
<p className="text-xs text-muted-foreground mt-1">Cache Hit Rate</p>
|
|
418
|
-
</div>
|
|
419
|
-
</div>
|
|
420
|
-
|
|
421
|
-
<div className="mt-4 flex items-center justify-between p-4 bg-primary/5 rounded-lg border border-primary/20">
|
|
422
|
-
<div className="flex items-center gap-2">
|
|
423
|
-
<Clock className="w-4 h-4 text-primary" />
|
|
424
|
-
<span className="text-sm text-foreground">Uptime</span>
|
|
425
|
-
</div>
|
|
426
|
-
<span className="text-sm font-semibold text-primary">{stats.uptime_formatted}</span>
|
|
427
|
-
</div>
|
|
428
|
-
</div>
|
|
429
|
-
)}
|
|
430
|
-
|
|
431
|
-
{/* Footer Info */}
|
|
432
|
-
<div className="text-center py-6 border-t border-border/30">
|
|
433
|
-
<p className="text-sm text-muted-foreground">
|
|
434
|
-
<span className="text-primary font-semibold">xtream-head</span> • Version 1.5.0 •{" "}
|
|
435
|
-
<a href="https://discord.gg/xtream-itsolutions" className="text-primary hover:underline">
|
|
436
|
-
Discord
|
|
437
|
-
</a>
|
|
438
|
-
</p>
|
|
439
|
-
</div>
|
|
440
|
-
</div>
|
|
441
|
-
)}
|
|
442
|
-
</div>
|
|
443
|
-
</div>
|
|
444
|
-
)
|
|
445
|
-
}
|
package/app/globals.css
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
@import "tailwindcss";
|
|
2
|
-
@config "../tailwind.config.js";
|
|
3
|
-
/* Precompiled from the shared repository-root design system during prebuild.
|
|
4
|
-
This keeps the Next app on Tailwind 4 while preserving the Tailwind 3 master
|
|
5
|
-
component layers from design-system/. The shared design system files use
|
|
6
|
-
@apply/@layer which work differently in Tailwind 4, so they are precompiled
|
|
7
|
-
via build-master-design-system.cjs during npm prebuild. */
|
|
8
|
-
@import "./master-design-system.css";
|
|
9
|
-
|
|
10
|
-
/* Legacy aliases for the black / white / #007FFF brand system */
|
|
11
|
-
:root {
|
|
12
|
-
--bg: hsl(var(--background));
|
|
13
|
-
--bg2: hsl(var(--card));
|
|
14
|
-
--surface: hsl(var(--card));
|
|
15
|
-
--surface2: hsl(var(--card));
|
|
16
|
-
--border-c: hsl(var(--border));
|
|
17
|
-
--border2: hsl(var(--border) / 0.28);
|
|
18
|
-
--yellow: hsl(var(--primary));
|
|
19
|
-
--red: hsl(var(--destructive));
|
|
20
|
-
--text: hsl(var(--foreground));
|
|
21
|
-
--text2: hsl(var(--muted-foreground));
|
|
22
|
-
--muted: hsl(var(--muted-foreground));
|
|
23
|
-
--box-pad: clamp(0.75rem, 3vw, 1.5rem);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/* Legacy layout helpers used in installation page */
|
|
27
|
-
.section {
|
|
28
|
-
padding: 3rem 0;
|
|
29
|
-
}
|
|
30
|
-
.box {
|
|
31
|
-
width: 100%;
|
|
32
|
-
max-width: 1640px;
|
|
33
|
-
margin-inline: auto;
|
|
34
|
-
padding-inline: clamp(0.5rem, 2vw, 1.5rem);
|
|
35
|
-
}
|