Commit 34e8c56f authored by Stephane Glondu's avatar Stephane Glondu
Browse files

Binding for Tool_mkelection

parent 2bb0fde4
......@@ -92,6 +92,32 @@
</div>
<div id="mkelection">
<h2>Election creation</h2>
<div>
<h3>Input</h3>
<div>
UUID:
<div><textarea id="mkelection_uuid" rows="1" cols="80"></textarea></div>
</div>
<div>
Group parameters:
<div><textarea id="mkelection_group" rows="1" cols="80"></textarea></div>
</div>
<div>
Public keys:
<div><textarea id="mkelection_pks" rows="1" cols="80"></textarea></div>
</div>
<div>
Template:
<div><textarea id="mkelection_template" rows="1" cols="80"></textarea></div>
</div>
</div>
<div>
<h3>Output</h3>
<div>
<button id="do_mkelection">Generate</button>
<div><textarea id="mkelection_output"></textarea></div>
</div>
</div>
</div>
</body>
</html>
......@@ -182,7 +182,26 @@ module Credgen = struct
]
end
let cmds = Tests.cmds @ Tkeygen.cmds @ Credgen.cmds
module Mkelection = struct
open Tool_mkelection
let mkelection () =
let module P : PARAMS = struct
let uuid = get_textarea "mkelection_uuid"
let group = get_textarea "mkelection_group"
let template = get_textarea "mkelection_template"
let get_public_keys () =
Some (get_textarea "mkelection_pks" |> split_lines |> Array.of_list)
end in
let module X = (val make (module P : PARAMS) : S) in
set_textarea "mkelection_output" (X.mkelection ())
let cmds = [
"do_mkelection", mkelection;
]
end
let cmds = Tests.cmds @ Tkeygen.cmds @ Credgen.cmds @ Mkelection.cmds
let install_handlers () =
List.iter install_handler cmds
......
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