disable traffic charts if set to zero

This commit is contained in:
Alireza Ahmadi
2025-08-30 02:11:43 +02:00
parent e3c33bf649
commit 560c41acbe
5 changed files with 27 additions and 8 deletions
+5
View File
@@ -90,6 +90,10 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
if err != nil {
return "", err
}
trafficAge, err := a.SettingService.GetTrafficAge()
if err != nil {
return "", err
}
data["config"] = json.RawMessage(config)
data["clients"] = clients
data["tls"] = tlsConfigs
@@ -98,6 +102,7 @@ func (a *ApiService) getData(c *gin.Context) (interface{}, error) {
data["endpoints"] = endpoints
data["services"] = services
data["subURI"] = subURI
data["enableTraffic"] = trafficAge > 0
data["onlines"] = onlines
} else {
data["onlines"] = onlines