-
Notifications
You must be signed in to change notification settings - Fork 0
feat: read-only dashboard (agentflare serve) — Phases 0–2 #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
eff0762
build: add axum, tower-http, rust-embed for dashboard
e84869b
feat(serve): wire agentflare serve subcommand
6f500be
feat(dashboard): read-only db helper and claims json
89a9bc5
feat(dashboard): axum server, embedded assets, claims endpoint
98c2517
test(dashboard): smoke-test claims endpoint
c1de60e
feat(dashboard): add pm_db_readonly helper for PM backend.db
4737281
feat(dashboard): add /api/pm/workspaces and /api/pm/projects endpoints
0740c41
feat(dashboard): add /api/pm/items and /api/pm/states endpoints
6e9864b
feat(dashboard): add /api/pm/comments, /api/pm/labels, and /api/pm/ev…
2ad568a
chore: gitignore Claude Code local runtime artifacts
a8d350b
Revert "chore: gitignore Claude Code local runtime artifacts"
cc2e66d
rename dashboard /api/pm/events route to /api/webhooks
875ab1b
add dashboard shell layout, design tokens, and shared nav chrome
23c5814
add PM board view
0cc81d4
add PM list view
e4ce599
add PM item detail view
70cf591
add webhook delivery log view
67d87fc
pull refined design tokens and board styling from claude.ai/design
4e4a864
add /api/cost endpoint reusing rollup query
b51416b
add /events SSE stream pushing live claims + cost snapshots
acae027
add live Claims and Cost dashboard views
9fa0d3f
default the dashboard port to 35273 (FLARE on a phone keypad)
672d11f
redirect dashboard root to the styled board view
c8fbccd
fix stray NUL byte in claims.html x-for key
41040d9
share one SSE snapshot across clients via broadcast
b05f700
keep serve near-idle: throttle the expensive cost refresh in /events
a1cf344
Merge remote-tracking branch 'origin/master' into feat/dashboard-design
45f2047
fix Cargo.lock merge: keep master's patched dep versions (crossbeam-e…
a09c13c
Merge remote-tracking branch 'origin/master' into feat/dashboard-design
d0d0e41
satisfy fmt + clippy: rustfmt dashboard files, drop dead live_snapsho…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,145 @@ | ||
| <!-- @dsCard group="PM" --> | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <title>agentflare dashboard — board</title> | ||
| <link rel="stylesheet" href="/tokens.css" /> | ||
| <script defer src="/shell.js"></script> | ||
| <script defer src="/vendor/alpine.js"></script> | ||
| </head> | ||
| <body> | ||
| <div class="af-app"> | ||
| <aside class="af-sidebar" x-data="shellNav()" x-init="init()"> | ||
| <div class="af-sidebar-header"><span class="af-logo-mark"></span>agentflare</div> | ||
|
|
||
| <div class="af-nav-section"> | ||
| <label class="af-nav-section-label" for="af-workspace-select">Workspace</label> | ||
| <select | ||
| id="af-workspace-select" | ||
| class="af-select" | ||
| x-model="workspaceId" | ||
| @change="onWorkspaceChange()" | ||
| > | ||
| <template x-if="!loading && workspaces.length === 0"> | ||
| <option value="">No workspaces</option> | ||
| </template> | ||
| <template x-for="w in workspaces" :key="w.id"> | ||
| <option :value="w.id" x-text="w.name"></option> | ||
| </template> | ||
| </select> | ||
| </div> | ||
|
|
||
| <div class="af-nav-section"> | ||
| <label class="af-nav-section-label" for="af-project-select">Project</label> | ||
| <select | ||
| id="af-project-select" | ||
| class="af-select" | ||
| x-model="projectId" | ||
| @change="onProjectChange()" | ||
| > | ||
| <template x-if="!loading && projects.length === 0"> | ||
| <option value="">No projects</option> | ||
| </template> | ||
| <template x-for="p in projects" :key="p.id"> | ||
| <option :value="p.id" x-text="p.identifier + ' — ' + p.name"></option> | ||
| </template> | ||
| </select> | ||
| </div> | ||
|
|
||
| <nav class="af-nav-links"> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/board.html') }" :href="navHref('/board.html')">Board</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/list.html') }" :href="navHref('/list.html')">List</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/webhooks.html') }" :href="navHref('/webhooks.html')">Webhooks</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/claims.html') }" :href="navHref('/claims.html')">Claims</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/cost.html') }" :href="navHref('/cost.html')">Cost</a> | ||
| </nav> | ||
| </aside> | ||
|
|
||
| <div class="af-main-col"> | ||
| <header class="af-topbar"> | ||
| <h1>Board</h1> | ||
| </header> | ||
| <main | ||
| class="af-content" | ||
| x-data="boardView()" | ||
| x-init="init()" | ||
| > | ||
| <template x-if="!loading && !projectId"> | ||
| <p class="af-empty">No project selected — create a workspace and project first.</p> | ||
| </template> | ||
| <template x-if="!loading && projectId && states.length === 0"> | ||
| <p class="af-empty">No states configured for this project.</p> | ||
| </template> | ||
| <div class="af-board" x-show="!loading && states.length > 0"> | ||
| <template x-for="state in states" :key="state.id"> | ||
| <div class="af-board-col"> | ||
| <div class="af-board-col-header"> | ||
| <span class="af-state-dot" :style="{ background: state.color, color: state.color }"></span> | ||
| <span x-text="state.name"></span> | ||
| <span class="af-board-col-count" x-text="itemsForState(state.id).length"></span> | ||
| </div> | ||
| <div class="af-board-col-body"> | ||
| <template x-if="itemsForState(state.id).length === 0"> | ||
| <p class="af-empty-col">No items</p> | ||
| </template> | ||
| <template x-for="item in itemsForState(state.id)" :key="item.id"> | ||
| <a | ||
| class="af-card" | ||
| :href="itemHref(item)" | ||
| > | ||
| <div class="af-card-title" x-text="item.name"></div> | ||
| <div class="af-card-meta"> | ||
| <span class="af-badge af-prio" :class="'af-prio-' + (item.priority || 'none').toLowerCase()" x-text="item.priority"></span> | ||
| <template x-if="item.assignee_agent"> | ||
| <span class="af-badge af-badge-assignee" x-text="item.assignee_agent"></span> | ||
| </template> | ||
| </div> | ||
| </a> | ||
| </template> | ||
| </div> | ||
| </div> | ||
| </template> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| function boardView() { | ||
| return { | ||
| projectId: '', | ||
| states: [], | ||
| items: [], | ||
| loading: true, | ||
|
|
||
| async init() { | ||
| const params = afParams(); | ||
| const scope = await afResolveScope(params.get('workspace_id'), params.get('project_id')); | ||
| this.projectId = scope.projectId; | ||
| if (!this.projectId) { | ||
| this.loading = false; | ||
| return; | ||
| } | ||
| const [states, items] = await Promise.all([ | ||
| afGetJson(`/api/pm/states?project_id=${encodeURIComponent(this.projectId)}`, []), | ||
| afGetJson(`/api/pm/items?project_id=${encodeURIComponent(this.projectId)}`, []), | ||
| ]); | ||
| this.states = states.slice().sort((a, b) => a.sequence - b.sequence); | ||
| this.items = items; | ||
| this.loading = false; | ||
| }, | ||
|
|
||
| itemsForState(stateId) { | ||
| return this.items.filter((i) => i.state_id === stateId); | ||
| }, | ||
|
|
||
| itemHref(item) { | ||
| return afLink('/item.html', { project_id: this.projectId, id: item.id }); | ||
| }, | ||
| }; | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,137 @@ | ||
| <!-- @dsCard group="Runtime" --> | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="utf-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
| <title>agentflare dashboard — claims</title> | ||
| <link rel="stylesheet" href="/tokens.css" /> | ||
| <script defer src="/shell.js"></script> | ||
| <script defer src="/vendor/alpine.js"></script> | ||
| </head> | ||
| <body> | ||
| <div class="af-app"> | ||
| <aside class="af-sidebar" x-data="shellNav()" x-init="init()"> | ||
| <div class="af-sidebar-header"><span class="af-logo-mark"></span>agentflare</div> | ||
|
|
||
| <div class="af-nav-section"> | ||
| <label class="af-nav-section-label" for="af-workspace-select">Workspace</label> | ||
| <select | ||
| id="af-workspace-select" | ||
| class="af-select" | ||
| x-model="workspaceId" | ||
| @change="onWorkspaceChange()" | ||
| > | ||
| <template x-if="!loading && workspaces.length === 0"> | ||
| <option value="">No workspaces</option> | ||
| </template> | ||
| <template x-for="w in workspaces" :key="w.id"> | ||
| <option :value="w.id" x-text="w.name"></option> | ||
| </template> | ||
| </select> | ||
| </div> | ||
|
|
||
| <div class="af-nav-section"> | ||
| <label class="af-nav-section-label" for="af-project-select">Project</label> | ||
| <select | ||
| id="af-project-select" | ||
| class="af-select" | ||
| x-model="projectId" | ||
| @change="onProjectChange()" | ||
| > | ||
| <template x-if="!loading && projects.length === 0"> | ||
| <option value="">No projects</option> | ||
| </template> | ||
| <template x-for="p in projects" :key="p.id"> | ||
| <option :value="p.id" x-text="p.identifier + ' — ' + p.name"></option> | ||
| </template> | ||
| </select> | ||
| </div> | ||
|
|
||
| <nav class="af-nav-links"> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/board.html') }" :href="navHref('/board.html')">Board</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/list.html') }" :href="navHref('/list.html')">List</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/webhooks.html') }" :href="navHref('/webhooks.html')">Webhooks</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/claims.html') }" :href="navHref('/claims.html')">Claims</a> | ||
| <a class="af-nav-link" :class="{ 'is-active': isActive('/cost.html') }" :href="navHref('/cost.html')">Cost</a> | ||
| </nav> | ||
| </aside> | ||
|
|
||
| <div class="af-main-col" x-data="claimsView()" x-init="init()"> | ||
| <header class="af-topbar"> | ||
| <h1>Claims</h1> | ||
| <span class="af-topbar-meta"> | ||
| <span class="af-live" :class="{ 'is-on': connected }"></span> | ||
| <span x-text="connected ? 'live' : 'connecting…'"></span> | ||
| </span> | ||
| </header> | ||
| <main class="af-content"> | ||
| <template x-if="claims.length === 0"> | ||
| <p class="af-empty">No active claims. Agents holding a repo/target lock will appear here in real time.</p> | ||
| </template> | ||
| <div class="af-table-wrap" x-show="claims.length > 0"> | ||
| <table class="af-table"> | ||
| <thead> | ||
| <tr> | ||
| <th>Repo</th> | ||
| <th>Target</th> | ||
| <th>Owner</th> | ||
| <th>Status</th> | ||
| <th>Claimed</th> | ||
| <th>Last heartbeat</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody> | ||
| <template x-for="c in claims" :key="c.repo + '|' + c.target"> | ||
| <tr> | ||
| <td class="af-mono af-truncate" x-text="c.repo"></td> | ||
| <td class="af-mono" x-text="c.target"></td> | ||
| <td x-text="c.owner"></td> | ||
| <td> | ||
| <span | ||
| class="af-badge" | ||
| :class="c.stale ? 'af-prio af-prio-urgent' : ''" | ||
| x-text="c.stale ? 'stale' : (c.status || 'active')" | ||
| ></span> | ||
| </td> | ||
| <td x-text="afFormatTime(c.created_at)"></td> | ||
| <td x-text="afFormatTime(c.heartbeat_at)"></td> | ||
| </tr> | ||
| </template> | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| </main> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script> | ||
| function claimsView() { | ||
| return { | ||
| claims: [], | ||
| connected: false, | ||
| source: null, | ||
|
|
||
| init() { | ||
| // Live feed: the /events SSE stream pushes a full { claims, ... } | ||
| // snapshot every ~2s, so no polling and no manual refresh. | ||
| this.source = new EventSource('/events'); | ||
| this.source.onmessage = (e) => { | ||
| try { | ||
| const snap = JSON.parse(e.data); | ||
| this.claims = Array.isArray(snap.claims) ? snap.claims : []; | ||
| this.connected = true; | ||
| } catch (_e) { | ||
| /* ignore a malformed frame; the next tick replaces it */ | ||
| } | ||
| }; | ||
| this.source.onerror = () => { | ||
| // EventSource auto-reconnects; just reflect the gap in the UI. | ||
| this.connected = false; | ||
| }; | ||
| }, | ||
| }; | ||
| } | ||
| </script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift
Paginate webhook delivery history.
This query loads every log and its potentially large request/response bodies. The API then serializes the full history and the browser sorts it in memory, so latency and memory grow without bound. Add a limit/cursor and fetch full bodies only when a delivery is expanded.
🤖 Prompt for AI Agents