Skip to content

Commit

Permalink
Display improvements, link to other tools.
Browse files Browse the repository at this point in the history
  • Loading branch information
ctslater committed Oct 18, 2024
1 parent 567a57a commit 1b4a809
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
9 changes: 8 additions & 1 deletion app/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ export default function RootLayout({ children }) {
return (
<html lang="en">
<body className={inter.className}>
<div className="bg-black text-rubin-blue text-2xl p-4 font-bold">Rubin Plot Navigator</div>
<div className="bg-black text-white text-1xl p-2 flex flex-row">
<div className="bg-black text-rubin-blue text-3xl p-2">Rubin Plot Navigator</div>
<ul className="flex flex-row p-2">
<li className="p-2 px-3 text-xl"><a href="/plot-navigator">Plots</a></li>
<li className="p-2 px-3 text-xl"><a href="/plot-navigator/metrics">Metrics</a></li>
<li className="p-2 px-3 text-xl"><a href="/plot-navigator/bokeh">Bokeh</a></li>
</ul>
</div>
{children}
</body>
</html>
Expand Down
35 changes: 23 additions & 12 deletions app/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,55 +11,66 @@ export default async function Collections() {
const summaryRefs = await ListSummaries()

summaryRefs.sort((a,b) => (b.lastModified - a.lastModified))
const officialSummaryRefs = summaryRefs.filter((ref) => ! ref.collection.startsWith("u"))
const userSummaryRefs = summaryRefs.filter((ref) => ref.collection.startsWith("u"))

officialSummaryRefs.sort((a,b) => (b.lastModified - a.lastModified))
userSummaryRefs.sort((a,b) => (b.lastModified - a.lastModified))

const decodeReportFilename = (filename) => {
const uriEncodedCollection = filename.match("report_(.*).json.gz")[1]
return decodeURIComponent(uriEncodedCollection)
}

/*
const reportFilenames = await ListReports()
const reports = reportFilenames.map(decodeReportFilename)
*/

const cellClassNames = "px-2 py-3"

return (
<div>
<h1 className="text-2xl m-5">Collections</h1>
<div className="m-5 border-2 rounded px-2 inline-block" >
<h1 className="text-2xl m-5">Official Collections</h1>
<div className="m-5 border-2 rounded px-2 inline-block my-0" >
<table className="divide-y">
<thead>
<tr>
<td className={cellClassNames}>Collection</td>
<td className={cellClassNames}>Repo</td>
<td className={`text-right ${cellClassNames}`}>Last Updated</td>
</tr>
</thead>
<tbody>
{summaryRefs.map((summary, n) =>
{officialSummaryRefs.map((summary, n) =>
(<tr key={n}><td className={cellClassNames}><Link href={`/collection/${encodeURIComponent(summary.repo)}/${encodeURIComponent(summary.collection)}`}>{summary.collection}</Link></td>
<td className={`${cellClassNames}`}>{summary.repo}</td>
<td className={`text-right ${cellClassNames}`}>{summary.lastModified.toDateString()}</td>
</tr>))}
</tbody>
</table>
</div>

<h1 className="text-2xl m-5">Reports</h1>
<div className="m-5 border-2 rounded" >
<h1 className="text-2xl m-5">User Collections</h1>
<div className="m-5 border-2 rounded px-2 inline-block my-0" >
<table className="divide-y">
<thead>
<tr>
<td className={cellClassNames}>Report</td>
<td className={cellClassNames}>Plots</td>
<td className={cellClassNames}>Last Updated</td>
<td className={cellClassNames}>Collection</td>
<td className={`${cellClassNames}`}>Repo</td>
<td className={`text-right ${cellClassNames}`}>Last Updated</td>
</tr>
</thead>
<tbody>
{reports.map((collection, n) =>
(<tr key={n}><td className={cellClassNames}><Link href={`/collection/${collection}`}>{collection}</Link></td>
<td className={cellClassNames}>4321</td>
<td className={`text-right ${cellClassNames}`}>2024-05-06</td>
{userSummaryRefs.map((summary, n) =>
(<tr key={n}><td className={cellClassNames}><Link href={`/collection/${encodeURIComponent(summary.repo)}/${encodeURIComponent(summary.collection)}`}>{summary.collection}</Link></td>
<td className={`${cellClassNames}`}>{summary.repo}</td>
<td className={`text-right ${cellClassNames}`}>{summary.lastModified.toDateString()}</td>
</tr>))}
</tbody>
</table>
</div>

</div>
)

Expand Down

0 comments on commit 1b4a809

Please sign in to comment.