Add a route exclusion flag to the analytics routes pane.

Improve the styling for chart legends and fix some broken ones.
Rename analyticsRowsToNameMap to analyticsRowsToRefMap.
This commit is contained in:
Azareal 2019-05-18 16:50:43 +10:00
parent bf0adeb8c6
commit adc26166f4
8 changed files with 48 additions and 23 deletions

View File

@ -608,7 +608,7 @@ func AnalyticsActiveMemory(w http.ResponseWriter, r *http.Request, user c.User)
return renderTemplate("panel", w, r, basePage.Header, c.Panel{basePage, "panel_analytics_right", "analytics", "panel_analytics_active_memory", pi}) return renderTemplate("panel", w, r, basePage.Header, c.Panel{basePage, "panel_analytics_right", "analytics", "panel_analytics_active_memory", pi})
} }
func analyticsRowsToNameMap(rows *sql.Rows) (map[string]int, error) { func analyticsRowsToRefMap(rows *sql.Rows) (map[string]int, error) {
nameMap := make(map[string]int) nameMap := make(map[string]int)
defer rows.Close() defer rows.Close()
for rows.Next() { for rows.Next() {
@ -812,10 +812,23 @@ func AnalyticsRoutes(w http.ResponseWriter, r *http.Request, user c.User) c.Rout
} }
ovList := analyticsVMapToOVList(vMap) ovList := analyticsVMapToOVList(vMap)
ex := strings.Split(r.FormValue("ex"), ",")
var inEx = func(name string) bool {
for _, e := range ex {
if e == name {
return true
}
}
return false
}
var vList [][]int64 var vList [][]int64
var legendList []string var legendList []string
var i int var i int
for _, ovitem := range ovList { for _, ovitem := range ovList {
if inEx(ovitem.name) {
continue
}
var viewList []int64 var viewList []int64
for _, value := range revLabelList { for _, value := range revLabelList {
viewList = append(viewList, ovitem.viewMap[value]) viewList = append(viewList, ovitem.viewMap[value])
@ -833,6 +846,9 @@ func AnalyticsRoutes(w http.ResponseWriter, r *http.Request, user c.User) c.Rout
// TODO: Sort this slice // TODO: Sort this slice
var routeItems []c.PanelAnalyticsRoutesItem var routeItems []c.PanelAnalyticsRoutesItem
for route, count := range routeMap { for route, count := range routeMap {
if inEx(route) {
continue
}
routeItems = append(routeItems, c.PanelAnalyticsRoutesItem{ routeItems = append(routeItems, c.PanelAnalyticsRoutesItem{
Route: route, Route: route,
Count: count, Count: count,
@ -1051,7 +1067,7 @@ func AnalyticsReferrers(w http.ResponseWriter, r *http.Request, user c.User) c.R
if err != nil && err != sql.ErrNoRows { if err != nil && err != sql.ErrNoRows {
return c.InternalError(err, w, r) return c.InternalError(err, w, r)
} }
refMap, err := analyticsRowsToNameMap(rows) refMap, err := analyticsRowsToRefMap(rows)
if err != nil { if err != nil {
return c.InternalError(err, w, r) return c.InternalError(err, w, r)
} }

View File

@ -161,7 +161,7 @@ li {
margin-right: 3px; margin-right: 3px;
} }
ul { #main_menu {
display: flex; display: flex;
list-style-type: none; list-style-type: none;
padding: 0px; padding: 0px;

View File

@ -314,10 +314,10 @@
.ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-slice-donut { .ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-slice-donut {
stroke: hsl(359,98%,53%) !important; stroke: hsl(359,98%,53%) !important;
} }
.ct-point { .ct-series-a.ct-point {
stroke: hsl(359,98%,23%) !important; stroke: hsl(359,98%,23%) !important;
} }
.ct-point:hover { .ct-series-a.ct-point:hover {
stroke: hsl(359,98%,30%) !important; stroke: hsl(359,98%,30%) !important;
} }
/*.ct-chart-line { /*.ct-chart-line {
@ -344,6 +344,10 @@
transform: translate(-100%) rotate(-45deg); transform: translate(-100%) rotate(-45deg);
white-space: nowrap; white-space: nowrap;
}*/ }*/
.ct-legend {
margin-top: 0px;
margin-bottom: 0px;
}
.analytics .colstack_head select { .analytics .colstack_head select {
margin-top: -5px; margin-top: -5px;
} }

View File

@ -203,6 +203,9 @@ button, .formbutton, .panel_right_button:not(.has_inner_button), #panel_users .p
.colstack_graph_holder .ct-grid { .colstack_graph_holder .ct-grid {
stroke: rgb(125,125,125); stroke: rgb(125,125,125);
} }
.ct-legend {
margin-left: 0px;
}
#panel_setting .formlabel { #panel_setting .formlabel {
display: none; display: none;

View File

@ -39,7 +39,7 @@ body {
padding-bottom: 5px; padding-bottom: 5px;
} }
ul { #main_menu {
list-style-type: none; list-style-type: none;
background-color: var(--main-block-color); background-color: var(--main-block-color);
border-bottom: 1px solid var(--main-background-color); border-bottom: 1px solid var(--main-background-color);
@ -49,28 +49,26 @@ ul {
height: 41px; height: 41px;
} }
li { .menu_left, .menu_right li {
float: left; float: left;
height: 29.5px; height: 29.5px;
padding-top: 12px; padding-top: 12px;
margin: 0; margin: 0;
} }
.menu_left { .menu_left {
margin-right: 10px; margin-right: 10px;
} }
.menu_right { .menu_right {
float: right; float: right;
} }
#menu_overview { #main_menu #menu_overview {
margin-right: 13px; margin-right: 13px;
margin-left: 10px; margin-left: 10px;
font-size: 16px; font-size: 16px;
} }
.menu_left:not(#menu_overview) { #main_menu .menu_left:not(#menu_overview) {
font-size: 15px; font-size: 15px;
padding-top: 13px; padding-top: 13px;
} }
@ -78,12 +76,10 @@ li {
.alert_bell { .alert_bell {
float: right; float: right;
} }
.menu_alerts { .menu_alerts {
float: right; float: right;
padding-top: 14px; padding-top: 14px;
} }
.alert_counter { .alert_counter {
background-color: rgb(200,0,0); background-color: rgb(200,0,0);
border-radius: 2px; border-radius: 2px;
@ -93,7 +89,6 @@ li {
position: relative; position: relative;
top: -1px; top: -1px;
} }
.alert_aftercounter { .alert_aftercounter {
float: right; float: right;
margin-right: 4px; margin-right: 4px;
@ -1045,7 +1040,7 @@ blockquote:first-child {
} }
@media(max-width: 830px) { @media(max-width: 830px) {
ul { #main_menu {
padding-left: 10px; padding-left: 10px;
padding-right: 0px; padding-right: 0px;
height: 35px; height: 35px;
@ -1125,7 +1120,7 @@ blockquote:first-child {
} }
@media(min-width: 400px) { @media(min-width: 400px) {
ul { #main_menu {
height: 40px; height: 40px;
} }
#menu_overview { #menu_overview {
@ -1204,7 +1199,7 @@ blockquote:first-child {
} }
@media(max-width: 324px) { @media(max-width: 324px) {
ul { #main_menu {
padding-left: 5px; padding-left: 5px;
} }
} }

View File

@ -129,6 +129,10 @@
.ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-slice-donut { .ct-series-a .ct-bar, .ct-series-a .ct-line, .ct-series-a .ct-point, .ct-series-a .ct-slice-donut {
stroke: hsl(359,98%,43%) !important; stroke: hsl(359,98%,43%) !important;
} }
.ct-legend {
margin-top: 0px;
margin-bottom: 0px;
}
.spamSelector + .timeRangeSelector { .spamSelector + .timeRangeSelector {
margin-left: 8px; margin-left: 8px;
} }

View File

@ -12,7 +12,7 @@ body {
/* Patch for Edge, until they fix emojis in arial x.x */ /* Patch for Edge, until they fix emojis in arial x.x */
@supports (-ms-ime-align:auto) { .user_content { font-family: Segoe UI Emoji, arial; } } @supports (-ms-ime-align:auto) { .user_content { font-family: Segoe UI Emoji, arial; } }
ul { #main_menu {
padding-left: 0px; padding-left: 0px;
padding-right: 0px; padding-right: 0px;
height: 36px; height: 36px;
@ -21,16 +21,17 @@ ul {
background-color: rgb(252,252,252); background-color: rgb(252,252,252);
margin-bottom: 12px; margin-bottom: 12px;
} }
li { .menu_left, .menu_right {
height: 35px; height: 35px;
padding-left: 10px; padding-left: 10px;
padding-top: 8px; padding-top: 8px;
padding-bottom: 8px; padding-bottom: 8px;
padding-right: 10px;
background: white; background: white;
border-bottom: 1px solid hsl(0, 0%, 80%); border-bottom: 1px solid hsl(0, 0%, 80%);
} }
li:hover { background: rgb(252,252,252); } .menu_left:hover, .menu_right:hover { background: rgb(252,252,252); }
li a { .menu_left a, .menu_right a {
text-decoration: none; text-decoration: none;
color: black; color: black;
font-size: 17px; font-size: 17px;
@ -38,12 +39,10 @@ li a {
.menu_left { .menu_left {
float: left; float: left;
border-right: 1px solid hsl(0, 0%, 80%); border-right: 1px solid hsl(0, 0%, 80%);
padding-right: 10px;
} }
.menu_right { .menu_right {
float: right; float: right;
border-left: 1px solid hsl(0, 0%, 80%); border-left: 1px solid hsl(0, 0%, 80%);
padding-right: 10px;
} }
#menu_overview { #menu_overview {
background: none; background: none;

View File

@ -173,6 +173,10 @@
background-color: white; background-color: white;
border: 1px solid hsl(0,0%,85%); border: 1px solid hsl(0,0%,85%);
} }
.ct-legend {
margin-top: 0px;
margin-bottom: 0px;
}
.spamSelector + .timeRangeSelector { .spamSelector + .timeRangeSelector {
margin-left: 8px; margin-left: 8px;
} }