From 90a20d5b058f611dc60572d126dd39e7374c934d Mon Sep 17 00:00:00 2001 From: Azareal Date: Fri, 12 Jan 2018 10:22:28 +0000 Subject: [PATCH] You can now filter views by one month. More debug logging. More progress with Topic Moving. --- gen_router.go | 19 +++ panel_routes.go | 18 +++ router_gen/main.go | 19 +++ template_list.go | 101 +++++++------- template_topics.go | 152 +++++++++++---------- templates/panel-analytics-views.html | 1 + templates/panel_analytics_agent_views.html | 1 + templates/panel_analytics_route_views.html | 1 + templates/topics.html | 3 +- themes/cosora/public/main.css | 36 ++++- 10 files changed, 220 insertions(+), 131 deletions(-) diff --git a/gen_router.go b/gen_router.go index 4b39afd9..d81dfcb0 100644 --- a/gen_router.go +++ b/gen_router.go @@ -329,6 +329,12 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { if common.Dev.SuperDebug { log.Print("before routeStatic") + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) @@ -381,6 +387,13 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { case ua == "": common.AgentViewCounter.Bump(14) if common.Dev.DebugMode { + log.Print("Blank UA: ", req.UserAgent()) + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) @@ -390,6 +403,12 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { common.AgentViewCounter.Bump(0) if common.Dev.DebugMode { log.Print("Unknown UA: ", req.UserAgent()) + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) diff --git a/panel_routes.go b/panel_routes.go index b02bab95..4abf9b93 100644 --- a/panel_routes.go +++ b/panel_routes.go @@ -574,6 +574,12 @@ func routePanelAnalyticsViews(w http.ResponseWriter, r *http.Request, user commo var timeRange = "six-hours" switch r.FormValue("timeRange") { + case "one-month": + timeQuantity = 30 + timeUnit = "day" + timeSlices = 30 + sliceWidth = 60 * 60 * 24 + timeRange = "one-month" case "two-days": // Two days is experimental timeQuantity = 2 timeUnit = "day" @@ -680,6 +686,12 @@ func routePanelAnalyticsRouteViews(w http.ResponseWriter, r *http.Request, user var timeRange = "six-hours" switch r.FormValue("timeRange") { + case "one-month": + timeQuantity = 30 + timeUnit = "day" + timeSlices = 30 + sliceWidth = 60 * 60 * 24 + timeRange = "one-month" case "two-days": // Two days is experimental timeQuantity = 2 timeUnit = "day" @@ -776,6 +788,12 @@ func routePanelAnalyticsAgentViews(w http.ResponseWriter, r *http.Request, user var timeRange = "six-hours" switch r.FormValue("timeRange") { + case "one-month": + timeQuantity = 30 + timeUnit = "day" + timeSlices = 30 + sliceWidth = 60 * 60 * 24 + timeRange = "one-month" case "two-days": // Two days is experimental timeQuantity = 2 timeUnit = "day" diff --git a/router_gen/main.go b/router_gen/main.go index aad19954..f0b64faa 100644 --- a/router_gen/main.go +++ b/router_gen/main.go @@ -289,6 +289,12 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { if common.Dev.SuperDebug { log.Print("before routeStatic") + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) @@ -341,6 +347,13 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { case ua == "": common.AgentViewCounter.Bump({{.AllAgentMap.blank}}) if common.Dev.DebugMode { + log.Print("Blank UA: ", req.UserAgent()) + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) @@ -350,6 +363,12 @@ func (router *GenRouter) ServeHTTP(w http.ResponseWriter, req *http.Request) { common.AgentViewCounter.Bump({{.AllAgentMap.unknown}}) if common.Dev.DebugMode { log.Print("Unknown UA: ", req.UserAgent()) + log.Print("Method: ", req.Method) + for key, value := range req.Header { + for _, vvalue := range value { + log.Print("Header '" + key + "': " + vvalue + "!!") + } + } log.Print("prefix: ", prefix) log.Print("req.URL.Path: ", req.URL.Path) log.Print("extraData: ", extraData) diff --git a/template_list.go b/template_list.go index 7618b42e..2f5e1c5c 100644 --- a/template_list.go +++ b/template_list.go @@ -827,11 +827,12 @@ var topics_9 = []byte(`
-
`) -var topics_10 = []byte(`
`) -var topics_11 = []byte(`
`) -var topics_12 = []byte(` +var topics_10 = []byte(`
`) +var topics_13 = []byte(`
`) +var topics_14 = []byte(`
@@ -842,18 +843,18 @@ var topics_12 = []byte(`