store hostname for each pageview & page stat

This commit is contained in:
Danny 2018-05-08 13:21:36 +02:00
parent 5fe5b97e94
commit b4c7de0880
2 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ class Table extends Component {
render(props, state) {
const tableRows = state.records !== null ? state.records.map((p, i) => {
let ahref = document.createElement('a');
ahref.href = p.Pathname || p.URL;
ahref.href = (p.Hostname + p.Pathname) || p.URL;
let classes = "table-row w"; // TODO: Add percentage of total back in
let label = ahref.pathname + ahref.search;
if( props.showHostname ) {

View File

@ -9,7 +9,7 @@ import (
func GetPageStats(date time.Time, hostname string, pathname string) (*models.PageStats, error) {
stats := &models.PageStats{}
query := dbx.Rebind(`SELECT * FROM daily_page_stats WHERE hostname = ? AND pathname = ? AND date = ? LIMIT 1`)
err := dbx.Get(stats, query, pathname, date.Format("2006-01-02"))
err := dbx.Get(stats, query, hostname, pathname, date.Format("2006-01-02"))
if err != nil && err == sql.ErrNoRows {
return nil, ErrNoResults
}