feat: example-lamp now uses harmony-tui

This commit is contained in:
2025-04-17 10:50:44 -04:00
parent afbbde694a
commit feea9780ab
3 changed files with 8 additions and 9 deletions

1
Cargo.lock generated
View File

@@ -823,6 +823,7 @@ dependencies = [
"env_logger", "env_logger",
"harmony", "harmony",
"harmony_macros", "harmony_macros",
"harmony_tui",
"harmony_types", "harmony_types",
"log", "log",
"tokio", "tokio",

View File

@@ -8,7 +8,7 @@ publish = false
[dependencies] [dependencies]
harmony = { path = "../../harmony" } harmony = { path = "../../harmony" }
#harmony_tui = { path = "../../harmony_tui" } harmony_tui = { path = "../../harmony_tui" }
harmony_types = { path = "../../harmony_types" } harmony_types = { path = "../../harmony_types" }
cidr = { workspace = true } cidr = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }

View File

@@ -1,8 +1,5 @@
use harmony::{ use harmony::{
data::Version, data::Version, inventory::Inventory, maestro::Maestro, modules::lamp::{LAMPConfig, LAMPScore}, topology::{HAClusterTopology, Url}
maestro::Maestro,
modules::lamp::{LAMPConfig, LAMPScore},
topology::{HAClusterTopology, Url},
}; };
#[tokio::main] #[tokio::main]
@@ -17,8 +14,9 @@ async fn main() {
}, },
}; };
Maestro::<HAClusterTopology>::load_from_env() let inventory = Inventory::autoload();
.interpret(Box::new(lamp_stack)) let topology = HAClusterTopology::autoload();
.await let mut maestro = Maestro::new(inventory, topology);
.unwrap(); maestro.register_all(vec![Box::new(lamp_stack)]);
harmony_tui::init(maestro).await.unwrap();
} }