🎨优化一下子
All checks were successful
continuous-integration/drone/tag Build is passing

This commit is contained in:
coward
2024-08-22 14:16:33 +08:00
parent c7a56b1dde
commit 4fa123baa8
2 changed files with 7 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package api
import (
"fmt"
"github.com/gin-gonic/gin"
"strings"
"time"
"wireguard-ui/component"
"wireguard-ui/http/param"
@@ -77,6 +78,10 @@ func (DashboardApi) ConnectionList(c *gin.Context) {
for _, iaip := range peer.AllowedIPs {
ipAllocation += iaip.String() + ","
}
// 去除一下最右边的逗号
if len(ipAllocation) > 0 {
ipAllocation = strings.TrimRight(ipAllocation, ",")
}
connections = append(connections, vo.DataTraffic{
Name: clientInfo.Name,
Email: clientInfo.Email,