mirror of
https://github.com/fatedier/frp.git
synced 2026-07-17 09:49:16 +08:00
feat(dashboard): add v2 client detail status (#5381)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { formatDistanceToNow } from './format'
|
||||
import type { ClientInfoData } from '../types/client'
|
||||
import type { ClientInfoData, ClientStatus } from '../types/client'
|
||||
|
||||
export class Client {
|
||||
key: string
|
||||
@@ -15,6 +15,7 @@ export class Client {
|
||||
lastConnectedAt: Date
|
||||
disconnectedAt?: Date
|
||||
online: boolean
|
||||
status: ClientStatus
|
||||
|
||||
constructor(data: ClientInfoData) {
|
||||
this.key = data.key
|
||||
@@ -37,6 +38,11 @@ export class Client {
|
||||
this.disconnectedAt = new Date(data.disconnectedAt * 1000)
|
||||
}
|
||||
this.online = data.online
|
||||
this.status = data.status || {
|
||||
phase: this.online ? 'online' : 'offline',
|
||||
curConns: 0,
|
||||
proxyCount: 0,
|
||||
}
|
||||
}
|
||||
|
||||
get displayName(): string {
|
||||
|
||||
Reference in New Issue
Block a user