seems to kinda work, the userspace errors missing Html_types module
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
*~
|
*~
|
||||||
_build/
|
_build/
|
||||||
|
gitkey.ml
|
||||||
|
|||||||
@ -37,7 +37,9 @@ let proxy_handler reqd : unit =
|
|||||||
| Request.{ meth; headers; target; _ } ->
|
| Request.{ meth; headers; target; _ } ->
|
||||||
Lwt.async (fun () ->
|
Lwt.async (fun () ->
|
||||||
let filename = Fmt.str "./%s" target in
|
let filename = Fmt.str "./%s" target in
|
||||||
if Sys.file_exists filename && Sys.is_regular_file filename
|
if
|
||||||
|
Sys.file_exists
|
||||||
|
filename (* && Sys.is_regular_file filename *)
|
||||||
then (
|
then (
|
||||||
let file =
|
let file =
|
||||||
Lwt_io.open_file ~flags:[ O_RDONLY ] ~mode:Lwt_io.input
|
Lwt_io.open_file ~flags:[ O_RDONLY ] ~mode:Lwt_io.input
|
||||||
|
|||||||
39
dune
39
dune
@ -4,8 +4,7 @@
|
|||||||
(executables
|
(executables
|
||||||
(names cors_proxy)
|
(names cors_proxy)
|
||||||
(libraries httpaf httpaf-lwt-unix base stdio fmt http-lwt-client)
|
(libraries httpaf httpaf-lwt-unix base stdio fmt http-lwt-client)
|
||||||
(modules cors_proxy)
|
(modules cors_proxy))
|
||||||
)
|
|
||||||
|
|
||||||
(library (name store)
|
(library (name store)
|
||||||
(libraries
|
(libraries
|
||||||
@ -17,7 +16,7 @@
|
|||||||
cohttp-lwt-jsoo
|
cohttp-lwt-jsoo
|
||||||
mimic
|
mimic
|
||||||
js_of_ocaml)
|
js_of_ocaml)
|
||||||
(modules store)
|
(modules store gitkey)
|
||||||
(preprocess
|
(preprocess
|
||||||
(pps js_of_ocaml-ppx)))
|
(pps js_of_ocaml-ppx)))
|
||||||
|
|
||||||
@ -29,6 +28,8 @@
|
|||||||
lwt js_of_ocaml-lwt
|
lwt js_of_ocaml-lwt
|
||||||
;; not used directly
|
;; not used directly
|
||||||
graphics
|
graphics
|
||||||
|
tyxml
|
||||||
|
tyxml.functor
|
||||||
js_of_ocaml.deriving
|
js_of_ocaml.deriving
|
||||||
react reactiveData
|
react reactiveData
|
||||||
str dynlink
|
str dynlink
|
||||||
@ -36,29 +37,36 @@
|
|||||||
higlo
|
higlo
|
||||||
js_of_ocaml-lwt.graphics
|
js_of_ocaml-lwt.graphics
|
||||||
js_of_ocaml-ppx
|
js_of_ocaml-ppx
|
||||||
|
js_of_ocaml-compiler.runtime
|
||||||
|
js_of_ocaml-compiler.dynlink
|
||||||
uucp
|
uucp
|
||||||
httpaf)
|
httpaf
|
||||||
|
tyxml-ppx
|
||||||
|
tyxml-syntax)
|
||||||
(flags
|
(flags
|
||||||
(:standard -rectypes -warn-error -A))
|
(:standard -rectypes -warn-error -A))
|
||||||
(link_flags
|
(link_flags
|
||||||
(:standard -linkall))
|
(:standard -linkall -keep-docs -keep-locs ))
|
||||||
(modes byte js)
|
(modes js byte )
|
||||||
(js_of_ocaml
|
(js_of_ocaml
|
||||||
(link_flags (:standard))
|
(link_flags (:standard))
|
||||||
(build_runtime_flags
|
(build_runtime_flags
|
||||||
(:standard
|
(:standard
|
||||||
;; +oplevel.js
|
+toplevel.js
|
||||||
+dynlink.js
|
+dynlink.js
|
||||||
--file
|
--file
|
||||||
%{dep:examples.ml}
|
%{dep:examples.ml}
|
||||||
--file
|
--file
|
||||||
%{dep:test_dynlink.cmo}
|
%{dep:test_dynlink.cmo}
|
||||||
--file
|
--file
|
||||||
%{dep:test_dynlink.js}))
|
%{dep:test_dynlink.js}
|
||||||
|
))
|
||||||
|
|
||||||
(flags
|
(flags
|
||||||
(:standard
|
(:standard
|
||||||
--toplevel
|
--toplevel --linkall --target-env=browser
|
||||||
(:include effects_flags.sexp))))
|
(:include effects_flags.sexp)
|
||||||
|
)))
|
||||||
(modules
|
(modules
|
||||||
oplevel toplevel ppx_support graphics_support colorize ocp_indent indent b64 )
|
oplevel toplevel ppx_support graphics_support colorize ocp_indent indent b64 )
|
||||||
(preprocess
|
(preprocess
|
||||||
@ -89,9 +97,11 @@
|
|||||||
-o
|
-o
|
||||||
%{targets}
|
%{targets}
|
||||||
stdlib
|
stdlib
|
||||||
|
graphics
|
||||||
str
|
str
|
||||||
dynlink
|
dynlink
|
||||||
js_of_ocaml.graphics
|
js_of_ocaml-compiler.runtime
|
||||||
|
js_of_ocaml-lwt.graphics
|
||||||
js_of_ocaml-ppx.as-lib
|
js_of_ocaml-ppx.as-lib
|
||||||
js_of_ocaml.deriving
|
js_of_ocaml.deriving
|
||||||
lwt
|
lwt
|
||||||
@ -139,15 +149,12 @@
|
|||||||
%{dep:test_dynlink.cmo}
|
%{dep:test_dynlink.cmo}
|
||||||
--file
|
--file
|
||||||
%{dep:test_dynlink.js}
|
%{dep:test_dynlink.js}
|
||||||
--export
|
|
||||||
%{dep:export.txt}
|
|
||||||
--toplevel
|
--toplevel
|
||||||
--disable
|
--linkall
|
||||||
shortvar
|
|
||||||
%{dep:oplevel.bc}
|
%{dep:oplevel.bc}
|
||||||
-o
|
-o
|
||||||
%{targets})))
|
%{targets})))
|
||||||
|
|
||||||
(alias
|
(alias
|
||||||
(name default)
|
(name default)
|
||||||
(deps oplevel.js oplevel.bc.js index.html))
|
(deps oplevel.bc.js index.html))
|
||||||
|
|||||||
@ -154,15 +154,6 @@
|
|||||||
var prefix = "";
|
var prefix = "";
|
||||||
var version = "";
|
var version = "";
|
||||||
var main = "oplevel.bc.js";
|
var main = "oplevel.bc.js";
|
||||||
for(var f in fields){
|
|
||||||
var data = fields[f].split(/=/);
|
|
||||||
if(data[0] == "version"){
|
|
||||||
version = data[1].replace(/%20|%2B/g,"+");
|
|
||||||
}
|
|
||||||
else if (data[0] == "separate"){
|
|
||||||
main = "oplevel.bc.js";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function load_script(url){
|
function load_script(url){
|
||||||
var fileref=document.createElement('script');
|
var fileref=document.createElement('script');
|
||||||
fileref.setAttribute("type","text/javascript");
|
fileref.setAttribute("type","text/javascript");
|
||||||
|
|||||||
18
oplevel.ml
18
oplevel.ml
@ -18,18 +18,29 @@ let resize ~container ~textbox () =
|
|||||||
container##.scrollTop := container##.scrollHeight;
|
container##.scrollTop := container##.scrollHeight;
|
||||||
Lwt.return ()
|
Lwt.return ()
|
||||||
|
|
||||||
|
let appendchild ~container html =
|
||||||
|
Dom.appendChild container (Tyxml_js.To_dom.of_a html)
|
||||||
|
|
||||||
let _ =
|
let _ =
|
||||||
Dom_html.window##.onload
|
Dom_html.window##.onload
|
||||||
:= Dom_html.handler (fun _ ->
|
:= Dom_html.handler (fun _ ->
|
||||||
Lwt.async (fun () ->
|
Lwt.async (fun () ->
|
||||||
let output = by_id "output" in
|
let output = by_id "output" in
|
||||||
let container = by_id "toplevel-container" in
|
let container = by_id "toplevel-container" in
|
||||||
|
appendchild ~container
|
||||||
|
Tyxml_js.Html.(
|
||||||
|
a
|
||||||
|
~a:[ a_class [ "window" ] ]
|
||||||
|
[
|
||||||
|
div
|
||||||
|
~a:[ a_class [ "status" ] ]
|
||||||
|
[ txt "starting..." ];
|
||||||
|
]);
|
||||||
let textbox : 'a Js.t =
|
let textbox : 'a Js.t =
|
||||||
by_id_coerce "userinput" Dom_html.CoerceTo.textarea
|
by_id_coerce "userinput" Dom_html.CoerceTo.textarea
|
||||||
in
|
in
|
||||||
let rootrepo = Store.test_pull () in
|
let rootrepo = Store.test_pull () in
|
||||||
rootrepo >>= fun (upstream, t) ->
|
rootrepo >>= fun (_upstream, t) ->
|
||||||
Store.S.tree t >>= fun rootstore ->
|
Store.S.tree t >>= fun rootstore ->
|
||||||
(try
|
(try
|
||||||
Store.S.Tree.get rootstore [ ".config"; "init.ml" ]
|
Store.S.Tree.get rootstore [ ".config"; "init.ml" ]
|
||||||
@ -88,7 +99,8 @@ let _ =
|
|||||||
Sync.pull_exn t upstream `Set
|
Sync.pull_exn t upstream `Set
|
||||||
>>= fun _ ->
|
>>= fun _ ->
|
||||||
Firebug.console##log
|
Firebug.console##log
|
||||||
(Js.string "Nav.test_pull(6)\n");
|
(Js.string
|
||||||
|
"re-pulling rootstore for init.ml\n");
|
||||||
tree t >>= fun rs ->
|
tree t >>= fun rs ->
|
||||||
(try
|
(try
|
||||||
Store.S.Tree.get rs
|
Store.S.Tree.get rs
|
||||||
|
|||||||
8
store.ml
8
store.ml
@ -366,13 +366,7 @@ let test_pull () : (Irmin.remote * Sync.db) Lwt.t =
|
|||||||
Firebug.console##log (Js.string "Nav.test_pull(4)\n");
|
Firebug.console##log (Js.string "Nav.test_pull(4)\n");
|
||||||
let upstream =
|
let upstream =
|
||||||
S.remote ~ctx
|
S.remote ~ctx
|
||||||
~headers:
|
~headers:[ ("Authorization", F.str "Basic %s" Gitkey.key) ]
|
||||||
[
|
|
||||||
( "Authorization",
|
|
||||||
"Basic \
|
|
||||||
Y3FjOmQ5YzJiNDkxZTcwZTMxYTc2MGNlNzBiYzQzMTAzNmM5MTMyNWY2ODM="
|
|
||||||
);
|
|
||||||
]
|
|
||||||
"http://localhost:8080/console/rootstore.git"
|
"http://localhost:8080/console/rootstore.git"
|
||||||
in
|
in
|
||||||
Firebug.console##log (Js.string "Nav.test_pull(5)\n");
|
Firebug.console##log (Js.string "Nav.test_pull(5)\n");
|
||||||
|
|||||||
@ -1,5 +1,4 @@
|
|||||||
open Js_of_ocaml
|
open Js_of_ocaml
|
||||||
open Store
|
|
||||||
|
|
||||||
val run :
|
val run :
|
||||||
init:string ->
|
init:string ->
|
||||||
|
|||||||
Reference in New Issue
Block a user