From 7e198ba7caecfd98cb25118b403f23545716e21b Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 23 Nov 2019 04:18:03 -0500 Subject: add basic template rendering ability --- Cargo.lock | 75 ++++++++ teleterm-web/src/views/page.rs | 8 +- teleterm/Cargo.toml | 1 + teleterm/src/web.rs | 46 ++++- teleterm/static/index.html | 13 -- teleterm/static/index.html.tmpl | 14 ++ teleterm/static/teleterm_web.js | 324 +++++++++++++++++------------------ teleterm/static/teleterm_web_bg.wasm | Bin 700342 -> 697715 bytes 8 files changed, 295 insertions(+), 186 deletions(-) delete mode 100644 teleterm/static/index.html create mode 100644 teleterm/static/index.html.tmpl diff --git a/Cargo.lock b/Cargo.lock index f0cd38a..6966652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -855,11 +855,30 @@ dependencies = [ "tokio-io", ] +[[package]] +name = "handlebars" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ef1ac30f2eaaa2b835fce73c57091cb6b9fc62b7eef285efbf980b0f20001b" +dependencies = [ + "hashbrown", + "log", + "pest", + "pest_derive", + "quick-error", + "serde", + "serde_json", + "walkdir", +] + [[package]] name = "hashbrown" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1de41fb8dba9714efd92241565cdff73f78508c95697dd56787d3cba27e2353" +dependencies = [ + "serde", +] [[package]] name = "heck" @@ -1093,6 +1112,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "maplit" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" + [[package]] name = "matches" version = "0.1.8" @@ -1373,6 +1398,49 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +[[package]] +name = "pest" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e4fb201c5c22a55d8b24fef95f78be52738e5e1361129be1b5e862ecdb6894a" +dependencies = [ + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b9fcf299b5712d06ee128a556c94709aaa04512c4dffb8ead07c5c998447fc0" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2 1.0.6", + "quote 1.0.2", + "syn 1.0.7", +] + +[[package]] +name = "pest_meta" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df43fd99896fd72c485fe47542c7b500e4ac1e8700bf995544d1317a60ded547" +dependencies = [ + "maplit", + "pest", + "sha-1", +] + [[package]] name = "pkg-config" version = "0.3.17" @@ -2116,6 +2184,7 @@ dependencies = [ "futures", "gotham", "gotham_derive", + "handlebars", "hyper", "lazy-static-include", "lazy_static", @@ -2600,6 +2669,12 @@ version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +[[package]] +name = "ucd-trie" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f00ed7be0c1ff1e24f46c3d2af4859f7e863672ba3a6e92e7cff702bf9f06c2" + [[package]] name = "unicase" version = "2.5.1" diff --git a/teleterm-web/src/views/page.rs b/teleterm-web/src/views/page.rs index 3b354e3..7842172 100644 --- a/teleterm-web/src/views/page.rs +++ b/teleterm-web/src/views/page.rs @@ -1,13 +1,9 @@ use crate::prelude::*; pub(crate) fn render(model: &crate::model::Model) -> Vec> { - let mut view = vec![seed::h1!["teleterm"]]; - if model.watching() { - view.extend(super::watch::render(model)) + super::watch::render(model) } else { - view.extend(super::list::render(model)) + super::list::render(model) } - - view } diff --git a/teleterm/Cargo.toml b/teleterm/Cargo.toml index 40949ae..774059e 100644 --- a/teleterm/Cargo.toml +++ b/teleterm/Cargo.toml @@ -24,6 +24,7 @@ futures = "0.1.29" # for websocket support - should be able to go back to released version in 0.5 gotham = { git = "https://github.com/gotham-rs/gotham", rev = "d2395926b93710832f8d72b49c9bd3e77516e386" } gotham_derive = "0.4" +handlebars = "2" hyper = "0.12" lazy_static = "1" lazy-static-include = "2" diff --git a/teleterm/src/web.rs b/teleterm/src/web.rs index 89291c5..c766e38 100644 --- a/teleterm/src/web.rs +++ b/teleterm/src/web.rs @@ -9,8 +9,8 @@ use lazy_static_include::*; use tokio_tungstenite::tungstenite; lazy_static_include::lazy_static_include_bytes!( - INDEX_HTML, - "static/index.html" + INDEX_HTML_TMPL, + "static/index.html.tmpl" ); lazy_static_include::lazy_static_include_bytes!( TELETERM_WEB_JS, @@ -34,14 +34,22 @@ struct WatchQueryParams { id: String, } +#[derive(Clone, serde::Serialize)] +struct TemplateData { + title: String, +} + pub struct Server { server: Box + Send>, } impl Server { pub fn new(addr: T) -> Self { + let data = TemplateData { + title: "teleterm".to_string(), + }; Self { - server: Box::new(gotham::init_server(addr, router())), + server: Box::new(gotham::init_server(addr, router(&data))), } } } @@ -74,9 +82,13 @@ impl futures::Future for Server { } } -pub fn router() -> impl gotham::handler::NewHandler { +fn router(data: &TemplateData) -> impl gotham::handler::NewHandler { gotham::router::builder::build_simple_router(|route| { - route.get("/").to(serve_static("text/html", &INDEX_HTML)); + route.get("/").to_new_handler(serve_template( + "text/html", + &INDEX_HTML_TMPL, + data, + )); route .get("/teleterm_web.js") .to(serve_static("application/javascript", &TELETERM_WEB_JS)); @@ -107,6 +119,30 @@ fn serve_static( } } +fn serve_template( + content_type: &'static str, + s: &'static [u8], + data: &TemplateData, +) -> impl gotham::handler::NewHandler { + let data = data.clone(); + move || { + let data = data.clone(); + Ok(move |state| { + let rendered = handlebars::Handlebars::new() + .render_template( + &String::from_utf8(s.to_vec()).unwrap(), + &data, + ) + .unwrap(); + let response = hyper::Response::builder() + .header("Content-Type", content_type) + .body(hyper::Body::from(rendered)) + .unwrap(); + (state, response) + }) + } +} + fn handle_list( state: gotham::state::State, ) -> (gotham::state::State, hyper::Response) { diff --git a/teleterm/static/index.html b/teleterm/static/index.html deleted file mode 100644 index 4a43e2b..0000000 --- a/teleterm/static/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - -
- - - diff --git a/teleterm/static/index.html.tmpl b/teleterm/static/index.html.tmpl new file mode 100644 index 0000000..c489d87 --- /dev/null +++ b/teleterm/static/index.html.tmpl @@ -0,0 +1,14 @@ + + + + + + +

{{title}}

+
+ + + diff --git a/teleterm/static/teleterm_web.js b/teleterm/static/teleterm_web.js index a2f704d..82cd6a4 100644 --- a/teleterm/static/teleterm_web.js +++ b/teleterm/static/teleterm_web.js @@ -18,31 +18,31 @@ function addHeapObject(obj) { return idx; } function __wbg_elem_binding0(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding1(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(6)(arg0, arg1, arg2); } -function __wbg_elem_binding2(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); +function __wbg_elem_binding2(arg0, arg1) { + wasm.__wbg_function_table.get(38)(arg0, arg1); } function __wbg_elem_binding3(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(62)(arg0, arg1, arg2); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding4(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding5(arg0, arg1, arg2) { - wasm.__wbg_function_table.get(61)(arg0, arg1, addHeapObject(arg2)); + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } -function __wbg_elem_binding6(arg0, arg1) { - wasm.__wbg_function_table.get(34)(arg0, arg1); +function __wbg_elem_binding6(arg0, arg1, arg2) { + wasm.__wbg_function_table.get(2)(arg0, arg1, addHeapObject(arg2)); } function __wbg_elem_binding7(arg0, arg1, arg2, arg3, arg4) { - wasm.__wbg_function_table.get(18)(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); + wasm.__wbg_function_table.get(22)(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4)); } function __wbg_elem_binding8(arg0, arg1, arg2, arg3) { - wasm.__wbg_function_table.get(22)(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); + wasm.__wbg_function_table.get(26)(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); } /** */ @@ -64,7 +64,29 @@ function takeObject(idx) { return ret; } -function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; } +function isLikeNone(x) { + return x === undefined || x === null; +} + +function handleError(e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); +} + +let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachegetUint8Memory = null; +function getUint8Memory() { + if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { + cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); + } + return cachegetUint8Memory; +} + +function getStringFromWasm(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); +} let WASM_VECTOR_LEN = 0; @@ -83,14 +105,6 @@ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' }; }); -let cachegetUint8Memory = null; -function getUint8Memory() { - if (cachegetUint8Memory === null || cachegetUint8Memory.buffer !== wasm.memory.buffer) { - cachegetUint8Memory = new Uint8Array(wasm.memory.buffer); - } - return cachegetUint8Memory; -} - function passStringToWasm(arg) { let len = arg.length; @@ -129,16 +143,12 @@ function getInt32Memory() { return cachegetInt32Memory; } -let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); - -cachedTextDecoder.decode(); - -function getStringFromWasm(ptr, len) { - return cachedTextDecoder.decode(getUint8Memory().subarray(ptr, ptr + len)); -} - -function handleError(e) { - wasm.__wbindgen_exn_store(addHeapObject(e)); +let cachegetUint32Memory = null; +function getUint32Memory() { + if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { + cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); + } + return cachegetUint32Memory; } function debugString(val) { @@ -206,17 +216,7 @@ function debugString(val) { return className; } -function isLikeNone(x) { - return x === undefined || x === null; -} - -let cachegetUint32Memory = null; -function getUint32Memory() { - if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { - cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); - } - return cachegetUint32Memory; -} +function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; } function init(module) { if (typeof module === 'undefined') { @@ -225,10 +225,6 @@ function init(module) { let result; const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); - }; - imports.wbg.__wbg_clearTimeout_42a8676f07d366c5 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout'); imports.wbg.__wbindgen_cb_drop = function(arg0) { const obj = takeObject(arg0).original; if (obj.cnt-- == 1) { @@ -238,6 +234,105 @@ function init(module) { const ret = false; return ret; }; + imports.wbg.__widl_f_target_Event = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); + }; + imports.wbg.__widl_instanceof_Element = function(arg0) { + const ret = getObject(arg0) instanceof Element; + return ret; + }; + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__widl_f_closest_Element = function(arg0, arg1, arg2) { + try { + const ret = getObject(arg0).closest(getStringFromWasm(arg1, arg2)); + return isLikeNone(ret) ? 0 : addHeapObject(ret); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_f_tag_name_Element = function(arg0, arg1) { + const ret = getObject(arg1).tagName; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_get_attribute_Element = function(arg0, arg1, arg2, arg3) { + const ret = getObject(arg1).getAttribute(getStringFromWasm(arg2, arg3)); + const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret); + const len0 = WASM_VECTOR_LEN; + const ret0 = ptr0; + const ret1 = len0; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_prevent_default_Event = function(arg0) { + getObject(arg0).preventDefault(); + }; + imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { + const ret = JSON.parse(getStringFromWasm(arg0, arg1)); + return addHeapObject(ret); + }; + imports.wbg.__widl_f_history_Window = function(arg0) { + try { + const ret = getObject(arg0).history; + return addHeapObject(ret); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_f_push_state_with_url_History = function(arg0, arg1, arg2, arg3, arg4, arg5) { + try { + getObject(arg0).pushState(getObject(arg1), getStringFromWasm(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm(arg4, arg5)); + } catch (e) { + handleError(e) + } + }; + imports.wbg.__widl_instanceof_PopStateEvent = function(arg0) { + const ret = getObject(arg0) instanceof PopStateEvent; + return ret; + }; + imports.wbg.__widl_f_state_PopStateEvent = function(arg0) { + const ret = getObject(arg0).state; + return addHeapObject(ret); + }; + imports.wbg.__wbindgen_string_get = function(arg0, arg1) { + const obj = getObject(arg0); + if (typeof(obj) !== 'string') return 0; + const ptr = passStringToWasm(obj); + getUint32Memory()[arg1 / 4] = WASM_VECTOR_LEN; + const ret = ptr; + return ret; + }; + imports.wbg.__widl_instanceof_HashChangeEvent = function(arg0) { + const ret = getObject(arg0) instanceof HashChangeEvent; + return ret; + }; + imports.wbg.__widl_f_new_url_HashChangeEvent = function(arg0, arg1) { + const ret = getObject(arg1).newURL; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_status_text_Response = function(arg0, arg1) { + const ret = getObject(arg1).statusText; + const ret0 = passStringToWasm(ret); + const ret1 = WASM_VECTOR_LEN; + getInt32Memory()[arg0 / 4 + 0] = ret0; + getInt32Memory()[arg0 / 4 + 1] = ret1; + }; + imports.wbg.__widl_f_status_Response = function(arg0) { + const ret = getObject(arg0).status; + return ret; + }; + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; imports.wbg.__wbg_new_59cb74e423758ede = function() { const ret = new Error(); return addHeapObject(ret); @@ -302,10 +397,6 @@ function init(module) { getInt32Memory()[arg0 / 4 + 0] = ret0; getInt32Memory()[arg0 / 4 + 1] = ret1; }; - imports.wbg.__widl_instanceof_Element = function(arg0) { - const ret = getObject(arg0) instanceof Element; - return ret; - }; imports.wbg.__widl_f_set_attribute_Element = function(arg0, arg1, arg2, arg3, arg4) { try { getObject(arg0).setAttribute(getStringFromWasm(arg1, arg2), getStringFromWasm(arg3, arg4)); @@ -445,6 +536,7 @@ function init(module) { imports.wbg.__widl_f_set_checked_HTMLMenuItemElement = function(arg0, arg1) { getObject(arg0).checked = arg1 !== 0; }; + imports.wbg.__wbg_clearTimeout_42a8676f07d366c5 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout'); imports.wbg.__widl_f_abort_AbortController = function(arg0) { getObject(arg0).abort(); }; @@ -483,14 +575,6 @@ function init(module) { const ret = getObject(arg0).data; return addHeapObject(ret); }; - imports.wbg.__wbindgen_string_get = function(arg0, arg1) { - const obj = getObject(arg0); - if (typeof(obj) !== 'string') return 0; - const ptr = passStringToWasm(obj); - getUint32Memory()[arg1 / 4] = WASM_VECTOR_LEN; - const ret = ptr; - return ret; - }; imports.wbg.__widl_f_close_WebSocket = function(arg0) { try { getObject(arg0).close(); @@ -560,10 +644,6 @@ function init(module) { imports.wbg.__widl_f_set_text_content_Node = function(arg0, arg1, arg2) { getObject(arg0).textContent = arg1 === 0 ? undefined : getStringFromWasm(arg1, arg2); }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); - return addHeapObject(ret); - }; imports.wbg.__wbg_resolve_04ca3cb0d333a4f0 = function(arg0) { const ret = Promise.resolve(getObject(arg0)); return addHeapObject(ret); @@ -583,86 +663,6 @@ function init(module) { handleError(e) } }; - imports.wbg.__widl_f_status_text_Response = function(arg0, arg1) { - const ret = getObject(arg1).statusText; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_status_Response = function(arg0) { - const ret = getObject(arg0).status; - return ret; - }; - imports.wbg.__widl_instanceof_HashChangeEvent = function(arg0) { - const ret = getObject(arg0) instanceof HashChangeEvent; - return ret; - }; - imports.wbg.__widl_f_new_url_HashChangeEvent = function(arg0, arg1) { - const ret = getObject(arg1).newURL; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_instanceof_PopStateEvent = function(arg0) { - const ret = getObject(arg0) instanceof PopStateEvent; - return ret; - }; - imports.wbg.__widl_f_state_PopStateEvent = function(arg0) { - const ret = getObject(arg0).state; - return addHeapObject(ret); - }; - imports.wbg.__widl_f_target_Event = function(arg0) { - const ret = getObject(arg0).target; - return isLikeNone(ret) ? 0 : addHeapObject(ret); - }; - imports.wbg.__widl_f_closest_Element = function(arg0, arg1, arg2) { - try { - const ret = getObject(arg0).closest(getStringFromWasm(arg1, arg2)); - return isLikeNone(ret) ? 0 : addHeapObject(ret); - } catch (e) { - handleError(e) - } - }; - imports.wbg.__widl_f_tag_name_Element = function(arg0, arg1) { - const ret = getObject(arg1).tagName; - const ret0 = passStringToWasm(ret); - const ret1 = WASM_VECTOR_LEN; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_get_attribute_Element = function(arg0, arg1, arg2, arg3) { - const ret = getObject(arg1).getAttribute(getStringFromWasm(arg2, arg3)); - const ptr0 = isLikeNone(ret) ? 0 : passStringToWasm(ret); - const len0 = WASM_VECTOR_LEN; - const ret0 = ptr0; - const ret1 = len0; - getInt32Memory()[arg0 / 4 + 0] = ret0; - getInt32Memory()[arg0 / 4 + 1] = ret1; - }; - imports.wbg.__widl_f_prevent_default_Event = function(arg0) { - getObject(arg0).preventDefault(); - }; - imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { - const ret = JSON.parse(getStringFromWasm(arg0, arg1)); - return addHeapObject(ret); - }; - imports.wbg.__widl_f_history_Window = function(arg0) { - try { - const ret = getObject(arg0).history; - return addHeapObject(ret); - } catch (e) { - handleError(e) - } - }; - imports.wbg.__widl_f_push_state_with_url_History = function(arg0, arg1, arg2, arg3, arg4, arg5) { - try { - getObject(arg0).pushState(getObject(arg1), getStringFromWasm(arg2, arg3), arg4 === 0 ? undefined : getStringFromWasm(arg4, arg5)); - } catch (e) { - handleError(e) - } - }; imports.wbg.__widl_f_get_attribute_names_Element = function(arg0) { const ret = getObject(arg0).getAttributeNames(); return addHeapObject(ret); @@ -884,16 +884,16 @@ function init(module) { imports.wbg.__widl_f_warn_1_ = function(arg0) { console.warn(getObject(arg0)); }; - imports.wbg.__wbindgen_closure_wrapper594 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper126 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding5(a, state.b, arg0); + return __wbg_elem_binding3(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -902,16 +902,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper593 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper133 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding0(a, state.b, arg0); + return __wbg_elem_binding5(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -920,16 +920,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper487 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper525 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = () => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding6(a, state.b, ); + return __wbg_elem_binding2(a, state.b, ); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -938,16 +938,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper655 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper789 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding3(a, state.b, arg0); + return __wbg_elem_binding4(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -956,16 +956,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper792 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper128 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding4(a, state.b, arg0); + return __wbg_elem_binding6(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -974,16 +974,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper653 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper130 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding1(a, state.b, arg0); + return __wbg_elem_binding0(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } @@ -992,16 +992,16 @@ function init(module) { const ret = real; return addHeapObject(ret); }; - imports.wbg.__wbindgen_closure_wrapper595 = function(arg0, arg1, arg2) { + imports.wbg.__wbindgen_closure_wrapper131 = function(arg0, arg1, arg2) { const state = { a: arg0, b: arg1, cnt: 1 }; const real = (arg0) => { state.cnt++; const a = state.a; state.a = 0; try { - return __wbg_elem_binding2(a, state.b, arg0); + return __wbg_elem_binding1(a, state.b, arg0); } finally { - if (--state.cnt === 0) wasm.__wbg_function_table.get(35)(a, state.b); + if (--state.cnt === 0) wasm.__wbg_function_table.get(3)(a, state.b); else state.a = a; } } diff --git a/teleterm/static/teleterm_web_bg.wasm b/teleterm/static/teleterm_web_bg.wasm index 2b2e8f8..f034ebe 100644 Binary files a/teleterm/static/teleterm_web_bg.wasm and b/teleterm/static/teleterm_web_bg.wasm differ -- cgit v1.2.3-54-g00ecf