mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
refactoring some files.
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
import {useEffect, useRef} from "react";
|
import {useEffect, useRef} from "react";
|
||||||
import {useSearchParams} from "next/navigation";
|
import {useSearchParams} from "next/navigation";
|
||||||
|
|
||||||
import {LoginForm} from "@/components/wrappers/Auth/Login/LoginForm/LoginForm";
|
import {LoginForm} from "@/components/wrappers/auth/Login/LoginForm/LoginForm";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
|
|
||||||
export default function SignInPage(props: {
|
export default function SignInPage(props: {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {RegisterForm} from "@/components/wrappers/Auth/Register/RegisterForm/RegisterForm";
|
import {RegisterForm} from "@/components/wrappers/auth/Register/RegisterForm/RegisterForm";
|
||||||
|
|
||||||
export default function RoutePage(props: PageParams<{}>) {
|
export default function RoutePage(props: PageParams<{}>) {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {PageParams} from "@/types/next";
|
|||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {AdminTabs} from "@/components/wrappers/Dashboard/admin/admin-tabs";
|
import {AdminTabs} from "@/components/wrappers/dashboard/admin/admin-tabs";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {AgentForm} from "@/components/wrappers/Agent/AgentForm/AgentForm";
|
import {AgentForm} from "@/components/wrappers/dashboard/agent/AgentForm/AgentForm";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import {Page, PageActions, PageContent, PageDescription, PageTitle} from "@/feat
|
|||||||
import {formatDateLastContact} from "@/utils/date-formatting";
|
import {formatDateLastContact} from "@/utils/date-formatting";
|
||||||
import {Button, buttonVariants} from "@/components/ui/button";
|
import {Button, buttonVariants} from "@/components/ui/button";
|
||||||
import {Card, CardContent, CardHeader} from "@/components/ui/card";
|
import {Card, CardContent, CardHeader} from "@/components/ui/card";
|
||||||
import {AgentModalKey} from "@/components/wrappers/Agent/AgentModalKey/AgentModalKey";
|
import {AgentModalKey} from "@/components/wrappers/dashboard/agent/AgentModalKey/AgentModalKey";
|
||||||
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
||||||
import {DatabaseCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectDatabaseCard";
|
import {DatabaseCard} from "@/components/wrappers/dashboard/Projects/ProjectCard/ProjectDatabaseCard";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{ agentId: string }>) {
|
export default async function RoutePage(props: PageParams<{ agentId: string }>) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {AgentForm} from "@/components/wrappers/Agent/AgentForm/AgentForm";
|
import {AgentForm} from "@/components/wrappers/dashboard/agent/AgentForm/AgentForm";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {AgentCard} from "@/components/wrappers/Agent/AgentCard/AgentCard";
|
import {AgentCard} from "@/components/wrappers/dashboard/agent/AgentCard/AgentCard";
|
||||||
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
|||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
import {RestoreForm} from "@/components/wrappers/Database/RestoreForm";
|
import {RestoreForm} from "@/components/wrappers/dashboard/database/RestoreForm";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{
|
export default async function RoutePage(props: PageParams<{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import React from "react";
|
|||||||
import {redirect} from "next/navigation";
|
import {redirect} from "next/navigation";
|
||||||
|
|
||||||
import {SidebarInset, SidebarProvider} from "@/components/ui/sidebar"
|
import {SidebarInset, SidebarProvider} from "@/components/ui/sidebar"
|
||||||
import {AppSidebar} from "@/components/wrappers/Dashboard/SideBar/app-sidebar";
|
import {AppSidebar} from "@/components/wrappers/dashboard/SideBar/app-sidebar";
|
||||||
import {currentUser} from "@/auth/current-user";
|
import {currentUser} from "@/auth/current-user";
|
||||||
import {Header} from "@/features/layout/Header";
|
import {Header} from "@/features/layout/Header";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/
|
|||||||
import {Avatar, AvatarFallback, AvatarImage} from "@/components/ui/avatar";
|
import {Avatar, AvatarFallback, AvatarImage} from "@/components/ui/avatar";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {UserForm} from "@/components/wrappers/Dashboard/Profile/UserForm/UserForm";
|
import {UserForm} from "@/components/wrappers/dashboard/Profile/UserForm/UserForm";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {Badge} from "@/components/ui/badge";
|
import {Badge} from "@/components/ui/badge";
|
||||||
import {ButtonDeleteAccount} from "@/components/wrappers/Dashboard/Profile/ButtonDeleteAccount/ButtonDeleteAccount";
|
import {ButtonDeleteAccount} from "@/components/wrappers/dashboard/Profile/ButtonDeleteAccount/ButtonDeleteAccount";
|
||||||
import {AvatarWithUpload} from "@/components/wrappers/Dashboard/Profile/Avatar/AvatarWithUpload";
|
import {AvatarWithUpload} from "@/components/wrappers/dashboard/Profile/Avatar/AvatarWithUpload";
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {AgentForm} from "@/components/wrappers/Agent/AgentForm/AgentForm";
|
import {AgentForm} from "@/components/wrappers/dashboard/agent/AgentForm/AgentForm";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
import {DatabaseForm} from "@/components/wrappers/Database/DatabaseForm/DatabaseForm";
|
import {DatabaseForm} from "@/components/wrappers/dashboard/database/DatabaseForm/DatabaseForm";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{
|
export default async function RoutePage(props: PageParams<{
|
||||||
|
|||||||
@@ -2,14 +2,14 @@ import {PageParams} from "@/types/next";
|
|||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {notFound, usePathname, useRouter} from "next/navigation";
|
import {notFound, usePathname, useRouter} from "next/navigation";
|
||||||
import {Page, PageActions, PageContent, PageDescription, PageTitle} from "@/features/layout/page";
|
import {Page, PageActions, PageContent, PageDescription, PageTitle} from "@/features/layout/page";
|
||||||
import {BackupButton} from "@/components/wrappers/BackupButton/BackupButton";
|
import {BackupButton} from "@/components/wrappers/dashboard/backup/backup-button/backup-button";
|
||||||
import {DatabaseTabs} from "@/components/wrappers/Dashboard/Projects/Database/DatabaseTabs";
|
import {DatabaseTabs} from "@/components/wrappers/dashboard/Projects/Database/DatabaseTabs";
|
||||||
import {DatabaseKpi} from "@/components/wrappers/Dashboard/Projects/Database/DatabaseKpi";
|
import {DatabaseKpi} from "@/components/wrappers/dashboard/Projects/Database/DatabaseKpi";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {buttonVariants} from "@/components/ui/button";
|
import {buttonVariants} from "@/components/ui/button";
|
||||||
import {GearIcon} from "@radix-ui/react-icons";
|
import {GearIcon} from "@radix-ui/react-icons";
|
||||||
import {EditButton} from "@/components/wrappers/Database/EditButton/EditButton";
|
import {EditButton} from "@/components/wrappers/dashboard/database/EditButton/EditButton";
|
||||||
import {CronButton} from "@/components/wrappers/Database/CronButton/CronButton";
|
import {CronButton} from "@/components/wrappers/dashboard/database/CronButton/CronButton";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{ databaseId: string }>) {
|
export default async function RoutePage(props: PageParams<{ databaseId: string }>) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {notFound} from "next/navigation";
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {ProjectForm} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm";
|
import {ProjectForm} from "@/components/wrappers/dashboard/Projects/ProjectsForm/ProjectForm";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{
|
export default async function RoutePage(props: PageParams<{
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import {buttonVariants} from "@/components/ui/button";
|
|||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {GearIcon} from "@radix-ui/react-icons";
|
import {GearIcon} from "@radix-ui/react-icons";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {ButtonDeleteProject} from "@/components/wrappers/Dashboard/Projects/ButtonDeleteProject/ButtonDeleteProject";
|
import {ButtonDeleteProject} from "@/components/wrappers/dashboard/Projects/ButtonDeleteProject/ButtonDeleteProject";
|
||||||
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
||||||
import {ProjectDatabaseCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectDatabaseCard";
|
import {ProjectDatabaseCard} from "@/components/wrappers/dashboard/Projects/ProjectCard/ProjectDatabaseCard";
|
||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {ProjectForm} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm";
|
import {ProjectForm} from "@/components/wrappers/dashboard/Projects/ProjectsForm/ProjectForm";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
|||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {ProjectCard} from "@/components/wrappers/Dashboard/Projects/ProjectCard/ProjectCard";
|
import {ProjectCard} from "@/components/wrappers/dashboard/Projects/ProjectCard/ProjectCard";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {prisma} from "@/prisma";
|
|||||||
import {PageParams} from "@/types/next";
|
import {PageParams} from "@/types/next";
|
||||||
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageDescription, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
import {SettingsTabs} from "@/components/wrappers/Dashboard/Settings/SettingsTabs/SettingsTabs";
|
import {SettingsTabs} from "@/components/wrappers/dashboard/Settings/SettingsTabs/SettingsTabs";
|
||||||
|
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ import {PageParams} from "@/types/next";
|
|||||||
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
|
||||||
import {EvolutionLineChart} from "@/components/wrappers/charts/evolution-line-chart";
|
import {EvolutionLineChart} from "@/components/wrappers/dashboard/statistics/charts/evolution-line-chart";
|
||||||
import {PercentageLineChart} from "@/components/wrappers/charts/percentage-line-chart";
|
import {PercentageLineChart} from "@/components/wrappers/dashboard/statistics/charts/percentage-line-chart";
|
||||||
|
|
||||||
export default async function RoutePage(props: PageParams<{}>) {
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import {PropsWithChildren} from "react";
|
import {PropsWithChildren} from "react";
|
||||||
import {ClipboardCopy, Copy, CopyIcon} from "lucide-react";
|
|
||||||
import {Button} from "@/components/ui/button"
|
import {Button} from "@/components/ui/button"
|
||||||
|
|
||||||
export type CodeSnippetProps = PropsWithChildren<{
|
export type CodeSnippetProps = PropsWithChildren<{
|
||||||
@@ -11,19 +10,10 @@ export const CodeSnippet = (props: CodeSnippetProps) => {
|
|||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
// <div className="flex items-center space-x-4 w-full">
|
|
||||||
// <code
|
|
||||||
// className="text-xs sm:text-sm inline-flex text-left bg-gray-800 text-white rounded-lg p-4 overflow-x-auto whitespace-nowrap max-w-full"
|
|
||||||
// >
|
|
||||||
// <span className="flex-1">{props.code}</span>
|
|
||||||
// </code>
|
|
||||||
// </div>
|
|
||||||
<div className="rounded-lg border bg-background">
|
<div className="rounded-lg border bg-background">
|
||||||
<div className="flex items-center justify-between border-b bg-muted px-4 py-2">
|
<div className="flex items-center justify-between border-b bg-muted px-4 py-2">
|
||||||
<div className="text-sm font-medium">.env</div>
|
<div className="text-sm font-medium">.env</div>
|
||||||
<Button variant="ghost" size="icon" className="hover:bg-muted/50 text-muted-foreground">
|
<Button variant="ghost" size="icon" className="hover:bg-muted/50 text-muted-foreground">
|
||||||
{/*<CopyIcon className="h-4 w-4"/>*/}
|
|
||||||
{/*<span className="sr-only">Copy code</span>*/}
|
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div className="p-4 font-mono text-sm leading-6 text-foreground truncate">
|
<div className="p-4 font-mono text-sm leading-6 text-foreground truncate">
|
||||||
|
|||||||
@@ -1,144 +0,0 @@
|
|||||||
// "use client"
|
|
||||||
//
|
|
||||||
// import {CartesianGrid, Line, LineChart, Tooltip, XAxis, YAxis} from "recharts"
|
|
||||||
// import {ChartConfig, ChartContainer, ChartTooltip, ChartTooltipContent,} from "@/components/ui/chart"
|
|
||||||
// import {humanReadableDate} from "@/utils/date-formatting";
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// export type lineChartProps = {
|
|
||||||
// data: any
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// export function EvolutionLineChart(props: lineChartProps) {
|
|
||||||
//
|
|
||||||
// const {data} = props
|
|
||||||
//
|
|
||||||
// // Process data to calculate cumulative count
|
|
||||||
// const cumulativeData = data.reduce((acc, backup) => {
|
|
||||||
// const date = backup.createdAt.toISOString().split("T")[0]; // Format as YYYY-MM-DD
|
|
||||||
//
|
|
||||||
// // Increment count for the current date or initialize it
|
|
||||||
// if (acc.length && acc[acc.length - 1].date === date) {
|
|
||||||
// acc[acc.length - 1].count += 1;
|
|
||||||
// } else {
|
|
||||||
// const lastCount = acc.length ? acc[acc.length - 1].count : 0;
|
|
||||||
// acc.push({date, count: lastCount + 1});
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// return acc;
|
|
||||||
// }, [] as { date: string; count: number }[]);
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// const chartConfig = {
|
|
||||||
// date: {
|
|
||||||
// label: "Date",
|
|
||||||
// color: "#2563eb",
|
|
||||||
// },
|
|
||||||
// count: {
|
|
||||||
// label: "Number of backups",
|
|
||||||
// color: "#60a5fa",
|
|
||||||
// },
|
|
||||||
// } satisfies ChartConfig
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// return (
|
|
||||||
// <ChartContainer config={chartConfig}>
|
|
||||||
// <LineChart
|
|
||||||
// accessibilityLayer
|
|
||||||
// data={data}
|
|
||||||
// margin={{
|
|
||||||
// left: 12,
|
|
||||||
// right: 12,
|
|
||||||
// }}
|
|
||||||
// >
|
|
||||||
// <CartesianGrid vertical={false}/>
|
|
||||||
// <XAxis
|
|
||||||
// dataKey="date"
|
|
||||||
// tickLine={false}
|
|
||||||
// axisLine={false}
|
|
||||||
// tickMargin={8}
|
|
||||||
// tickFormatter={(value) => humanReadableDate(Date(value)).split(' ')[0]}
|
|
||||||
// />
|
|
||||||
// <YAxis/>
|
|
||||||
// <ChartTooltip
|
|
||||||
// cursor={false}
|
|
||||||
// content={<ChartTooltipContent hideLabel/>}
|
|
||||||
// />
|
|
||||||
// <Line
|
|
||||||
// dataKey="count"
|
|
||||||
// type="linear"
|
|
||||||
// stroke="var(--color-desktop)"
|
|
||||||
// strokeWidth={2}
|
|
||||||
// dot={false}
|
|
||||||
// />
|
|
||||||
// </LineChart>
|
|
||||||
// </ChartContainer>
|
|
||||||
// )
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// export function PercentageLineChart(props: lineChartProps) {
|
|
||||||
//
|
|
||||||
// const {data} = props
|
|
||||||
//
|
|
||||||
// const chartConfig = {
|
|
||||||
// date: {
|
|
||||||
// label: "Date",
|
|
||||||
// color: "#2563eb",
|
|
||||||
// },
|
|
||||||
// successRate: {
|
|
||||||
// label: "Success Rate",
|
|
||||||
// color: "#60a5fa",
|
|
||||||
// },
|
|
||||||
// } satisfies ChartConfig
|
|
||||||
//
|
|
||||||
// const dailyStats = data.reduce((acc, backup) => {
|
|
||||||
// const date = backup.createdAt.toISOString().split("T")[0]; // Format YYYY-MM-DD
|
|
||||||
// const status = backup.status;
|
|
||||||
//
|
|
||||||
// if (!acc[date]) {
|
|
||||||
// acc[date] = {success: 0, failed: 0, total: 0};
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// acc[date][status === "success" ? "success" : "failed"] += backup._count.id;
|
|
||||||
// acc[date].total += backup._count.id;
|
|
||||||
//
|
|
||||||
// return acc;
|
|
||||||
// }, {} as Record<string, { success: number; failed: number; total: number }>);
|
|
||||||
//
|
|
||||||
// // Format data for the chart
|
|
||||||
// const formattedData = Object.entries(dailyStats).map(([date, stats]) => ({
|
|
||||||
// date,
|
|
||||||
// successRate: (stats.success / stats.total) * 100,
|
|
||||||
// }));
|
|
||||||
//
|
|
||||||
// return (
|
|
||||||
// <ChartContainer config={chartConfig}>
|
|
||||||
// <LineChart data={formattedData}>
|
|
||||||
// <CartesianGrid strokeDasharray="3 3"/>
|
|
||||||
// <XAxis dataKey="date"/>
|
|
||||||
// <YAxis domain={[0, 100]} tickFormatter={(tick) => `${tick}%`}/>
|
|
||||||
// {/*<Tooltip formatter={(value: number) => `${value.toFixed(2)}%`}/>*/}
|
|
||||||
// <ChartTooltip
|
|
||||||
// content={<ChartTooltipContent/>}
|
|
||||||
// cursor={false}
|
|
||||||
// defaultIndex={1}
|
|
||||||
// formatter={(value, name) => (
|
|
||||||
// <div className="flex min-w-[130px] items-center text-xs text-muted-foreground">
|
|
||||||
// {chartConfig[name as keyof typeof chartConfig]?.label ||
|
|
||||||
// name}
|
|
||||||
// <div className="ml-auto flex items-baseline gap-0.5 font-mono font-medium tabular-nums text-foreground">
|
|
||||||
// {value}
|
|
||||||
// <span className="font-normal text-muted-foreground">
|
|
||||||
// %
|
|
||||||
// </span>
|
|
||||||
// </div>
|
|
||||||
// </div>
|
|
||||||
// )}
|
|
||||||
// />
|
|
||||||
// <Line type="step" dataKey="successRate" stroke="#8884d8" strokeWidth={2}/>
|
|
||||||
// </LineChart>
|
|
||||||
// </ChartContainer>
|
|
||||||
// )
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
+3
-3
@@ -11,10 +11,10 @@ import {toast} from "sonner";
|
|||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {TooltipProvider} from "@/components/ui/tooltip";
|
import {TooltipProvider} from "@/components/ui/tooltip";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {PasswordInput} from "@/components/wrappers/Auth/PaswordInput/password-input";
|
import {PasswordInput} from "@/components/wrappers/auth/PaswordInput/password-input";
|
||||||
import {LoginSchema, LoginType} from "@/components/wrappers/Auth/Login/LoginForm/login-form.schema";
|
import {LoginSchema, LoginType} from "@/components/wrappers/auth/Login/LoginForm/login-form.schema";
|
||||||
import {signInAction} from "@/features/auth/auth.action";
|
import {signInAction} from "@/features/auth/auth.action";
|
||||||
import {SocialAuthButton} from "@/components/wrappers/Auth/Login/SocialAuth/SocialAuthButtons/SocialAuthButton";
|
import {SocialAuthButton} from "@/components/wrappers/auth/Login/SocialAuth/SocialAuthButtons/SocialAuthButton";
|
||||||
import Image from 'next/image';
|
import Image from 'next/image';
|
||||||
|
|
||||||
export type loginFormProps = {
|
export type loginFormProps = {
|
||||||
+3
-3
@@ -11,9 +11,9 @@ import {Input} from "@/components/ui/input";
|
|||||||
import {Form} from "@/components/ui/form"
|
import {Form} from "@/components/ui/form"
|
||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
import {TooltipProvider, TooltipTrigger, Tooltip, TooltipContent} from "@/components/ui/tooltip";
|
import {TooltipProvider, TooltipTrigger, Tooltip, TooltipContent} from "@/components/ui/tooltip";
|
||||||
import {RegisterSchema, RegisterType} from "@/components/wrappers/Auth/Register/RegisterForm/register-form.schema";
|
import {RegisterSchema, RegisterType} from "@/components/wrappers/auth/Register/RegisterForm/register-form.schema";
|
||||||
import {registerUserAction} from "@/components/wrappers/Auth/Register/RegisterForm/register-form.action";
|
import {registerUserAction} from "@/components/wrappers/auth/Register/RegisterForm/register-form.action";
|
||||||
import {PasswordInput} from "@/components/wrappers/Auth/PaswordInput/password-input";
|
import {PasswordInput} from "@/components/wrappers/auth/PaswordInput/password-input";
|
||||||
|
|
||||||
export type registerFormProps = {
|
export type registerFormProps = {
|
||||||
defaultValues?: RegisterType;
|
defaultValues?: RegisterType;
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
"use server"
|
"use server"
|
||||||
import {RegisterSchema} from "@/components/wrappers/Auth/Register/RegisterForm/register-form.schema";
|
import {RegisterSchema} from "@/components/wrappers/auth/Register/RegisterForm/register-form.schema";
|
||||||
import {action} from "@/safe-actions";
|
import {action} from "@/safe-actions";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {hashPassword} from "@/utils/password";
|
import {hashPassword} from "@/utils/password";
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
|
|
||||||
import {Check, ChevronDown} from "lucide-react"
|
import {Check, ChevronDown, KeyRound} from "lucide-react"
|
||||||
|
|
||||||
import {cn} from "@/lib/utils"
|
import {cn} from "@/lib/utils"
|
||||||
import {Button} from "@/components/ui/button"
|
import {Button} from "@/components/ui/button"
|
||||||
@@ -22,6 +22,8 @@ import {
|
|||||||
import {FormControl} from "@/components/ui/form";
|
import {FormControl} from "@/components/ui/form";
|
||||||
import {SidebarMenuButton} from "@/components/ui/sidebar";
|
import {SidebarMenuButton} from "@/components/ui/sidebar";
|
||||||
import {Separator} from "@/components/ui/separator";
|
import {Separator} from "@/components/ui/separator";
|
||||||
|
import {AgentModalKey} from "@/components/wrappers/dashboard/agent/AgentModalKey/AgentModalKey";
|
||||||
|
import {CreateOrganizationModal} from "@/components/wrappers/dashboard/Organization/create-organisation-modal";
|
||||||
|
|
||||||
export type comboBoxProps = {
|
export type comboBoxProps = {
|
||||||
values: Array<{ value: string, label: string }>
|
values: Array<{ value: string, label: string }>
|
||||||
@@ -34,7 +36,13 @@ export type comboBoxProps = {
|
|||||||
|
|
||||||
export function ComboBox(props: comboBoxProps) {
|
export function ComboBox(props: comboBoxProps) {
|
||||||
|
|
||||||
const {values: choices, defaultValue: defaultChoice = "", onValueChange, searchField = false, sideBar = false} = props;
|
const {
|
||||||
|
values: choices,
|
||||||
|
defaultValue: defaultChoice = "",
|
||||||
|
onValueChange,
|
||||||
|
searchField = false,
|
||||||
|
sideBar = false
|
||||||
|
} = props;
|
||||||
|
|
||||||
const [value, setValue] = useState<string>()
|
const [value, setValue] = useState<string>()
|
||||||
|
|
||||||
@@ -100,9 +108,11 @@ export function ComboBox(props: comboBoxProps) {
|
|||||||
</Command>
|
</Command>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
{sideBar ?
|
{sideBar ?
|
||||||
<SidebarMenuButton>
|
<CreateOrganizationModal>
|
||||||
+ Create new organization
|
<SidebarMenuButton>
|
||||||
</SidebarMenuButton>
|
+ Create new organization
|
||||||
|
</SidebarMenuButton>
|
||||||
|
</CreateOrganizationModal>
|
||||||
: null}
|
: null}
|
||||||
</PopoverContent>
|
</PopoverContent>
|
||||||
</Popover>
|
</Popover>
|
||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import {Avatar, AvatarFallback, AvatarImage} from "@/components/ui/avatar"
|
import {Avatar, AvatarFallback, AvatarImage} from "@/components/ui/avatar"
|
||||||
import {currentUser} from "@/auth/current-user";
|
import {currentUser} from "@/auth/current-user";
|
||||||
import {LoggedInDropdown} from "@/components/wrappers/Dashboard/LoggedInDropdown/LoggedInDropdown";
|
import {LoggedInDropdown} from "@/components/wrappers/dashboard/LoggedInDropdown/LoggedInDropdown";
|
||||||
import {SidebarMenuButton} from "@/components/ui/sidebar";
|
import {SidebarMenuButton} from "@/components/ui/sidebar";
|
||||||
import {ChevronUp} from "lucide-react";
|
import {ChevronUp} from "lucide-react";
|
||||||
|
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
"use client"
|
||||||
|
|
||||||
|
import {useMutation} from "@tanstack/react-query";
|
||||||
|
|
||||||
|
import {Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle, DialogTrigger} from "@/components/ui/dialog";
|
||||||
|
import {Button} from "@/components/ui/button";
|
||||||
|
import {Form, FormControl, FormField, FormItem, FormLabel, FormMessage, useZodForm} from "@/components/ui/form";
|
||||||
|
import {Input} from "@/components/ui/input";
|
||||||
|
import {OrganizationSchema} from "@/components/wrappers/dashboard/Organization/organization.schema";
|
||||||
|
|
||||||
|
export type createOrganizationModalProps = {
|
||||||
|
children: any
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function CreateOrganizationModal(props: createOrganizationModalProps) {
|
||||||
|
|
||||||
|
const {children} = props;
|
||||||
|
|
||||||
|
const form = useZodForm({
|
||||||
|
schema: OrganizationSchema,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mutation = useMutation({
|
||||||
|
mutationFn: async (values: OrganizationSchema) => {
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Dialog>
|
||||||
|
|
||||||
|
<DialogTrigger asChild>
|
||||||
|
{children}
|
||||||
|
</DialogTrigger>
|
||||||
|
|
||||||
|
<DialogContent className="sm:max-w-[425px] w-full">
|
||||||
|
|
||||||
|
<DialogHeader>
|
||||||
|
<DialogTitle>Create a new organization</DialogTitle>
|
||||||
|
</DialogHeader>
|
||||||
|
|
||||||
|
<div className="sm:max-w-[375px] w-full">
|
||||||
|
<Form form={form}
|
||||||
|
className="flex flex-col gap-4"
|
||||||
|
onSubmit={async (values) => {
|
||||||
|
await mutation.mutateAsync(values);
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<FormField
|
||||||
|
control={form.control}
|
||||||
|
name="name"
|
||||||
|
defaultValue=""
|
||||||
|
render={({field}) => (
|
||||||
|
<FormItem>
|
||||||
|
<FormLabel>Name</FormLabel>
|
||||||
|
<FormControl>
|
||||||
|
<Input {...field} />
|
||||||
|
</FormControl>
|
||||||
|
<FormMessage/>
|
||||||
|
</FormItem>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<DialogFooter>
|
||||||
|
<div className="flex items-center justify-between w-full">
|
||||||
|
<Button type="submit">Create</Button>
|
||||||
|
</div>
|
||||||
|
</DialogFooter>
|
||||||
|
|
||||||
|
</DialogContent>
|
||||||
|
|
||||||
|
</Dialog>
|
||||||
|
)
|
||||||
|
}
|
||||||
+3
-3
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
import {useEffect, useState} from "react";
|
import {useEffect, useState} from "react";
|
||||||
|
|
||||||
import {ComboBox} from "@/components/wrappers/combobox";
|
import {ComboBox} from "@/components/wrappers/common/combobox";
|
||||||
import {Organization} from "@prisma/client";
|
import {Organization} from "@prisma/client";
|
||||||
import {useStore} from "@/state-management/store";
|
import {useStore} from "@/state-management/store";
|
||||||
import {getCurrentOrganizationSlug, setCurrentOrganizationSlug} from "@/features/dashboard/organization";
|
import {getCurrentOrganizationSlug, setCurrentOrganizationSlug} from "@/features/dashboard/organization-cookie";
|
||||||
|
|
||||||
export type organizationComboBoxProps = {
|
export type organizationComboBoxProps = {
|
||||||
organizations: Organization[]
|
organizations: Organization[]
|
||||||
@@ -13,7 +13,7 @@ export type organizationComboBoxProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export function OrganizationComboBox(props: organizationComboBoxProps) {
|
export function OrganizationCombobox(props: organizationComboBoxProps) {
|
||||||
|
|
||||||
// const {organizationId, moveToAnotherOrganization} = useStore((state) => state);
|
// const {organizationId, moveToAnotherOrganization} = useStore((state) => state);
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import {z} from "zod";
|
||||||
|
|
||||||
|
|
||||||
|
export const OrganizationSchema = z.object({
|
||||||
|
name: z.string(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export type OrganizationSchema = z.infer<typeof OrganizationSchema>;
|
||||||
+1
-1
@@ -6,7 +6,7 @@ import {toast} from "sonner";
|
|||||||
import {uploadImageAction} from "@/features/upload/public/upload.action";
|
import {uploadImageAction} from "@/features/upload/public/upload.action";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {updateImageUserAction} from "@/components/wrappers/Dashboard/Profile/Avatar/avatar.action";
|
import {updateImageUserAction} from "@/components/wrappers/dashboard/Profile/Avatar/avatar.action";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {useSession} from "next-auth/react";
|
import {useSession} from "next-auth/react";
|
||||||
|
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {signOutAction} from "@/features/auth/auth.action";
|
import {signOutAction} from "@/features/auth/auth.action";
|
||||||
import {ButtonWithConfirm} from "@/components/wrappers/Button/ButtonWithConfirm/ButtonWithConfirm";
|
import {ButtonWithConfirm} from "@/components/wrappers/common/button/ButtonWithConfirm/ButtonWithConfirm";
|
||||||
import {deleteUserAction} from "@/components/wrappers/Dashboard/Profile/ButtonDeleteAccount/delete-account.action";
|
import {deleteUserAction} from "@/components/wrappers/dashboard/Profile/ButtonDeleteAccount/delete-account.action";
|
||||||
import {Trash2} from "lucide-react";
|
import {Trash2} from "lucide-react";
|
||||||
|
|
||||||
export type ButtonDeleteAccountProps = {
|
export type ButtonDeleteAccountProps = {
|
||||||
+1
-1
@@ -3,7 +3,7 @@ import {userAction} from "@/safe-actions";
|
|||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {v4 as uuidv4} from "uuid";
|
import {v4 as uuidv4} from "uuid";
|
||||||
import {EmailFormSchema} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
import {EmailFormSchema} from "@/components/wrappers/dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
||||||
|
|
||||||
|
|
||||||
export const deleteUserAction = userAction
|
export const deleteUserAction = userAction
|
||||||
+2
-2
@@ -10,9 +10,9 @@ import {Button} from "@/components/ui/button";
|
|||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {TooltipProvider} from "@/components/ui/tooltip";
|
import {TooltipProvider} from "@/components/ui/tooltip";
|
||||||
import {UserSchema, UserType} from "@/components/wrappers/Dashboard/Profile/UserForm/user-form.schema";
|
import {UserSchema, UserType} from "@/components/wrappers/dashboard/Profile/UserForm/user-form.schema";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {updateUserAction} from "@/components/wrappers/Dashboard/Profile/UserForm/user-form.action";
|
import {updateUserAction} from "@/components/wrappers/dashboard/Profile/UserForm/user-form.action";
|
||||||
import { useSession } from "next-auth/react";
|
import { useSession } from "next-auth/react";
|
||||||
|
|
||||||
export type userFormProps = {
|
export type userFormProps = {
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
import {userAction} from "@/safe-actions";
|
import {userAction} from "@/safe-actions";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {UserSchema} from "@/components/wrappers/Dashboard/Profile/UserForm/user-form.schema";
|
import {UserSchema} from "@/components/wrappers/dashboard/Profile/UserForm/user-form.schema";
|
||||||
|
|
||||||
export const updateUserAction = userAction
|
export const updateUserAction = userAction
|
||||||
.schema(
|
.schema(
|
||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import {ButtonWithConfirm} from "@/components/wrappers/Button/ButtonWithConfirm/ButtonWithConfirm";
|
import {ButtonWithConfirm} from "@/components/wrappers/common/button/ButtonWithConfirm/ButtonWithConfirm";
|
||||||
import {Trash2} from "lucide-react";
|
import {Trash2} from "lucide-react";
|
||||||
|
|
||||||
export type ButtonDeleteProjectProps = {
|
export type ButtonDeleteProjectProps = {
|
||||||
+2
-2
@@ -14,11 +14,11 @@ import {Input} from "@/components/ui/input";
|
|||||||
import {Form} from "@/components/ui/form"
|
import {Form} from "@/components/ui/form"
|
||||||
import {Button} from "@/components/ui/button";
|
import {Button} from "@/components/ui/button";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {ProjectSchema, ProjectType} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm.schema";
|
import {ProjectSchema, ProjectType} from "@/components/wrappers/dashboard/Projects/ProjectsForm/ProjectForm.schema";
|
||||||
import {
|
import {
|
||||||
createProjectAction,
|
createProjectAction,
|
||||||
updateProjectAction
|
updateProjectAction
|
||||||
} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/project-form.action";
|
} from "@/components/wrappers/dashboard/Projects/ProjectsForm/project-form.action";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {Database, Organization, Projects} from "@prisma/client"
|
import {Database, Organization, Projects} from "@prisma/client"
|
||||||
import {MultiSelect} from "@/components/wrappers/MultiSelect/MultiSelect";
|
import {MultiSelect} from "@/components/wrappers/MultiSelect/MultiSelect";
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import {userAction} from "@/safe-actions";
|
import {userAction} from "@/safe-actions";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {ProjectSchema} from "@/components/wrappers/Dashboard/Projects/ProjectsForm/ProjectForm.schema";
|
import {ProjectSchema} from "@/components/wrappers/dashboard/Projects/ProjectsForm/ProjectForm.schema";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {ServerActionResult} from "@/types/action-type";
|
import {ServerActionResult} from "@/types/action-type";
|
||||||
import {Projects} from "@prisma/client";
|
import {Projects} from "@prisma/client";
|
||||||
+4
-4
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
|
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
|
||||||
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
||||||
import {usersColumns} from "@/components/wrappers/Dashboard/Settings/SettingsUsersTab/columns-users";
|
import {usersColumns} from "@/components/wrappers/dashboard/Settings/SettingsUsersTab/columns-users";
|
||||||
import {User, Settings} from "@prisma/client";
|
import {User, Settings} from "@prisma/client";
|
||||||
import {backupColumns} from "@/features/backup/columns";
|
import {backupColumns} from "@/features/backup/columns";
|
||||||
import {SettingsEmailTab} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/SettingsEmailTab";
|
import {SettingsEmailTab} from "@/components/wrappers/dashboard/admin/AdminEmailTab/SettingsEmailTab";
|
||||||
import {SettingsStorageTab} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/SettingsStorageTab";
|
import {SettingsStorageTab} from "@/components/wrappers/dashboard/admin/AdminStorageTab/SettingsStorageTab";
|
||||||
import {SettingsUsersTab} from "@/components/wrappers/Dashboard/Settings/SettingsUsersTab/SettingsUsersTab";
|
import {SettingsUsersTab} from "@/components/wrappers/dashboard/Settings/SettingsUsersTab/SettingsUsersTab";
|
||||||
|
|
||||||
|
|
||||||
export type SettingsTabsProps = {
|
export type SettingsTabsProps = {
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import {User} from "@prisma/client";
|
import {User} from "@prisma/client";
|
||||||
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
||||||
import {usersColumns} from "@/components/wrappers/Dashboard/Settings/SettingsUsersTab/columns-users";
|
import {usersColumns} from "@/components/wrappers/dashboard/Settings/SettingsUsersTab/columns-users";
|
||||||
import {UsersDataTable} from "@/components/wrappers/Dashboard/admin/admin-user-table";
|
import {UsersDataTable} from "@/components/wrappers/dashboard/admin/admin-user-table";
|
||||||
|
|
||||||
|
|
||||||
export type SettingsUsersTabProps = {
|
export type SettingsUsersTabProps = {
|
||||||
+3
-3
@@ -3,14 +3,14 @@
|
|||||||
import {ColumnDef} from "@tanstack/react-table"
|
import {ColumnDef} from "@tanstack/react-table"
|
||||||
import {Badge} from "@/components/ui/badge";
|
import {Badge} from "@/components/ui/badge";
|
||||||
import {User} from "@prisma/client";
|
import {User} from "@prisma/client";
|
||||||
import {updateUserAction} from "@/components/wrappers/Dashboard/Profile/UserForm/user-form.action";
|
import {updateUserAction} from "@/components/wrappers/dashboard/Profile/UserForm/user-form.action";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {Trash2} from "lucide-react";
|
import {Trash2} from "lucide-react";
|
||||||
import {deleteUserAction} from "@/components/wrappers/Dashboard/Profile/ButtonDeleteAccount/delete-account.action";
|
import {deleteUserAction} from "@/components/wrappers/dashboard/Profile/ButtonDeleteAccount/delete-account.action";
|
||||||
import {ButtonWithLoading} from "@/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading";
|
import {ButtonWithLoading} from "@/components/wrappers/common/button/ButtonWithLoading/ButtonWithLoading";
|
||||||
|
|
||||||
export const usersColumns: ColumnDef<User>[] = [
|
export const usersColumns: ColumnDef<User>[] = [
|
||||||
{
|
{
|
||||||
+1
-6
@@ -5,7 +5,7 @@ import Link from "next/link";
|
|||||||
import {SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem} from "@/components/ui/sidebar";
|
import {SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem} from "@/components/ui/sidebar";
|
||||||
import {cn} from "@/lib/utils";
|
import {cn} from "@/lib/utils";
|
||||||
import {buttonVariants} from "@/components/ui/button";
|
import {buttonVariants} from "@/components/ui/button";
|
||||||
import {ChartArea, FolderKanban, Home, Layers, Settings, ShieldHalf} from "lucide-react";
|
import {ChartArea, Layers, Settings, ShieldHalf} from "lucide-react";
|
||||||
import {usePathname} from "next/navigation";
|
import {usePathname} from "next/navigation";
|
||||||
|
|
||||||
export type SidebarMenuCustomProps = {}
|
export type SidebarMenuCustomProps = {}
|
||||||
@@ -16,11 +16,6 @@ export const SidebarMenuCustom = (props: SidebarMenuCustomProps) => {
|
|||||||
const pathname = usePathname();
|
const pathname = usePathname();
|
||||||
// Menu items.
|
// Menu items.
|
||||||
const items = [
|
const items = [
|
||||||
// {
|
|
||||||
// title: "Home",
|
|
||||||
// url: "/",
|
|
||||||
// icon: Home,
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
title: "Projects",
|
title: "Projects",
|
||||||
url: "projects",
|
url: "projects",
|
||||||
+4
-4
@@ -6,9 +6,9 @@ import {
|
|||||||
SidebarMenu, SidebarMenuButton,
|
SidebarMenu, SidebarMenuButton,
|
||||||
SidebarMenuItem,
|
SidebarMenuItem,
|
||||||
} from "@/components/ui/sidebar"
|
} from "@/components/ui/sidebar"
|
||||||
import {LoggedInButton} from "@/components/wrappers/Dashboard/LoggedInButton/LoggedInButton";
|
import {LoggedInButton} from "@/components/wrappers/dashboard/LoggedInButton/LoggedInButton";
|
||||||
import {SidebarMenuCustom} from "@/components/wrappers/Dashboard/SideBar/SideBarMenu/SideBarMenu";
|
import {SidebarMenuCustom} from "@/components/wrappers/dashboard/SideBar/SideBarMenu/SideBarMenu";
|
||||||
import {OrganizationComboBox} from "@/components/wrappers/Organization/OrganizationCombobox";
|
import {OrganizationCombobox} from "@/components/wrappers/dashboard/Organization/organization-combobox";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {requiredCurrentUser} from "@/auth/current-user";
|
import {requiredCurrentUser} from "@/auth/current-user";
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ export async function AppSidebar() {
|
|||||||
</div>
|
</div>
|
||||||
<SidebarMenu>
|
<SidebarMenu>
|
||||||
<SidebarMenuItem>
|
<SidebarMenuItem>
|
||||||
<OrganizationComboBox
|
<OrganizationCombobox
|
||||||
organizations={organizations}
|
organizations={organizations}
|
||||||
defaultOrganization={defaultOrganization}
|
defaultOrganization={defaultOrganization}
|
||||||
/>
|
/>
|
||||||
+3
-3
@@ -13,12 +13,12 @@ import {TooltipProvider} from "@/components/ui/tooltip";
|
|||||||
import {
|
import {
|
||||||
EmailFormSchema,
|
EmailFormSchema,
|
||||||
EmailFormType
|
EmailFormType
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
} from "@/components/wrappers/dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import {PasswordInput} from "@/components/wrappers/Auth/PaswordInput/password-input";
|
import {PasswordInput} from "@/components/wrappers/auth/PaswordInput/password-input";
|
||||||
import {
|
import {
|
||||||
updateEmailSettingsAction
|
updateEmailSettingsAction
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/EmailForm/email-form.action";
|
} from "@/components/wrappers/dashboard/admin/AdminEmailTab/EmailForm/email-form.action";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
|
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
import {userAction} from "@/safe-actions";
|
import {userAction} from "@/safe-actions";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {EmailFormSchema} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
import {EmailFormSchema} from "@/components/wrappers/dashboard/admin/AdminEmailTab/EmailForm/email-form.schema";
|
||||||
|
|
||||||
|
|
||||||
export const updateEmailSettingsAction = userAction
|
export const updateEmailSettingsAction = userAction
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
import {EmailForm} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/EmailForm/EmailForm";
|
import {EmailForm} from "@/components/wrappers/dashboard/admin/AdminEmailTab/EmailForm/EmailForm";
|
||||||
import {Settings} from "@prisma/client";
|
import {Settings} from "@prisma/client";
|
||||||
import {Send} from "lucide-react";
|
import {Send} from "lucide-react";
|
||||||
import {ButtonWithLoading} from "@/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading";
|
import {ButtonWithLoading} from "@/components/wrappers/common/button/ButtonWithLoading/ButtonWithLoading";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {sendEmail} from "@/utils/email-helper";
|
import {sendEmail} from "@/utils/email-helper";
|
||||||
import TestEmailSettings from "../../../../../../emails/TestEmailSettings";
|
import TestEmailSettings from "../../../../../../emails/TestEmailSettings";
|
||||||
+4
-4
@@ -2,18 +2,18 @@ import {Alert, AlertDescription, AlertTitle} from "@/components/ui/alert";
|
|||||||
import {Info, Send, ShieldCheck} from "lucide-react";
|
import {Info, Send, ShieldCheck} from "lucide-react";
|
||||||
import {Switch} from "@/components/ui/switch";
|
import {Switch} from "@/components/ui/switch";
|
||||||
import {Label} from "@/components/ui/label";
|
import {Label} from "@/components/ui/label";
|
||||||
import {StorageS3Form} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/StorageS3Form";
|
import {StorageS3Form} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/StorageS3Form";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {Settings} from "@prisma/client";
|
import {Settings} from "@prisma/client";
|
||||||
import {ButtonWithLoading} from "@/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading";
|
import {ButtonWithLoading} from "@/components/wrappers/common/button/ButtonWithLoading/ButtonWithLoading";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {checkConnexionToS3} from "@/features/upload/public/upload.action";
|
import {checkConnexionToS3} from "@/features/upload/public/upload.action";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {updateUserAction} from "@/components/wrappers/Dashboard/Profile/UserForm/user-form.action";
|
import {updateUserAction} from "@/components/wrappers/dashboard/Profile/UserForm/user-form.action";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {
|
import {
|
||||||
updateStorageSettingsAction
|
updateStorageSettingsAction
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
||||||
|
|
||||||
|
|
||||||
export type SettingsStorageTabProps = {
|
export type SettingsStorageTabProps = {
|
||||||
+2
-2
@@ -13,12 +13,12 @@ import {TooltipProvider} from "@/components/ui/tooltip";
|
|||||||
import {
|
import {
|
||||||
S3FormSchema,
|
S3FormSchema,
|
||||||
S3FormType
|
S3FormType
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.schema";
|
} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.schema";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {
|
import {
|
||||||
updateS3SettingsAction
|
updateS3SettingsAction
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
||||||
|
|
||||||
export type S3FormProps = {
|
export type S3FormProps = {
|
||||||
defaultValues?: S3FormType;
|
defaultValues?: S3FormType;
|
||||||
+1
-1
@@ -5,7 +5,7 @@ import {prisma} from "@/prisma";
|
|||||||
import {
|
import {
|
||||||
S3FormSchema,
|
S3FormSchema,
|
||||||
StorageSwitchSchema
|
StorageSwitchSchema
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.schema";
|
} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.schema";
|
||||||
|
|
||||||
|
|
||||||
export const updateS3SettingsAction = userAction
|
export const updateS3SettingsAction = userAction
|
||||||
+3
-3
@@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
import {User, Settings} from "@prisma/client";
|
import {User, Settings} from "@prisma/client";
|
||||||
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
|
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs";
|
||||||
import {SettingsEmailTab} from "@/components/wrappers/Dashboard/admin/AdminEmailTab/SettingsEmailTab";
|
import {SettingsEmailTab} from "@/components/wrappers/dashboard/admin/AdminEmailTab/SettingsEmailTab";
|
||||||
import {SettingsStorageTab} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/SettingsStorageTab";
|
import {SettingsStorageTab} from "@/components/wrappers/dashboard/admin/AdminStorageTab/SettingsStorageTab";
|
||||||
import {AdminUsersTable} from "@/components/wrappers/Dashboard/admin/admin-user-table";
|
import {AdminUsersTable} from "@/components/wrappers/dashboard/admin/admin-user-table";
|
||||||
|
|
||||||
|
|
||||||
export type AdminTabsProps = {
|
export type AdminTabsProps = {
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import {flexRender, Row, RowData} from "@tanstack/react-table";
|
|||||||
|
|
||||||
import {User} from "@prisma/client";
|
import {User} from "@prisma/client";
|
||||||
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
import {DataTableWithPagination} from "@/components/wrappers/table/data-table-with-pagination";
|
||||||
import {usersColumns} from "@/components/wrappers/Dashboard/Settings/SettingsUsersTab/columns-users";
|
import {usersColumns} from "@/components/wrappers/dashboard/Settings/SettingsUsersTab/columns-users";
|
||||||
import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow} from "@/components/ui/table";
|
import {Table, TableBody, TableCell, TableHead, TableHeader, TableRow} from "@/components/ui/table";
|
||||||
import {cn} from "@/lib/utils";
|
import {cn} from "@/lib/utils";
|
||||||
|
|
||||||
+2
-2
@@ -10,9 +10,9 @@ import {Button} from "@/components/ui/button";
|
|||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {TooltipProvider} from "@/components/ui/tooltip";
|
import {TooltipProvider} from "@/components/ui/tooltip";
|
||||||
import {AgentSchema, AgentType} from "@/components/wrappers/Agent/AgentForm/agent-form.schema";
|
import {AgentSchema, AgentType} from "@/components/wrappers/dashboard/agent/AgentForm/agent-form.schema";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {createAgentAction, updateAgentAction} from "@/components/wrappers/Agent/AgentForm/agent-form.action";
|
import {createAgentAction, updateAgentAction} from "@/components/wrappers/dashboard/agent/AgentForm/agent-form.action";
|
||||||
|
|
||||||
export type agentFormProps = {
|
export type agentFormProps = {
|
||||||
defaultValues?: AgentType;
|
defaultValues?: AgentType;
|
||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
"use server"
|
"use server"
|
||||||
import {ActionError, userAction} from "@/safe-actions";
|
import {ActionError, userAction} from "@/safe-actions";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {AgentSchema} from "@/components/wrappers/Agent/AgentForm/agent-form.schema";
|
import {AgentSchema} from "@/components/wrappers/dashboard/agent/AgentForm/agent-form.schema";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
|
||||||
|
|
||||||
+1
-1
@@ -14,7 +14,7 @@ import {CodeSnippet} from "@/components/wrappers/CodeSnippet/CodeSnippet";
|
|||||||
import {generateEdgeKey} from "@/utils/edge_key";
|
import {generateEdgeKey} from "@/utils/edge_key";
|
||||||
import {Copy} from "lucide-react";
|
import {Copy} from "lucide-react";
|
||||||
import {PropsWithChildren, useState} from "react";
|
import {PropsWithChildren, useState} from "react";
|
||||||
import {CopyButton} from "@/components/wrappers/copy-button";
|
import {CopyButton} from "@/components/wrappers/common/button/copy-button";
|
||||||
import {Agent} from "@prisma/client";
|
import {Agent} from "@prisma/client";
|
||||||
import {getServerUrl} from "@/utils/get-server-url";
|
import {getServerUrl} from "@/utils/get-server-url";
|
||||||
|
|
||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
"use server"
|
"use server"
|
||||||
import {userAction} from "@/safe-actions";
|
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
|
|
||||||
|
import {userAction} from "@/safe-actions";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {ServerActionResult} from "@/types/action-type";
|
import {ServerActionResult} from "@/types/action-type";
|
||||||
import {Backup} from "@prisma/client";
|
import {Backup} from "@prisma/client";
|
||||||
+7
-4
@@ -1,9 +1,12 @@
|
|||||||
"use client"
|
"use client"
|
||||||
import {useMutation} from "@tanstack/react-query";
|
|
||||||
import {backupButtonAction} from "@/components/wrappers/BackupButton/backup-button.action";
|
|
||||||
import {toast} from "sonner";
|
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {ButtonWithLoading} from "@/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading";
|
|
||||||
|
import {useMutation} from "@tanstack/react-query";
|
||||||
|
import {toast} from "sonner";
|
||||||
|
|
||||||
|
import {backupButtonAction} from "@/components/wrappers/dashboard/backup/backup-button/backup-button.action";
|
||||||
|
import {ButtonWithLoading} from "@/components/wrappers/common/button/ButtonWithLoading/ButtonWithLoading";
|
||||||
|
|
||||||
export type BackupButtonProps = {
|
export type BackupButtonProps = {
|
||||||
databaseId: string
|
databaseId: string
|
||||||
+3
-3
@@ -9,7 +9,7 @@ import {
|
|||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger
|
DialogTrigger
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import {CronInput} from "@/components/wrappers/Database/CronButton/CronInput";
|
import {CronInput} from "@/components/wrappers/dashboard/database/CronButton/CronInput";
|
||||||
import {Switch} from "@/components/ui/switch";
|
import {Switch} from "@/components/ui/switch";
|
||||||
import {Label} from "@/components/ui/label"
|
import {Label} from "@/components/ui/label"
|
||||||
import {Separator} from "@/components/ui/separator";
|
import {Separator} from "@/components/ui/separator";
|
||||||
@@ -17,14 +17,14 @@ import {useState} from "react";
|
|||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
updateStorageSettingsAction
|
updateStorageSettingsAction
|
||||||
} from "@/components/wrappers/Dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
} from "@/components/wrappers/dashboard/admin/AdminStorageTab/StorageS3Form/s3-form.action";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {Database} from "@prisma/client";
|
import {Database} from "@prisma/client";
|
||||||
import {
|
import {
|
||||||
updateBackupPolicyAction,
|
updateBackupPolicyAction,
|
||||||
updateDatabaseBackupPolicyAction
|
updateDatabaseBackupPolicyAction
|
||||||
} from "@/components/wrappers/Database/CronButton/cron.action";
|
} from "@/components/wrappers/dashboard/database/CronButton/cron.action";
|
||||||
|
|
||||||
|
|
||||||
export type CronButtonProps = {
|
export type CronButtonProps = {
|
||||||
+1
-1
@@ -2,7 +2,7 @@ import { AdvancedCronSelect } from "./AdvancedCronSelect";
|
|||||||
import {
|
import {
|
||||||
updateBackupPolicyAction,
|
updateBackupPolicyAction,
|
||||||
updateDatabaseBackupPolicyAction
|
updateDatabaseBackupPolicyAction
|
||||||
} from "@/components/wrappers/Database/CronButton/cron.action";
|
} from "@/components/wrappers/dashboard/database/CronButton/cron.action";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {useState} from "react";
|
import {useState} from "react";
|
||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
+2
-2
@@ -16,8 +16,8 @@ import {Button} from "@/components/ui/button";
|
|||||||
import {useRouter} from "next/navigation";
|
import {useRouter} from "next/navigation";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {TooltipProvider} from "@/components/ui/tooltip";
|
import {TooltipProvider} from "@/components/ui/tooltip";
|
||||||
import {DatabaseSchema, DatabaseType} from "@/components/wrappers/Database/DatabaseForm/form-database.schema";
|
import {DatabaseSchema, DatabaseType} from "@/components/wrappers/dashboard/database/DatabaseForm/form-database.schema";
|
||||||
import {updateDatabaseAction} from "@/components/wrappers/Database/DatabaseForm/form-database.action";
|
import {updateDatabaseAction} from "@/components/wrappers/dashboard/database/DatabaseForm/form-database.action";
|
||||||
import {toast} from "sonner";
|
import {toast} from "sonner";
|
||||||
|
|
||||||
export type DatabaseFormProps = {
|
export type DatabaseFormProps = {
|
||||||
+1
-1
@@ -4,7 +4,7 @@ import {z} from "zod";
|
|||||||
|
|
||||||
import {userAction} from "@/safe-actions";
|
import {userAction} from "@/safe-actions";
|
||||||
import {prisma} from "@/prisma";
|
import {prisma} from "@/prisma";
|
||||||
import {DatabaseSchema} from "@/components/wrappers/Database/DatabaseForm/form-database.schema";
|
import {DatabaseSchema} from "@/components/wrappers/dashboard/database/DatabaseForm/form-database.schema";
|
||||||
|
|
||||||
|
|
||||||
export const updateDatabaseAction = userAction
|
export const updateDatabaseAction = userAction
|
||||||
+2
-2
@@ -14,10 +14,10 @@ import {
|
|||||||
useZodForm
|
useZodForm
|
||||||
} from "@/components/ui/form";
|
} from "@/components/ui/form";
|
||||||
import {Input} from "@/components/ui/input";
|
import {Input} from "@/components/ui/input";
|
||||||
import {RestoreSchema} from "@/components/wrappers/Database/restore-form.schema";
|
import {RestoreSchema} from "@/components/wrappers/dashboard/database/restore-form.schema";
|
||||||
import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select";
|
import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select";
|
||||||
import {useMutation} from "@tanstack/react-query";
|
import {useMutation} from "@tanstack/react-query";
|
||||||
import {ComboBox, ComboBoxFormItem} from "@/components/wrappers/combobox";
|
import {ComboBox, ComboBoxFormItem} from "@/components/wrappers/common/combobox";
|
||||||
import {Label} from "@/components/ui/label";
|
import {Label} from "@/components/ui/label";
|
||||||
|
|
||||||
export type restoreFormProps = {
|
export type restoreFormProps = {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import {notFound} from "next/navigation";
|
import {notFound} from "next/navigation";
|
||||||
|
|
||||||
import {currentUser} from "@/auth/current-user";
|
import {currentUser} from "@/auth/current-user";
|
||||||
import {LoggedInButton} from "@/components/wrappers/Dashboard/LoggedInButton/LoggedInButton";
|
import {LoggedInButton} from "@/components/wrappers/dashboard/LoggedInButton/LoggedInButton";
|
||||||
import {SidebarTrigger} from "@/components/ui/sidebar";
|
import {SidebarTrigger} from "@/components/ui/sidebar";
|
||||||
import {ModeToggle} from "@/features/theme/ModeToggle";
|
import {ModeToggle} from "@/features/theme/ModeToggle";
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use server"
|
"use server"
|
||||||
|
|
||||||
import {mkdir, writeFile} from "fs/promises";
|
import {mkdir, writeFile} from "fs/promises";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
import * as fs from "node:fs";
|
import * as fs from "node:fs";
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
"use server"
|
"use server"
|
||||||
|
|
||||||
import {userAction} from "@/safe-actions";
|
import {userAction} from "@/safe-actions";
|
||||||
import {z} from "zod";
|
import {z} from "zod";
|
||||||
import {v4 as uuidv4} from 'uuid';
|
import {v4 as uuidv4} from 'uuid';
|
||||||
|
|||||||
@@ -6,6 +6,5 @@ export const isValidCronPart = (type: string, value: string): boolean => {
|
|||||||
month: /^(\*|([1-9]|1[0-2])|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
|
month: /^(\*|([1-9]|1[0-2])|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
|
||||||
"day-of-week": /^(\*|[0-6]|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
|
"day-of-week": /^(\*|[0-6]|(\d+(,\d+)*|(\d+-\d+)|(\*\/\d+)))$/,
|
||||||
};
|
};
|
||||||
|
|
||||||
return regexMap[type]?.test(value) ?? false;
|
return regexMap[type]?.test(value) ?? false;
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user