From 9acc016465ef7db60ef08e8aea11501a6c0f8041 Mon Sep 17 00:00:00 2001 From: GitCaddy Date: Sun, 11 Jan 2026 07:45:39 +0000 Subject: [PATCH] feat: add bandwidth display to runner capabilities panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- modules/structs/actions_capabilities.go | 11 +++++++++++ options/locale/locale_en-US.json | 1 + templates/shared/actions/runner_edit.tmpl | 21 +++++++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/modules/structs/actions_capabilities.go b/modules/structs/actions_capabilities.go index d6b8661490..2e258047ba 100644 --- a/modules/structs/actions_capabilities.go +++ b/modules/structs/actions_capabilities.go @@ -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 diff --git a/options/locale/locale_en-US.json b/options/locale/locale_en-US.json index 2f843ed882..46c6ea0a87 100644 --- a/options/locale/locale_en-US.json +++ b/options/locale/locale_en-US.json @@ -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", diff --git a/templates/shared/actions/runner_edit.tmpl b/templates/shared/actions/runner_edit.tmpl index be9b3b41b6..29221421ca 100644 --- a/templates/shared/actions/runner_edit.tmpl +++ b/templates/shared/actions/runner_edit.tmpl @@ -115,6 +115,27 @@ {{end}} + {{if .RunnerCapabilities.Bandwidth}} +
+ +
+ + {{svg "octicon-arrow-down" 14}} {{printf "%.1f" .RunnerCapabilities.Bandwidth.DownloadMbps}} Mbps + + {{if gt .RunnerCapabilities.Bandwidth.Latency 0.0}} + + {{svg "octicon-clock" 14}} {{printf "%.0f" .RunnerCapabilities.Bandwidth.Latency}} ms + + {{end}} +
+ {{if .RunnerCapabilities.Bandwidth.TestedAt}} +
+ Tested {{DateUtils.TimeSince .RunnerCapabilities.Bandwidth.TestedAt}} +
+ {{end}} +
+ {{end}} + {{if .RunnerCapabilities.Limitations}}