feat: add bandwidth display to runner capabilities panel
Some checks failed
Build and Release / Lint (push) Failing after 2m0s
Build and Release / Unit Tests (push) Successful in 2m52s
Build and Release / Create Release (push) Has been skipped
Build and Release / Build Binaries (amd64, darwin) (push) Has been skipped
Build and Release / Build Binaries (amd64, linux) (push) Has been skipped
Build and Release / Build Binaries (amd64, windows) (push) Has been skipped
Build and Release / Build Binaries (arm64, darwin) (push) Has been skipped
Build and Release / Build Binaries (arm64, linux) (push) Has been skipped
Build and Release / Integration Tests (PostgreSQL) (push) Successful in 1m2s

- Add BandwidthInfo struct for bandwidth test results
- Display download speed and latency in runner edit page
- Show when the bandwidth test was last performed
- Add locale string for bandwidth label

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
GitCaddy 2026-01-11 07:45:39 +00:00
parent 469551095b
commit a3c1aa3011
3 changed files with 33 additions and 0 deletions

View File

@ -3,6 +3,16 @@
package structs
import "time"
// BandwidthInfo holds network bandwidth test results
type BandwidthInfo struct {
DownloadMbps float64 `json:"download_mbps"`
UploadMbps float64 `json:"upload_mbps,omitempty"`
Latency float64 `json:"latency_ms,omitempty"`
TestedAt time.Time `json:"tested_at"`
}
// DiskInfo holds disk space information for a runner
type DiskInfo struct {
Total uint64 `json:"total_bytes"`
@ -23,6 +33,7 @@ type RunnerCapability struct {
Features *CapabilityFeatures `json:"features,omitempty"`
Limitations []string `json:"limitations,omitempty"`
Disk *DiskInfo `json:"disk,omitempty"`
Bandwidth *BandwidthInfo `json:"bandwidth,omitempty"`
}
// CapabilityFeatures represents feature support flags

View File

@ -3713,6 +3713,7 @@
"actions.runners.capabilities.disk_total": "total",
"actions.runners.capabilities.disk_warning": "Low disk space",
"actions.runners.capabilities.disk_critical": "Critical: disk almost full",
"actions.runners.capabilities.bandwidth": "Network Bandwidth",
"actions.runs.all_workflows": "All Workflows",
"actions.runs.commit": "Commit",
"actions.runs.scheduled": "Scheduled",

View File

@ -115,6 +115,27 @@
</div>
{{end}}
{{if .RunnerCapabilities.Bandwidth}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.bandwidth"}}</label>
<div class="tw-flex tw-items-center tw-gap-2">
<span class="ui {{if ge .RunnerCapabilities.Bandwidth.DownloadMbps 100.0}}green{{else if ge .RunnerCapabilities.Bandwidth.DownloadMbps 10.0}}blue{{else}}yellow{{end}} label">
{{svg "octicon-arrow-down" 14}} {{printf "%.1f" .RunnerCapabilities.Bandwidth.DownloadMbps}} Mbps
</span>
{{if gt .RunnerCapabilities.Bandwidth.Latency 0.0}}
<span class="ui {{if le .RunnerCapabilities.Bandwidth.Latency 50.0}}green{{else if le .RunnerCapabilities.Bandwidth.Latency 150.0}}yellow{{else}}red{{end}} label">
{{svg "octicon-clock" 14}} {{printf "%.0f" .RunnerCapabilities.Bandwidth.Latency}} ms
</span>
{{end}}
</div>
{{if .RunnerCapabilities.Bandwidth.TestedAt}}
<div class="tw-text-sm tw-text-secondary tw-mt-1">
Tested {{DateUtils.TimeSince .RunnerCapabilities.Bandwidth.TestedAt}}
</div>
{{end}}
</div>
{{end}}
{{if .RunnerCapabilities.Limitations}}
<div class="field tw-mb-3">
<label>{{ctx.Locale.Tr "actions.runners.capabilities.limitations"}}</label>