Этот коммит содержится в:
=Corey Hulen
2015-10-22 20:48:57 -07:00
родитель ae5d189803
Коммит 009982cd45
2 изменённых файлов: 52 добавлений и 3 удалений

Просмотреть файл

@@ -2,7 +2,6 @@
// See License.txt for license information. // See License.txt for license information.
var Client = require('../../utils/client.jsx'); var Client = require('../../utils/client.jsx');
var LoadingScreen = require('../loading_screen.jsx');
export default class UserList extends React.Component { export default class UserList extends React.Component {
constructor(props) { constructor(props) {
@@ -15,7 +14,8 @@ export default class UserList extends React.Component {
serverError: null, serverError: null,
channel_open_count: null, channel_open_count: null,
channel_private_count: null, channel_private_count: null,
post_count: null post_count: null,
post_counts_day: null
}; };
} }
@@ -47,6 +47,18 @@ export default class UserList extends React.Component {
} }
); );
Client.getAnalytics(
teamId,
'post_counts_day',
(data) => {
console.log(data);
this.setState({post_counts_day: data});
},
(err) => {
this.setState({serverError: err.message});
}
);
Client.getProfilesForTeam( Client.getProfilesForTeam(
teamId, teamId,
(users) => { (users) => {
@@ -83,7 +95,8 @@ export default class UserList extends React.Component {
serverError: null, serverError: null,
channel_open_count: null, channel_open_count: null,
channel_private_count: null, channel_private_count: null,
post_count: null post_count: null,
post_counts_day: null
}); });
this.getData(newProps.team.id); this.getData(newProps.team.id);
@@ -126,6 +139,26 @@ export default class UserList extends React.Component {
</div> </div>
); );
var postCountsByDay = (
<div className='total-count text-center'>
<div>{'Total Posts'}</div>
<div>{'Loading...'}</div>
</div>
);
if (this.state.post_counts_day != null) {
postCountsByDay = (
<div className='total-count-by-day'>
<div>{'Total Posts By Day'}</div>
<LineChart
data={chartData}
width="100"
height="250"
/>
</div>
);
}
return ( return (
<div className='wrapper--fixed'> <div className='wrapper--fixed'>
<h2>{'Analytics for ' + this.props.team.name}</h2> <h2>{'Analytics for ' + this.props.team.name}</h2>
@@ -134,6 +167,7 @@ export default class UserList extends React.Component {
{postCount} {postCount}
{openChannelCount} {openChannelCount}
{openPrivateCount} {openPrivateCount}
{postCountsByDay}
</div> </div>
); );
} }

Просмотреть файл

@@ -21,6 +21,21 @@
} }
} }
.total-count-by-day {
width: 760px;
height: 275px;
border: 1px solid #ddd;
padding: 5px 10px 10px 10px;
margin: 10px 10px 10px 10px;
background: #fff;
clear: both;
> div {
font-size: 18px;
font-weight: 300;
}
}
.sidebar--left { .sidebar--left {
&.sidebar--collapsable { &.sidebar--collapsable {
background: #333; background: #333;