platform: Prepare connections list

This commit is contained in:
世界
2024-06-11 21:16:33 +08:00
parent d44e7d9834
commit b1d75812c5
18 changed files with 652 additions and 254 deletions

View File

@@ -4,10 +4,12 @@ import (
"os"
"os/user"
"strconv"
"time"
"github.com/sagernet/sing-box/common/humanize"
C "github.com/sagernet/sing-box/constant"
_ "github.com/sagernet/sing-box/include"
"github.com/sagernet/sing-box/log"
)
var (
@@ -59,6 +61,10 @@ func FormatMemoryBytes(length int64) string {
return humanize.MemoryBytes(uint64(length))
}
func FormatDuration(duration int64) string {
return log.FormatDuration(time.Duration(duration) * time.Millisecond)
}
func ProxyDisplayType(proxyType string) string {
return C.ProxyDisplayName(proxyType)
}