import getConfig from 'next/config'; import styles from './index.module.css'; import { CKAN } from '@portaljs/ckan'; const backend_url = getConfig().publicRuntimeConfig.DMS const formatter = new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric', second: 'numeric', timeZone: 'UTC', }); export async function getServerSideProps() { const ckan = new CKAN(backend_url) const { datasets } = await ckan.packageSearch({ limit: 1000, offset: 0, groups:[], orgs: [], tags: []}) const datasetsWithDetails = await Promise.all(datasets.map(async (dataset) => { const _dataset = await ckan.getDatasetDetails(dataset.name) return _dataset })) return { props: { datasets: datasetsWithDetails } } } export function Index({ datasets }) { return (
Here is a list of all my datasets for easy access and sharing, they are all available in the following{' '} CKAN Instance
| Title | Description | Last updated | |
|---|---|---|---|
| {dataset.title} | {dataset.notes} | {formatter.format( new Date(dataset.metadata_modified) )} | More info |