mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-06 12:54:20 +00:00
fix: propagate inbound traffic reset to nodes (#5103)
Co-authored-by: Rqzbeh <Rqzbeh@example.com>
This commit is contained in:
@@ -159,3 +159,7 @@ func (l *Local) ResetClientTraffic(_ context.Context, _ *model.Inbound, _ string
|
||||
func (l *Local) ResetAllTraffics(_ context.Context) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (l *Local) ResetInboundTraffic(_ context.Context, _ *model.Inbound) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -399,6 +399,11 @@ func (r *Remote) ResetAllTraffics(ctx context.Context) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (r *Remote) ResetInboundTraffic(ctx context.Context, ib *model.Inbound) error {
|
||||
_, err := r.do(ctx, http.MethodPost, fmt.Sprintf("panel/api/inbounds/%d/resetTraffic", ib.Id), nil)
|
||||
return err
|
||||
}
|
||||
|
||||
type TrafficSnapshot struct {
|
||||
Inbounds []*model.Inbound
|
||||
OnlineEmails []string
|
||||
|
||||
@@ -26,5 +26,6 @@ type Runtime interface {
|
||||
RestartXray(ctx context.Context) error
|
||||
|
||||
ResetClientTraffic(ctx context.Context, ib *model.Inbound, email string) error
|
||||
ResetInboundTraffic(ctx context.Context, ib *model.Inbound) error
|
||||
ResetAllTraffics(ctx context.Context) error
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user