0.6.6
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
|
||||
mod demo_http;
|
||||
mod demo_ws;
|
||||
mod demo_ws_manager;
|
||||
mod splash;
|
||||
|
||||
pub use crate::splash::SplashOrder;
|
||||
@@ -37,6 +38,8 @@ struct KbAppState {
|
||||
config: kb_lib::KbConfig,
|
||||
ws_runtime: tokio::sync::Mutex<KbWsRuntimeState>,
|
||||
demo_ws_runtime: std::sync::Arc<tokio::sync::Mutex<crate::demo_ws::KbDemoWsRuntimeState>>,
|
||||
demo_ws_manager_runtime: std::sync::Arc<tokio::sync::Mutex<crate::demo_ws_manager::KbDemoWsManagerRuntimeState>>,
|
||||
ws_manager: std::sync::Arc<kb_lib::WsManager>,
|
||||
http_pool: kb_lib::HttpEndpointPool,
|
||||
}
|
||||
|
||||
@@ -82,12 +85,24 @@ pub fn run() {
|
||||
panic!("cannot create http endpoint pool: {}", error);
|
||||
}
|
||||
};
|
||||
let ws_manager_result = kb_lib::WsManager::from_config(&config);
|
||||
let ws_manager = match ws_manager_result {
|
||||
Ok(ws_manager) => ws_manager,
|
||||
Err(error) => {
|
||||
tracing::error!("cannot create websocket manager: {}", error);
|
||||
panic!("cannot create websocket manager: {}", error);
|
||||
}
|
||||
};
|
||||
let app_state = KbAppState {
|
||||
config: config.clone(),
|
||||
ws_runtime: tokio::sync::Mutex::new(KbWsRuntimeState::new()),
|
||||
demo_ws_runtime: std::sync::Arc::new(tokio::sync::Mutex::new(
|
||||
crate::demo_ws::KbDemoWsRuntimeState::new(),
|
||||
)),
|
||||
demo_ws_manager_runtime: std::sync::Arc::new(tokio::sync::Mutex::new(
|
||||
crate::demo_ws_manager::KbDemoWsManagerRuntimeState::new(),
|
||||
)),
|
||||
ws_manager: std::sync::Arc::new(ws_manager),
|
||||
http_pool,
|
||||
};
|
||||
let tracing_builder = tauri_plugin_tracing::Builder::new();
|
||||
@@ -106,6 +121,13 @@ pub fn run() {
|
||||
crate::demo_http::open_demo_http_window,
|
||||
crate::demo_http::demo_http_list_pool_clients,
|
||||
crate::demo_http::demo_http_execute_request,
|
||||
crate::demo_ws_manager::open_demo_ws_manager_window,
|
||||
crate::demo_ws_manager::demo_ws_manager_get_snapshot,
|
||||
crate::demo_ws_manager::demo_ws_manager_list_roles,
|
||||
crate::demo_ws_manager::demo_ws_manager_start_all,
|
||||
crate::demo_ws_manager::demo_ws_manager_stop_all,
|
||||
crate::demo_ws_manager::demo_ws_manager_start_role,
|
||||
crate::demo_ws_manager::demo_ws_manager_stop_role,
|
||||
]);
|
||||
tauri_builder = tauri_builder.plugin(tracing_builder.build::<tauri::Wry>());
|
||||
tauri_builder = tauri_builder.setup(|app| {
|
||||
|
||||
Reference in New Issue
Block a user