Implement the search query input on the derivation outputs page
This commit is contained in:
parent
6cb7e92257
commit
d7036bdd37
2 changed files with 12 additions and 5 deletions
|
|
@ -423,6 +423,7 @@ ORDER BY derivations.file_name
|
||||||
(define* (select-derivation-outputs-in-revision conn
|
(define* (select-derivation-outputs-in-revision conn
|
||||||
commit-hash
|
commit-hash
|
||||||
#:key
|
#:key
|
||||||
|
search-query
|
||||||
output-consistency
|
output-consistency
|
||||||
system
|
system
|
||||||
target
|
target
|
||||||
|
|
@ -477,6 +478,9 @@ WHERE guix_revisions.commit = $1
|
||||||
'())
|
'())
|
||||||
,@(if target
|
,@(if target
|
||||||
'(" AND package_derivations.target = ")
|
'(" AND package_derivations.target = ")
|
||||||
|
'())
|
||||||
|
,@(if search-query
|
||||||
|
'(" AND derivation_output_details.path LIKE ")
|
||||||
'()))))
|
'()))))
|
||||||
(string-concatenate
|
(string-concatenate
|
||||||
(map (lambda (query count)
|
(map (lambda (query count)
|
||||||
|
|
@ -549,6 +553,10 @@ ORDER BY derivation_output_details.path
|
||||||
'())
|
'())
|
||||||
,@(if target
|
,@(if target
|
||||||
(list target)
|
(list target)
|
||||||
|
'())
|
||||||
|
,@(if search-query
|
||||||
|
(list (string-append
|
||||||
|
"%" search-query "%"))
|
||||||
'())))))
|
'())))))
|
||||||
|
|
||||||
(define (fix-derivation-output-details-hash-encoding conn)
|
(define (fix-derivation-output-details-hash-encoding conn)
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,8 @@
|
||||||
(guard-against-mutually-exclusive-query-parameters
|
(guard-against-mutually-exclusive-query-parameters
|
||||||
(parse-query-parameters
|
(parse-query-parameters
|
||||||
request
|
request
|
||||||
`((after_path ,identity)
|
`((search_query ,identity)
|
||||||
|
(after_path ,identity)
|
||||||
(output_consistency ,identity
|
(output_consistency ,identity
|
||||||
#:default "any")
|
#:default "any")
|
||||||
(system ,parse-system #:default "x86_64-linux")
|
(system ,parse-system #:default "x86_64-linux")
|
||||||
|
|
@ -204,10 +205,7 @@
|
||||||
#:no-default-when (all_results)
|
#:no-default-when (all_results)
|
||||||
#:default 10)
|
#:default 10)
|
||||||
(all_results ,parse-checkbox-value)))
|
(all_results ,parse-checkbox-value)))
|
||||||
;; You can't specify a search query, but then also limit the
|
'((limit_results all_results)))))
|
||||||
;; results by filtering for after a particular output path
|
|
||||||
'((after_path search_query)
|
|
||||||
(limit_results all_results)))))
|
|
||||||
|
|
||||||
(render-revision-derivation-outputs mime-types
|
(render-revision-derivation-outputs mime-types
|
||||||
conn
|
conn
|
||||||
|
|
@ -723,6 +721,7 @@
|
||||||
(select-derivation-outputs-in-revision
|
(select-derivation-outputs-in-revision
|
||||||
conn
|
conn
|
||||||
commit-hash
|
commit-hash
|
||||||
|
#:search-query (assq-ref query-parameters 'search_query)
|
||||||
#:output-consistency
|
#:output-consistency
|
||||||
(assq-ref query-parameters 'output_consistency)
|
(assq-ref query-parameters 'output_consistency)
|
||||||
#:system (assq-ref query-parameters 'system)
|
#:system (assq-ref query-parameters 'system)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue