feat: persist and display device uptime and logged-in user#90
Open
ToddHebebrand wants to merge 2 commits intomainfrom
Open
feat: persist and display device uptime and logged-in user#90ToddHebebrand wants to merge 2 commits intomainfrom
ToddHebebrand wants to merge 2 commits intomainfrom
Conversation
The agent already collected lastUser but it was never stored in the DB or shown in the UI, and uptime was not computed at all. This adds: - Agent: compute uptime via gopsutil host.BootTime() and include in heartbeat - API: new DB migration adding last_user/uptime_seconds columns to devices - API: heartbeat handler now persists both fields on each heartbeat - Frontend: uptime and logged-in user cards on device overview tab - Frontend: uptime and logged-in user rows on device info tab Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add lastUser and uptimeSeconds to device list API select and response mapping so overview cards populate when navigating from the list - Log warning when host.BootTime() fails instead of silently swallowing - Add .max(255) to lastUser and .min(0) to uptime Zod validation - Extract duplicated formatUptime into shared lib/utils.ts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
host.BootTime()(gopsutil) and send asuptimein heartbeat payloadlast_useranduptime_secondscolumns todevicestable (migration + Drizzle schema), persist both fields in heartbeat handlerTest plan
go build ./cmd/breeze-agent)go test ./internal/heartbeat/...)tsc --noEmit)pnpm db:migrateto apply migrationlastUseranduptimefields — verify stored in DB🤖 Generated with Claude Code