thin RustyWolf window chrome; make heatmap proxy degrade gracefully on upstream failure
This commit is contained in:
parent
7f6ac177b4
commit
6daaf7e55b
8 changed files with 52 additions and 34 deletions
|
|
@ -1,5 +1,15 @@
|
|||
export async function GET() {
|
||||
const res = await fetch("https://git.dvorakmortonxd.dev/api/v1/users/dvorakmortonxd/heatmap");
|
||||
const data = await res.json();
|
||||
return Response.json(data);
|
||||
}
|
||||
try {
|
||||
const res = await fetch(
|
||||
"https://git.dvorakmortonxd.dev/api/v1/users/dvorakmortonxd/heatmap",
|
||||
{ headers: { Accept: "application/json" } }
|
||||
);
|
||||
if (!res.ok) {
|
||||
return Response.json({ error: "failed to load" }, { status: 502 });
|
||||
}
|
||||
const data = await res.json();
|
||||
return Response.json(data);
|
||||
} catch {
|
||||
return Response.json({ error: "failed to load" }, { status: 502 });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,9 +39,16 @@ export default function ContributionHeatmap({ variant = "terminal" }: { variant?
|
|||
try {
|
||||
const res = await fetch("/api/heatmap");
|
||||
if (!res.ok) {
|
||||
throw new Error("Failed to fetch");
|
||||
setError(true);
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
const data: HeatmapData[] = await res.json();
|
||||
if (!Array.isArray(data)) {
|
||||
setError(true);
|
||||
setLoading(false);
|
||||
return;
|
||||
}
|
||||
const map = new Map<string, number>();
|
||||
let total = 0;
|
||||
let maxContribs = 0;
|
||||
|
|
@ -90,7 +97,7 @@ export default function ContributionHeatmap({ variant = "terminal" }: { variant?
|
|||
setTotalContribs(total);
|
||||
setLoading(false);
|
||||
} catch (err) {
|
||||
console.error("Failed to load heatmap:", err);
|
||||
console.warn("Failed to load heatmap:", err);
|
||||
setError(true);
|
||||
setLoading(false);
|
||||
}
|
||||
|
|
@ -106,7 +113,7 @@ export default function ContributionHeatmap({ variant = "terminal" }: { variant?
|
|||
setActivities(valid);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error("Failed to load activities:", err);
|
||||
console.warn("Failed to load activities:", err);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ export default function WebLayout() {
|
|||
</Section>
|
||||
|
||||
<footer className="web-footer glass">
|
||||
<span className="web-footer-label">v2.2.9</span>
|
||||
<span className="web-footer-label">v2.2.10</span>
|
||||
© 2025-2026 Martin Dvořák. All rights reserved (not really I dont care, just
|
||||
follow the GPL3.0 License)
|
||||
</footer>
|
||||
|
|
|
|||
|
|
@ -649,44 +649,44 @@ html[data-theme="web"] body {
|
|||
.fw-tabs {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
gap: 6px;
|
||||
height: 32px;
|
||||
padding: 7px 10px 0;
|
||||
gap: 5px;
|
||||
height: 26px;
|
||||
padding: 5px 10px 0;
|
||||
}
|
||||
.fw-tab {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
gap: 6px;
|
||||
max-width: 62%;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
padding: 6px 13px;
|
||||
border-radius: 9px 9px 0 0;
|
||||
padding: 3px 11px;
|
||||
border-radius: 8px 8px 0 0;
|
||||
border: 1px solid var(--btn-border, var(--glass-border));
|
||||
border-bottom: none;
|
||||
background: var(--btn-bg, var(--glass-lo));
|
||||
font-size: 0.66rem;
|
||||
font-size: 0.62rem;
|
||||
color: var(--fg);
|
||||
}
|
||||
.fw-tab-dot {
|
||||
flex: none;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
border-radius: 50%;
|
||||
background: var(--accent);
|
||||
}
|
||||
.fw-tab-plus {
|
||||
padding: 0 6px;
|
||||
padding: 0 5px;
|
||||
color: var(--web-muted);
|
||||
font-size: 0.9rem;
|
||||
font-size: 0.82rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.fw-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 12px;
|
||||
gap: 6px;
|
||||
padding: 5px 10px;
|
||||
border-top: 1px solid var(--glass-border);
|
||||
border-bottom: 1px solid var(--glass-border);
|
||||
background: var(--fw-chrome);
|
||||
|
|
@ -695,12 +695,12 @@ html[data-theme="web"] body {
|
|||
flex: none;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: var(--btn-bg, var(--glass-lo));
|
||||
color: var(--web-muted);
|
||||
font-size: 0.85rem;
|
||||
font-size: 0.78rem;
|
||||
line-height: 1;
|
||||
}
|
||||
.fw-url {
|
||||
|
|
@ -708,13 +708,13 @@ html[data-theme="web"] body {
|
|||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
height: 26px;
|
||||
padding: 0 12px;
|
||||
height: 22px;
|
||||
padding: 0 11px;
|
||||
border-radius: 999px;
|
||||
border: 1px solid var(--glass-border);
|
||||
background: var(--glass-lo);
|
||||
font-family: var(--font-custom-mono);
|
||||
font-size: 0.66rem;
|
||||
font-size: 0.62rem;
|
||||
color: var(--web-muted);
|
||||
}
|
||||
.fw-lock {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue