fix init.ml

This commit is contained in:
cqc
2024-02-17 14:52:01 -06:00
parent 08fd2c2362
commit d24d28e046

View File

@ -35,6 +35,9 @@ let headers_of_string_list (sl : string list) : Httpaf.Headers.t =
(String.index_opt s ':'))
sl)
let appendchild ~container html =
Dom.appendChild container (Tyxml_js.To_dom.of_a html)
let setup_workspace ~container cstore : unit Lwt.t =
let render ~container cstore : unit Lwt.t =
let module Headers = Httpaf.Headers in
@ -55,23 +58,21 @@ let setup_workspace ~container cstore : unit Lwt.t =
~some:(fun s -> s)
(Headers.get headers "path"))
in
Dom.appendChild container
(Tyxml_js.To_dom.of_a
Tyxml_js.Html.(
a
~a:[ a_class [ "window" ] ]
[
div
~a:[ a_class [ "status" ] ]
[
txt
(F.str "Name: %s; Path: %a" step Uri.pp_hum
uri);
];
div
~a:[ a_class [ "output" ] ]
[ txt (F.str "%s" contents) ];
]));
appendchild ~container
Tyxml_js.Html.(
a
~a:[ a_class [ "window" ] ]
[
div
~a:[ a_class [ "status" ] ]
[
txt
(F.str "Name: %s; Path: %a" step Uri.pp_hum uri);
];
div
~a:[ a_class [ "output" ] ]
[ txt (F.str "%s" contents) ];
]);
Lwt.return_unit)
csl
in