mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
working on restore form.
This commit is contained in:
@@ -0,0 +1,51 @@
|
|||||||
|
import {PageParams} from "@/types/next";
|
||||||
|
import {prisma} from "@/prisma";
|
||||||
|
import {AgentCard} from "@/components/wrappers/Agent/AgentCard/AgentCard";
|
||||||
|
import {CardsWithPagination} from "@/components/wrappers/cards-with-pagination";
|
||||||
|
import {Button} from "@/components/ui/button";
|
||||||
|
import Link from 'next/link'
|
||||||
|
import {Page, PageActions, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
|
|
||||||
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|
||||||
|
const projects = await prisma.project.findMany({})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<PageHeader>
|
||||||
|
<PageTitle>
|
||||||
|
Projects
|
||||||
|
</PageTitle>
|
||||||
|
{projects.length > 0 && (
|
||||||
|
<PageActions>
|
||||||
|
<Link href={"/dashboard/projects/new"}>
|
||||||
|
<Button>+ Create Project</Button>
|
||||||
|
</Link>
|
||||||
|
</PageActions>
|
||||||
|
)}
|
||||||
|
|
||||||
|
</PageHeader>
|
||||||
|
|
||||||
|
<PageContent className="mt-10">
|
||||||
|
|
||||||
|
{projects.length > 0 ?
|
||||||
|
<CardsWithPagination
|
||||||
|
data={projects}
|
||||||
|
cardItem={AgentCard}
|
||||||
|
cardsPerPage={4}
|
||||||
|
numberOfColumns={1}
|
||||||
|
/>
|
||||||
|
:
|
||||||
|
<Link
|
||||||
|
href="/dashboard/projects/new"
|
||||||
|
className=" flex item-center justify-center border-2 border-dashed transition-colors border-primary p-8 lg:p-12 w-full rounded-md">
|
||||||
|
Create new Project
|
||||||
|
</Link>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</PageContent>
|
||||||
|
</Page>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
import {PageParams} from "@/types/next";
|
||||||
|
import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page";
|
||||||
|
|
||||||
|
|
||||||
|
export default async function RoutePage(props: PageParams<{}>) {
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<PageHeader>
|
||||||
|
<PageTitle>
|
||||||
|
Create new project
|
||||||
|
</PageTitle>
|
||||||
|
</PageHeader>
|
||||||
|
<PageContent>
|
||||||
|
|
||||||
|
</PageContent>
|
||||||
|
</Page>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -77,6 +77,31 @@ enum Role {
|
|||||||
admin
|
admin
|
||||||
}
|
}
|
||||||
|
|
||||||
|
model Organization {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
slug String @unique
|
||||||
|
name String
|
||||||
|
createdAt DateTime @default(now()) @map("created_at")
|
||||||
|
|
||||||
|
projects Project[]
|
||||||
|
|
||||||
|
@@map("organizations")
|
||||||
|
}
|
||||||
|
|
||||||
|
model Project {
|
||||||
|
id String @id @default(cuid())
|
||||||
|
slug String @unique
|
||||||
|
name String
|
||||||
|
createdAt DateTime @default(now()) @map("created_at")
|
||||||
|
|
||||||
|
organizationId String @map("organization_id")
|
||||||
|
organization Organization @relation(fields: [organizationId], references: [id])
|
||||||
|
|
||||||
|
databases Database[]
|
||||||
|
|
||||||
|
@@map("projects")
|
||||||
|
}
|
||||||
|
|
||||||
model Agent {
|
model Agent {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
slug String @unique
|
slug String @unique
|
||||||
@@ -112,6 +137,9 @@ model Database {
|
|||||||
backups Backup[]
|
backups Backup[]
|
||||||
restaurations Restauration[]
|
restaurations Restauration[]
|
||||||
|
|
||||||
|
projectId String? @map("project_id")
|
||||||
|
project Project? @relation(fields: [projectId], references: [id])
|
||||||
|
|
||||||
@@map("databases")
|
@@map("databases")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user