misc: moved graph module to experimental branch for now

This commit is contained in:
Simone Margaritelli 2021-04-12 14:09:03 +02:00
commit f2b6d9b708
16 changed files with 0 additions and 1751 deletions

View file

@ -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" {

View file

@ -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)
}
}