Files
unshell/src/config/mod.rs
T

42 lines
943 B
Rust
Raw Normal View History

2025-12-21 00:35:28 -07:00
pub mod config_struct;
2025-12-23 23:09:05 -07:00
pub mod config_struct_list;
2025-12-21 00:35:28 -07:00
mod tree;
pub use tree::{InterfaceData, InterfaceStruct, Tree, TreeMessage};
2025-12-20 22:39:56 -07:00
use std::collections::HashMap;
#[derive(Debug, Clone)]
pub struct RuntimeConfig {
2025-11-14 09:43:41 -07:00
pub parent_component: String,
pub name: String,
pub config: HashMap<String, String>,
}
2025-12-23 23:09:05 -07:00
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize)]
pub enum ConfigStructField {
Header(String),
Text(String),
String {
// Default value of string edit in struct
#[serde(default)]
default: String,
max_length: Option<usize>,
// Display string edit as password
#[serde(default)]
protected: bool,
},
Integer {
// Default value of integer in struct
#[serde(default)]
default: i32,
min: Option<i32>,
max: Option<i32>,
},
// Checkbox
// Dropdown
// Collapsing header
// Slider
// ...
}