mirror of
https://github.com/Kugelschieber/marvinblum.git
synced 2026-01-18 14:50:27 +00:00
Todos...
This commit is contained in:
@@ -14,6 +14,9 @@
|
|||||||
<a href="/tracking?start=365" class="button {{if eq .Start 365}}filled{{end}}">Year</a>
|
<a href="/tracking?start=365" class="button {{if eq .Start 365}}filled{{end}}">Year</a>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
<!-- TODO real time -->
|
||||||
|
|
||||||
<section>
|
<section>
|
||||||
<h2>Total Visitors</h2>
|
<h2>Total Visitors</h2>
|
||||||
<canvas id="totalVisitors" class="tracking"></canvas>
|
<canvas id="totalVisitors" class="tracking"></canvas>
|
||||||
|
|||||||
@@ -52,8 +52,7 @@ func GetPageVisits(start int) []PageVisits {
|
|||||||
query := `SELECT "date" "day",
|
query := `SELECT "date" "day",
|
||||||
CASE WHEN "visitors_per_page".visitors IS NULL THEN 0 ELSE "visitors_per_page".visitors END
|
CASE WHEN "visitors_per_page".visitors IS NULL THEN 0 ELSE "visitors_per_page".visitors END
|
||||||
FROM (SELECT * FROM generate_series(date($1), date(now() - INTERVAL '1 day'), interval '1 day') "date") AS date_series
|
FROM (SELECT * FROM generate_series(date($1), date(now() - INTERVAL '1 day'), interval '1 day') "date") AS date_series
|
||||||
LEFT JOIN "visitors_per_page" ON date("visitors_per_page"."day") = date("date")
|
LEFT JOIN "visitors_per_page" ON date("visitors_per_page"."day") = date("date") AND "visitors_per_page"."path" = $2
|
||||||
WHERE "visitors_per_page" IS NULL OR "visitors_per_page"."path" = $2
|
|
||||||
ORDER BY "date" ASC, length("visitors_per_page"."path") ASC`
|
ORDER BY "date" ASC, length("visitors_per_page"."path") ASC`
|
||||||
startTime := today()
|
startTime := today()
|
||||||
startTime = startTime.Add(-time.Hour * 24 * time.Duration(start-1))
|
startTime = startTime.Add(-time.Hour * 24 * time.Duration(start-1))
|
||||||
@@ -65,6 +64,7 @@ func GetPageVisits(start int) []PageVisits {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO add visitors for today
|
||||||
pageVisits := make([]PageVisits, len(paths))
|
pageVisits := make([]PageVisits, len(paths))
|
||||||
|
|
||||||
for i, path := range paths {
|
for i, path := range paths {
|
||||||
|
|||||||
Reference in New Issue
Block a user