Refactored realtime components.

This commit is contained in:
Mike Cao 2020-10-10 01:16:28 -07:00
parent 8912daa2fa
commit a039f405b6
8 changed files with 51 additions and 51 deletions

View file

@ -16,7 +16,7 @@ import useCountryNames from 'hooks/useCountryNames';
import { FormattedMessage } from 'react-intl';
const REALTIME_RANGE = 30;
const REALTIME_INTERVAL = 5000;
const REALTIME_INTERVAL = 55000;
function mergeData(state, data, time) {
const ids = state.map(({ __id }) => __id);
@ -151,17 +151,18 @@ export default function RealtimeDashboard() {
</div>
<GridLayout>
<GridRow>
<GridColumn xs={12} lg={8}>
<RealtimeLog data={realtimeData} websites={websites} />
</GridColumn>
<GridColumn xs={12} lg={4}>
<DataTable
title={<FormattedMessage id="metrics.referrers" defaultMessage="Referrers" />}
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
data={referrers}
height={400}
animate={false}
/>
</GridColumn>
<GridColumn xs={12} lg={8}>
<RealtimeLog data={realtimeData} websites={websites} />
</GridColumn>
</GridRow>
<GridRow>
<GridColumn xs={12} lg={4}>
@ -170,6 +171,7 @@ export default function RealtimeDashboard() {
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
data={countries}
renderLabel={renderCountryName}
height={500}
animate={false}
/>
</GridColumn>

View file

@ -171,7 +171,7 @@ export default function WebsiteDetails({ websiteId, token }) {
contentClassName={styles.content}
menu={menuOptions}
>
<DetailsComponent {...tableProps} limit={false} showFilters={true} />
<DetailsComponent {...tableProps} height={500} limit={false} showFilters={true} />
</MenuLayout>
)}
</Page>