feat: phase 2 — am web : dashboard web local + API JSON (contrats --json, 127.0.0.1, tiny_http, frontend embarqué) (closes #54)
release / linux (push) Successful in 14m16s
release / windows (push) Canceled after 0s
release / macos (push) Canceled after 0s

This commit is contained in:
2026-08-18 16:40:15 -04:00
parent 7f4d74f811
commit fa51cdb339
20 changed files with 1392 additions and 40 deletions
+22 -8
View File
@@ -75,14 +75,14 @@ pub fn parse_since(s: &str) -> Result<chrono::DateTime<chrono::FixedOffset>> {
}
#[derive(Serialize)]
struct LogRow {
ts: String,
kind: String,
agent: Option<String>,
pid: Option<u32>,
exit_code: Option<i32>,
duration_s: Option<u64>,
session: Option<String>,
pub struct LogRow {
pub ts: String,
pub kind: String,
pub agent: Option<String>,
pub pid: Option<u32>,
pub exit_code: Option<i32>,
pub duration_s: Option<u64>,
pub session: Option<String>,
}
impl From<&Event> for LogRow {
@@ -99,6 +99,20 @@ impl From<&Event> for LogRow {
}
}
/// Rows for the web API (issue #54): same shape as `am log --json`.
pub fn rows(
app: &App,
agent: Option<&str>,
kinds: Option<&str>,
since: Option<&str>,
limit: usize,
) -> Result<Vec<LogRow>> {
Ok(filter_events(app, agent, kinds, since, limit)?
.iter()
.map(LogRow::from)
.collect())
}
/// Chars of text after byte offset seen (UTF-8 safe).
pub fn text_after(text: &str, seen: usize) -> String {
text.char_indices()