mirror of
https://github.com/netbirdio/netbird.git
synced 2026-09-19 13:19:06 +02:00
update debug bundle setting page
This commit is contained in:
@@ -9,6 +9,9 @@ import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
|
||||
"github.com/netbirdio/netbird/client/proto"
|
||||
"github.com/netbirdio/netbird/version"
|
||||
@@ -113,6 +116,28 @@ func (s *Debug) RegisterUILog(ctx context.Context, path string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Debug) StartBundleCapture(ctx context.Context, timeoutSeconds int32) error {
|
||||
cli, err := s.conn.Client()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req := &proto.StartBundleCaptureRequest{}
|
||||
if timeoutSeconds > 0 {
|
||||
req.Timeout = durationpb.New(time.Duration(timeoutSeconds) * time.Second)
|
||||
}
|
||||
_, err = cli.StartBundleCapture(ctx, req)
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Debug) StopBundleCapture(ctx context.Context) error {
|
||||
cli, err := s.conn.Client()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = cli.StopBundleCapture(ctx, &proto.StopBundleCaptureRequest{})
|
||||
return err
|
||||
}
|
||||
|
||||
func (s *Debug) SetLogLevel(ctx context.Context, lvl LogLevel) error {
|
||||
cli, err := s.conn.Client()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user