mirror of https://github.com/status-im/fathom.git
store hostname for each pageview & page stat
This commit is contained in:
parent
5fe5b97e94
commit
b4c7de0880
|
@ -53,7 +53,7 @@ class Table extends Component {
|
||||||
render(props, state) {
|
render(props, state) {
|
||||||
const tableRows = state.records !== null ? state.records.map((p, i) => {
|
const tableRows = state.records !== null ? state.records.map((p, i) => {
|
||||||
let ahref = document.createElement('a');
|
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 classes = "table-row w"; // TODO: Add percentage of total back in
|
||||||
let label = ahref.pathname + ahref.search;
|
let label = ahref.pathname + ahref.search;
|
||||||
if( props.showHostname ) {
|
if( props.showHostname ) {
|
||||||
|
|
|
@ -9,7 +9,7 @@ import (
|
||||||
func GetPageStats(date time.Time, hostname string, pathname string) (*models.PageStats, error) {
|
func GetPageStats(date time.Time, hostname string, pathname string) (*models.PageStats, error) {
|
||||||
stats := &models.PageStats{}
|
stats := &models.PageStats{}
|
||||||
query := dbx.Rebind(`SELECT * FROM daily_page_stats WHERE hostname = ? AND pathname = ? AND date = ? LIMIT 1`)
|
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 {
|
if err != nil && err == sql.ErrNoRows {
|
||||||
return nil, ErrNoResults
|
return nil, ErrNoResults
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue