Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions scripts/fetch-registry-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ import { fileURLToPath } from "url";

const __dirname = dirname(fileURLToPath(import.meta.url));
const OUT = resolve(__dirname, "../static/data/registry-data.json");
const REGISTRY_URL = "https://hive.kubestellar.io/api/registry";
const REGISTRY_URL = "https://hive.hivecommons.dev/api/registry";
const TARGET_ORG = "projectbluefin";
const CACHE_TTL_MS = 24 * 60 * 60 * 1000;
const force = process.argv.includes("--force");

if (!force && existsSync(OUT)) {
const age = Date.now() - statSync(OUT).mtimeMs;
if (age < CACHE_TTL_MS) {
console.log(`fetch-registry-data: cache fresh (${Math.round(age / 60000)}m old), skipping`);
console.log(
`fetch-registry-data: cache fresh (${Math.round(age / 60000)}m old), skipping`,
);
process.exit(0);
}
}
Expand All @@ -35,11 +37,15 @@ try {
const data = await res.json();
const entry = data.hives?.find((h) => h.org === TARGET_ORG) ?? null;
if (!entry) {
console.warn(`fetch-registry-data: no entry for org=${TARGET_ORG}, writing null`);
console.warn(
`fetch-registry-data: no entry for org=${TARGET_ORG}, writing null`,
);
writeFileSync(OUT, "null\n");
} else {
writeFileSync(OUT, JSON.stringify(entry, null, 2) + "\n");
console.log(`fetch-registry-data: wrote ${OUT} (acmmLevel=${entry.acmmLevel}, mode=${entry.governorMode})`);
console.log(
`fetch-registry-data: wrote ${OUT} (acmmLevel=${entry.acmmLevel}, mode=${entry.governorMode})`,
);
}
} catch (err) {
console.error(`fetch-registry-data: fetch failed: ${err.message}`);
Expand Down
15 changes: 15 additions & 0 deletions src/components/HiveFactoryDashboard.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2096,6 +2096,21 @@

/* ── Contribution and newcomer landing ─────────────────────────────────── */

.leaderboards .panel {
background: var(--ifm-card-background-color);
border-color: var(--ifm-color-emphasis-200);
border-radius: var(--ifm-global-radius);
box-shadow: var(--ifm-global-shadow-lw);
}

.leaderboards .panelTitle {
color: var(--ifm-heading-color);
font-size: var(--ifm-h2-font-size);
font-weight: var(--ifm-heading-font-weight);
letter-spacing: normal;
text-transform: none;
}

.contributionLinks {
margin-bottom: 1.25rem;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/HiveFactoryDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4303,7 +4303,7 @@ export function LeaderboardsSection(): React.JSX.Element {
: null;

return (
<>
<div className={styles.leaderboards}>
<ContributionLinks />
{hiveHistory ? (
<div className={styles.twoCol}>
Expand Down Expand Up @@ -4333,7 +4333,7 @@ export function LeaderboardsSection(): React.JSX.Element {
</p>
</section>
)}
</>
</div>
);
}

Expand Down
Loading