mirror of
https://github.com/fatedier/frp.git
synced 2026-03-23 02:09:14 +08:00
web/frps: add detailed client and proxy views with enhanced tracking (#5144)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user