| import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card' | |
| import { Button } from '@/components/ui/button' | |
| import { Label } from '@/components/ui/label' | |
| import { Switch } from '@/components/ui/switch' | |
| import { Badge } from '@/components/ui/badge' | |
| import { | |
| Settings as SettingsIcon, | |
| Server, | |
| Brain, | |
| Palette, | |
| Shield, | |
| Info | |
| } from 'lucide-react' | |
| export function Settings() { | |
| return ( | |
| <div className="min-h-screen bg-background"> | |
| {/* Header */} | |
| <div className="border-b"> | |
| <div className="flex h-14 items-center px-6"> | |
| <div className="flex items-center gap-2"> | |
| <SettingsIcon className="h-5 w-5" /> | |
| <h1 className="text-lg font-semibold">Settings</h1> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="flex-1 p-6"> | |
| <div className="max-w-4xl mx-auto space-y-6"> | |
| {/* Server Settings */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| <Server className="h-5 w-5" /> | |
| Server Configuration | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div> | |
| <Label className="text-sm font-medium">Backend URL</Label> | |
| <div className="mt-1 p-2 bg-muted rounded-md text-sm font-mono"> | |
| {window.location.origin} | |
| </div> | |
| </div> | |
| <div> | |
| <Label className="text-sm font-medium">Frontend URL</Label> | |
| <div className="mt-1 p-2 bg-muted rounded-md text-sm font-mono"> | |
| {window.location.origin} | |
| </div> | |
| </div> | |
| </div> | |
| <div className="pt-2 border-t"> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Auto-connect on startup</Label> | |
| <p className="text-xs text-muted-foreground">Automatically connect to backend when app starts</p> | |
| </div> | |
| <Switch defaultChecked /> | |
| </div> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| {/* Model Settings */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| <Brain className="h-5 w-5" /> | |
| Model Preferences | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Auto-load last used model</Label> | |
| <p className="text-xs text-muted-foreground">Automatically load the last used model on startup</p> | |
| </div> | |
| <Switch /> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Show model thinking process</Label> | |
| <p className="text-xs text-muted-foreground">Display thinking content for supported models</p> | |
| </div> | |
| <Switch defaultChecked /> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Confirm model loading</Label> | |
| <p className="text-xs text-muted-foreground">Show confirmation dialog before downloading models</p> | |
| </div> | |
| <Switch defaultChecked /> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| {/* Interface Settings */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| <Palette className="h-5 w-5" /> | |
| Interface | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Dark mode</Label> | |
| <p className="text-xs text-muted-foreground">Use dark theme for the interface</p> | |
| </div> | |
| <Switch /> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Compact mode</Label> | |
| <p className="text-xs text-muted-foreground">Use smaller spacing for more content</p> | |
| </div> | |
| <Switch /> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Show sample prompts</Label> | |
| <p className="text-xs text-muted-foreground">Display quick start prompts in playground</p> | |
| </div> | |
| <Switch defaultChecked /> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| {/* Privacy Settings */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| <Shield className="h-5 w-5" /> | |
| Privacy & Data | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| <div className="p-3 bg-green-50 border border-green-200 rounded-md"> | |
| <div className="flex items-center gap-2 mb-2"> | |
| <Shield className="h-4 w-4 text-green-600" /> | |
| <span className="text-sm font-medium text-green-800">Local Processing</span> | |
| </div> | |
| <p className="text-xs text-green-700"> | |
| All AI processing happens locally on your machine. No data is sent to external servers. | |
| </p> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Save conversation history</Label> | |
| <p className="text-xs text-muted-foreground">Store conversations locally for reference</p> | |
| </div> | |
| <Switch /> | |
| </div> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <Label className="text-sm font-medium">Save system prompts</Label> | |
| <p className="text-xs text-muted-foreground">Remember custom system prompts</p> | |
| </div> | |
| <Switch defaultChecked /> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| {/* System Information */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle className="flex items-center gap-2"> | |
| <Info className="h-5 w-5" /> | |
| System Information | |
| </CardTitle> | |
| </CardHeader> | |
| <CardContent className="space-y-4"> | |
| <div className="grid grid-cols-1 md:grid-cols-2 gap-4"> | |
| <div> | |
| <Label className="text-sm font-medium">Platform</Label> | |
| <div className="mt-1 flex items-center gap-2"> | |
| <Badge variant="outline">Local</Badge> | |
| <span className="text-sm text-muted-foreground">Privacy-focused AI</span> | |
| </div> | |
| </div> | |
| <div> | |
| <Label className="text-sm font-medium">Version</Label> | |
| <div className="mt-1"> | |
| <Badge variant="outline">v1.0.0</Badge> | |
| </div> | |
| </div> | |
| </div> | |
| <div className="pt-2 border-t"> | |
| <div className="flex items-center justify-between"> | |
| <div> | |
| <p className="text-sm font-medium">Storage Location</p> | |
| <p className="text-xs text-muted-foreground font-mono">~/.edge-llm/models/</p> | |
| </div> | |
| <Button variant="outline" size="sm"> | |
| Open Folder | |
| </Button> | |
| </div> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| {/* Actions */} | |
| <Card> | |
| <CardHeader> | |
| <CardTitle>Actions</CardTitle> | |
| </CardHeader> | |
| <CardContent> | |
| <div className="flex gap-2"> | |
| <Button variant="outline"> | |
| Export Settings | |
| </Button> | |
| <Button variant="outline"> | |
| Import Settings | |
| </Button> | |
| <Button variant="outline"> | |
| Reset to Defaults | |
| </Button> | |
| </div> | |
| </CardContent> | |
| </Card> | |
| </div> | |
| </div> | |
| </div> | |
| ) | |
| } | |