MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / refreshMeta

Function refreshMeta

telemetry-dashboard/public/app.js:366–382  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

364// ---------------------------------------------------------------------------
365
366async function refreshMeta() {
367 // Re-read on every refresh, so a page left open overnight moves on to the new day.
368 state.anchor = utcDay(Date.now());
369 try {
370 const meta = await api('/api/meta');
371 state.meta = meta;
372 if (meta.today) state.anchor = meta.today;
373 state.earliest = meta.earliest_day ?? null;
374 } catch {
375 // A meta failure is not fatal: the presets still end today and every panel
376 // still answers. The status line is what says so.
377 state.meta = null;
378 }
379 for (const input of document.querySelectorAll('.custom-range input')) input.max = state.anchor;
380 syncFilters();
381 drawDataWarning();
382}
383
384const plural = (n, one, many) => `${n.toLocaleString('en-US')} ${n === 1 ? one : many}`;
385

Callers 2

buildFiltersFunction · 0.85
app.jsFile · 0.85

Calls 4

syncFiltersFunction · 0.85
drawDataWarningFunction · 0.85
utcDayFunction · 0.70
apiFunction · 0.70

Tested by

no test coverage detected