mirror of https://github.com/daffainfo/nuclei.git
Update output coloring, set a maximum length for template names
parent
dad381e66e
commit
436e7223d8
|
@ -45,7 +45,14 @@ func (p *Progress) SetupTemplateProgressbar(templateId string, requestCount int6
|
||||||
}
|
}
|
||||||
|
|
||||||
color := p.colorizer
|
color := p.colorizer
|
||||||
barName := color.Green(templateId).String()
|
uiBarName := templateId
|
||||||
|
|
||||||
|
const MaxLen = 40
|
||||||
|
if len(uiBarName) > MaxLen {
|
||||||
|
uiBarName = uiBarName[:MaxLen] + ".."
|
||||||
|
}
|
||||||
|
|
||||||
|
barName := color.BrightYellow(uiBarName).String()
|
||||||
bar := p.setupProgressbar(barName, requestCount, priority)
|
bar := p.setupProgressbar(barName, requestCount, priority)
|
||||||
|
|
||||||
p.bars[templateId] = &Bar{
|
p.bars[templateId] = &Bar{
|
||||||
|
@ -124,11 +131,11 @@ func (p *Progress) setupProgressbar(name string, total int64, priority int) *mpb
|
||||||
mpb.BarRemoveOnComplete(),
|
mpb.BarRemoveOnComplete(),
|
||||||
mpb.PrependDecorators(
|
mpb.PrependDecorators(
|
||||||
decor.Name(fmt.Sprintf("[%s]", name), decor.WCSyncSpaceR),
|
decor.Name(fmt.Sprintf("[%s]", name), decor.WCSyncSpaceR),
|
||||||
decor.CountersNoUnit(color.Blue(" %d/%d").String(), decor.WCSyncSpace),
|
decor.CountersNoUnit(color.BrightBlue(" %d/%d").String(), decor.WCSyncSpace),
|
||||||
decor.NewPercentage(color.Bold("%d").String(), decor.WCSyncSpace),
|
decor.NewPercentage(color.Bold("%d").String(), decor.WCSyncSpace),
|
||||||
),
|
),
|
||||||
mpb.AppendDecorators(
|
mpb.AppendDecorators(
|
||||||
decor.AverageSpeed(0, color.Yellow("%.2f r/s ").String(), decor.WCSyncSpace),
|
decor.AverageSpeed(0, color.BrightBlue("%.2f r/s ").String(), decor.WCSyncSpace),
|
||||||
decor.Elapsed(decor.ET_STYLE_GO, decor.WCSyncSpace),
|
decor.Elapsed(decor.ET_STYLE_GO, decor.WCSyncSpace),
|
||||||
decor.AverageETA(decor.ET_STYLE_GO, decor.WCSyncSpace),
|
decor.AverageETA(decor.ET_STYLE_GO, decor.WCSyncSpace),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue