mirror of
https://github.com/bettercap/bettercap
synced 2025-08-21 14:03:17 -07:00
misc: moved graph module to experimental branch for now
This commit is contained in:
parent
4dac3b9373
commit
f2b6d9b708
16 changed files with 0 additions and 1751 deletions
|
@ -127,8 +127,6 @@ func (mod *EventsStream) Render(output io.Writer, e session.Event) {
|
|||
mod.viewSynScanEvent(output, e)
|
||||
} else if e.Tag == "update.available" {
|
||||
mod.viewUpdateEvent(output, e)
|
||||
} else if strings.HasPrefix(e.Tag, "graph.") {
|
||||
mod.viewGraphEvent(output, e)
|
||||
} else if e.Tag == "gateway.change" {
|
||||
mod.viewGatewayEvent(output, e)
|
||||
} else if e.Tag != "tick" {
|
||||
|
|
|
@ -1,35 +0,0 @@
|
|||
package events_stream
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
|
||||
"github.com/bettercap/bettercap/session"
|
||||
"github.com/bettercap/bettercap/modules/graph"
|
||||
|
||||
"github.com/evilsocket/islazy/tui"
|
||||
)
|
||||
|
||||
func (mod *EventsStream) viewGraphEvent(output io.Writer, e session.Event) {
|
||||
if e.Tag == "graph.node.new" {
|
||||
node := e.Data.(*graph.Node)
|
||||
|
||||
fmt.Fprintf(output, "[%s] [%s] %s %s\n",
|
||||
e.Time.Format(mod.timeFormat),
|
||||
tui.Green(e.Tag),
|
||||
tui.Yellow(string(node.Type)),
|
||||
node.ID)
|
||||
} else if e.Tag == "graph.edge.new" {
|
||||
data := e.Data.(graph.EdgeEvent)
|
||||
fmt.Fprintf(output, "[%s] [%s] %s %s %s %s %s\n",
|
||||
e.Time.Format(mod.timeFormat),
|
||||
tui.Green(e.Tag),
|
||||
tui.Dim(string(data.Left.Type)),
|
||||
data.Left.ID,
|
||||
tui.Bold(string(data.Edge.Type)),
|
||||
tui.Dim(string(data.Right.Type)),
|
||||
data.Right.ID)
|
||||
}else {
|
||||
fmt.Fprintf(output, "[%s] [%s] %v\n", e.Time.Format(mod.timeFormat), tui.Green(e.Tag), e)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue