diff options
-rw-r--r-- | guix-data-service/model/derivation.scm | 16 | ||||
-rw-r--r-- | guix-data-service/web/view/html.scm | 18 |
2 files changed, 26 insertions, 8 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index 5d900fc..49973be 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -605,8 +605,13 @@ VALUES ($1, $2)" (define query (string-append " -SELECT derivations.file_name, derivation_outputs.name, - derivation_output_details.path +SELECT derivations.file_name, + JSON_AGG( + json_build_object( + 'output_name', derivation_outputs.name, + 'store_filename', derivation_output_details.path + ) + ) FROM derivation_inputs INNER JOIN derivation_outputs ON derivation_outputs.id = derivation_inputs.derivation_output_id @@ -615,9 +620,14 @@ INNER JOIN derivation_output_details INNER JOIN derivations ON derivation_outputs.derivation_id = derivations.id WHERE derivation_inputs.derivation_id = $1 +GROUP BY derivations.file_name ORDER BY derivations.file_name")) - (exec-query conn query (list (number->string id)))) + (map (match-lambda + ((derivation-file-name outputs-json) + (list derivation-file-name + (json-string->scm outputs-json)))) + (exec-query conn query (list (number->string id))))) (define (select-derivation-sources-by-derivation-id conn id) (define query diff --git a/guix-data-service/web/view/html.scm b/guix-data-service/web/view/html.scm index 51c021c..8375d0b 100644 --- a/guix-data-service/web/view/html.scm +++ b/guix-data-service/web/view/html.scm @@ -551,10 +551,10 @@ (th "File name"))) (tdata ,@(map (match-lambda - ((file-name output-name path) + ((derivation-file-name outputs) `(tr - (td (a (@ (href ,file-name)) - ,(display-store-item-short path)))))) + (td (a (@ (href ,derivation-file-name)) + ,(display-store-item-short derivation-file-name)))))) derivation-inputs))))) (div (@ (class "col-md-4")) @@ -697,14 +697,22 @@ (@ (class "col-md-10") (style "font-family: monospace;")) ,@(map (match-lambda* - (((file-name output-name path) count-down) + (((file-name outputs) count-down) `(div (@ (style "margin-left: 3em;")) "(\"" (a (@ (href ,file-name)) ,(display-store-item file-name)) "\",\"" - "[\"" ,output-name "\"]" + "[" ,(string-join + (map (lambda (output) + (string-append + "\"" + (assoc-ref output "output_name") + "\"")) + (vector->list outputs)) + ",") + "]" ")" ,@(if (eq? count-down 0) '() |