From 05db0a87f92dbc705d0f9285becff22a2ffdc887 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 22 Jul 2019 20:51:54 +0100 Subject: Switch the index page to show branches for a repository As that's probably more useful than recent revisions and jobs. --- guix-data-service/web/controller.scm | 14 ++--------- guix-data-service/web/view/html.scm | 49 +++++------------------------------- 2 files changed, 8 insertions(+), 55 deletions(-) diff --git a/guix-data-service/web/controller.scm b/guix-data-service/web/controller.scm index 6f2511c..3dec210 100644 --- a/guix-data-service/web/controller.scm +++ b/guix-data-service/web/controller.scm @@ -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 diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 970492d..a126f4d 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -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) -- cgit v1.2.3