diff --git a/.env.example b/.env.example index 3e76d4b5..a9310366 100644 --- a/.env.example +++ b/.env.example @@ -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= @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 28637b2b..2f6ecf78 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: db: image: postgres:17-alpine ports: - - "5433:5432" + - "5432:5432" volumes: - postgres-data:/var/lib/postgresql/data environment: diff --git a/src/components/wrappers/common/connection-circle.tsx b/src/components/wrappers/common/connection-circle.tsx deleted file mode 100644 index f30b3a3e..00000000 --- a/src/components/wrappers/common/connection-circle.tsx +++ /dev/null @@ -1,27 +0,0 @@ -import {cn} from "@/lib/utils"; - -export type ConnectionCircleProps = { - date?: Date | null; -}; - -export const ConnectionCircle = ({date}: ConnectionCircleProps) => { - let style = "bg-gray-300 border-gray-400"; - - if (date instanceof Date && !isNaN(date.getTime())) { - const now = Date.now(); - const timestamp = date.getTime(); - const interval_seconds = (now - timestamp) / 1000; - - if (interval_seconds < 55) { - style = "bg-green-400 border-green-600"; - } else if (interval_seconds <= 60) { - style = "bg-orange-400 border-orange-600"; - } else { - style = "bg-red-400 border-red-600"; - } - } else { - console.warn("Invalid date passed to ConnectionCircle:", date); - } - - return
; -}; diff --git a/src/components/wrappers/common/connection-indicator.tsx b/src/components/wrappers/common/connection-indicator.tsx new file mode 100644 index 00000000..8812932c --- /dev/null +++ b/src/components/wrappers/common/connection-indicator.tsx @@ -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 ( +
+ + + +
+
+ ); +}; diff --git a/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-form.tsx b/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-form.tsx index a8bdd60d..e43a7c10 100644 --- a/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-form.tsx +++ b/src/components/wrappers/dashboard/admin/channels/channel/channel-form/channel-form.tsx @@ -106,18 +106,43 @@ export const ChannelForm = ({onSuccessAction, organization, defaultValues, kind} { + if (type.preview) return; form.setValue("provider", type.value as any); form.setValue("config", {}); }} > -
- + {type.preview && ( +
+
+ coming soon +
+
+ )} +
+
- {type.label} + + {type.label} + + ); })}
diff --git a/src/components/wrappers/dashboard/admin/users/table-colums.tsx b/src/components/wrappers/dashboard/admin/users/table-colums.tsx index 74a5ecd5..611f7d88 100644 --- a/src/components/wrappers/dashboard/admin/users/table-colums.tsx +++ b/src/components/wrappers/dashboard/admin/users/table-colums.tsx @@ -46,14 +46,14 @@ export function usersListColumns(): ColumnDef[] { {formatLocalizedDate(row.original.createdAt)} - {/*{row.original.lastConnectedAt && (*/} - {/* */} - {/* Last connected*/} - {/* */} - {/* {formatLocalizedDate(row.original.lastConnectedAt)} ({timeAgo(row.original.lastConnectedAt, locale)})*/} - {/* */} - {/* */} - {/*)}*/} + {row.original.lastConnectedAt && ( + + Last connected + + {formatLocalizedDate(row.original.lastConnectedAt)} ({timeAgo(row.original.lastConnectedAt)}) + + + )} {row.original.lastChangedPasswordAt && ( Last password change diff --git a/src/components/wrappers/dashboard/agent/agent-card/agent-card.tsx b/src/components/wrappers/dashboard/agent/agent-card/agent-card.tsx index 35d45c0e..2191e4ba 100644 --- a/src/components/wrappers/dashboard/agent/agent-card/agent-card.tsx +++ b/src/components/wrappers/dashboard/agent/agent-card/agent-card.tsx @@ -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"; @@ -86,7 +86,7 @@ export const AgentCard = (props: agentCardProps) => {
- +
diff --git a/src/components/wrappers/dashboard/common/profile/profile-modal.tsx b/src/components/wrappers/dashboard/common/profile/profile-modal.tsx index 9fa99913..6290eaf6 100644 --- a/src/components/wrappers/dashboard/common/profile/profile-modal.tsx +++ b/src/components/wrappers/dashboard/common/profile/profile-modal.tsx @@ -26,7 +26,7 @@ type ProfileModalProps = { export const ProfileModal = ({ user, sessions, currentSession, accounts, open, onOpenChange, providers }: ProfileModalProps) => { return ( - + Settings Manage your account settings diff --git a/src/components/wrappers/dashboard/profile/components/avatar-with-upload.tsx b/src/components/wrappers/dashboard/profile/components/avatar-with-upload.tsx index 7bdb1d77..a5719d3e 100644 --- a/src/components/wrappers/dashboard/profile/components/avatar-with-upload.tsx +++ b/src/components/wrappers/dashboard/profile/components/avatar-with-upload.tsx @@ -73,7 +73,7 @@ export const AvatarWithUpload = (props: AvatarWithUploadProps) => { fileInput.onchange = handleImageUpload; fileInput.click(); }} - className="cursor-pointer absolute inset-0 flex justify-center items-center opacity-0 transition-opacity hover:opacity-100 hover:bg-gray-500 hover:bg-opacity-50 rounded-full w-24 h-24 lg:w-32 lg:h-32" + className="cursor-pointer absolute inset-0 flex justify-center items-center opacity-0 transition-opacity hover:opacity-30 hover:bg-gray-500 hover:bg-opacity-50 rounded-full w-24 h-24 lg:w-32 lg:h-32" >
diff --git a/src/components/wrappers/dashboard/projects/project-card/project-database-card.tsx b/src/components/wrappers/dashboard/projects/project-card/project-database-card.tsx index c7399e7c..57b8af1b 100644 --- a/src/components/wrappers/dashboard/projects/project-card/project-database-card.tsx +++ b/src/components/wrappers/dashboard/projects/project-card/project-database-card.tsx @@ -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"; @@ -60,7 +60,7 @@ export const DatabaseCard = (props: databaseCardProps) => {
- +
diff --git a/src/db/migrations/0020_low_giant_girl.sql b/src/db/migrations/0020_low_giant_girl.sql new file mode 100644 index 00000000..5a71036b --- /dev/null +++ b/src/db/migrations/0020_low_giant_girl.sql @@ -0,0 +1 @@ +ALTER TABLE "user" ADD COLUMN "lastConnectedAt" timestamp; \ No newline at end of file diff --git a/src/db/schema/02_user.ts b/src/db/schema/02_user.ts index 94ca7272..78ac7900 100644 --- a/src/db/schema/02_user.ts +++ b/src/db/schema/02_user.ts @@ -3,7 +3,7 @@ import {boolean, integer, pgEnum, pgTable, text, timestamp, uuid} from "drizzle- import {createSelectSchema} from "drizzle-zod"; import {z} from "zod"; import {project} from "./06_project"; -import {member, OrganizationMember} from "@/db/schema/04_member"; +import {member} from "@/db/schema/04_member"; import {invitation} from "@/db/schema/05_invitation"; import {organization} from "@/db/schema/03_organization"; import {Account as BetterAuthAccount} from "better-auth"; @@ -23,6 +23,7 @@ export const user = pgTable("user", { banned: boolean("banned"), banReason: text("ban_reason"), banExpires: timestamp("ban_expires"), + lastConnectedAt: timestamp(), lastChangedPasswordAt: timestamp(), twoFactorEnabled: boolean("two_factor_enabled").default(false), ...timestamps