2020-07-14 16:52:26 +03:00
|
|
|
import React from 'react';
|
|
|
|
|
2021-07-22 10:33:16 +03:00
|
|
|
import Datepicker from './datepicker'
|
|
|
|
import SiteSwitcher from './site-switcher'
|
|
|
|
import Filters from './filters'
|
2022-04-13 10:38:47 +03:00
|
|
|
import VisitorGraph from './stats/graph/visitor-graph'
|
2020-08-17 15:13:30 +03:00
|
|
|
import Sources from './stats/sources'
|
2021-07-22 10:33:16 +03:00
|
|
|
import Pages from './stats/pages'
|
2021-10-14 11:55:43 +03:00
|
|
|
import Locations from './stats/locations'
|
2020-07-14 16:52:26 +03:00
|
|
|
import Devices from './stats/devices'
|
2023-06-13 09:16:38 +03:00
|
|
|
import Behaviours from './stats/behaviours'
|
2021-07-22 10:33:16 +03:00
|
|
|
import { withPinnedHeader } from './pinned-header-hoc';
|
2020-07-14 16:52:26 +03:00
|
|
|
|
2021-07-22 10:33:16 +03:00
|
|
|
class Realtime extends React.Component {
|
2020-07-14 16:52:26 +03:00
|
|
|
render() {
|
2021-03-16 11:40:25 +03:00
|
|
|
const navClass = this.props.site.embedded ? 'relative' : 'sticky'
|
|
|
|
|
2020-07-14 16:52:26 +03:00
|
|
|
return (
|
|
|
|
<div className="mb-12">
|
2021-07-22 10:33:16 +03:00
|
|
|
<div id="stats-container-top"></div>
|
2021-09-21 12:08:00 +03:00
|
|
|
<div className={`${navClass} top-0 sm:py-3 py-2 z-10 ${this.props.stuck && !this.props.site.embedded ? 'fullwidth-shadow bg-gray-50 dark:bg-gray-850' : ''}`}>
|
2021-07-22 10:33:16 +03:00
|
|
|
<div className="items-center w-full flex">
|
|
|
|
<div className="flex items-center w-full">
|
|
|
|
<SiteSwitcher site={this.props.site} loggedIn={this.props.loggedIn} currentUserRole={this.props.currentUserRole} />
|
|
|
|
<Filters className="flex" site={this.props.site} query={this.props.query} history={this.props.history} />
|
|
|
|
</div>
|
2021-07-22 11:27:10 +03:00
|
|
|
<Datepicker site={this.props.site} query={this.props.query} />
|
2021-07-22 10:33:16 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-16 11:30:22 +03:00
|
|
|
<VisitorGraph site={this.props.site} query={this.props.query} lastLoadTimestamp={this.props.lastLoadTimestamp} />
|
2021-03-16 11:40:25 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2023-01-02 18:42:57 +03:00
|
|
|
<Sources site={this.props.site} query={this.props.query} />
|
|
|
|
<Pages site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
2021-03-16 11:40:25 +03:00
|
|
|
<div className="items-start justify-between block w-full md:flex">
|
2023-01-02 18:42:57 +03:00
|
|
|
<Locations site={this.props.site} query={this.props.query} />
|
|
|
|
<Devices site={this.props.site} query={this.props.query} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
2023-06-13 09:16:38 +03:00
|
|
|
<Behaviours site={this.props.site} query={this.props.query} currentUserRole={this.props.currentUserRole} />
|
2020-07-14 16:52:26 +03:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
2021-07-22 10:33:16 +03:00
|
|
|
|
|
|
|
export default withPinnedHeader(Realtime, '#stats-container-top');
|