pi-agent: Implement Operations Console dashboard

This commit is contained in:
proxyctl coordinator
2026-07-17 20:44:48 +08:00
parent daeb788eac
commit 8ac0695152
15 changed files with 600 additions and 138 deletions
+12 -1
View File
@@ -58,6 +58,10 @@ type presentationState struct {
width int
height int
selected int
selectedTargetID string
dashboardFocus dashboardPane
showUnavailable bool
detailsOffset int
form formState
confirm bool
targetConfirm bool
@@ -83,6 +87,7 @@ type terminalPage struct {
footer string
status string
focusLine int
dashboard *dashboardRenderState
}
func (p terminalPresentation) Render(state presentationState) string {
@@ -112,7 +117,10 @@ func (p terminalPresentation) Render(state presentationState) string {
}
page.status = state.status
page = redactTerminalPage(page)
return p.renderShell(page, width, height)
// Dashboard composition retains structured Target metadata until pane sizes
// are known. Redact the fully composed frame as the final presentation
// boundary as well, so no render path can bypass credential scrubbing.
return profile.RedactText(p.renderShell(page, width, height))
}
func redactTerminalPage(page terminalPage) terminalPage {
@@ -149,6 +157,9 @@ func (p terminalPresentation) renderShell(page terminalPage, width, height int)
bodyHeight = 1
}
body := renderPageBody(page, width, bodyHeight)
if page.dashboard != nil {
body = p.renderDashboard(*page.dashboard, width, bodyHeight)
}
sections := make([]string, 0, 3)
if header != "" {