web/frps: add detailed client and proxy views with enhanced tracking (#5144)

This commit is contained in:
fatedier
2026-01-31 02:18:35 +08:00
committed by GitHub
parent 5dd70ace6b
commit 266c492b5d
34 changed files with 3000 additions and 923 deletions

View File

@@ -28,6 +28,6 @@ export function formatFileSize(bytes: number): string {
// Prevent index out of bounds for extremely large numbers
const unit = sizes[i] || sizes[sizes.length - 1]
const val = bytes / Math.pow(k, i)
return parseFloat(val.toFixed(2)) + ' ' + unit
}

View File

@@ -10,6 +10,8 @@ class BaseProxy {
lastStartTime: string
lastCloseTime: string
status: string
user: string
clientID: string
clientVersion: string
addr: string
port: number
@@ -19,6 +21,10 @@ class BaseProxy {
locations: string
subdomain: string
// TCPMux specific
multiplexer: string
routeByHTTPUser: string
constructor(proxyStats: any) {
this.name = proxyStats.name
this.type = ''
@@ -41,6 +47,8 @@ class BaseProxy {
this.lastStartTime = proxyStats.lastStartTime
this.lastCloseTime = proxyStats.lastCloseTime
this.status = proxyStats.status
this.user = proxyStats.user || ''
this.clientID = proxyStats.clientID || ''
this.clientVersion = proxyStats.clientVersion
this.addr = ''
@@ -49,6 +57,8 @@ class BaseProxy {
this.hostHeaderRewrite = ''
this.locations = ''
this.subdomain = ''
this.multiplexer = ''
this.routeByHTTPUser = ''
}
}
@@ -111,20 +121,15 @@ class HTTPSProxy extends BaseProxy {
}
class TCPMuxProxy extends BaseProxy {
multiplexer: string
routeByHTTPUser: string
constructor(proxyStats: any, port: number, subdomainHost: string) {
super(proxyStats)
this.type = 'tcpmux'
this.port = port
this.multiplexer = ''
this.routeByHTTPUser = ''
if (proxyStats.conf) {
this.customDomains = proxyStats.conf.customDomains || this.customDomains
this.multiplexer = proxyStats.conf.multiplexer
this.routeByHTTPUser = proxyStats.conf.routeByHTTPUser
this.multiplexer = proxyStats.conf.multiplexer || ''
this.routeByHTTPUser = proxyStats.conf.routeByHTTPUser || ''
if (proxyStats.conf.subdomain) {
this.subdomain = `${proxyStats.conf.subdomain}.${subdomainHost}`
}