diff --git a/dist/static/layout.css b/dist/static/layout.css index 263b348..a84d937 100644 --- a/dist/static/layout.css +++ b/dist/static/layout.css @@ -307,3 +307,19 @@ body.stats { background: var(--color-background); box-shadow: var(--box-shadow-bottom); } + +table { + border-collapse: collapse; + & th, & td { + padding: 0.5rem; + text-align: center; + } + + & th:first-child, & td:first-child { + text-align: left; + } + + & td { + border-bottom: 1px solid var(--color-base-muted); + } +} diff --git a/dist/static/modules.js b/dist/static/modules.js index 36a3076..db88bac 100644 --- a/dist/static/modules.js +++ b/dist/static/modules.js @@ -14,10 +14,10 @@ class FormatNumber extends HTMLElement { class FormatDate extends HTMLElement { connectedCallback() { - this.innerHTML = this.formatNumber(this.innerHTML); + this.innerHTML = this.formatDate(this.innerHTML); } - formatNumber(number) { + formatDate(number) { try { const parsed = new Date(number); if (!isFinite(parsed)) { diff --git a/dist/static/variables.css b/dist/static/variables.css index 741ceb2..d387836 100644 --- a/dist/static/variables.css +++ b/dist/static/variables.css @@ -4,6 +4,7 @@ --color-background: oklch(1 0 0); --color-base: oklch(0 0 0); + --color-base-muted: oklch(0.521 0 89.876); --color-contrast-bg: oklch(0 0 0); --color-contrast-fg: oklch(1 0 0); --color-link: unset; @@ -16,6 +17,7 @@ :root { --color-background: oklch(0.25 0 0); --color-base: oklch(0.84 0.06 152.17); + --color-base-muted: oklch(0.869 0.026 149.045); --color-contrast-bg: oklch(0.84 0.06 152.17); --color-contrast-fg: oklch(0.25 0 0); --border-size: 4px; diff --git a/functions/status/index.js b/functions/status/index.js index cf04153..283f0e6 100644 --- a/functions/status/index.js +++ b/functions/status/index.js @@ -2,7 +2,7 @@ import Mustache from 'mustache'; import template from './template.html'; import { getDefaultViewData } from '../../lib/view.js'; import {emitPageView} from '../../lib/plausible.js'; -import { getUnchecked, getIndexStats } from '../../lib/mongo.js'; +import {getUnchecked, getIndexStats, getCrawlHistory} from '../../lib/mongo.js'; export const onRequestGet = async (context) => { emitPageView(context); @@ -11,6 +11,7 @@ export const onRequestGet = async (context) => { const unchecked = await getUnchecked(env); const uncheckedLang = unchecked === null ? 'unknown' : unchecked; const viewDefaults = await getDefaultViewData(env); + const history = await getCrawlHistory(env); const indexMap = new Map(); const finalStats = indexStats @@ -42,6 +43,7 @@ export const onRequestGet = async (context) => { const view = { ...viewDefaults, title: 'Index statistics - kukei.eu', + history, finalStats, uncheckedLang, }; diff --git a/functions/status/template.html b/functions/status/template.html index 1c4be81..782273b 100644 --- a/functions/status/template.html +++ b/functions/status/template.html @@ -23,6 +23,33 @@

Index statistics

  • {{magazinesPages}} magazines pages
  • Pages known but yet to be crawled: {{ uncheckedLang }}

    +

    Index over time

    + + + + + + + + + + + + + + {{#history}} + + + + + + + + + + {{/history}} + +
    DateCrawled countKnown, pendingIndexedIndexed: blogsIndex: docsIndex: magazines
    {{ date }}{{ crawledCount }}{{ uncheckedLang }}{{ totalPages }}{{ blogPages }}{{ docsPages }}{{ magazinesPages }}

    Index sources list

    Index / url - last crawled at