feat: add proxy labels and default profiles

This commit is contained in:
QiuSW
2026-07-27 12:09:54 +08:00
parent a8b7277dab
commit 0f25f39480
10 changed files with 397 additions and 115 deletions
+10
View File
@@ -104,6 +104,16 @@ func NormalizeProxyServer(value string) (string, error) {
return scheme + "://" + net.JoinHostPort(strings.ToLower(parsed.Hostname()), strconv.Itoa(port)), nil
}
// NormalizeProxyName returns a non-empty display name for a locally saved
// proxy profile. It deliberately carries no endpoint or credentials semantics.
func NormalizeProxyName(value string) (string, error) {
name := strings.TrimSpace(value)
if name == "" {
return "", fmt.Errorf("%w: proxy name is required", ErrInvalidLaunchSpec)
}
return name, nil
}
func ValidRemoteDebugPort(port int) bool {
return port >= MinRemoteDebugPort && port <= MaxRemoteDebugPort
}