From: Ian Jackson Date: Sat, 10 Oct 2020 19:38:42 +0000 (+0100) Subject: wip wasm deploy X-Git-Tag: otter-0.2.0~712 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=5b5fb62e7e36701ae04ac219075be480356177ea;p=otter.git wip wasm deploy Signed-off-by: Ian Jackson --- diff --git a/src/global.rs b/src/global.rs index b7c62d19..7e7dc2fd 100644 --- a/src/global.rs +++ b/src/global.rs @@ -1076,6 +1076,7 @@ const DEFAULT_SAVE_DIRECTORY : &str = "save"; const DEFAULT_COMMAND_SOCKET : &str = "command.socket"; // in save dir const DEFAULT_TEMPLATE_DIR : &str = "templates"; const DEFAULT_LIBRARY_DIR : &str = "library"; +const DEFAULT_WASM_DIR : &str = "target/packed-wasm"; #[derive(Deserialize,Debug,Clone)] pub struct ServerConfigSpec { @@ -1085,6 +1086,7 @@ pub struct ServerConfigSpec { pub http_port: Option, pub rocket_workers: Option, pub template_dir: Option, + pub wasm_dir: Option, pub log: Option, pub bundled_sources: Option, pub shapelibs: Option>, @@ -1098,6 +1100,7 @@ pub struct ServerConfig { pub http_port: Option, pub rocket_workers: u16, pub template_dir: String, + pub wasm_dir: String, pub log: LogSpecification, pub bundled_sources: String, pub shapelibs: Vec, @@ -1109,8 +1112,8 @@ impl TryFrom for ServerConfig { fn try_from(spec: ServerConfigSpec) -> ServerConfig { let ServerConfigSpec { save_directory, command_socket, debug, - http_port, rocket_workers, template_dir, log, bundled_sources, - shapelibs, + http_port, rocket_workers, template_dir, wasm_dir, + log, bundled_sources, shapelibs, } = spec; let save_directory = save_directory @@ -1152,10 +1155,12 @@ impl TryFrom for ServerConfig { format!("{}/*.toml", DEFAULT_LIBRARY_DIR) )]); + let wasm_dir = wasm_dir.unwrap_or_else(|| DEFAULT_WASM_DIR.to_owned()); + ServerConfig { save_directory, command_socket, debug, - http_port, rocket_workers, template_dir, log, bundled_sources, - shapelibs, + http_port, rocket_workers, template_dir, wasm_dir, + log, bundled_sources, shapelibs, } } } diff --git a/templates/loading.tera b/templates/loading.tera index e06dc75e..46c6f0e4 100644 --- a/templates/loading.tera +++ b/templates/loading.tera @@ -4,8 +4,9 @@ + +

Loading!

-