From fa48ae79a03da66711b3b63db95124c090033738 Mon Sep 17 00:00:00 2001 From: bkellam Date: Tue, 10 Sep 2024 22:38:09 -0700 Subject: [PATCH] use force-dynamic --- src/app/repos/page.tsx | 44 ++++--------------------------- src/app/repos/repositoryTable.tsx | 43 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 39 deletions(-) create mode 100644 src/app/repos/repositoryTable.tsx diff --git a/src/app/repos/page.tsx b/src/app/repos/page.tsx index 742e0160..861385a9 100644 --- a/src/app/repos/page.tsx +++ b/src/app/repos/page.tsx @@ -1,49 +1,15 @@ -"use server"; - -import { NavigationMenu } from "../navigationMenu"; -import { DataTable } from "@/components/ui/data-table"; -import { columns, RepositoryColumnInfo } from "./columns"; -import { listRepositories } from "@/lib/server/searchService"; -import { isServiceError } from "@/lib/utils"; import { Suspense } from "react"; +import { NavigationMenu } from "../navigationMenu"; +import { RepositoryTable } from "./repositoryTable"; + +export const dynamic = 'force-dynamic' export default async function ReposPage() { - const _repos = await listRepositories(); - - if (isServiceError(_repos)) { - return
Error fetching repositories
; - } - const repos = _repos.List.Repos.map((repo): RepositoryColumnInfo => { - return { - name: repo.Repository.Name, - branches: repo.Repository.Branches.map((branch) => { - return { - name: branch.Name, - version: branch.Version, - } - }), - repoSizeBytes: repo.Stats.ContentBytes, - indexSizeBytes: repo.Stats.IndexBytes, - shardCount: repo.Stats.Shards, - lastIndexed: repo.IndexMetadata.IndexTime, - latestCommit: repo.Repository.LatestCommitDate, - indexedFiles: repo.Stats.Documents, - commitUrlTemplate: repo.Repository.CommitURLTemplate, - } - }).sort((a, b) => { - return new Date(b.lastIndexed).getTime() - new Date(a.lastIndexed).getTime(); - }) - return (
Loading...
}> - + ) diff --git a/src/app/repos/repositoryTable.tsx b/src/app/repos/repositoryTable.tsx new file mode 100644 index 00000000..9ff086fb --- /dev/null +++ b/src/app/repos/repositoryTable.tsx @@ -0,0 +1,43 @@ +'use server'; + +import { DataTable } from "@/components/ui/data-table"; +import { columns, RepositoryColumnInfo } from "./columns"; +import { listRepositories } from "@/lib/server/searchService"; +import { isServiceError } from "@/lib/utils"; + +export const RepositoryTable = async () => { + const _repos = await listRepositories(); + + if (isServiceError(_repos)) { + return
Error fetching repositories
; + } + const repos = _repos.List.Repos.map((repo): RepositoryColumnInfo => { + return { + name: repo.Repository.Name, + branches: repo.Repository.Branches.map((branch) => { + return { + name: branch.Name, + version: branch.Version, + } + }), + repoSizeBytes: repo.Stats.ContentBytes, + indexSizeBytes: repo.Stats.IndexBytes, + shardCount: repo.Stats.Shards, + lastIndexed: repo.IndexMetadata.IndexTime, + latestCommit: repo.Repository.LatestCommitDate, + indexedFiles: repo.Stats.Documents, + commitUrlTemplate: repo.Repository.CommitURLTemplate, + } + }).sort((a, b) => { + return new Date(b.lastIndexed).getTime() - new Date(a.lastIndexed).getTime(); + }); + + return ( + + ); +} \ No newline at end of file