mirror of
https://github.com/bettercap/bettercap
synced 2025-07-06 13:02:12 -07:00
misc: added loading boolean flag to api.rest state object
This commit is contained in:
parent
0a31ac8167
commit
a411607a57
2 changed files with 8 additions and 0 deletions
|
@ -30,6 +30,7 @@ type RestAPI struct {
|
||||||
|
|
||||||
recording bool
|
recording bool
|
||||||
recTime int
|
recTime int
|
||||||
|
loading bool
|
||||||
replaying bool
|
replaying bool
|
||||||
recordFileName string
|
recordFileName string
|
||||||
recordWait *sync.WaitGroup
|
recordWait *sync.WaitGroup
|
||||||
|
@ -49,6 +50,7 @@ func NewRestAPI(s *session.Session) *RestAPI {
|
||||||
},
|
},
|
||||||
recording: false,
|
recording: false,
|
||||||
recTime: 0,
|
recTime: 0,
|
||||||
|
loading: false,
|
||||||
replaying: false,
|
replaying: false,
|
||||||
recordFileName: "",
|
recordFileName: "",
|
||||||
recordWait: &sync.WaitGroup{},
|
recordWait: &sync.WaitGroup{},
|
||||||
|
@ -57,6 +59,7 @@ func NewRestAPI(s *session.Session) *RestAPI {
|
||||||
|
|
||||||
mod.State.Store("recording", &mod.recording)
|
mod.State.Store("recording", &mod.recording)
|
||||||
mod.State.Store("replaying", &mod.replaying)
|
mod.State.Store("replaying", &mod.replaying)
|
||||||
|
mod.State.Store("loading", &mod.loading)
|
||||||
mod.State.Store("rec_time", &mod.recTime)
|
mod.State.Store("rec_time", &mod.recTime)
|
||||||
mod.State.Store("rec_filename", &mod.recordFileName)
|
mod.State.Store("rec_filename", &mod.recordFileName)
|
||||||
mod.State.Store("rec_frames", 0)
|
mod.State.Store("rec_frames", 0)
|
||||||
|
|
|
@ -25,6 +25,11 @@ func (mod *RestAPI) startReplay(filename string) (err error) {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mod.loading = true
|
||||||
|
defer func() {
|
||||||
|
mod.loading = false
|
||||||
|
}()
|
||||||
|
|
||||||
mod.Info("loading %s ...", mod.recordFileName)
|
mod.Info("loading %s ...", mod.recordFileName)
|
||||||
|
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue