修复中控

This commit is contained in:
dekun
2026-05-30 15:19:38 +08:00
parent 4cd5a48dc1
commit a67d7aa58b
7 changed files with 447 additions and 53 deletions
+4 -1
View File
@@ -54,7 +54,10 @@ class Service(db.Model):
proto = (self.scheme or "http").strip().lower()
if proto not in ("http", "https"):
proto = "http"
return f"{proto}://{self.host}:{self.port}"
port = int(self.port or (443 if proto == "https" else 80))
if (proto == "https" and port == 443) or (proto == "http" and port == 80):
return f"{proto}://{self.host}"
return f"{proto}://{self.host}:{port}"
def build_url(self) -> str:
p = (self.path or "/").strip()