Skip to content

Commit

Permalink
feat: add some common report func of backdoor plugin (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
ek1ng authored Jun 21, 2023
1 parent ef67e8b commit 11f88c4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions service/report/event/backdoor.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ func init() {

type BackdoorDetail struct {
FileDetail
Content string `json:"content"`
Description string `json:"description"`
}

func (b *BackdoorDetail) RenderTable(id string, level string) []table.Row {
data := make([]table.Row, 0)
data = append(data, table.Row{simply(id), level, b.CalcSize(), b.Path, b.Description})
data = append(data, table.Row{simply(id), level, b.CalcSize(), b.Path, b.Content, b.Description})
return data
}

func (b *BackdoorDetail) RenderTableHeader() table.Row {
return table.Row{"FROM", "LEVEL", "Size", "Path", "Description"}
return table.Row{"FROM", "LEVEL", "Mod", "FilePath", "Content", "Description"}
}

func (b *BackdoorDetail) RenderTableTitle() string {
Expand All @@ -37,7 +38,7 @@ func (b *BackdoorDetail) RenderColumnConfig() []table.ColumnConfig {
{Number: 2, WidthMax: 12},
{Number: 3, WidthMax: 12},
{Number: 4, WidthMax: 32},
{Number: 5, WidthMax: 12},
{Number: 5, WidthMax: 32},
{Number: 6, WidthMax: 32},
}
}

0 comments on commit 11f88c4

Please sign in to comment.