Add 'all' column to admin dashboard counts
This commit is contained in:
parent
38415f28da
commit
40962c84ca
|
@ -61,11 +61,6 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
<div class="dashboard-stats total-users">
|
|
||||||
{{i18n admin.dashboard.total_users}}: <strong>{{#unless loading}}{{ totalUsers }}{{/unless}}</strong><br/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="dashboard-stats trust-levels">
|
<div class="dashboard-stats trust-levels">
|
||||||
<table class="table table-condensed table-hover">
|
<table class="table table-condensed table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -94,6 +89,7 @@
|
||||||
<th>{{i18n admin.dashboard.reports.yesterday}}</th>
|
<th>{{i18n admin.dashboard.reports.yesterday}}</th>
|
||||||
<th>{{i18n admin.dashboard.reports.last_7_days}}</th>
|
<th>{{i18n admin.dashboard.reports.last_7_days}}</th>
|
||||||
<th>{{i18n admin.dashboard.reports.last_30_days}}</th>
|
<th>{{i18n admin.dashboard.reports.last_30_days}}</th>
|
||||||
|
<th>{{i18n admin.dashboard.reports.all}}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
{{#unless loading}}
|
{{#unless loading}}
|
||||||
|
|
|
@ -4,4 +4,5 @@
|
||||||
<td class="value">{{valueAtDaysAgo data 1}}</td>
|
<td class="value">{{valueAtDaysAgo data 1}}</td>
|
||||||
<td class="value">{{valueAtDaysAgo data 7}}</td>
|
<td class="value">{{valueAtDaysAgo data 7}}</td>
|
||||||
<td class="value">{{valueAtDaysAgo data 30}}</td>
|
<td class="value">{{valueAtDaysAgo data 30}}</td>
|
||||||
|
<td class="value">{{total}}</td>
|
||||||
</tr>
|
</tr>
|
|
@ -4,4 +4,5 @@
|
||||||
<td class="value">{{valueAtDaysAgo data 1}}</td>
|
<td class="value">{{valueAtDaysAgo data 1}}</td>
|
||||||
<td class="value">{{sumLast data 7}}</td>
|
<td class="value">{{sumLast data 7}}</td>
|
||||||
<td class="value">{{sumLast data 30}}</td>
|
<td class="value">{{sumLast data 30}}</td>
|
||||||
|
<td class="value">{{total}}</td>
|
||||||
</tr>
|
</tr>
|
|
@ -9,7 +9,6 @@ class AdminDashboardData
|
||||||
def as_json
|
def as_json
|
||||||
@json ||= {
|
@json ||= {
|
||||||
reports: REPORTS.map { |type| Report.find(type) },
|
reports: REPORTS.map { |type| Report.find(type) },
|
||||||
total_users: User.count,
|
|
||||||
problems: [rails_env_check, host_names_check, gc_checks].compact
|
problems: [rails_env_check, host_names_check, gc_checks].compact
|
||||||
}.merge(
|
}.merge(
|
||||||
SiteSetting.version_checks? ? {version_check: DiscourseUpdates.check_version} : {}
|
SiteSetting.version_checks? ? {version_check: DiscourseUpdates.check_version} : {}
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
class Report
|
class Report
|
||||||
|
|
||||||
attr_accessor :type, :data
|
attr_accessor :type, :data, :total
|
||||||
|
|
||||||
def initialize(type)
|
def initialize(type)
|
||||||
@type = type
|
@type = type
|
||||||
@data = nil
|
@data = nil
|
||||||
|
@total = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def as_json
|
def as_json
|
||||||
|
@ -13,7 +14,8 @@ class Report
|
||||||
title: I18n.t("reports.#{self.type}.title"),
|
title: I18n.t("reports.#{self.type}.title"),
|
||||||
xaxis: I18n.t("reports.#{self.type}.xaxis"),
|
xaxis: I18n.t("reports.#{self.type}.xaxis"),
|
||||||
yaxis: I18n.t("reports.#{self.type}.yaxis"),
|
yaxis: I18n.t("reports.#{self.type}.yaxis"),
|
||||||
data: self.data
|
data: self.data,
|
||||||
|
total: self.total
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -39,6 +41,7 @@ class Report
|
||||||
User.count_by_signup_date(30.days.ago).each do |date, count|
|
User.count_by_signup_date(30.days.ago).each do |date, count|
|
||||||
report.data << {x: date, y: count}
|
report.data << {x: date, y: count}
|
||||||
end
|
end
|
||||||
|
report.total = User.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_topics(report)
|
def self.report_topics(report)
|
||||||
|
@ -46,6 +49,7 @@ class Report
|
||||||
Topic.count_per_day(30.days.ago).each do |date, count|
|
Topic.count_per_day(30.days.ago).each do |date, count|
|
||||||
report.data << {x: date, y: count}
|
report.data << {x: date, y: count}
|
||||||
end
|
end
|
||||||
|
report.total = Topic.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_posts(report)
|
def self.report_posts(report)
|
||||||
|
@ -53,6 +57,7 @@ class Report
|
||||||
Post.count_per_day(30.days.ago).each do |date, count|
|
Post.count_per_day(30.days.ago).each do |date, count|
|
||||||
report.data << {x: date, y: count}
|
report.data << {x: date, y: count}
|
||||||
end
|
end
|
||||||
|
report.total = Post.count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_flags(report)
|
def self.report_flags(report)
|
||||||
|
@ -62,6 +67,7 @@ class Report
|
||||||
report.data << {x: i.days.ago.to_date.to_s, y: count}
|
report.data << {x: i.days.ago.to_date.to_s, y: count}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
report.total = PostAction.where(post_action_type_id: PostActionType.flag_types.values).count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_users_by_trust_level(report)
|
def self.report_users_by_trust_level(report)
|
||||||
|
@ -76,6 +82,7 @@ class Report
|
||||||
PostAction.count_likes_per_day(30.days.ago).each do |date, count|
|
PostAction.count_likes_per_day(30.days.ago).each do |date, count|
|
||||||
report.data << {x: date, y: count}
|
report.data << {x: date, y: count}
|
||||||
end
|
end
|
||||||
|
report.total = PostAction.where(post_action_type_id: PostActionType.types[:like]).count
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.report_emails(report)
|
def self.report_emails(report)
|
||||||
|
@ -83,6 +90,7 @@ class Report
|
||||||
EmailLog.count_per_day(30.days.ago).each do |date, count|
|
EmailLog.count_per_day(30.days.ago).each do |date, count|
|
||||||
report.data << {x: date, y: count}
|
report.data << {x: date, y: count}
|
||||||
end
|
end
|
||||||
|
report.total = EmailLog.count
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -695,7 +695,6 @@ cs:
|
||||||
please_upgrade: "Prosím aktualizujte!"
|
please_upgrade: "Prosím aktualizujte!"
|
||||||
latest_version: "Poslední verze"
|
latest_version: "Poslední verze"
|
||||||
update_often: 'Prosím aktualizujte často!'
|
update_often: 'Prosím aktualizujte často!'
|
||||||
total_users: "Celkem uživatelů"
|
|
||||||
moderator_short: "mod"
|
moderator_short: "mod"
|
||||||
|
|
||||||
reports:
|
reports:
|
||||||
|
|
|
@ -700,7 +700,6 @@ en:
|
||||||
installed_version: "Installed"
|
installed_version: "Installed"
|
||||||
latest_version: "Latest"
|
latest_version: "Latest"
|
||||||
update_often: 'Please update often!'
|
update_often: 'Please update often!'
|
||||||
total_users: "Total Users"
|
|
||||||
moderator_short: "mod"
|
moderator_short: "mod"
|
||||||
problems_found: "Some problems have been found with your installation of Discourse:"
|
problems_found: "Some problems have been found with your installation of Discourse:"
|
||||||
|
|
||||||
|
@ -712,6 +711,7 @@ en:
|
||||||
all_time: "All Time"
|
all_time: "All Time"
|
||||||
7_days_ago: "7 Days Ago"
|
7_days_ago: "7 Days Ago"
|
||||||
30_days_ago: "30 Days Ago"
|
30_days_ago: "30 Days Ago"
|
||||||
|
all: "All"
|
||||||
|
|
||||||
commits:
|
commits:
|
||||||
latest_changes: "Latest changes."
|
latest_changes: "Latest changes."
|
||||||
|
|
|
@ -701,7 +701,6 @@ fr:
|
||||||
installed_version: "Version installée"
|
installed_version: "Version installée"
|
||||||
latest_version: "Dernière version"
|
latest_version: "Dernière version"
|
||||||
update_often: "Merci de mettre à jour régulièrement !"
|
update_often: "Merci de mettre à jour régulièrement !"
|
||||||
total_users: "Total d'utilisateurs"
|
|
||||||
moderator_short: "mod"
|
moderator_short: "mod"
|
||||||
problems_found: "Quelques problèmes ont été trouvés dans votre installation de Discourse :"
|
problems_found: "Quelques problèmes ont été trouvés dans votre installation de Discourse :"
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -703,7 +703,6 @@ zh_CN:
|
||||||
installed_version: "已安装"
|
installed_version: "已安装"
|
||||||
latest_version: "最新版本"
|
latest_version: "最新版本"
|
||||||
update_often: '请经常升级!'
|
update_often: '请经常升级!'
|
||||||
total_users: "用户总数"
|
|
||||||
moderator_short: "版主"
|
moderator_short: "版主"
|
||||||
|
|
||||||
reports:
|
reports:
|
||||||
|
|
|
@ -703,7 +703,6 @@ zh_TW:
|
||||||
installed_version: "已安裝"
|
installed_version: "已安裝"
|
||||||
latest_version: "最新版本"
|
latest_version: "最新版本"
|
||||||
update_often: '請經常升級!'
|
update_often: '請經常升級!'
|
||||||
total_users: "用戶總數"
|
|
||||||
moderator_short: "版主"
|
moderator_short: "版主"
|
||||||
|
|
||||||
reports:
|
reports:
|
||||||
|
|
|
@ -269,10 +269,6 @@ cs:
|
||||||
title: "Nová 'líbí se'"
|
title: "Nová 'líbí se'"
|
||||||
xaxis: "Den"
|
xaxis: "Den"
|
||||||
yaxis: "Počet nových 'líbí se'"
|
yaxis: "Počet nových 'líbí se'"
|
||||||
total_users:
|
|
||||||
title: "Celkem uživatelů"
|
|
||||||
xaxis: "Den"
|
|
||||||
yaxis: "Celkový počet uživatelů"
|
|
||||||
flags:
|
flags:
|
||||||
title: "Nahlášení"
|
title: "Nahlášení"
|
||||||
xaxis: "Den"
|
xaxis: "Den"
|
||||||
|
|
|
@ -252,27 +252,23 @@ en:
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of visits"
|
yaxis: "Number of visits"
|
||||||
signups:
|
signups:
|
||||||
title: "New Users"
|
title: "Users"
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of new users"
|
yaxis: "Number of new users"
|
||||||
topics:
|
topics:
|
||||||
title: "New Topics"
|
title: "Topics"
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of new topics"
|
yaxis: "Number of new topics"
|
||||||
posts:
|
posts:
|
||||||
title: "New Posts"
|
title: "Posts"
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of new posts"
|
yaxis: "Number of new posts"
|
||||||
likes:
|
likes:
|
||||||
title: "New Likes"
|
title: "Likes"
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of new likes"
|
yaxis: "Number of new likes"
|
||||||
total_users:
|
|
||||||
title: "Total Users"
|
|
||||||
xaxis: "Day"
|
|
||||||
yaxis: "Total number of users"
|
|
||||||
flags:
|
flags:
|
||||||
title: "New Flags"
|
title: "Flags"
|
||||||
xaxis: "Day"
|
xaxis: "Day"
|
||||||
yaxis: "Number of flags"
|
yaxis: "Number of flags"
|
||||||
users_by_trust_level:
|
users_by_trust_level:
|
||||||
|
|
|
@ -274,10 +274,6 @@ fr:
|
||||||
title: Nouveau Likes
|
title: Nouveau Likes
|
||||||
xaxis: Jour
|
xaxis: Jour
|
||||||
yaxis: Nombre de Likes
|
yaxis: Nombre de Likes
|
||||||
total_users:
|
|
||||||
title: "Total d'utilisateurs"
|
|
||||||
xaxis: Jour
|
|
||||||
yaxis: "Total d'utilisateurs"
|
|
||||||
flags:
|
flags:
|
||||||
title: Nouveaux Signalements
|
title: Nouveaux Signalements
|
||||||
xaxis: Jour
|
xaxis: Jour
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -266,10 +266,6 @@ zh_CN:
|
||||||
title: "新的赞"
|
title: "新的赞"
|
||||||
xaxis: "天"
|
xaxis: "天"
|
||||||
yaxis: "新的赞数"
|
yaxis: "新的赞数"
|
||||||
total_users:
|
|
||||||
title: "用户总数"
|
|
||||||
xaxis: "天"
|
|
||||||
yaxis: "用户总数"
|
|
||||||
flags:
|
flags:
|
||||||
title: "投诉"
|
title: "投诉"
|
||||||
xaxis: "天"
|
xaxis: "天"
|
||||||
|
|
|
@ -266,10 +266,6 @@ zh_TW:
|
||||||
title: "新的贊"
|
title: "新的贊"
|
||||||
xaxis: "天"
|
xaxis: "天"
|
||||||
yaxis: "新的贊數"
|
yaxis: "新的贊數"
|
||||||
total_users:
|
|
||||||
title: "用戶總數"
|
|
||||||
xaxis: "天"
|
|
||||||
yaxis: "用戶總數"
|
|
||||||
flags:
|
flags:
|
||||||
title: "投訴"
|
title: "投訴"
|
||||||
xaxis: "天"
|
xaxis: "天"
|
||||||
|
|
Loading…
Reference in New Issue