Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 992574e3ee |
@@ -161,7 +161,8 @@
|
|||||||
"Bash(curl -s http://localhost:8916/users/)",
|
"Bash(curl -s http://localhost:8916/users/)",
|
||||||
"Bash(pkill -9 -f \"uvicorn.*backend.main\" sleep 2 /data/programare_AI/tfm_ainventory/venv/bin/python3 -m uvicorn backend.main:app --host 0.0.0.0 --port 8916)",
|
"Bash(pkill -9 -f \"uvicorn.*backend.main\" sleep 2 /data/programare_AI/tfm_ainventory/venv/bin/python3 -m uvicorn backend.main:app --host 0.0.0.0 --port 8916)",
|
||||||
"Bash(curl -s http://localhost:8916/users/auth-mode)",
|
"Bash(curl -s http://localhost:8916/users/auth-mode)",
|
||||||
"Bash(pkill -9 -f \"next-server|node.*next\" sleep 2 python3 scripts/run_standalone.py restart)"
|
"Bash(pkill -9 -f \"next-server|node.*next\" sleep 2 python3 scripts/run_standalone.py restart)",
|
||||||
|
"WebSearch"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ export default function Home() {
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-2xl md:text-3xl font-normal tracking-tight text-white leading-tight">TFM aInventory</h1>
|
<h1 className="text-2xl md:text-3xl font-normal tracking-tight text-white leading-tight">TFM aInventory</h1>
|
||||||
<p className="text-xs md:text-sm text-secondary font-normal tracking-tight mt-1">Industrial Asset Management</p>
|
<p className="text-xs md:text-sm text-secondary font-normal tracking-tight mt-1">IT/DC Asset Management</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -397,7 +397,7 @@ export default function Home() {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
<footer className="mt-20 mb-8 flex flex-col items-center gap-4 opacity-50 border-t border-border/30 pt-8">
|
<footer className="mt-20 mb-8 flex flex-col items-center gap-4 opacity-50 border-t border-border/30 pt-8">
|
||||||
<p className="text-xs font-normal text-secondary tracking-widest uppercase">Powered by TFM Group Software</p>
|
<p className="text-xs font-normal text-secondary tracking-widest uppercase">Powered by TFM Group Software S.R.L.</p>
|
||||||
<p className="text-[10px] font-mono text-muted">v{versionData.version} • {versionData.last_build} • BUILD: {versionData.commit}</p>
|
<p className="text-[10px] font-mono text-muted">v{versionData.version} • {versionData.last_build} • BUILD: {versionData.commit}</p>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
import React from 'react';
|
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 { cn } from '@/lib/utils';
|
||||||
|
import { GeminiLogo } from '@/components/icons/GeminiLogo';
|
||||||
|
import { ClaudeLogo } from '@/components/icons/ClaudeLogo';
|
||||||
|
|
||||||
interface AiManagerProps {
|
interface AiManagerProps {
|
||||||
aiConfig: any;
|
aiConfig: any;
|
||||||
@@ -49,7 +51,7 @@ export default function AiManager({
|
|||||||
data-testid="provider-option"
|
data-testid="provider-option"
|
||||||
onClick={() => handleUpdateAiProvider(p.id)}
|
onClick={() => handleUpdateAiProvider(p.id)}
|
||||||
className={cn(
|
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
|
p.active
|
||||||
? "bg-primary border-primary"
|
? "bg-primary border-primary"
|
||||||
: "level-0 border-border hover:border-primary/40"
|
: "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",
|
"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.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>
|
||||||
<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(
|
<p className={cn(
|
||||||
"text-xs font-normal mt-1 px-0.5",
|
"text-sm font-normal mt-1 px-0.5",
|
||||||
p.active
|
p.active
|
||||||
? (p.configured ? "text-black/70" : "text-black/50")
|
? (p.configured ? "text-black/70" : "text-black/50")
|
||||||
: (p.configured ? "text-emerald-500" : "text-error")
|
: (p.configured ? "text-emerald-500" : "text-error")
|
||||||
)}>
|
)}>
|
||||||
{p.configured ? "● Key Configured" : "○ Missing Api Key"}
|
{p.configured ? "✓ Key Configured" : "✗ Missing Api Key"}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{p.active && (
|
{p.active && (
|
||||||
<div className="bg-surface-container-lowest/20 px-2.5 py-1 text-xs font-normal text-black tracking-tight">
|
<div className="bg-surface-container-lowest/20 px-2.5 py-1 text-sm font-normal text-black tracking-tight">
|
||||||
Active
|
Active
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
@@ -110,13 +112,13 @@ export default function AiManager({
|
|||||||
value={aiKeys.gemini}
|
value={aiKeys.gemini}
|
||||||
onChange={(e) => setAiKeys({...aiKeys, gemini: e.target.value})}
|
onChange={(e) => setAiKeys({...aiKeys, gemini: e.target.value})}
|
||||||
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'gemini')?.masked_key || "Enter Gemini Key..."}
|
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
|
<button
|
||||||
onClick={() => onTestAiKey('gemini')}
|
onClick={() => onTestAiKey('gemini')}
|
||||||
disabled={isTestingKeys.gemini}
|
disabled={isTestingKeys.gemini}
|
||||||
className={cn(
|
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
|
isTestingKeys.gemini
|
||||||
? "bg-surface-bright border-border text-muted cursor-wait"
|
? "bg-surface-bright border-border text-muted cursor-wait"
|
||||||
: "btn-primary"
|
: "btn-primary"
|
||||||
@@ -136,13 +138,13 @@ export default function AiManager({
|
|||||||
value={aiKeys.claude}
|
value={aiKeys.claude}
|
||||||
onChange={(e) => setAiKeys({...aiKeys, claude: e.target.value})}
|
onChange={(e) => setAiKeys({...aiKeys, claude: e.target.value})}
|
||||||
placeholder={aiConfig?.providers?.find((p: any) => p.id === 'claude')?.masked_key || "Enter Claude Key..."}
|
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
|
<button
|
||||||
onClick={() => onTestAiKey('claude')}
|
onClick={() => onTestAiKey('claude')}
|
||||||
disabled={isTestingKeys.claude}
|
disabled={isTestingKeys.claude}
|
||||||
className={cn(
|
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
|
isTestingKeys.claude
|
||||||
? "bg-surface-bright border-border text-muted cursor-wait"
|
? "bg-surface-bright border-border text-muted cursor-wait"
|
||||||
: "btn-primary"
|
: "btn-primary"
|
||||||
@@ -172,12 +174,12 @@ export default function AiManager({
|
|||||||
<textarea
|
<textarea
|
||||||
value={aiPrompt}
|
value={aiPrompt}
|
||||||
onChange={(e) => setAiPrompt(e.target.value)}
|
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>
|
||||||
<div className="bg-primary/5 border border-primary/10 p-4 flex gap-3 items-start">
|
<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>
|
<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.
|
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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export default function LdapManager({
|
|||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className={cn(
|
<div className={cn(
|
||||||
"w-8 h-8 flex items-center justify-center transition-all",
|
"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} />
|
<Lock size={14} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
23
frontend/components/icons/ClaudeLogo.tsx
Normal file
23
frontend/components/icons/ClaudeLogo.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
interface ClaudeLogoProps {
|
||||||
|
size?: number;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ClaudeLogo({ size = 16, className = '' }: ClaudeLogoProps) {
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
width={size}
|
||||||
|
height={size}
|
||||||
|
fill="currentColor"
|
||||||
|
fillRule="evenodd"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
className={className}
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<title>Claude</title>
|
||||||
|
<path d="M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
23
frontend/components/icons/GeminiLogo.tsx
Normal file
23
frontend/components/icons/GeminiLogo.tsx
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import React from 'react';
|
||||||
|
|
||||||
|
interface GeminiLogoProps {
|
||||||
|
size?: number;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function GeminiLogo({ size = 16, className = '' }: GeminiLogoProps) {
|
||||||
|
return (
|
||||||
|
<svg
|
||||||
|
width={size}
|
||||||
|
height={size}
|
||||||
|
fill="currentColor"
|
||||||
|
fillRule="evenodd"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
className={className}
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
>
|
||||||
|
<title>Gemini</title>
|
||||||
|
<path d="M20.616 10.835a14.147 14.147 0 01-4.45-3.001 14.111 14.111 0 01-3.678-6.452.503.503 0 00-.975 0 14.134 14.134 0 01-3.679 6.452 14.155 14.155 0 01-4.45 3.001c-.65.28-1.318.505-2.002.678a.502.502 0 000 .975c.684.172 1.35.397 2.002.677a14.147 14.147 0 014.45 3.001 14.112 14.112 0 013.679 6.453.502.502 0 00.975 0c.172-.685.397-1.351.677-2.003a14.145 14.145 0 013.001-4.45 14.113 14.113 0 016.453-3.678.503.503 0 000-.975 13.245 13.245 0 01-2.003-.678z" />
|
||||||
|
</svg>
|
||||||
|
);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user