Maj terminée. Pour consulter la release notes associée voici le lien :
https://about.gitlab.com/releases/2021/07/07/critical-security-release-gitlab-14-0-4-released/

Commit 99052513 authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Use <input> element for the number of credentials

parent b6c245ab
......@@ -46,3 +46,16 @@ let set_textarea id z =
(Dom_html.CoerceTo.textarea e)
(fun x -> x##value <- Js.string z)
)
let get_input id =
let res = ref None in
Js.Opt.iter
(document##getElementById (Js.string id))
(fun e ->
Js.Opt.iter
(Dom_html.CoerceTo.input e)
(fun x -> res := Some (Js.to_string (x##value)))
);
match !res with
| None -> raise Not_found
| Some x -> x
......@@ -25,7 +25,7 @@ open Tool_js_common
open Tool_credgen
let generate _ =
let number = get_textarea "number" |> int_of_string in
let number = get_input "number" |> int_of_string in
let ids = generate_ids number in
let module P : PARAMS = struct
let uuid = get_textarea "uuid"
......@@ -58,17 +58,16 @@ let fill_interactivity _ =
let x = document##createElement (Js.string "div") in
let t = document##createTextNode (Js.string "Number of credentials to generate: ") in
Dom.appendChild x t;
let y = document##createElement (Js.string "textarea") in
let y = document##createElement (Js.string "input") in
y##setAttribute (Js.string "id", Js.string "number");
y##setAttribute (Js.string "rows", Js.string "1");
y##setAttribute (Js.string "cols", Js.string "5");
y##setAttribute (Js.string "size", Js.string "5");
Dom.appendChild x y;
Dom.appendChild e x;
let b = document##createElement (Js.string "button") in
let t = document##createTextNode (Js.string "Generate credentials") in
let t = document##createTextNode (Js.string "Generate") in
b##onclick <- Dom_html.handler generate;
Dom.appendChild b t;
Dom.appendChild e b;
Dom.appendChild x b;
);
Js._false
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment