Add a statistics page
To show the total number of derivations, and guix revisions.
This commit is contained in:
parent
0c72ee747c
commit
6022edd074
2 changed files with 29 additions and 0 deletions
|
|
@ -293,6 +293,10 @@
|
||||||
(apply render-html
|
(apply render-html
|
||||||
(view-builds (select-build-stats conn)
|
(view-builds (select-build-stats conn)
|
||||||
(select-builds-with-context conn))))
|
(select-builds-with-context conn))))
|
||||||
|
((GET "statistics")
|
||||||
|
(apply render-html
|
||||||
|
(view-statistics (count-guix-revisions conn)
|
||||||
|
(count-derivations conn))))
|
||||||
((GET "revision" commit-hash)
|
((GET "revision" commit-hash)
|
||||||
(apply render-html
|
(apply render-html
|
||||||
(view-revision commit-hash
|
(view-revision commit-hash
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@
|
||||||
#:use-module (texinfo)
|
#:use-module (texinfo)
|
||||||
#:use-module (texinfo html)
|
#:use-module (texinfo html)
|
||||||
#:export (index
|
#:export (index
|
||||||
|
view-statistics
|
||||||
view-revision-package-and-version
|
view-revision-package-and-version
|
||||||
view-revision
|
view-revision
|
||||||
view-revision-packages
|
view-revision-packages
|
||||||
|
|
@ -188,6 +189,30 @@
|
||||||
(td ,source))))
|
(td ,source))))
|
||||||
queued-guix-revisions))))))))))
|
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
|
(define (view-revision-package-and-version revision-commit-hash name version
|
||||||
package-metadata
|
package-metadata
|
||||||
derivations)
|
derivations)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue