Compare commits
12 Commits
acc
..
e8896df0b3
| Author | SHA1 | Date | |
|---|---|---|---|
| e8896df0b3 | |||
| 84d7b7e847 | |||
| a0a77648ca | |||
| 6cb35e82fe | |||
| b43cf6f036 | |||
| b573d20aab | |||
| b3d7e312c4 | |||
| 063f3ecc75 | |||
| 6e33a19d41 | |||
| 3db249f3e1 | |||
| fcc04895f3 | |||
| d037af11b6 |
@@ -22,3 +22,4 @@ dist-ssr
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<
|
|||||||
ref={ref}
|
ref={ref}
|
||||||
className={cn(
|
className={cn(
|
||||||
// Séparation discrète (bordure fine plutôt qu'ombre inset, pour rester léger)
|
// Séparation discrète (bordure fine plutôt qu'ombre inset, pour rester léger)
|
||||||
"px-6 py-5 flex flex-col space-y-1.5 border-b border-black/5 dark:border-white/5 transition-all duration-300 ease-in-out",
|
"px-6 py-5 flex flex-col space-y-1.5 border-black/5 dark:border-white/5 transition-all duration-300",
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export const Input = forwardRef<HTMLInputElement, InputProps>(
|
|||||||
"bg-[#e8e8e8] dark:bg-[#1e293b]",
|
"bg-[#e8e8e8] dark:bg-[#1e293b]",
|
||||||
"text-slate-800 dark:text-slate-100 font-medium placeholder:text-slate-400 dark:placeholder:text-slate-500",
|
"text-slate-800 dark:text-slate-100 font-medium placeholder:text-slate-400 dark:placeholder:text-slate-500",
|
||||||
|
|
||||||
// 🎯 Utilisation directe de tes constantes Neumorphic creusées
|
// Utilisation directe de tes constantes Neumorphic creusées
|
||||||
NEUMORPHISM.insetLight,
|
NEUMORPHISM.insetLight,
|
||||||
NEUMORPHISM.insetDark,
|
NEUMORPHISM.insetDark,
|
||||||
|
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ export default function BackupWidget({ onClick }: BackupWidgetProps) {
|
|||||||
<Badge className="max-w-fit min-w-fit" name="PRA Immuable">
|
<Badge className="max-w-fit min-w-fit" name="PRA Immuable">
|
||||||
</Badge>
|
</Badge>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardContent className="p-6">
|
<CardContent className="p-6 flex flex-col h-full">
|
||||||
<Card variant='digged' className="bg-slate-50 rounded-lg p-4 border border-slate-100 mb-4">
|
<Card variant="flat" className="rounded-lg p-4 border border-slate-100 mb-4">
|
||||||
<p className="text-sm text-slate-500 mb-1">Dernier snapshot système</p>
|
<p className="text-sm text-slate-500 mb-1">Dernier snapshot système</p>
|
||||||
<p className="text-slate-900 font-medium">Aujourd'hui à 03:00 AM</p>
|
<p className="text-slate-900 font-medium">Aujourd'hui à 03:00 AM</p>
|
||||||
</Card>
|
</Card>
|
||||||
|
|||||||
@@ -1,7 +1,33 @@
|
|||||||
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||||
|
import type { Company } from '@/types/Company';
|
||||||
|
import type { User } from '@/types/user';
|
||||||
|
import { Loader } from '@/components/ui/Loader';
|
||||||
import { Building } from "lucide-react";
|
import { Building } from "lucide-react";
|
||||||
|
|
||||||
export function InformationWidget() {
|
interface InformationWidgetProps {
|
||||||
|
user: User;
|
||||||
|
company: Company;
|
||||||
|
isLoading: boolean;
|
||||||
|
error: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setVipBadge(vip_level: string | undefined) {
|
||||||
|
switch (vip_level?.toLowerCase()) {
|
||||||
|
case "platinum":
|
||||||
|
return <span className="px-2 py-1 bg-amber-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
||||||
|
case "premium":
|
||||||
|
return <span className="px-2 py-1 bg-violet-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
||||||
|
default:
|
||||||
|
return <span className="px-2 py-1 bg-blue-600 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">{vip_level?.toUpperCase()}</span>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const InformationWidget: React.FC<InformationWidgetProps> = ({
|
||||||
|
user,
|
||||||
|
company,
|
||||||
|
isLoading,
|
||||||
|
error,
|
||||||
|
}) => {
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className="p-6 border-slate-100">
|
<CardHeader className="p-6 border-slate-100">
|
||||||
@@ -12,23 +38,27 @@ export function InformationWidget() {
|
|||||||
</CardHeader>
|
</CardHeader>
|
||||||
|
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<dl className="space-y-4 text-sm">
|
{isLoading && !error && <Loader />}
|
||||||
<div>
|
{!isLoading && !error && (
|
||||||
<dt className="text-slate-500 font-medium">Entité Légale</dt>
|
<dl className="space-y-4 text-sm">
|
||||||
<dd className="mt-1 font-semibold text-slate-900">Cabinet Juridique Example & Associés</dd>
|
<div>
|
||||||
</div>
|
<dt className="text-slate-500 font-medium">Entité Légale</dt>
|
||||||
<div>
|
<dd className="mt-1 font-semibold text-slate-900">{company?.name}</dd>
|
||||||
<dt className="text-slate-500 font-medium">Administrateur du compte</dt>
|
</div>
|
||||||
<dd className="mt-1 text-slate-900">Direction Générale (direction@example.com)</dd>
|
<div>
|
||||||
</div>
|
<dt className="text-slate-500 font-medium">Administrateur du compte</dt>
|
||||||
<div>
|
<dd className="mt-1 text-slate-900">{user?.role} {user?.name}</dd>
|
||||||
<dt className="text-slate-500 font-medium">Niveau d'Infogérance (SLA)</dt>
|
<dd className="mt-1 text-slate-500">Email : {user?.emailVisibility && user?.email}{!user?.emailVisibility && "caché"}</dd>
|
||||||
<dd className="mt-1 flex items-center">
|
</div>
|
||||||
<span className="px-2 py-1 bg-blue-900 text-white text-xs font-bold rounded shadow-sm mr-2 tracking-wider">VIP PLATINUM</span>
|
<div>
|
||||||
<span className="text-slate-700 font-medium">Couverture 24/7 (99.99%)</span>
|
<dt className="text-slate-500 font-medium">Niveau d'Infogérance (SLA)</dt>
|
||||||
</dd>
|
<dd className="mt-1 flex items-center">
|
||||||
</div>
|
{setVipBadge(company?.vip_level)}
|
||||||
</dl>
|
<span className="text-slate-700 font-medium">Couverture 24/7 (99.99%)</span>
|
||||||
|
</dd>
|
||||||
|
</div>
|
||||||
|
</dl>
|
||||||
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -30,10 +30,10 @@ export default function ServicesWidget() {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<Button size="lg" onClick={() => navigate('/evolution-infrastructure')}>
|
<Button className ="text-green-600" size="lg" onClick={() => navigate('/evolution-infrastructure')}>
|
||||||
Demander une évolution du parc
|
Mise à niveau du Parc
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,14 +8,14 @@ export const SupportCtaWidget: React.FC = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardContent className="p-6">
|
<CardContent className="p-6 rounded-xl">
|
||||||
<h3 className="text-lg font-semibold mb-2">Centre de Support</h3>
|
<h3 className="text-lg font-semibold mb-2">Centre de Support</h3>
|
||||||
<p className="text-blue-900 text-sm mb-4 leading-relaxed">
|
<p className="text-sm mb-4 leading-relaxed">
|
||||||
Déclarez un incident critique ou demandez une évolution de votre infrastructure.
|
Déclarez un incident critique ou demandez une évolution de votre infrastructure.
|
||||||
</p>
|
</p>
|
||||||
<Button
|
<Button
|
||||||
onClick={() => navigate('/support')}
|
onClick={() => navigate('/support')}
|
||||||
className="w-full text-blue-900"
|
className= "text-rose-500 w-full"
|
||||||
>
|
>
|
||||||
Ouvrir un ticket sécurisé
|
Ouvrir un ticket sécurisé
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ export const SupportFooterWidget: React.FC<SupportFooterWidgetProps> = ({
|
|||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="mt-12 bg-slate-900 text-slate-300 rounded-xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4 shadow-sm">
|
<div className="mt-12 bg-slate-500 text-slate-300 rounded-xl p-6 flex flex-col sm:flex-row items-center justify-between gap-4 shadow-sm">
|
||||||
<div>
|
<div>
|
||||||
<h4 className="text-sm font-bold text-white">{title}</h4>
|
<h4 className="text-sm font-bold text-white">{title}</h4>
|
||||||
<p className="text-xs text-slate-400 mt-0.5">
|
<p className="text-xs text-slate-400 mt-0.5">
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ export const useTickets = () => {
|
|||||||
sort: '-created', // Du plus récent au plus ancien
|
sort: '-created', // Du plus récent au plus ancien
|
||||||
});
|
});
|
||||||
setTickets(records);
|
setTickets(records);
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error("Erreur lors de la récupération des tickets :", err);
|
|
||||||
setError("Impossible de charger l'historique de vos requêtes.");
|
setError("Impossible de charger l'historique de vos requêtes.");
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { pb } from "@/services/pocketbase";
|
||||||
|
import type { Company } from "@/types/Company";
|
||||||
|
import type { User } from "@/types/user";
|
||||||
|
import { useEffect, useState } from "react";
|
||||||
|
|
||||||
|
export const useUserInformations = () => {
|
||||||
|
const [user, setUser] = useState<User | null>(null);
|
||||||
|
const [company, setCompany] = useState<Company | null>(null);
|
||||||
|
const [isLoading, setIsLoading] = useState(true);
|
||||||
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const fetchInformations = async () => {
|
||||||
|
setIsLoading(true);
|
||||||
|
try {
|
||||||
|
const userRecords = await pb.collection('aegis_users').getFullList<User>();
|
||||||
|
setUser(userRecords[0]);
|
||||||
|
const companyRecords = await pb.collection('aegis_companies').getFullList<Company>();
|
||||||
|
setCompany(companyRecords[0])
|
||||||
|
} catch (err) {
|
||||||
|
setError("Erreur lors de la récupération des infos utilisateur :"+err);
|
||||||
|
} finally {
|
||||||
|
setIsLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
fetchInformations();
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return { user, company, isLoading, error };
|
||||||
|
};
|
||||||
@@ -1,29 +1,29 @@
|
|||||||
import PageHeader from "@/components/ui/PageHeader";
|
import PageHeader from "@/components/ui/PageHeader";
|
||||||
import AccessWidget from "@/components/widgets/AccessWidget";
|
import AccessWidget from "@/components/widgets/AccessWidget";
|
||||||
import InformationWidget from "@/components/widgets/InformationWidget";
|
import InformationWidget from "@/components/widgets/InformationWidget";
|
||||||
|
import { useUserInformations } from "@/hooks/useUserInformations";
|
||||||
|
|
||||||
export default function AccountSettings() {
|
export default function AccountSettings() {
|
||||||
|
const { user, company, isLoading, error } = useUserInformations();
|
||||||
return (
|
return (
|
||||||
<div className="font-sans relative min-h-[calc(100vh-4rem)]">
|
<div className="font-sans relative min-h-[calc(100vh-4rem)]">
|
||||||
|
|
||||||
|
|
||||||
{/* Contenu Principal */}
|
{/* Contenu Principal */}
|
||||||
<main className="max-w-7xl mx-auto px-8 sm:px-8 space-y-6 m-4">
|
<main className="max-w-7xl mx-auto px-8 sm:px-8 space-y-6 m-4">
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<PageHeader
|
<PageHeader
|
||||||
title="Paramètres du compte"
|
title="Paramètres du compte"
|
||||||
description="Gestion de la sécurité et informations contractuelles" />
|
description="Gestion de la sécurité et informations contractuelles" />
|
||||||
|
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
<div className="grid grid-cols-1 lg:grid-cols-2 gap-8">
|
||||||
|
|
||||||
{/* Colonne 1 : Sécurité */}
|
{/* Colonne 1 : Sécurité */}
|
||||||
<AccessWidget/>
|
<AccessWidget />
|
||||||
|
|
||||||
{/* Colonne 2 : Organisation & Contrat */}
|
{/* Colonne 2 : Organisation & Contrat */}
|
||||||
<InformationWidget/>
|
<InformationWidget
|
||||||
|
user={user}
|
||||||
|
company={company}
|
||||||
|
isLoading={isLoading}
|
||||||
|
error={error}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export default function ServiceDesk() {
|
|||||||
title="Centre de Support (Service Desk)"
|
title="Centre de Support (Service Desk)"
|
||||||
description="Canal de communication sécurisé avec vos experts GISE."
|
description="Canal de communication sécurisé avec vos experts GISE."
|
||||||
>
|
>
|
||||||
<Button onClick={() => navigate('/support/new')}>
|
<Button className= "text-rose-500" onClick={() => navigate('/support/new')}>
|
||||||
Ouvrir un ticket sécurisé
|
Ouvrir un ticket sécurisé
|
||||||
</Button>
|
</Button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export interface Company {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
no: string;
|
||||||
|
vip_level: string;
|
||||||
|
created: string;
|
||||||
|
updated: string
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export interface User {
|
||||||
|
id: string;
|
||||||
|
email: string;
|
||||||
|
emailVisibility: boolean;
|
||||||
|
verified: boolean;
|
||||||
|
name: string;
|
||||||
|
role: string;
|
||||||
|
company: string;
|
||||||
|
mfa_enabled: boolean;
|
||||||
|
created: string;
|
||||||
|
updated: string
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user