Working on implementation of alert policies. Some refactoring in user profile and patching a bug in status endpoint api.

This commit is contained in:
charlesgauthereau
2025-11-28 23:10:37 +01:00
parent d968aa9c16
commit 934e635cdb
29 changed files with 3364 additions and 1551 deletions
@@ -2,9 +2,9 @@
import Link from "next/link";
import Image from "next/image";
import { Card, CardContent, CardHeader } from "@/components/ui/card";
import { ConnectionCircle } from "@/components/wrappers/common/connection-circle";
import { formatDateLastContact } from "@/utils/date-formatting";
import {Card, CardContent, CardHeader} from "@/components/ui/card";
import {ConnectionCircle} from "@/components/wrappers/common/connection-circle";
import {formatDateLastContact} from "@/utils/date-formatting";
import {Database} from "@/db/schema/07_database";
import {Avatar, AvatarFallback, AvatarImage} from "@/components/ui/avatar";
@@ -15,11 +15,12 @@ export type projectDatabaseCardProps = {
};
export const ProjectDatabaseCard = (props: projectDatabaseCardProps) => {
const { organizationSlug, data: database, extendedProps: extendedProps } = props;
const {organizationSlug, data: database, extendedProps: extendedProps} = props;
return (
<Link className="block transition-all duration-200 hover:scale-[1.01] hover:shadow-md rounded-xl" href={`/dashboard/projects/${extendedProps.id}/database/${database.id}`}>
<DatabaseCard data={database} />
<Link className="block transition-all duration-200 hover:scale-[1.01] hover:shadow-md rounded-xl"
href={`/dashboard/projects/${extendedProps.id}/database/${database.id}`}>
<DatabaseCard data={database}/>
</Link>
);
};
@@ -29,12 +30,13 @@ export type databaseCardProps = {
};
export const DatabaseCard = (props: databaseCardProps) => {
const { data: database } = props;
const {data: database} = props;
return (
<Card className="flex flex-row justify-between">
<div className="flex items-center space-x-4 px-4">
<Image src={`/images/${database.dbms}.png`} alt="Database type Icon" width={60} height={60} className="object-cover ml-4" />
<Card className="flex flex-row justify-between space-x-2 ">
<div className="flex items-center justify-start w-full space-x-5 ">
<Image src={`/images/${database.dbms}.png`} alt="Database type Icon" width={60} height={60}
className="object-cover ml-4"/>
<div className="justify-between">
<div className="font-medium">Name: {database.name}</div>
<div className="text-sm text-muted-foreground">Generated Id: {database.agentDatabaseId}</div>
@@ -43,9 +45,8 @@ export const DatabaseCard = (props: databaseCardProps) => {
</div>
</div>
</div>
<div className="flex items-center px-4">
<ConnectionCircle date={database.lastContact} />
<div className="flex items-center px-5 justify-center">
<ConnectionCircle date={database.lastContact}/>
</div>
</Card>
);