Responsive

This commit is contained in:
Orionis312050 committed 2026-04-17 14:24:53 +02:00
1 parent ffddef9845
commit c1c6d97a77
6 files changed
+75 -46

No files matched your search

+1 -1
View File
@@ -101,7 +101,7 @@ function AppContent() {
<main className={cn( <main className={cn(
"flex-1 transition-all duration-300", "flex-1 transition-all duration-300",
isChatOpen ? "mr-[var(--sidebar-width)]" : "" isChatOpen ? "lg:mr-[var(--sidebar-width)]" : ""
)}> )}>
<Routes> <Routes>
<Route path="/login" element={<LoginView />} /> <Route path="/login" element={<LoginView />} />
+26 -10
View File
@@ -64,6 +64,11 @@ export default function AIChatSidebar({ isOpen, onClose, currentService }: AICha
}; };
}, [isResizing, sidebarWidth]); }, [isResizing, sidebarWidth]);
// Sync sidebarWidth to CSS variable for App.tsx layout
useEffect(() => {
document.documentElement.style.setProperty('--sidebar-width', `${sidebarWidth}px`);
}, [sidebarWidth]);
useEffect(() => { useEffect(() => {
if (isOpen) fetchConversations(); if (isOpen) fetchConversations();
}, [isOpen]); }, [isOpen]);
@@ -253,18 +258,28 @@ export default function AIChatSidebar({ isOpen, onClose, currentService }: AICha
}, [isOpen, currentConv]); }, [isOpen, currentConv]);
return ( return (
<div <>
className={cn( {/* Mobile Backdrop */}
"fixed top-0 right-0 h-full bg-card border-l border-muted/50 shadow-2xl transition-all duration-500 z-50 flex flex-col", {isOpen && (
isOpen ? "translate-x-0" : "translate-x-full" <div
className="fixed inset-0 bg-background/60 backdrop-blur-sm z-40 lg:hidden animate-in fade-in duration-300"
onClick={onClose}
/>
)} )}
style={{ width: sidebarWidth }}
>
{/* Resize Handle */}
<div <div
className="absolute left-0 top-0 w-1.5 h-full cursor-col-resize hover:bg-primary/20 transition-colors z-50" className={cn(
onMouseDown={handleMouseDown} "fixed top-0 right-0 h-full bg-card border-l border-muted/50 shadow-2xl transition-transform duration-500 z-50 flex flex-col",
/> isOpen ? "translate-x-0" : "translate-x-full",
"w-full sm:w-[500px] lg:w-[var(--sidebar-width)]"
)}
style={{ width: isOpen && window.innerWidth >= 1024 ? sidebarWidth : undefined }}
>
{/* Resize Handle - Only on Desktop */}
<div
className="absolute left-0 top-0 w-1.5 h-full cursor-col-resize hover:bg-primary/20 transition-colors z-50 hidden lg:block"
onMouseDown={handleMouseDown}
/>
{/* Header */} {/* Header */}
<div className="flex items-center justify-between p-6 bg-muted/5"> <div className="flex items-center justify-between p-6 bg-muted/5">
@@ -439,5 +454,6 @@ export default function AIChatSidebar({ isOpen, onClose, currentService }: AICha
</div> </div>
)} )}
</div> </div>
</>
); );
} }
+6 -2
View File
@@ -5,6 +5,7 @@ import { Label } from '@/components/ui/label';
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
DialogDescription,
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
DialogFooter, DialogFooter,
@@ -72,6 +73,9 @@ export default function AddServiceModal({ onClose, onAdded }: { onClose: () => v
<form onSubmit={handleSubmit}> <form onSubmit={handleSubmit}>
<DialogHeader> <DialogHeader>
<DialogTitle className="text-xl">Nouveau Service</DialogTitle> <DialogTitle className="text-xl">Nouveau Service</DialogTitle>
<DialogDescription>
Enregistrez un nouveau conteneur Docker ou un service système pour commencer la supervision.
</DialogDescription>
</DialogHeader> </DialogHeader>
<div className="grid gap-4 py-4"> <div className="grid gap-4 py-4">
@@ -122,8 +126,8 @@ export default function AddServiceModal({ onClose, onAdded }: { onClose: () => v
)} )}
</div> </div>
<datalist id="targets-list"> <datalist id="targets-list">
{availableTargets.map(target => ( {availableTargets.map((target, idx) => (
<option key={target.id} value={target.id}>{target.name}</option> <option key={`${target.id}-${idx}`} value={target.id}>{target.name}</option>
))} ))}
</datalist> </datalist>
</div> </div>
+4
View File
@@ -5,6 +5,7 @@ import { Label } from '@/components/ui/label';
import { import {
Dialog, Dialog,
DialogContent, DialogContent,
DialogDescription,
DialogHeader, DialogHeader,
DialogTitle, DialogTitle,
DialogFooter, DialogFooter,
@@ -72,6 +73,9 @@ export default function SettingsModal({ onClose }: { onClose: () => void }) {
<DialogContent className="sm:max-w-[600px] max-h-[90vh] overflow-hidden flex flex-col p-0"> <DialogContent className="sm:max-w-[600px] max-h-[90vh] overflow-hidden flex flex-col p-0">
<DialogHeader className="p-6 pb-2 border-b"> <DialogHeader className="p-6 pb-2 border-b">
<DialogTitle className="text-2xl font-bold tracking-tight">Paramètres Globaux</DialogTitle> <DialogTitle className="text-2xl font-bold tracking-tight">Paramètres Globaux</DialogTitle>
<DialogDescription>
Configurez vos intégrations Notion, Ollama et SearXNG pour personnaliser votre expérience LogAI.
</DialogDescription>
</DialogHeader> </DialogHeader>
<div className="flex-1 overflow-y-auto p-6 pt-2 space-y-8 scrollbar-thin"> <div className="flex-1 overflow-y-auto p-6 pt-2 space-y-8 scrollbar-thin">
+17 -17
View File
@@ -111,12 +111,12 @@ export default function HomeView() {
{/* Welcome Banner */} {/* Welcome Banner */}
<div className="relative overflow-hidden rounded-3xl bg-card border shadow-sm"> <div className="relative overflow-hidden rounded-3xl bg-card border shadow-sm">
<div className="absolute inset-0 bg-gradient-to-r from-primary/10 via-transparent to-secondary/5" /> <div className="absolute inset-0 bg-gradient-to-r from-primary/10 via-transparent to-secondary/5" />
<CardContent className="relative flex flex-col md:flex-row items-center justify-between p-10 gap-8"> <CardContent className="relative flex flex-col md:flex-row items-center justify-between p-6 sm:p-10 gap-8">
<div className="space-y-3"> <div className="space-y-3 text-center md:text-left">
<h2 className="text-4xl font-bold tracking-tight">Bienvenue sur votre Log <span className="ai-gradient-text tracking-tighter">AI</span></h2> <h2 className="text-3xl sm:text-4xl font-bold tracking-tight">Bienvenue sur votre Log <span className="ai-gradient-text tracking-tighter">AI</span></h2>
<p className="text-muted-foreground text-lg max-w-xl">Supervisez et diagnostiquez vos services en temps réel avec la puissance de l'IA.</p> <p className="text-muted-foreground text-base sm:text-lg max-w-xl mx-auto md:mx-0">Supervisez et diagnostiquez vos services en temps réel avec la puissance de l'IA.</p>
</div> </div>
<Button size="lg" className="h-14 px-10 rounded-2xl shadow-lg hover:shadow-primary/20 transition-all font-semibold" onClick={() => setIsModalOpen(true)}> <Button size="lg" className="h-12 sm:h-14 px-8 sm:px-10 rounded-2xl shadow-lg hover:shadow-primary/20 transition-all font-semibold w-full md:w-auto" onClick={() => setIsModalOpen(true)}>
<PlusCircle size={22} className="mr-2" /> <PlusCircle size={22} className="mr-2" />
Ajouter un Service Ajouter un Service
</Button> </Button>
@@ -148,11 +148,11 @@ export default function HomeView() {
</div> </div>
<Tabs defaultValue="all" className="w-full" onValueChange={setActiveTab}> <Tabs defaultValue="all" className="w-full" onValueChange={setActiveTab}>
<div className="flex flex-col items-center gap-6"> <div className="flex flex-col items-center gap-6 overflow-x-auto pb-2 scrollbar-none">
<TabsList className="bg-muted/30 p-1 rounded-xl border border-muted/50"> <TabsList className="bg-muted/30 p-1 rounded-xl border border-muted/50 w-full sm:w-auto h-auto sm:h-12 flex-wrap sm:flex-nowrap">
<TabsTrigger value="all" className="rounded-lg px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Tous</TabsTrigger> <TabsTrigger value="all" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Tous</TabsTrigger>
<TabsTrigger value="docker" className="rounded-lg px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Docker</TabsTrigger> <TabsTrigger value="docker" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Docker</TabsTrigger>
<TabsTrigger value="os" className="rounded-lg px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Système</TabsTrigger> <TabsTrigger value="os" className="rounded-lg flex-1 sm:flex-none px-4 sm:px-8 py-2 data-[state=active]:bg-card data-[state=active]:shadow-sm">Système</TabsTrigger>
</TabsList> </TabsList>
</div> </div>
@@ -225,7 +225,7 @@ export default function HomeView() {
<h3 className="text-lg font-bold tracking-tight uppercase tracking-wider text-muted-foreground">Consultés Récemment</h3> <h3 className="text-lg font-bold tracking-tight uppercase tracking-wider text-muted-foreground">Consultés Récemment</h3>
<Separator className="flex-1" /> <Separator className="flex-1" />
</div> </div>
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4"> <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4">
{recentServices.map(s => ( {recentServices.map(s => (
<Card <Card
key={s.id} key={s.id}
@@ -253,23 +253,23 @@ export default function HomeView() {
<h3 className="text-lg font-bold tracking-tight uppercase tracking-wider text-muted-foreground">Tous les Services ({services.length})</h3> <h3 className="text-lg font-bold tracking-tight uppercase tracking-wider text-muted-foreground">Tous les Services ({services.length})</h3>
<Separator className="flex-1" /> <Separator className="flex-1" />
</div> </div>
<div className="grid sm:grid-cols-2 gap-4"> <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{filteredRegistered.map(s => ( {filteredRegistered.map(s => (
<Card <Card
key={s.id} key={s.id}
className="hover:border-primary/50 hover:bg-muted/10 transition-all cursor-pointer shadow-none group" className="hover:border-primary/50 hover:bg-muted/10 transition-all cursor-pointer shadow-none group"
onClick={() => navigate(`/service/${s.id}`)} onClick={() => navigate(`/service/${s.id}`)}
> >
<CardHeader className="p-5 pb-3"> <CardHeader className="p-4 sm:p-5 pb-3">
<CardTitle className="text-lg flex items-center gap-4"> <CardTitle className="text-base sm:text-lg flex items-center gap-4">
<div className="p-2 rounded-lg bg-primary/5 text-primary group-hover:bg-primary/10 transition-colors"> <div className="p-2 rounded-lg bg-primary/5 text-primary group-hover:bg-primary/10 transition-colors shrink-0">
{s.type === 'docker' ? <DockerIcon size={20} /> : <Server size={20} />} {s.type === 'docker' ? <DockerIcon size={20} /> : <Server size={20} />}
</div> </div>
<span className="truncate">{s.name}</span> <span className="truncate">{s.name}</span>
</CardTitle> </CardTitle>
</CardHeader> </CardHeader>
<CardContent className="p-5 pt-0"> <CardContent className="p-4 sm:p-5 pt-0">
<p className="text-xs text-muted-foreground font-mono truncate opacity-60"> <p className="text-[10px] sm:text-xs text-muted-foreground font-mono truncate opacity-60">
{s.pathOrContainerId} {s.pathOrContainerId}
</p> </p>
</CardContent> </CardContent>
+21 -16
View File
@@ -9,6 +9,7 @@ import { Input } from '@/components/ui/input';
import { Card, CardContent, CardHeader } from '@/components/ui/card'; import { Card, CardContent, CardHeader } from '@/components/ui/card';
import { Separator } from '@/components/ui/separator'; import { Separator } from '@/components/ui/separator';
import { DockerIcon } from '../components/icons/DockerIcon'; import { DockerIcon } from '../components/icons/DockerIcon';
import { cn } from '@/lib/utils';
function DeleteWithConfirmation({ onDelete, serviceName }: { onDelete: () => void, serviceName: string }) { function DeleteWithConfirmation({ onDelete, serviceName }: { onDelete: () => void, serviceName: string }) {
const [showConfirm, setShowConfirm] = useState(false); const [showConfirm, setShowConfirm] = useState(false);
@@ -230,16 +231,17 @@ export default function ServiceView() {
</Button> </Button>
<Card className="overflow-hidden shadow-sm border-muted/50 rounded-xl"> <Card className="overflow-hidden shadow-sm border-muted/50 rounded-xl">
<CardHeader className="bg-muted/10 p-8 space-y-6 flex flex-col md:flex-row items-start md:items-center justify-between gap-6"> <CardHeader className="bg-muted/10 p-4 sm:p-8 space-y-6 flex flex-col lg:flex-row items-start lg:items-center justify-between gap-6">
<div className="flex items-center gap-6"> <div className="flex items-start sm:items-center gap-4 sm:gap-6 w-full">
<div className="w-16 h-16 rounded-2xl bg-card border flex items-center justify-center text-primary shadow-sm group-hover:bg-primary/5 transition-colors"> <div className="w-12 h-12 sm:w-16 sm:h-16 rounded-xl sm:rounded-2xl bg-card border flex items-center justify-center text-primary shadow-sm shrink-0">
{service.type === 'docker' ? <DockerIcon size={32} /> : <Server size={32} />} {service.type === 'docker' ? <DockerIcon size={24} className="sm:hidden" /> : <Server size={24} className="sm:hidden" />}
{service.type === 'docker' ? <DockerIcon size={32} className="hidden sm:block" /> : <Server size={32} className="hidden sm:block" />}
</div> </div>
<div className="space-y-2"> <div className="space-y-1 sm:space-y-2 min-w-0 flex-1">
<div className="flex items-center gap-3 flex-wrap"> <div className="flex items-center gap-2 sm:gap-3 flex-wrap">
{isEditingName ? ( {isEditingName ? (
<Input <Input
className="h-10 w-72 text-2xl font-bold bg-card border-primary/30" className="h-9 sm:h-10 w-full sm:w-72 text-xl sm:text-2xl font-bold bg-card border-primary/30"
value={tempName} value={tempName}
onChange={(e) => setTempName(e.target.value)} onChange={(e) => setTempName(e.target.value)}
onBlur={handleSaveName} onBlur={handleSaveName}
@@ -250,25 +252,25 @@ export default function ServiceView() {
autoFocus autoFocus
/> />
) : ( ) : (
<h3 className="text-3xl font-bold tracking-tight cursor-pointer hover:text-primary transition-colors flex items-center gap-3 group" onClick={() => { setIsEditingName(true); setTempName(service.name); }}> <h3 className="text-xl sm:text-3xl font-bold tracking-tight cursor-pointer hover:text-primary transition-colors flex items-center gap-2 sm:gap-3 group truncate" onClick={() => { setIsEditingName(true); setTempName(service.name); }}>
{service.name} <span className="truncate">{service.name}</span>
<Pencil size={18} className="opacity-0 group-hover:opacity-40 transition-opacity" /> <Pencil size={16} className="opacity-0 group-hover:opacity-40 transition-opacity shrink-0" />
</h3> </h3>
)} )}
{typeof service.id === 'string' && service.id.startsWith('ephemeral') && !isSaved && ( {typeof service.id === 'string' && service.id.startsWith('ephemeral') && !isSaved && (
<Badge variant="outline" className="bg-secondary/10 text-secondary border-secondary/20 font-bold px-3 py-1 uppercase tracking-widest text-[10px]">Session Éphémère</Badge> <Badge variant="outline" className="bg-secondary/10 text-secondary border-secondary/20 font-bold px-2 py-0.5 sm:px-3 sm:py-1 uppercase tracking-widest text-[8px] sm:text-[10px]">Session Éphémère</Badge>
)} )}
</div> </div>
<div className="flex items-center gap-3"> <div className="flex items-center gap-2 sm:gap-3 overflow-hidden">
<p className="text-sm font-mono text-muted-foreground opacity-70 truncate max-w-[200px] md:max-w-md"> <p className="text-xs sm:text-sm font-mono text-muted-foreground opacity-70 truncate max-w-full">
{service.pathOrContainerId} {service.pathOrContainerId}
</p> </p>
<Badge variant="outline" className="text-[10px] font-mono opacity-50 uppercase tracking-tighter">ID: {id}</Badge> <Badge variant="outline" className="text-[8px] sm:text-[10px] font-mono opacity-50 uppercase tracking-tighter shrink-0">ID: {id}</Badge>
</div> </div>
</div> </div>
</div> </div>
<div className="flex items-center gap-4 shrink-0 w-full md:w-auto justify-end"> <div className="flex flex-wrap items-center gap-3 sm:gap-4 shrink-0 w-full lg:w-auto justify-start lg:justify-end">
{typeof service.id === 'number' && ( {typeof service.id === 'number' && (
<DeleteWithConfirmation onDelete={handleDelete} serviceName={service.name} /> <DeleteWithConfirmation onDelete={handleDelete} serviceName={service.name} />
)} )}
@@ -277,7 +279,10 @@ export default function ServiceView() {
<Button <Button
variant={isSaved ? "outline" : "default"} variant={isSaved ? "outline" : "default"}
size="lg" size="lg"
className={isSaved ? "border-green-500/50 text-green-500 hover:bg-green-500/5 px-8 rounded-2xl" : "bg-blue-700 hover:bg-blue-800 text-white border-none shadow-lg hover:shadow-blue-500/20 transition-all font-semibold px-8 rounded-2xl"} className={cn(
"h-10 sm:h-12 px-6 sm:px-8 rounded-xl sm:rounded-2xl transition-all font-semibold w-full sm:w-auto",
isSaved ? "border-green-500/50 text-green-500 hover:bg-green-500/5" : "bg-blue-700 hover:bg-blue-800 text-white border-none shadow-lg hover:shadow-blue-500/20"
)}
onClick={handleSave} onClick={handleSave}
disabled={isSaving || isSaved} disabled={isSaving || isSaved}
> >