pub struct InventoryHint {
pub display: Vec<DisplayField>,
pub summary: Option<Vec<DisplayField>>,
pub explode: Option<Vec<ExplodeSpec>>,
pub history_scalars: Option<Vec<String>>,
}Expand description
Manifest sub-section: how the SPA should render the inventory
facts this job produces. Each field name (field) is a top-level
key in the stdout JSON, e.g. hostname, ram_gb.
Two render modes:
display— vertical “field / value” per PC, used by the/inventory?pc=<id>detail view. ALL columns the operator wants visible on the detail page.summary— horizontal table across the fleet (row = PC, column = field) on/inventory. Optional; when omitted the SPA falls back todisplay, but operators usually want a trimmer “hostname / OS / CPU / RAM” set for the fleet view.
Fields§
§display: Vec<DisplayField>Detail-view columns, in order.
summary: Option<Vec<DisplayField>>Optional fleet-list columns (row = PC). Defaults to display
when omitted, but operators usually pick a 3-5 column subset.
explode: Option<Vec<ExplodeSpec>>v0.31 / #40: payload arrays that should be exploded into
per-element rows of a derived SQLite table. Lets operators
answer cross-PC questions (“which PCs still have Chrome <
120?”, “C: >90% full”) with normal SQL filters + indexes
instead of grepping JSON. The projector creates the derived
table on register and replaces this PC’s rows on each result
(DELETE WHERE pc_id=? AND job_id=? + bulk INSERT). See
ExplodeSpec for the per-spec schema.
history_scalars: Option<Vec<String>>v0.35 / #93: top-level scalar fields whose changes the
projector logs to inventory_history (one event per
changed field per scan). Pairs with explode[].track_history
— that covers array elements; this covers single-valued
fields like ram_bytes / os_version / cpu_model /
os_build that operators want to track for “did the RAM
get upgraded?” / “when did Win 11 land on this PC?” /
“BIOS / firmware bumped?” questions. Field name = field_path
in the history row, identity_json is NULL, before_json
/ after_json each carry {"value": <prior or new value>}.
First-ever observation of a scalar (no prior facts row)
emits added; subsequent value changes emit changed. No
removed events — a scalar disappearing from the payload
is rare and the operator can still see the last value via
the before_json of the most recent change.
Trait Implementations§
Source§impl Clone for InventoryHint
impl Clone for InventoryHint
Source§fn clone(&self) -> InventoryHint
fn clone(&self) -> InventoryHint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InventoryHint
impl Debug for InventoryHint
Source§impl<'de> Deserialize<'de> for InventoryHint
impl<'de> Deserialize<'de> for InventoryHint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for InventoryHint
impl JsonSchema for InventoryHint
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more