diff --git a/packages/frontend/src/modules/pages/editor.rs b/packages/frontend/src/modules/pages/editor.rs index d9ca1ee..4d1963a 100644 --- a/packages/frontend/src/modules/pages/editor.rs +++ b/packages/frontend/src/modules/pages/editor.rs @@ -11,7 +11,7 @@ const CREATE_VIEWPORT: &str = r#" // -> add something like simple_ai_backend :: onnx :: Project . train() // - BUT FIRST: add a save button and // -> js getNodesFunction -// -> convert to Node of backend +// -> convert to Node of backend (serde json) // -> add something like simple_ai_backend :: onnx :: Project . save_nodes(Vec) #[page] pub fn Editor() -> Element { @@ -21,11 +21,19 @@ pub fn Editor() -> Element { sleep(Duration::from_millis(100)).await; let mut viewport_listener = document::eval(CREATE_VIEWPORT); // loop { - // let id: i32 = viewport_listener.recv().await.unwrap(); - // debug!("id {id}"); + // TODO: also convert the string to a rust new Event enum + // - the event types of the enum are AddNode and CheckConnection + // - the backend will need something like simple_ai_backend :: onnx :: + // check_connection (param1, param2) + // + // let event: String = viewport_listener.recv().await.unwrap(); + // + // // TODO: simple_ai_backend :: onnx :: fetch_node_from_id(id) -> Node; // - Then make a function that converts the Node to the js one; // - Lastly document::eval(format!(r#"window.activeOnnxViewport.addNode({})"#, node)); + // + // TODO: If something failes make a notification. // } }, section { id: "viewport" }