pub struct CheckAlert {
pub on: Vec<CheckAlertStatus>,
pub notify_user: bool,
pub notify_groups: Vec<String>,
pub priority: NotificationPriority,
pub require_ack: bool,
pub toast: bool,
pub email: bool,
pub title: String,
pub body: Option<String>,
}Expand description
Auto-notification rule for a CheckHint (compliance alerting). When a
check’s status transitions into one of on, the backend
publishes a notification to the failing PC’s user
(notify_user) and/or operator groups
(notify_groups). Deliberately config-driven:
who gets told, how loud, and the wording all live in the manifest, not
hardcoded in the backend.
Fields§
§on: Vec<CheckAlertStatus>Statuses that fire the alert on transition into them (a check that
stays failing doesn’t re-alert every poll). Defaults to [fail].
ok is not representable — CheckAlertStatus has no Ok variant,
so a YAML on: [ok] fails to deserialize (before validate() is
even reached); “recovered” notifications are out of scope.
notify_user: boolNotify the user(s) on the failing PC (notifications.pc.<pc_id>).
notify_groups: Vec<String>Notify these operator groups (notifications.group.<name>).
priority: NotificationPriorityNotification priority (colour/label only — toasting is the separate
toast flag). Defaults to warn.
require_ack: boolRequire the recipient to click 確認 to dismiss.
toast: boolSurface an OS toast (launches a closed Client App, Action Center
while locked). Recommended true for notify_user so a
non-emergency “your PC is non-compliant” nudge still reaches a user
whose app is closed.
email: boolAlso send the alert by email, to every address mapped to the
notify_groups (via the group_contacts KV, edited on the SPA
Groups page). Opt-in: defaults to false, so an existing alert
never starts emailing on its own. Requires notify_groups to be
non-empty (there is no per-PC user email) and the backend’s
[mail] config to be present; otherwise the email is a logged
no-op while the in-app/toast notification still fires.
title: StringNotification title (required). May use the same {…} placeholders
as body.
body: Option<String>Notification body template. Placeholders: {pc_id}, {name} (check
slug), {label} (check label, falls back to slug), {status},
{detail} (the check’s one-line summary), {last_logon} (the PC’s
last sign-in account). Absent → empty body.
Trait Implementations§
Source§impl Clone for CheckAlert
impl Clone for CheckAlert
Source§fn clone(&self) -> CheckAlert
fn clone(&self) -> CheckAlert
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 CheckAlert
impl Debug for CheckAlert
Source§impl<'de> Deserialize<'de> for CheckAlert
impl<'de> Deserialize<'de> for CheckAlert
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 CheckAlert
impl JsonSchema for CheckAlert
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