Skip to content
Merged
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
14 changes: 11 additions & 3 deletions packages/frontend/src/modules/pages/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Nodes>)
#[page]
pub fn Editor() -> Element {
Expand All @@ -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" }
Expand Down
Loading