package datakit-ci

  1. Overview
  2. Docs

Generate HTML for the various pages in the UI.

type t = private {
  1. name : string;
  2. state_repo : Uri.t option;
  3. metrics_token : [ `SHA256 of Cstruct.t ] option;
  4. listen_addr : [ `HTTP of int | `HTTPS of int ];
  5. github_scopes_needed : Github_t.scope list;
  6. can_read : CI_ACL.t;
  7. can_build : CI_ACL.t;
}
val config : ?name:string -> ?state_repo:Uri.t -> ?metrics_token:[ `SHA256 of string ] -> ?listen_addr:[ `HTTP of int | `HTTPS of int ] -> ?github_scopes_needed:Github_t.scope list -> can_read:CI_ACL.t -> can_build:CI_ACL.t -> unit -> t

config ~name ~state_repo () is a web configuration. If name is given, it is used as the main heading, and also as the name of the session cookie (useful if you run multiple CIs on the same host, on different ports). If state_repo is given, it is used to construct links to the state repository on GitHub.

type page = user:string option -> [ `Html ] Tyxml.Html.elt
module Error : sig ... end
val login_page : ?github:Uri.t -> csrf_token:string -> CI_form.State.t -> is_configured:bool -> t -> page
val auth_setup : csrf_token:string -> CI_form.State.t -> t -> page
val user_page : csrf_token:string -> t -> page
val main_page : csrf_token:string -> ci:CI_engine.t -> dashboards:CI_target.Set.t Datakit_github.Repo.Map.t -> t -> page
val prs_page : ci:CI_engine.t -> t -> page
val branches_page : ci:CI_engine.t -> t -> page
val tags_page : ci:CI_engine.t -> t -> page
val commit_page : ?test:string -> commit:string -> archived_targets:(CI_target.t * CI_utils.DK.Commit.t) list -> CI_target.t list -> t -> page
val target_page : ?test:string -> csrf_token:string -> ?title:string -> target:CI_target.t -> CI_history.State.t -> t -> page
val live_log_frame : branch:string -> have_history:bool -> t -> page
val saved_log_frame : commit:string -> branch:string -> t -> page
val plain_error : string -> t -> page

A basic page just the error text and no header, footer, etc.

val error_page : string -> t -> page
module Settings : sig ... end

saved_log_frame_link ~branch ~commit is the path component of the iframe link for the given saved log.

OCaml

Innovation. Community. Security.