Index: cgisetup/models/pgdb.scm ================================================================== --- cgisetup/models/pgdb.scm +++ cgisetup/models/pgdb.scm @@ -200,13 +200,13 @@ ttypes))) (define (pgdb:get-targets-of-type dbh ttype-id target-patt) (dbi:get-rows dbh "SELECT DISTINCT target FROM runs WHERE target LIKE ? AND ttype_id=?;" target-patt ttype-id)) -(define (pgdb:get-runs-by-target dbh targets) +(define (pgdb:get-runs-by-target dbh targets run-patt) (dbi:get-rows dbh "SELECT r.run_name, t.test_name, t.status, t.item_path, t.id, t.rundir, t.final_logf FROM runs as r INNER JOIN tests AS t ON t.run_id=r.id - WHERE t.state='COMPLETED' AND r.target like ?;" targets) + WHERE t.state='COMPLETED' AND r.target like ? AND r.run_name like ?;" targets run-patt) ) (define (pgdb:get-test-by-id dbh id) (dbi:get-rows dbh "SELECT t.test_name, t.item_path, t.rundir, t.final_logf FROM runs as r INNER JOIN tests AS t ON t.run_id=r.id WHERE t.id = ?;" id) Index: cgisetup/pages/home_view.scm ================================================================== --- cgisetup/pages/home_view.scm +++ cgisetup/pages/home_view.scm @@ -116,11 +116,11 @@ ;; "-" "%2D" ;;(string-substitute "/" "%2F" (conc col-key "/" row-key) 'all) (string-substitute "[/]" "_x_" (conc col-key "/" row-key) 'all) ;; 'all))) )) - (s:td 'style (conc "background: linear-gradient(to right, green " passper "%, red " failper "%);") - (s:a 'href (s:link-to "run" 'target run-key) + (s:td 'style (conc "background: -webkit-linear-gradient(left, green " passper "%, red); background: -o-linear-gradient(right, green " passper "%, red); background: -moz-linear-gradient(right, green " passper "%, red); background: linear-gradient(to right, green " passper "%, red);") + (s:a 'href (s:link-to "run" 'target run-key) (conc total "/" pass "/" fail "/" other)))) (s:td "")))) a-keys))) b-keys)))))))) Index: cgisetup/pages/run_ctrl.scm ================================================================== --- cgisetup/pages/run_ctrl.scm +++ cgisetup/pages/run_ctrl.scm @@ -11,9 +11,12 @@ ;; a function -action is called on POST (define (run-action action) (case (string->symbol action) - ((dosomething) - (dosomething)))) + ((filter) + (let ((run-name-filter (s:get-input 'run-name-filter)) + (target (s:get-input 'target))) + (s:set! "run-name-filter" run-name-filter) + (s:set! "target" target))))) Index: cgisetup/pages/run_view.scm ================================================================== --- cgisetup/pages/run_view.scm +++ cgisetup/pages/run_view.scm @@ -6,18 +6,41 @@ ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== - (define (pages:run session db shared) (let* ((dbh (s:db)) - (target (string-substitute "_x_" "/" (s:get-param 'target) 'all)) - (runs (pgdb:get-runs-by-target dbh target)) + (target-param (s:get-param 'target)) + (target1 (if (s:get "target") + (s:get "target") + (s:get-param 'target))) + (target (if (equal? target1 #f) + "%" + (string-substitute "_x_" "/" target1 'all) + )) + (run-filter (or (s:get "run-name-filter") "%")) + (runs (pgdb:get-runs-by-target dbh target run-filter)) (ordered-runs (pgdb:runs-to-hash runs))) (s:div 'class "col_12" + (s:fieldset + "Run filter" + (s:form + 'action "run.filter" 'method "post" + (s:div 'class "col_12" + (s:div 'class "col_6" + ;(s:p (conc "param" (s:get-param 'target)) ) + ; (s:p (conc "get" (s:get "target")) ) + ;(s:p target1) + (s:input-preserve 'name "run-name-filter" 'placeholder "Filter by run names") + (s:input 'type "hidden" 'value target 'name "target" )) + + (s:div 'class "col_6" + (s:input 'type "submit" 'name "set-filter-vals" 'value "Submit"))) + )) + (s:fieldset (conc "Show a runs for Target: " target) (let* ((a-keys (sort (hash-table-keys ordered-runs) string>=?)) (b-keys (delete-duplicates(sort (apply append @@ -24,13 +47,13 @@ (map (lambda (sub-key) (let ((subdat (hash-table-ref ordered-runs sub-key))) (hash-table-keys subdat))) a-keys)) string>=?)))) - + (s:table - (s:tr (s:td "")(map s:td a-keys)) + (s:tr (s:th "") (map s:th a-keys)) (map (lambda (row-key) (s:tr (s:td row-key) (map (lambda (col-key)