Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Scan the QR-Code with a smart-phone camera and open the URL.

Select the module to run in the drop-down, then click "Run module" button.

The module list is dynamically populated from the modules in [services/ws-modules](services/ws-modules).

Note: The WASM build disables WebAssembly reference types, so it can still load on older browsers such as Chrome 95.

## Grant
Expand Down
2 changes: 2 additions & 0 deletions services/ws-modules/comm1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
description = "comm 1"
name = "et-ws-comm1"
version = "0.1.0"
edition.workspace = true
Expand All @@ -13,6 +14,7 @@ edge-toolkit = { path = "../../../libs/edge-toolkit" }
et-ws-wasm-agent = { path = "../../ws-wasm-agent" }
js-sys = "0.3"
serde.workspace = true
serde-wasm-bindgen = "0.6"
serde_json.workspace = true
tracing.workspace = true
tracing-wasm = "0.2"
Expand Down
10 changes: 10 additions & 0 deletions services/ws-modules/comm1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ pub fn init() {
info!("comm1 workflow module initialized");
}

#[wasm_bindgen]
pub fn metadata() -> JsValue {
serde_wasm_bindgen::to_value(&json!({
"name": env!("CARGO_PKG_NAME"),
"description": env!("CARGO_PKG_DESCRIPTION"),
"version": env!("CARGO_PKG_VERSION"),
}))
.unwrap_or(JsValue::NULL)
}

#[wasm_bindgen]
pub async fn run() -> Result<(), JsValue> {
log("comm1: entered run()")?;
Expand Down
2 changes: 2 additions & 0 deletions services/ws-modules/data1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
description = "data 1"
name = "et-ws-data1"
version = "0.1.0"
edition.workspace = true
Expand All @@ -13,6 +14,7 @@ edge-toolkit = { path = "../../../libs/edge-toolkit" }
et-ws-wasm-agent = { path = "../../ws-wasm-agent" }
js-sys = "0.3"
serde.workspace = true
serde-wasm-bindgen = "0.6"
serde_json.workspace = true
tracing.workspace = true
tracing-wasm = "0.2"
Expand Down
11 changes: 11 additions & 0 deletions services/ws-modules/data1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::rc::Rc;
use edge_toolkit::ws::WsMessage;
use et_ws_wasm_agent::{WsClient, WsClientConfig, append_to_textarea};
use js_sys::{Promise, Reflect};
use serde_json::json;
use tracing::info;
use wasm_bindgen::prelude::*;
use wasm_bindgen_futures::JsFuture;
Expand All @@ -15,6 +16,16 @@ pub fn init() {
info!("data1 workflow module initialized");
}

#[wasm_bindgen]
pub fn metadata() -> JsValue {
serde_wasm_bindgen::to_value(&json!({
"name": env!("CARGO_PKG_NAME"),
"description": env!("CARGO_PKG_DESCRIPTION"),
"version": env!("CARGO_PKG_VERSION"),
}))
.unwrap_or(JsValue::NULL)
}

#[wasm_bindgen]
pub async fn run() -> Result<(), JsValue> {
let msg = "data1: entered run()";
Expand Down
2 changes: 2 additions & 0 deletions services/ws-modules/face-detection/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
description = "face detection"
name = "et-ws-face-detection"
version = "0.1.0"
edition.workspace = true
Expand All @@ -12,6 +13,7 @@ crate-type = ["cdylib", "rlib"]
et-ws-wasm-agent = { path = "../../ws-wasm-agent" }
js-sys = "0.3"
serde.workspace = true
serde-wasm-bindgen = "0.6"
serde_json.workspace = true
tracing.workspace = true
tracing-wasm = "0.2"
Expand Down
10 changes: 10 additions & 0 deletions services/ws-modules/face-detection/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,16 @@ pub fn init() {
info!("face detection workflow module initialized");
}

#[wasm_bindgen]
pub fn metadata() -> JsValue {
serde_wasm_bindgen::to_value(&json!({
"name": env!("CARGO_PKG_NAME"),
"description": env!("CARGO_PKG_DESCRIPTION"),
"version": env!("CARGO_PKG_VERSION"),
}))
.unwrap_or(JsValue::NULL)
}

#[wasm_bindgen]
pub fn is_running() -> bool {
FACE_RUNTIME.with(|runtime| runtime.borrow().is_some())
Expand Down
2 changes: 2 additions & 0 deletions services/ws-modules/har1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[package]
description = "human activity recognition 1"
name = "et-ws-har1"
version = "0.1.0"
edition.workspace = true
Expand All @@ -12,6 +13,7 @@ crate-type = ["cdylib", "rlib"]
et-ws-wasm-agent = { path = "../../ws-wasm-agent" }
js-sys = "0.3"
serde.workspace = true
serde-wasm-bindgen = "0.6"
serde_json.workspace = true
tracing.workspace = true
tracing-wasm = "0.2"
Expand Down
10 changes: 10 additions & 0 deletions services/ws-modules/har1/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@ pub fn init() {
info!("har1 workflow module initialized");
}

#[wasm_bindgen]
pub fn metadata() -> JsValue {
serde_wasm_bindgen::to_value(&json!({
"name": env!("CARGO_PKG_NAME"),
"description": env!("CARGO_PKG_DESCRIPTION"),
"version": env!("CARGO_PKG_VERSION"),
}))
.unwrap_or(JsValue::NULL)
}

#[wasm_bindgen]
pub async fn run() -> Result<(), JsValue> {
set_har_status("har1: entered run()")?;
Expand Down
Loading
Loading