feat(dashboard): Add Polecat Workers section with activity monitoring

- Add FetchPolecats() to fetch tmux session data for active polecats
- Display polecat name, rig, activity status (green/yellow/red)
- Show status hint from last line of pane output
- Add FetchMergeQueue stub for interface compliance
- Update handler to pass polecats data to template
- Add Polecat Workers table section to convoy.html

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Mike Lady
2026-01-03 17:34:22 -08:00
parent 6d4f2c40d1
commit 565b2a0d52
5 changed files with 522 additions and 7 deletions

View File

@@ -176,6 +176,93 @@
font-size: 0.875rem;
}
.status-hint {
color: var(--text-secondary);
font-size: 0.875rem;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.section-header {
margin-top: 32px;
margin-bottom: 16px;
font-size: 1.25rem;
font-weight: 600;
}
/* Merge queue colors */
.mq-green {
background: rgba(74, 222, 128, 0.1);
}
.mq-yellow {
background: rgba(250, 204, 21, 0.1);
}
.mq-red {
background: rgba(248, 113, 113, 0.1);
}
.ci-status, .merge-status {
display: inline-block;
padding: 2px 8px;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 500;
}
.ci-pass {
background: var(--green);
color: var(--bg-dark);
}
.ci-fail {
background: var(--red);
color: var(--bg-dark);
}
.ci-pending {
background: var(--yellow);
color: var(--bg-dark);
}
.merge-ready {
background: var(--green);
color: var(--bg-dark);
}
.merge-conflict {
background: var(--red);
color: var(--bg-dark);
}
.merge-pending {
background: var(--yellow);
color: var(--bg-dark);
}
.pr-link {
color: var(--text-primary);
text-decoration: none;
}
.pr-link:hover {
text-decoration: underline;
}
.pr-title {
color: var(--text-secondary);
margin-left: 8px;
max-width: 400px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
vertical-align: middle;
}
/* htmx loading indicator */
.htmx-request .htmx-indicator {
opacity: 1;
@@ -240,6 +327,81 @@
<p>Create a convoy with: gt convoy create &lt;name&gt; [issues...]</p>
</div>
{{end}}
{{if .MergeQueue}}
<h2 class="section-header">🔀 Refinery Merge Queue</h2>
<table class="convoy-table">
<thead>
<tr>
<th>PR #</th>
<th>Repo</th>
<th>Title</th>
<th>CI Status</th>
<th>Mergeable</th>
</tr>
</thead>
<tbody>
{{range .MergeQueue}}
<tr class="{{.ColorClass}}">
<td>
<a href="{{.URL}}" target="_blank" class="pr-link">#{{.Number}}</a>
</td>
<td>{{.Repo}}</td>
<td>
<span class="pr-title">{{.Title}}</span>
</td>
<td>
{{if eq .CIStatus "pass"}}
<span class="ci-status ci-pass">✓ Pass</span>
{{else if eq .CIStatus "fail"}}
<span class="ci-status ci-fail">✗ Fail</span>
{{else}}
<span class="ci-status ci-pending">⏳ Pending</span>
{{end}}
</td>
<td>
{{if eq .Mergeable "ready"}}
<span class="merge-status merge-ready">Ready</span>
{{else if eq .Mergeable "conflict"}}
<span class="merge-status merge-conflict">Conflict</span>
{{else}}
<span class="merge-status merge-pending">Pending</span>
{{end}}
</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
{{if .Polecats}}
<h2 class="section-header">🐾 Polecat Workers</h2>
<table class="convoy-table">
<thead>
<tr>
<th>Polecat</th>
<th>Rig</th>
<th>Last Activity</th>
<th>Status</th>
</tr>
</thead>
<tbody>
{{range .Polecats}}
<tr>
<td>
<span class="convoy-id">{{.Name}}</span>
</td>
<td>{{.Rig}}</td>
<td class="{{activityClass .LastActivity}}">
<span class="activity-dot"></span>
{{.LastActivity.FormattedAge}}
</td>
<td class="status-hint">{{.StatusHint}}</td>
</tr>
{{end}}
</tbody>
</table>
{{end}}
</div>
</body>
</html>