2
0
Fork 0
mirror of git://git.savannah.gnu.org/guix/data-service.git synced 2023-12-14 03:23:03 +01:00

Switch the index page to show branches for a repository

As that's probably more useful than recent revisions and jobs.
This commit is contained in:
Christopher Baines 2019-07-22 20:51:54 +01:00
parent c23822e14d
commit 05db0a87f9
2 changed files with 8 additions and 55 deletions

View file

@ -621,18 +621,8 @@
(lambda (git-repository-details)
(cons
git-repository-details
(map
(match-lambda
((id job-id job-events commit source)
(list id
job-id
job-events
commit
source
(git-branches-for-commit conn commit))))
(guix-revisions-and-jobs-for-git-repository
conn
(car git-repository-details)))))
(all-branches-with-most-recent-commit
conn (first git-repository-details))))
(all-git-repositories conn)))))
(('GET "builds")
(render-html

View file

@ -233,54 +233,17 @@
(h1 "Guix Data Service")))
,@(map
(match-lambda
(((repository-id label url) . revisions)
(((repository-id label url) . branches-with-most-recent-commits)
`(div
(@ (class "row"))
(div
(@ (class "col-sm-12"))
(h3 ,url)
,(if (null? revisions)
'(p "No revisions")
`(table
(@ (class "table"))
(thead
(tr
(th (@ (class "col-md-6")) "Branch")
(th (@ (class "col-md-6")) "Commit")))
(tbody
,@(map
(match-lambda
((revision-id job-id job-events commit source branches)
`(tr
(td
,@(map
(match-lambda
((name date)
`(span
(a (@ (href ,(string-append
"/repository/"
repository-id
"/branch/" name)))
,name)
" at "
,date)))
branches))
(td (a (@ (href ,(string-append
"/revision/" commit)))
(samp ,commit))
" "
,(cond
((not (string-null? revision-id))
'(span
(@ (class "label label-success"))
"✓"))
((member "failure" job-events)
'(span (@ (class "label label-danger"))
"Failed to import data"))
(else
'(span (@ (class "label label-default"))
"No information yet")))))))
revisions))))))))
,(if (null? branches-with-most-recent-commits)
'(p "No branches")
(table/branches-with-most-recent-commits
repository-id
branches-with-most-recent-commits))))))
git-repositories-and-revisions)))))
(define (view-statistics guix-revisions-count derivations-count)