[sub] Show used traffic for unlimited users

This commit is contained in:
AmoAlireza 2023-09-06 20:15:29 +00:00
parent 25430b7818
commit a5c3df33a0

View file

@ -787,11 +787,14 @@ func (s *SubService) genRemark(inbound *model.Inbound, email string, extra strin
}
}
// Get remained days
if statsExist {
if !stats.Enable {
return fmt.Sprintf("⛔N/A-%s", strings.Join(remark, "-"))
}
if stats.ExpiryTime == 0 && stats.Total == 0 {
totalUsage := stats.Up + stats.Down
remark = append(remark, fmt.Sprintf("%s♾", common.FormatTraffic(totalUsage)))
} else {
if vol := stats.Total - (stats.Up + stats.Down); vol > 0 {
remark = append(remark, fmt.Sprintf("%s%s", common.FormatTraffic(vol), "📊"))
}
@ -804,6 +807,7 @@ func (s *SubService) genRemark(inbound *model.Inbound, email string, extra strin
}
}
}
}
return strings.Join(remark, " : ")
}