diff options
| author | Saeid <43953720+surbiks@users.noreply.github.com> | 2024-01-29 23:37:20 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-29 23:37:20 +0300 |
| commit | 6c0775b12055e4546cb0fd86e1d8d569d886eefa (patch) | |
| tree | 8f7ee64e54f83f9c563a178c4afaee10e072eddc /xray/api.go | |
| parent | 9fbaede59f87dd9d8b77479a3fb295c3c882630e (diff) | |
Show outbound traffic in outbounds table (#1711)
* store outbound traffic in database
* show outbound traffic in outbounds table
* add refresh button
Diffstat (limited to 'xray/api.go')
| -rw-r--r-- | xray/api.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xray/api.go b/xray/api.go index 36b19875..1ce5afa1 100644 --- a/xray/api.go +++ b/xray/api.go @@ -213,6 +213,7 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) { continue } isInbound := matchs[1] == "inbound" + isOutbound := matchs[1] == "outbound" tag := matchs[2] isDown := matchs[3] == "downlink" if tag == "api" { @@ -221,8 +222,9 @@ func (x *XrayAPI) GetTraffic(reset bool) ([]*Traffic, []*ClientTraffic, error) { traffic, ok := tagTrafficMap[tag] if !ok { traffic = &Traffic{ - IsInbound: isInbound, - Tag: tag, + IsInbound: isInbound, + IsOutbound: isOutbound, + Tag: tag, } tagTrafficMap[tag] = traffic traffics = append(traffics, traffic) |
