Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Environnement
NODE_ENV=production
NODE_ENV=development

# Base de données
DATABASE_URL=postgresql://devuser:changeme@db:5432/devdb?schema=public
DATABASE_URL=postgresql://devuser:changeme@localhost:5432/devdb?schema=public

# Projet
PROJECT_NAME="Portabase"
PROJECT_DESCRIPTION="Portabase is a powerful database manager"
PROJECT_URL=http://app.portabase.io
PROJECT_URL=http://localhost:8887
PROJECT_SECRET=

# SMTP (email)
SMTP_HOST=
SMTP_PORT=587
SMTP_PORT=
SMTP_USER=
SMTP_PASSWORD=
SMTP_FROM=
Expand All @@ -23,14 +23,14 @@ AUTH_GOOGLE_SECRET=
AUTH_GOOGLE_METHOD=

# S3
S3_ENDPOINT=http://app.s3.portabase.io
S3_ENDPOINT=
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET_NAME=portabase
S3_PORT=9000
S3_USE_SSL=true
S3_BUCKET_NAME=
S3_PORT=
S3_USE_SSL=

# Storage Type (s3, local)
# Storage type (local, S3)
STORAGE_TYPE=local

# Retention
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:
db:
image: postgres:16-alpine
ports:
- "5433:5432"
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
Expand Down
27 changes: 0 additions & 27 deletions src/components/wrappers/common/connection-circle.tsx

This file was deleted.

46 changes: 46 additions & 0 deletions src/components/wrappers/common/connection-indicator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {cn} from "@/lib/utils";

export type ConnectionIndicatorProps = {
date?: Date | null;
};

export const ConnectionIndicator = ({date}: ConnectionIndicatorProps) => {
let style = "bg-gray-300";

if (date instanceof Date && !isNaN(date.getTime())) {
const intervalSeconds = (Date.now() - date.getTime()) / 1000;

if (intervalSeconds < 55) {
style = "bg-green-500";
} else if (intervalSeconds <= 60) {
style = "bg-orange-400";
} else {
style = "bg-red-500";
}
}

return (
<div className="relative w-3 h-3">

<span
className={cn(
"absolute -inset-0.25 rounded-full opacity-60 animate-ping",
style
)}
style={{
animationDuration: "2s",
}}
/>

<div
className={cn(
"relative w-3 h-3 rounded-full shadow-sm animate-pulse",
style
)}
style={{
animationDuration: "2s",
}}
/>
</div>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
import {useState} from "react";
import Link from "next/link";
import {Card} from "@/components/ui/card";
import {ConnectionCircle} from "@/components/wrappers/common/connection-circle";
import {ConnectionIndicator} from "@/components/wrappers/common/connection-indicator";
import {formatDateLastContact} from "@/utils/date-formatting";
import {AgentWith} from "@/db/schema/08_agent";
import {Activity, ChevronRight, Copy, Check, Fingerprint, Server, Database, ShieldCheck} from "lucide-react";
import {Activity, ChevronRight, Copy, Check, Fingerprint, Server, Database} from "lucide-react";
import {Badge} from "@/components/ui/badge";
import {truncateWords} from "@/utils/text";
import {useIsMobile} from "@/hooks/use-mobile";
Expand Down Expand Up @@ -86,7 +86,7 @@ export const AgentCard = (props: agentCardProps) => {
</div>

<div className="scale-110">
<ConnectionCircle date={agent.lastContact}/>
<ConnectionIndicator date={agent.lastContact}/>
</div>

<ChevronRight className="w-5 h-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Link from "next/link";
import Image from "next/image";
import {useState} from "react";
import {Card} from "@/components/ui/card";
import {ConnectionCircle} from "@/components/wrappers/common/connection-circle";
import {ConnectionIndicator} from "@/components/wrappers/common/connection-indicator";
import {formatDateLastContact} from "@/utils/date-formatting";
import {Database} from "@/db/schema/07_database";
import {ChevronRight, Activity, Fingerprint, Copy, Check} from "lucide-react";
Expand Down Expand Up @@ -60,7 +60,7 @@ export const DatabaseCard = (props: databaseCardProps) => {
</div>
<div className="flex flex-col items-end gap-3">
<div className="scale-100 origin-right">
<ConnectionCircle date={database.lastContact}/>
<ConnectionIndicator date={database.lastContact}/>
</div>
</div>
</div>
Expand Down
Loading