diff --git a/src/api/admin/i18n.rs b/src/api/admin/i18n.rs index 0f458e2..4a340aa 100644 --- a/src/api/admin/i18n.rs +++ b/src/api/admin/i18n.rs @@ -865,13 +865,6 @@ pub fn t(lang: Lang, key: &str) -> &'static str { "Datele de inventar nu au fost încă raportate. Agentul le colectează la pornire și le încarcă la următorul ciclu sysinfo (≤120 s).", "Aún no se han reportado datos de inventario. El agente los recopila al iniciar y los envía en el próximo ciclo sysinfo (≤120 s).", ), - "devices.inventory_unsupported" => ( - "Inventory data is only reported by HelloAgent. This device is running {0}; the standard RustDesk client does not collect hardware or BitLocker inventory.", - "Inventardaten werden nur von HelloAgent gemeldet. Auf diesem Gerät läuft {0}; der Standard-RustDesk-Client erfasst keine Hardware- oder BitLocker-Inventardaten.", - "Les données d'inventaire ne sont rapportées que par HelloAgent. Cet appareil exécute {0} ; le client RustDesk standard ne collecte pas l'inventaire matériel ou BitLocker.", - "Datele de inventar sunt raportate doar de HelloAgent. Acest dispozitiv rulează {0}; clientul RustDesk standard nu colectează inventar hardware sau BitLocker.", - "Los datos de inventario solo los reporta HelloAgent. Este dispositivo está ejecutando {0}; el cliente RustDesk estándar no recopila inventario de hardware ni BitLocker.", - ), "devices.serial_number" => ( "Serial number", "Seriennummer", diff --git a/src/api/admin/pages/devices.rs b/src/api/admin/pages/devices.rs index 7184378..f195eaa 100644 --- a/src/api/admin/pages/devices.rs +++ b/src/api/admin/pages/devices.rs @@ -521,32 +521,24 @@ fn render_detail(lang: Lang, d: &DashboardDeviceRow) -> String { mem_rt = html_escape(if mem_runtime.is_empty() { "—" } else { &mem_runtime }), ); - // Inventory section — only present when the agent reports it. We key - // gating off `agent_name == "HelloAgent"` because the regular RustDesk - // client doesn't ship the inventory collector and would never populate - // this. `agent_name` is the explicit rebrand identity stamped by - // hello-agent's main.rs; absence means vanilla rustdesk. - let inventory_section = if agent_name == "HelloAgent" { - match parsed.get("inventory") { - Some(inv) if inv.is_object() => render_inventory_table(lang, inv), - _ => format!( - r##"
- {msg} -
"##, - msg = t(lang, "devices.inventory_pending"), - ), - } - } else { - format!( + // Inventory section — rendered whenever the device's sysinfo payload + // contains a populated `inventory` object, regardless of which client + // sent it. We used to gate this on `agent_name == "HelloAgent"` (the + // explicit rebrand identity stamped by hello-agent), but that filter + // (a) broke silently when hello-agent's APP_NAME changed casing, and + // (b) hid any inventory data shipped by a future client variant that + // didn't carry the exact same agent_name string. Rendering on presence + // (`inv.is_object()`) instead of identity makes the page robust to both. + // The "pending" message covers the only remaining absence case: an + // agent that doesn't (or doesn't yet) report inventory. + let inventory_section = match parsed.get("inventory") { + Some(inv) if inv.is_object() => render_inventory_table(lang, inv), + _ => format!( r##"
{msg}
"##, - msg = tf1( - lang, - "devices.inventory_unsupported", - &format!("{}", html_escape(&identity_label)) - ), - ) + msg = t(lang, "devices.inventory_pending"), + ), }; format!(