UI enhancement: all/active build modal
When showing the active builds link to all builds and vice versa.
This commit is contained in:
parent
bfa06c95f8
commit
378f5c4538
2 changed files with 15 additions and 10 deletions
|
@ -259,7 +259,7 @@ end
|
||||||
|
|
||||||
|
|
||||||
let routes ~datadir ~cachedir ~configdir ~expired_jobs =
|
let routes ~datadir ~cachedir ~configdir ~expired_jobs =
|
||||||
let builds ?(filter_builds_later_than = 0) req =
|
let builds ~all ?(filter_builds_later_than = 0) req =
|
||||||
let than =
|
let than =
|
||||||
if filter_builds_later_than = 0 then
|
if filter_builds_later_than = 0 then
|
||||||
Ptime.epoch
|
Ptime.epoch
|
||||||
|
@ -300,7 +300,7 @@ let routes ~datadir ~cachedir ~configdir ~expired_jobs =
|
||||||
|> if_error "Error getting jobs"
|
|> if_error "Error getting jobs"
|
||||||
~log:(fun e -> Log.warn (fun m -> m "Error getting jobs: %a" pp_error e))
|
~log:(fun e -> Log.warn (fun m -> m "Error getting jobs: %a" pp_error e))
|
||||||
>>= fun jobs ->
|
>>= fun jobs ->
|
||||||
Views.Builds.make jobs |> string_of_html |> Dream.html |> Lwt_result.ok
|
Views.Builds.make ~all jobs |> string_of_html |> Dream.html |> Lwt_result.ok
|
||||||
in
|
in
|
||||||
|
|
||||||
let job req =
|
let job req =
|
||||||
|
@ -620,7 +620,7 @@ let routes ~datadir ~cachedir ~configdir ~expired_jobs =
|
||||||
let w f req = or_error_response (f req) in
|
let w f req = or_error_response (f req) in
|
||||||
|
|
||||||
[
|
[
|
||||||
`Get, "/", (w (builds ~filter_builds_later_than:expired_jobs));
|
`Get, "/", (w (builds ~all:false ~filter_builds_later_than:expired_jobs));
|
||||||
`Get, "/job/:job", (w job);
|
`Get, "/job/:job", (w job);
|
||||||
`Get, "/job/:job/failed", (w job_with_failed);
|
`Get, "/job/:job/failed", (w job_with_failed);
|
||||||
`Get, "/job/:job/build/latest/**", (w redirect_latest);
|
`Get, "/job/:job/build/latest/**", (w redirect_latest);
|
||||||
|
@ -634,7 +634,7 @@ let routes ~datadir ~cachedir ~configdir ~expired_jobs =
|
||||||
`Get, "/job/:job/build/:build/console", (w (job_build_static_file `Console));
|
`Get, "/job/:job/build/:build/console", (w (job_build_static_file `Console));
|
||||||
`Get, "/job/:job/build/:build/all.tar.gz", (w job_build_targz);
|
`Get, "/job/:job/build/:build/all.tar.gz", (w job_build_targz);
|
||||||
`Get, "/failed-builds", (w failed_builds);
|
`Get, "/failed-builds", (w failed_builds);
|
||||||
`Get, "/all-builds", (w builds);
|
`Get, "/all-builds", (w (builds ~all:true));
|
||||||
`Get, "/hash", (w hash);
|
`Get, "/hash", (w hash);
|
||||||
`Get, "/compare/:build_left/:build_right", (w compare_builds);
|
`Get, "/compare/:build_left/:build_right", (w compare_builds);
|
||||||
`Post, "/upload", (Authorization.authenticate (w upload));
|
`Post, "/upload", (Authorization.authenticate (w upload));
|
||||||
|
|
17
lib/views.ml
17
lib/views.ml
|
@ -362,17 +362,22 @@ have questions or suggestions.
|
||||||
H.a ~a:H.[a_href "/failed-builds"]
|
H.a ~a:H.[a_href "/failed-builds"]
|
||||||
[H.txt "here"];
|
[H.txt "here"];
|
||||||
H.txt ".";
|
H.txt ".";
|
||||||
H.txt "View all jobs ";
|
|
||||||
H.a ~a:H.[a_href "/all-builds"]
|
|
||||||
[H.txt "here"];
|
|
||||||
H.txt ".";
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
let make section_job_map =
|
let make_all_or_active all =
|
||||||
|
[ H.p [
|
||||||
|
H.txt (if all then "View active jobs " else "View all jobs ");
|
||||||
|
H.a ~a:H.[a_href (if all then "/" else "/all-builds")]
|
||||||
|
[H.txt "here"];
|
||||||
|
H.txt ".";
|
||||||
|
]]
|
||||||
|
|
||||||
|
let make ~all section_job_map =
|
||||||
layout ~title:"Reproducible OPAM builds"
|
layout ~title:"Reproducible OPAM builds"
|
||||||
(make_header
|
(make_header
|
||||||
@ make_body section_job_map
|
@ make_body section_job_map
|
||||||
@ make_failed_builds)
|
@ make_failed_builds
|
||||||
|
@ make_all_or_active all)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue