From 36a521e7b1597c72b46df7098330d4a8eca51e1e Mon Sep 17 00:00:00 2001 From: Jean-Louis Huynen Date: Mon, 10 Feb 2020 17:13:24 +0100 Subject: [PATCH] chg: [template] removes current madness --- logparser/sshd.go | 10 ++-------- logparser/sshd/statistics.gohtml | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/logparser/sshd.go b/logparser/sshd.go index f884f3d..04bd9b9 100644 --- a/logparser/sshd.go +++ b/logparser/sshd.go @@ -387,7 +387,6 @@ func (s *SshdParser) Compile() error { daily := struct { Title string - Current string MinDate string MaxDate string CurrentTime string @@ -395,7 +394,6 @@ func (s *SshdParser) Compile() error { Title: "sshd failed logins - daily statistics", MinDate: parsedOldestStr, MaxDate: parsedNewestStr, - Current: newest, CurrentTime: parsedNewestStr, } @@ -403,24 +401,20 @@ func (s *SshdParser) Compile() error { Title string MonthList map[string][]string CurrentTime string - Current string }{ Title: "sshd failed logins - monthly statistics", MonthList: months, - CurrentTime: years[0] + months[years[0]][0], - Current: years[0] + months[years[0]][0], + CurrentTime: parsedNewestStr, } yearly := struct { Title string YearList []string - Current string CurrentTime string }{ Title: "sshd failed logins - yearly statistics", YearList: years, - Current: years[0], - CurrentTime: years[0], + CurrentTime: parsedNewestStr, } // Create folder to store resulting files diff --git a/logparser/sshd/statistics.gohtml b/logparser/sshd/statistics.gohtml index 9127859..c78bcd2 100644 --- a/logparser/sshd/statistics.gohtml +++ b/logparser/sshd/statistics.gohtml @@ -7,7 +7,11 @@ {{.Title}} - + {{end}} {{ define "footertpl"}} - @@ -47,13 +51,13 @@ {{ define "dailytpl"}} - + {{end}} {{ define "yearlytpl"}} - {{range $val := .YearList}} {{end}} @@ -63,7 +67,7 @@ {{ define "monthlytpl"}} - {{range $key, $val := .MonthList}} {{range $month := index $val}} @@ -71,4 +75,12 @@ {{end}} + + + {{end}} +'' \ No newline at end of file