kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
pull/715/head
rodzic
4a6525a784
commit
01b8063d68
|
@ -2,3 +2,4 @@
|
||||||
|
|
||||||
- better auth error handling
|
- better auth error handling
|
||||||
- display validation errors in auth forms
|
- display validation errors in auth forms
|
||||||
|
- race condition on login; sometimes doesn't actually login
|
||||||
|
|
|
@ -5,81 +5,79 @@ import styles from './styles.module.css'
|
||||||
export default function AboutPage() {
|
export default function AboutPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section>
|
<section className={cn('prose dark:prose-invert', styles.markdown)}>
|
||||||
<h1>About</h1>
|
<h1>About</h1>
|
||||||
|
|
||||||
<div className={cn('prose dark:prose-invert', styles.markdown)}>
|
<h2>Our Mission</h2>
|
||||||
<h2>Our Mission</h2>
|
<p>
|
||||||
<p>
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
||||||
eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
<b>Ut enim ad minim veniam</b>, quis nostrud exercitation ullamco
|
||||||
<b>Ut enim ad minim veniam</b>, quis nostrud exercitation ullamco
|
laboris nisi ut aliquip ex ea commodo consequat.
|
||||||
laboris nisi ut aliquip ex ea commodo consequat.
|
</p>
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Our Story</h2>
|
<h2>Our Story</h2>
|
||||||
<p>
|
<p>
|
||||||
Duis aute irure dolor in reprehenderit in voluptate velit esse
|
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
|
||||||
cillum dolore eu fugiat nulla pariatur.
|
dolore eu fugiat nulla pariatur.
|
||||||
<em>Excepteur sint occaecat cupidatat non proident</em>, sunt in
|
<em>Excepteur sint occaecat cupidatat non proident</em>, sunt in culpa
|
||||||
culpa qui officia deserunt mollit anim id est laborum.
|
qui officia deserunt mollit anim id est laborum.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Values</h2>
|
<h2>Our Values</h2>
|
||||||
<p>
|
<p>
|
||||||
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
|
Sed ut perspiciatis unde omnis iste natus error sit voluptatem
|
||||||
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa
|
accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae
|
||||||
quae ab illo inventore veritatis et quasi architecto beatae vitae
|
ab illo inventore veritatis et quasi architecto beatae vitae dicta
|
||||||
dicta sunt explicabo.
|
sunt explicabo.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Team</h2>
|
<h2>Our Team</h2>
|
||||||
<p>
|
<p>
|
||||||
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut
|
Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut
|
||||||
fugit, sed quia consequuntur magni dolores eos qui ratione
|
fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem
|
||||||
voluptatem sequi nesciunt.
|
sequi nesciunt.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Technology</h2>
|
<h2>Our Technology</h2>
|
||||||
<p>
|
<p>
|
||||||
At vero eos et accusamus et iusto odio dignissimos ducimus qui
|
At vero eos et accusamus et iusto odio dignissimos ducimus qui
|
||||||
blanditiis praesentium voluptatum deleniti atque corrupti quos
|
blanditiis praesentium voluptatum deleniti atque corrupti quos dolores
|
||||||
dolores et quas molestias <b>excepturi sint occaecati</b> cupiditate
|
et quas molestias <b>excepturi sint occaecati</b> cupiditate non
|
||||||
non provident.
|
provident.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Impact</h2>
|
<h2>Our Impact</h2>
|
||||||
<p>
|
<p>
|
||||||
Similique sunt in culpa qui officia deserunt mollitia animi, id est
|
Similique sunt in culpa qui officia deserunt mollitia animi, id est
|
||||||
laborum et dolorum fuga.
|
laborum et dolorum fuga.
|
||||||
<em>Et harum quidem rerum facilis est et expedita distinctio</em>.
|
<em>Et harum quidem rerum facilis est et expedita distinctio</em>. Nam
|
||||||
Nam libero tempore, cum soluta nobis est eligendi optio.
|
libero tempore, cum soluta nobis est eligendi optio.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Future</h2>
|
<h2>Our Future</h2>
|
||||||
<p>
|
<p>
|
||||||
Temporibus autem quibusdam et aut officiis debitis aut rerum
|
Temporibus autem quibusdam et aut officiis debitis aut rerum
|
||||||
necessitatibus saepe eveniet ut et voluptates repudiandae sint et
|
necessitatibus saepe eveniet ut et voluptates repudiandae sint et
|
||||||
molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente
|
molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente
|
||||||
delectus.
|
delectus.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Community</h2>
|
<h2>Our Community</h2>
|
||||||
<p>
|
<p>
|
||||||
Ut aut reiciendis voluptatibus maiores alias consequatur aut
|
Ut aut reiciendis voluptatibus maiores alias consequatur aut
|
||||||
perferendis doloribus asperiores repellat. Sed ut perspiciatis unde
|
perferendis doloribus asperiores repellat. Sed ut perspiciatis unde
|
||||||
omnis iste natus error sit voluptatem accusantium doloremque
|
omnis iste natus error sit voluptatem accusantium doloremque
|
||||||
laudantium.
|
laudantium.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Our Commitment</h2>
|
<h2>Our Commitment</h2>
|
||||||
<p>
|
<p>
|
||||||
Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse
|
Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse
|
||||||
quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat
|
quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo
|
||||||
quo voluptas nulla pariatur?{' '}
|
voluptas nulla pariatur?{' '}
|
||||||
<b>Excepteur sint occaecat cupidatat non proident</b>.
|
<b>Excepteur sint occaecat cupidatat non proident</b>.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
|
||||||
</section>
|
</section>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|
|
@ -0,0 +1,81 @@
|
||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useQuery } from '@tanstack/react-query'
|
||||||
|
import Link from 'next/link'
|
||||||
|
|
||||||
|
import { useAuthenticatedAgentic } from '@/components/agentic-provider'
|
||||||
|
import { LoadingIndicator } from '@/components/loading-indicator'
|
||||||
|
import { toastError } from '@/lib/notifications'
|
||||||
|
|
||||||
|
export function AppIndex() {
|
||||||
|
const ctx = useAuthenticatedAgentic()
|
||||||
|
const {
|
||||||
|
data: projects,
|
||||||
|
isLoading,
|
||||||
|
isError
|
||||||
|
} = useQuery({
|
||||||
|
queryKey: ['projects'],
|
||||||
|
queryFn: () =>
|
||||||
|
ctx?.api
|
||||||
|
.listProjects({ populate: ['lastPublishedDeployment'] })
|
||||||
|
.catch((err: any) => {
|
||||||
|
void toastError(err, { label: 'Failed to fetch projects' })
|
||||||
|
throw err
|
||||||
|
}),
|
||||||
|
enabled: !!ctx
|
||||||
|
})
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<section>
|
||||||
|
<h1
|
||||||
|
className='text-center text-balance leading-snug md:leading-none
|
||||||
|
text-4xl font-extrabold tracking-tight
|
||||||
|
'
|
||||||
|
>
|
||||||
|
Dashboard
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
{!ctx || isLoading ? (
|
||||||
|
<LoadingIndicator />
|
||||||
|
) : (
|
||||||
|
<div className='mt-8'>
|
||||||
|
<h2 className='text-xl font-semibold mb-4'>Your Projects</h2>
|
||||||
|
|
||||||
|
{isError ? (
|
||||||
|
<p>Error fetching projects</p>
|
||||||
|
) : !projects?.length ? (
|
||||||
|
<p>
|
||||||
|
No projects found. Create your first project to get started!
|
||||||
|
</p>
|
||||||
|
) : (
|
||||||
|
<div className='grid gap-4'>
|
||||||
|
{projects.map((project) => (
|
||||||
|
<Link
|
||||||
|
key={project.id}
|
||||||
|
className='p-4 border rounded-lg hover:border-gray-400 transition-colors'
|
||||||
|
href={`/app/projects/${project.identifier}`}
|
||||||
|
>
|
||||||
|
<h3 className='font-medium'>{project.name}</h3>
|
||||||
|
|
||||||
|
<p className='text-sm text-gray-500'>
|
||||||
|
{project.identifier}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
{project.lastPublishedDeployment && (
|
||||||
|
<p className='text-sm text-gray-500 mt-1'>
|
||||||
|
Last published:{' '}
|
||||||
|
{project.lastPublishedDeployment.version ||
|
||||||
|
project.lastPublishedDeployment.hash}
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</Link>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</section>
|
||||||
|
</>
|
||||||
|
)
|
||||||
|
}
|
|
@ -1,71 +1,5 @@
|
||||||
'use client'
|
import { AppIndex } from './app-index'
|
||||||
|
|
||||||
import { useQuery } from '@tanstack/react-query'
|
|
||||||
import Link from 'next/link'
|
|
||||||
|
|
||||||
import { useAuthenticatedAgentic } from '@/components/agentic-provider'
|
|
||||||
import { LoadingIndicator } from '@/components/loading-indicator'
|
|
||||||
|
|
||||||
export default function AppIndexPage() {
|
export default function AppIndexPage() {
|
||||||
const ctx = useAuthenticatedAgentic()
|
return <AppIndex />
|
||||||
const { data: projects, isLoading } = useQuery({
|
|
||||||
queryKey: ['projects'],
|
|
||||||
queryFn: () =>
|
|
||||||
ctx?.api
|
|
||||||
.listProjects({ populate: ['lastPublishedDeployment'] })
|
|
||||||
.catch(() => []),
|
|
||||||
enabled: !!ctx
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<section>
|
|
||||||
<h1
|
|
||||||
className='text-center text-balance leading-snug md:leading-none
|
|
||||||
text-4xl font-extrabold tracking-tight
|
|
||||||
'
|
|
||||||
>
|
|
||||||
Dashboard
|
|
||||||
</h1>
|
|
||||||
|
|
||||||
{!ctx || isLoading ? (
|
|
||||||
<LoadingIndicator />
|
|
||||||
) : (
|
|
||||||
<div className='mt-8'>
|
|
||||||
<h2 className='text-xl font-semibold mb-4'>Your Projects</h2>
|
|
||||||
|
|
||||||
{!projects?.length ? (
|
|
||||||
<p>
|
|
||||||
No projects found. Create your first project to get started!
|
|
||||||
</p>
|
|
||||||
) : (
|
|
||||||
<div className='grid gap-4'>
|
|
||||||
{projects?.map((project) => (
|
|
||||||
<Link
|
|
||||||
key={project.id}
|
|
||||||
className='p-4 border rounded-lg hover:border-gray-400 transition-colors'
|
|
||||||
href={`/app/projects/${project.identifier}`}
|
|
||||||
>
|
|
||||||
<h3 className='font-medium'>{project.name}</h3>
|
|
||||||
|
|
||||||
<p className='text-sm text-gray-500'>
|
|
||||||
{project.identifier}
|
|
||||||
</p>
|
|
||||||
|
|
||||||
{project.lastPublishedDeployment && (
|
|
||||||
<p className='text-sm text-gray-500 mt-1'>
|
|
||||||
Last published:{' '}
|
|
||||||
{project.lastPublishedDeployment.version ||
|
|
||||||
project.lastPublishedDeployment.hash}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
</Link>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</section>
|
|
||||||
</>
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,18 @@ import { useAuthenticatedAgentic } from '@/components/agentic-provider'
|
||||||
import { LoadingIndicator } from '@/components/loading-indicator'
|
import { LoadingIndicator } from '@/components/loading-indicator'
|
||||||
import { toastError } from '@/lib/notifications'
|
import { toastError } from '@/lib/notifications'
|
||||||
|
|
||||||
export default function ProjectIndex({
|
export function AppProjectIndex({
|
||||||
projectIdentifier
|
projectIdentifier
|
||||||
}: {
|
}: {
|
||||||
projectIdentifier: string
|
projectIdentifier: string
|
||||||
}) {
|
}) {
|
||||||
const ctx = useAuthenticatedAgentic()
|
const ctx = useAuthenticatedAgentic()
|
||||||
const { data: project, isLoading } = useQuery({
|
const {
|
||||||
queryKey: [`project:${projectIdentifier}`],
|
data: project,
|
||||||
|
isLoading,
|
||||||
|
isError
|
||||||
|
} = useQuery({
|
||||||
|
queryKey: ['project', projectIdentifier],
|
||||||
queryFn: () =>
|
queryFn: () =>
|
||||||
ctx?.api
|
ctx?.api
|
||||||
.getProjectByIdentifier({
|
.getProjectByIdentifier({
|
||||||
|
@ -32,8 +36,12 @@ export default function ProjectIndex({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
{!ctx || !project || isLoading ? (
|
{!ctx || isLoading ? (
|
||||||
<LoadingIndicator />
|
<LoadingIndicator />
|
||||||
|
) : isError ? (
|
||||||
|
<p>Error fetching project</p>
|
||||||
|
) : !project ? (
|
||||||
|
<p>Project "{projectIdentifier}" not found</p>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<h1
|
<h1
|
|
@ -3,7 +3,7 @@ import { notFound } from 'next/navigation'
|
||||||
|
|
||||||
import { toastError } from '@/lib/notifications'
|
import { toastError } from '@/lib/notifications'
|
||||||
|
|
||||||
import ProjectIndex from './project-index'
|
import { AppProjectIndex } from './app-project-index'
|
||||||
|
|
||||||
export default async function AppProjectIndexPage({
|
export default async function AppProjectIndexPage({
|
||||||
params
|
params
|
||||||
|
@ -26,7 +26,7 @@ export default async function AppProjectIndexPage({
|
||||||
{ strict: true }
|
{ strict: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
return <ProjectIndex projectIdentifier={projectIdentifier} />
|
return <AppProjectIndex projectIdentifier={projectIdentifier} />
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
void toastError(err, { label: 'Invalid project identifier' })
|
void toastError(err, { label: 'Invalid project identifier' })
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,11 @@ export default function IndexPage() {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section>
|
<section>
|
||||||
<h1 className='my-0! text-center text-balance leading-snug md:leading-none'>
|
<h1 className='my-0! text-center text-balance leading-snug md:leading-none text-4xl font-extrabold tracking-tight'>
|
||||||
Agentic MCP Gateway
|
Agentic MCP Gateway
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<h5 className='my-8! text-center text-balance'>
|
<h5 className='my-8! text-center text-balance text-lg'>
|
||||||
An API gateway built exclusively for AI agents.
|
An API gateway built exclusively for AI agents.
|
||||||
</h5>
|
</h5>
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ export default function IndexPage() {
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className='flex-1'>
|
<section className='flex-1'>
|
||||||
<h2 className='text-center text-balance'>How it works</h2>
|
<h2 className='text-center text-balance text-lg'>How it works</h2>
|
||||||
|
|
||||||
<div>TODO</div>
|
<div>TODO</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
Ładowanie…
Reference in New Issue