bede
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import React from 'react';
|
||||
import { Brain, Cpu, Zap, Lock, RotateCcw, Wifi, FileText, Shield } from 'lucide-react';
|
||||
import { Brain, Lock, RotateCcw, Wifi, FileText, Shield } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { GeminiLogo } from '@/components/icons/GeminiLogo';
|
||||
import { ClaudeLogo } from '@/components/icons/ClaudeLogo';
|
||||
|
||||
interface AiManagerProps {
|
||||
aiConfig: any;
|
||||
@@ -49,7 +51,7 @@ export default function AiManager({
|
||||
data-testid="provider-option"
|
||||
onClick={() => handleUpdateAiProvider(p.id)}
|
||||
className={cn(
|
||||
"p-4 lg:p-5 xl:p-6 lg:p-8 xl:p-10 border transition-all text-left flex items-center justify-between group",
|
||||
"p-4 lg:p-4 xl:p-5 lg:p-4 xl:p-5 border transition-all text-left flex items-center justify-between group",
|
||||
p.active
|
||||
? "bg-primary border-primary"
|
||||
: "level-0 border-border hover:border-primary/40"
|
||||
@@ -60,23 +62,23 @@ export default function AiManager({
|
||||
"w-8 h-8 flex items-center justify-center transition-colors",
|
||||
p.active ? "bg-surface-container-lowest/20 text-black" : "bg-primary/10 text-primary group-hover:bg-primary/20"
|
||||
)}>
|
||||
{p.id === 'gemini' ? <Cpu size={16} /> : <Zap size={16} />}
|
||||
{p.id === 'gemini' ? <GeminiLogo size={16} /> : <ClaudeLogo size={16} />}
|
||||
</div>
|
||||
<div>
|
||||
<p className={cn("text-xs font-normal tracking-tight", p.active ? "text-black" : "text-secondary")}>{p.name}</p>
|
||||
<p className={cn("text-sm font-normal tracking-tight", p.active ? "text-black" : "text-secondary")}>{p.name}</p>
|
||||
<p className={cn(
|
||||
"text-xs font-normal mt-1 px-0.5",
|
||||
"text-sm font-normal mt-1 px-0.5",
|
||||
p.active
|
||||
? (p.configured ? "text-black/70" : "text-black/50")
|
||||
: (p.configured ? "text-emerald-500" : "text-error")
|
||||
)}>
|
||||
{p.configured ? "● Key Configured" : "○ Missing Api Key"}
|
||||
{p.configured ? "✓ Key Configured" : "✗ Missing Api Key"}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{p.active && (
|
||||
<div className="bg-surface-container-lowest/20 px-2.5 py-1 text-xs font-normal text-black tracking-tight">
|
||||
Active
|
||||
<div className="bg-surface-container-lowest/20 px-2.5 py-1 text-sm font-normal text-black tracking-tight">
|
||||
Active
|
||||
</div>
|
||||
)}
|
||||
</button>
|
||||
@@ -110,13 +112,13 @@ export default function AiManager({
|
||||
value={aiKeys.gemini}
|
||||
onChange={(e) => setAiKeys({...aiKeys, gemini: e.target.value})}
|
||||
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'gemini')?.masked_key || "Enter Gemini Key..."}
|
||||
className="input-field flex-1 text-xs"
|
||||
className="input-field flex-1 text-sm"
|
||||
/>
|
||||
<button
|
||||
onClick={() => onTestAiKey('gemini')}
|
||||
disabled={isTestingKeys.gemini}
|
||||
className={cn(
|
||||
"px-3 py-1.5 text-xs font-normal tracking-tight transition-all border flex items-center gap-1.5",
|
||||
"px-3 py-1.5 text-sm font-normal tracking-tight transition-all border flex items-center gap-1.5",
|
||||
isTestingKeys.gemini
|
||||
? "bg-surface-bright border-border text-muted cursor-wait"
|
||||
: "btn-primary"
|
||||
@@ -136,13 +138,13 @@ export default function AiManager({
|
||||
value={aiKeys.claude}
|
||||
onChange={(e) => setAiKeys({...aiKeys, claude: e.target.value})}
|
||||
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'claude')?.masked_key || "Enter Claude Key..."}
|
||||
className="input-field flex-1 text-xs"
|
||||
className="input-field flex-1 text-sm"
|
||||
/>
|
||||
<button
|
||||
onClick={() => onTestAiKey('claude')}
|
||||
disabled={isTestingKeys.claude}
|
||||
className={cn(
|
||||
"px-3 py-1.5 text-xs font-normal tracking-tight transition-all border flex items-center gap-1.5",
|
||||
"px-3 py-1.5 text-sm font-normal tracking-tight transition-all border flex items-center gap-1.5",
|
||||
isTestingKeys.claude
|
||||
? "bg-surface-bright border-border text-muted cursor-wait"
|
||||
: "btn-primary"
|
||||
@@ -172,12 +174,12 @@ export default function AiManager({
|
||||
<textarea
|
||||
value={aiPrompt}
|
||||
onChange={(e) => setAiPrompt(e.target.value)}
|
||||
className="log-viewer w-full min-h-[200px] text-xs text-secondary leading-relaxed outline-none focus:border-primary/50 transition-all"
|
||||
className="log-viewer w-full min-h-[200px] text-sm text-secondary leading-relaxed outline-none focus:border-primary/50 transition-all"
|
||||
/>
|
||||
</div>
|
||||
<div className="bg-primary/5 border border-primary/10 p-4 flex gap-3 items-start">
|
||||
<div className="p-2 bg-primary/10 text-primary shrink-0"><Shield size={14} /></div>
|
||||
<p className="text-xs font-normal text-secondary leading-relaxed">
|
||||
<p className="text-sm font-normal text-secondary leading-relaxed">
|
||||
This prompt instructs the Vision AI core on label interpretation. Ensure it defines explicit mapping for technical attributes like <span className="text-primary">Item</span>, <span className="text-primary">Type</span>, and <span className="text-primary">Part Number</span> to avoid extraction null-pointers and ensure inventory data integrity.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -113,7 +113,7 @@ export default function LdapManager({
|
||||
<div className="flex items-center gap-3">
|
||||
<div className={cn(
|
||||
"w-8 h-8 flex items-center justify-center transition-all",
|
||||
ldapConfig.use_tls ? "bg-primary/10 text-primary" : "bg-surface-bright text-muted"
|
||||
ldapConfig.use_tls ? "status-success" : "bg-surface-bright text-muted"
|
||||
)}>
|
||||
<Lock size={14} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user