Adding active users statistics to system console (#5141)

Этот коммит содержится в:
Christopher Speller
2017-01-20 15:24:53 -05:00
коммит произвёл enahum
родитель 66dddbdb78
Коммит 11a688d381
7 изменённых файлов: 98 добавлений и 2 удалений

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

@@ -358,6 +358,32 @@ class SystemAnalytics extends React.Component {
/>
);
const dailyActiveUsers = (
<StatisticCount
title={
<FormattedMessage
id='analytics.system.dailyActiveUsers'
defaultMessage='Daily Active Users'
/>
}
icon='fa-users'
count={stats[StatTypes.DAILY_ACTIVE_USERS]}
/>
);
const monthlyActiveUsers = (
<StatisticCount
title={
<FormattedMessage
id='analytics.system.monthlyActiveUsers'
defaultMessage='Monthly Active Users'
/>
}
icon='fa-users'
count={stats[StatTypes.MONTHLY_ACTIVE_USERS]}
/>
);
let firstRow;
let secondRow;
if (isLicensed && skippedIntensiveQueries) {
@@ -406,6 +432,13 @@ class SystemAnalytics extends React.Component {
);
}
const thirdRow = (
<div className='row'>
{dailyActiveUsers}
{monthlyActiveUsers}
</div>
);
return (
<div className='wrapper--fixed team_statistics'>
<h3>
@@ -417,6 +450,7 @@ class SystemAnalytics extends React.Component {
{banner}
{firstRow}
{secondRow}
{thirdRow}
{advancedStats}
{advancedGraphs}
{postTotalGraph}

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

@@ -945,6 +945,8 @@
"analytics.system.textPosts": "Posts with Text-only",
"analytics.system.title": "System Statistics",
"analytics.system.totalChannels": "Total Channels",
"analytics.system.dailyActiveUsers": "Daily Active Users",
"analytics.system.monthlyActiveUsers": "Monthly Active Users",
"analytics.system.totalCommands": "Total Commands",
"analytics.system.totalFilePosts": "Posts with Files",
"analytics.system.totalHashtagPosts": "Posts with Hashtags",

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

@@ -1039,6 +1039,14 @@ export function getStandardAnalytics(teamId) {
if (data[index].name === 'total_read_db_connections') {
stats[StatTypes.TOTAL_READ_DB_CONNECTIONS] = data[index].value;
}
if (data[index].name === 'daily_active_users') {
stats[StatTypes.DAILY_ACTIVE_USERS] = data[index].value;
}
if (data[index].name === 'monthly_active_users') {
stats[StatTypes.MONTHLY_ACTIVE_USERS] = data[index].value;
}
}
AppDispatcher.handleServerAction({

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

@@ -260,7 +260,9 @@ export const Constants = {
NEWLY_CREATED_USERS: null,
TOTAL_WEBSOCKET_CONNECTIONS: null,
TOTAL_MASTER_DB_CONNECTIONS: null,
TOTAL_READ_DB_CONNECTIONS: null
TOTAL_READ_DB_CONNECTIONS: null,
DAILY_ACTIVE_USERS: null,
MONTHLY_ACTIVE_USERS: null
}),
STAT_MAX_ACTIVE_USERS: 20,
STAT_MAX_NEW_USERS: 20,