Added comprehensive timestamp formatting to both agent logs and UI:
Rust Agent Logger:
- Added chrono dependency to Cargo.toml
- Updated SimpleLogger to include timestamps in log output
- Format: [2026-01-15 19:45:23.456] [LEVEL] message
- Shows full date, time, and milliseconds for precise log tracking
Phoenix UI Enhancements:
- Added format_datetime/1 - Full date/time with timezone
- Added format_date/1 - Short date format
- Added format_last_seen_with_date/1 - Relative time with full date
- Updated agent show page to display full timestamps in 'Last Seen' card
- Added comprehensive Timestamps section showing:
- Created date (inserted_at)
- Last Updated date (updated_at)
- Last Seen date (last_seen_at with heartbeat context)
- Last IP Address
- Updated agent index page to show full datetime alongside relative time
All timestamps now include both human-readable relative times ('5m ago')
and precise absolute dates for accurate record keeping and debugging.
27 lines
650 B
TOML
27 lines
650 B
TOML
[package]
|
|
name = "towerops-agent"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
|
|
[dependencies]
|
|
snmp = "0.2"
|
|
ureq = { version = "2.10", features = ["json"] }
|
|
tokio = { version = "1", features = ["rt-multi-thread", "macros", "sync", "time"] }
|
|
serde = { version = "1.0", features = ["derive"] }
|
|
serde_json = "1.0"
|
|
rusqlite = { version = "0.32", features = ["bundled"] }
|
|
log = { version = "0.4", features = ["std"] }
|
|
clap = { version = "4.0", features = ["derive", "env"] }
|
|
prost = "0.13"
|
|
prost-types = "0.13"
|
|
tiny_http = "0.12"
|
|
chrono = "0.4"
|
|
|
|
[build-dependencies]
|
|
prost-build = "0.13"
|
|
|
|
[profile.release]
|
|
opt-level = "z"
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = true
|