Will change this commit message to mean something later
Some checks failed
dev release / build (push) Failing after 0s
Some checks failed
dev release / build (push) Failing after 0s
This commit is contained in:
parent
f3905d8114
commit
8d3f55b607
14 changed files with 1491 additions and 40 deletions
|
|
@ -38,6 +38,7 @@ pub enum StateCommand {
|
|||
},
|
||||
ClearSubscriptions,
|
||||
ClearModules,
|
||||
ClearWidgets,
|
||||
SetModuleStatus {
|
||||
name: String,
|
||||
status: ModuleLoadState,
|
||||
|
|
@ -117,6 +118,10 @@ impl StateHandle {
|
|||
let _ = self.command_tx.send(StateCommand::ClearModules);
|
||||
}
|
||||
|
||||
pub fn clear_widgets(&self) {
|
||||
let _ = self.command_tx.send(StateCommand::ClearWidgets);
|
||||
}
|
||||
|
||||
pub fn set_module_status(
|
||||
&self,
|
||||
name: String,
|
||||
|
|
@ -290,6 +295,9 @@ async fn handle_command(
|
|||
StateCommand::ClearModules => {
|
||||
state.write().await.modules.clear();
|
||||
}
|
||||
StateCommand::ClearWidgets => {
|
||||
state.write().await.widgets.clear();
|
||||
}
|
||||
StateCommand::SetModuleStatus {
|
||||
name,
|
||||
status,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
use std::collections::{BTreeMap, HashMap};
|
||||
|
||||
use bread_shared::widget::WidgetSpec;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::Value;
|
||||
|
||||
|
|
@ -15,6 +16,10 @@ pub struct RuntimeState {
|
|||
pub profile: ProfileState,
|
||||
pub modules: Vec<ModuleStatus>,
|
||||
pub workflows: Vec<WorkflowStatus>,
|
||||
/// Widgets registered via `bread.widget.register` from any Lua module,
|
||||
/// keyed implicitly by `WidgetSpec.id` (fully-qualified `<module>.<local_id>`).
|
||||
/// Surfaced via the `widgets.list` IPC method for breadbar to render.
|
||||
pub widgets: Vec<WidgetSpec>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue