CMMS embedding: Export to CAM - build STL, save, navigate to Kiri:Moto

Wires Message::StlExport's existing STLOUT command to the CMMS when
embedded, instead of the native save-dialog flow (which was already
non-functional on the web build regardless - handle_path() has no real
filesystem to write to there, a pre-existing upstream gap, not something
this touches).

- Cargo.toml: add the Location web-sys feature (needed for
  window.location().set_href()).
- src/sys.rs: post_stl_export_to_host() - POSTs STL bytes as a new
  attachment (cad_export_stl action, not cad_save/cad_save_new - STL isn't
  in CAD_EDITABLE_EXT, it needs its own allowlist), then navigates the
  browser straight to the CMMS's Kiri:Moto CAM page for the attachment it
  just created. Splits cfg.job_id's "type:id" owner token apart to build
  cam-edit.php's entity_type=/entity_id= params.
- src/app/mod.rs + update/mod.rs: CmmsStlExportResult message/handler -
  only ever surfaces a failure (a success already navigated away).
- src/app/update/mod.rs: Message::StlExport gains a wasm32+embedded branch
  that skips the file-picker entirely and calls the above directly.
This commit is contained in:
AI Assistant 2026-08-23 17:41:02 +10:00
commit 3f8b69c71b
4 changed files with 120 additions and 0 deletions

View file

@ -82,6 +82,7 @@ js-sys = "0.3"
bincode = "1.3"
web-sys = { version = "=0.3.85", features = [
"Window",
"Location",
"Storage",
"StorageManager",
"Navigator",