Skip to content

Commit

Permalink
Remove input fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nakabonne committed Oct 1, 2020
1 parent 96ab36c commit 9f7e69e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
23 changes: 4 additions & 19 deletions gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,10 @@ func run(t *termbox.Terminal, r runner, targetURL string, opts *attacker.Options
func gridLayout(w *widgets) ([]container.Option, error) {
raw1 := grid.RowHeightPerc(65, grid.Widget(w.latencyChart, container.Border(linestyle.Light), container.BorderTitle("Latency (ms)")))
raw2 := grid.RowHeightPerc(30,
grid.ColWidthPerc(50,
grid.RowHeightPerc(34, grid.Widget(w.urlInput, container.Border(linestyle.Light), container.BorderTitle("Target URL"))),
grid.RowHeightPerc(33,
grid.ColWidthPerc(20, grid.Widget(w.rateLimitInput, container.Border(linestyle.Light), container.BorderTitle("Rate Limit"))),
grid.ColWidthPerc(20, grid.Widget(w.durationInput, container.Border(linestyle.Light), container.BorderTitle("Duration"))),
grid.ColWidthPerc(20, grid.Widget(w.timeoutInput, container.Border(linestyle.Light), container.BorderTitle("Timeout"))),
grid.ColWidthPerc(20, grid.Widget(w.methodInput, container.Border(linestyle.Light), container.BorderTitle("Method"))),
grid.ColWidthPerc(19, grid.Widget(w.headerInput, container.Border(linestyle.Light), container.BorderTitle("Header"))),
),
grid.RowHeightPerc(33, grid.Widget(w.bodyInput, container.Border(linestyle.Light), container.BorderTitle("Body"))),
),
grid.ColWidthPerc(50,
grid.RowHeightPerc(85,
grid.ColWidthPerc(25, grid.Widget(w.latenciesText, container.Border(linestyle.Light), container.BorderTitle("Latencies"))),
grid.ColWidthPerc(25, grid.Widget(w.bytesText, container.Border(linestyle.Light), container.BorderTitle("Bytes"))),
grid.ColWidthPerc(50, grid.Widget(w.othersText, container.Border(linestyle.Light), container.BorderTitle("Others"))),
),
grid.RowHeightPerc(15, grid.Widget(w.messageText, container.Border(linestyle.Light), container.BorderTitle("Message"))),
),
grid.ColWidthPerc(15, grid.Widget(w.paramsText, container.Border(linestyle.Light), container.BorderTitle("Parameters"))),
grid.ColWidthPerc(15, grid.Widget(w.latenciesText, container.Border(linestyle.Light), container.BorderTitle("Latencies"))),
grid.ColWidthPerc(15, grid.Widget(w.bytesText, container.Border(linestyle.Light), container.BorderTitle("Bytes"))),
grid.ColWidthPerc(50, grid.Widget(w.othersText, container.Border(linestyle.Light), container.BorderTitle("Others"))),
)
raw3 := grid.RowHeightPerc(4,
grid.ColWidthPerc(50, grid.Widget(w.progressGauge, container.Border(linestyle.Light), container.BorderTitle("Progress"))),
Expand Down
8 changes: 8 additions & 0 deletions gui/widgets.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type widgets struct {

latencyChart LineChart

paramsText Text
messageText Text
latenciesText Text
bytesText Text
Expand All @@ -59,6 +60,11 @@ func newWidgets() (*widgets, error) {
if err != nil {
return nil, err
}

paramsText, err := newText("")
if err != nil {
return nil, err
}
messageText, err := newText("Give the target URL and press Enter")
if err != nil {
return nil, err
Expand All @@ -75,6 +81,7 @@ func newWidgets() (*widgets, error) {
if err != nil {
return nil, err
}

navi, err := newText("Ctrl-C: quit, Enter: attack")
if err != nil {
return nil, err
Expand Down Expand Up @@ -120,6 +127,7 @@ func newWidgets() (*widgets, error) {
headerInput: headerInput,
timeoutInput: timeoutInput,
latencyChart: latencyChart,
paramsText: paramsText,
messageText: messageText,
latenciesText: latenciesText,
bytesText: bytesText,
Expand Down

0 comments on commit 9f7e69e

Please sign in to comment.