diff options
-rw-r--r-- | guix-data-service/web/controller.scm | 4 | ||||
-rw-r--r-- | guix-data-service/web/view/html.scm | 25 |
2 files changed, 29 insertions, 0 deletions
diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 0823c5f..2aa516d 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -293,6 +293,10 @@ (apply render-html (view-builds (select-build-stats conn) (select-builds-with-context conn)))) + ((GET "statistics") + (apply render-html + (view-statistics (count-guix-revisions conn) + (count-derivations conn)))) ((GET "revision" commit-hash) (apply render-html (view-revision commit-hash diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 2be4b22..0122504 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -26,6 +26,7 @@ #:use-module (texinfo) #:use-module (texinfo html) #:export (index + view-statistics view-revision-package-and-version view-revision view-revision-packages @@ -188,6 +189,30 @@ (td ,source)))) queued-guix-revisions)))))))))) + +(define (view-statistics guix-revisions-count derivations-count) + (layout + #:extra-headers + '((cache-control . ((max-age . 60)))) + #:body + `(,(header) + (div + (@ (class "container")) + (div + (@ (class "row")) + (div + (@ (class "col-md-6")) + (h3 "Guix revisions") + (strong (@ (class "text-center") + (style "font-size: 2em; display: block;")) + ,guix-revisions-count)) + (div + (@ (class "col-md-6")) + (h3 "Derivations") + (strong (@ (class "text-center") + (style "font-size: 2em; display: block;")) + ,derivations-count))))))) + (define (view-revision-package-and-version revision-commit-hash name version package-metadata derivations) |