mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 15:48:43 -05:00
Deuglify the admin dashboard loading state. Also clean up the code
This commit is contained in:
parent
19fa24d888
commit
331135a88e
4 changed files with 301 additions and 324 deletions
|
@ -1,56 +1,95 @@
|
|||
import { setting } from 'discourse/lib/computed';
|
||||
import AdminDashboard from 'admin/models/admin-dashboard';
|
||||
import VersionCheck from 'admin/models/version-check';
|
||||
import Report from 'admin/models/report';
|
||||
import AdminUser from 'admin/models/admin-user';
|
||||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
|
||||
const PROBLEMS_CHECK_MINUTES = 1;
|
||||
|
||||
const ATTRIBUTES = [ 'disk_space','admins', 'moderators', 'blocked', 'suspended', 'top_traffic_sources',
|
||||
'top_referred_topics', 'updated_at'];
|
||||
|
||||
const REPORTS = [ 'global_reports', 'page_view_reports', 'private_message_reports', 'http_reports',
|
||||
'user_reports', 'mobile_reports'];
|
||||
|
||||
// This controller supports the default interface when you enter the admin section.
|
||||
export default Ember.Controller.extend({
|
||||
loading: true,
|
||||
loading: null,
|
||||
versionCheck: null,
|
||||
problemsCheckMinutes: 1,
|
||||
|
||||
dashboardFetchedAt: null,
|
||||
showVersionChecks: setting('version_checks'),
|
||||
|
||||
foundProblems: function() {
|
||||
return(Discourse.User.currentProp('admin') && this.get('problems') && this.get('problems').length > 0);
|
||||
}.property('problems'),
|
||||
@computed('problems.length')
|
||||
foundProblems(problemsLength) {
|
||||
return this.currentUser.get('admin') && (problemsLength || 0) > 1;
|
||||
},
|
||||
|
||||
thereWereProblems: function() {
|
||||
if(!Discourse.User.currentProp('admin')) { return false; }
|
||||
if( this.get('foundProblems') ) {
|
||||
@computed('foundProblems')
|
||||
thereWereProblems(foundProblems) {
|
||||
if (!this.currentUser.get('admin')) { return false; }
|
||||
|
||||
if (foundProblems) {
|
||||
this.set('hadProblems', true);
|
||||
return true;
|
||||
} else {
|
||||
return this.get('hadProblems') || false;
|
||||
}
|
||||
}.property('foundProblems'),
|
||||
},
|
||||
|
||||
loadProblems: function() {
|
||||
fetchDashboard() {
|
||||
if (!this.get('dashboardFetchedAt') || moment().subtract(30, 'minutes').toDate() > this.get('dashboardFetchedAt')) {
|
||||
this.set('dashboardFetchedAt', new Date());
|
||||
this.set('loading', true);
|
||||
const versionChecks = this.siteSettings.version_checks;
|
||||
AdminDashboard.find().then(d => {
|
||||
if (versionChecks) {
|
||||
this.set('versionCheck', VersionCheck.create(d.version_check));
|
||||
}
|
||||
|
||||
REPORTS.forEach(name => this.set(name, d[name].map(r => Report.create(r))));
|
||||
|
||||
const topReferrers = d.top_referrers;
|
||||
if (topReferrers && topReferrers.data) {
|
||||
d.top_referrers.data = topReferrers.data.map(user => AdminUser.create(user));
|
||||
this.set('top_referrers', topReferrers);
|
||||
}
|
||||
|
||||
ATTRIBUTES.forEach(a => this.set(a, d[a]));
|
||||
this.set('loading', false);
|
||||
});
|
||||
}
|
||||
|
||||
if (!this.get('problemsFetchedAt') || moment().subtract(PROBLEMS_CHECK_MINUTES, 'minutes').toDate() > this.get('problemsFetchedAt')) {
|
||||
this.loadProblems();
|
||||
}
|
||||
},
|
||||
|
||||
loadProblems() {
|
||||
this.set('loadingProblems', true);
|
||||
this.set('problemsFetchedAt', new Date());
|
||||
var c = this;
|
||||
AdminDashboard.fetchProblems().then(function(d) {
|
||||
c.set('problems', d.problems);
|
||||
c.set('loadingProblems', false);
|
||||
if( d.problems && d.problems.length > 0 ) {
|
||||
c.problemsCheckInterval = 1;
|
||||
} else {
|
||||
c.problemsCheckInterval = 10;
|
||||
}
|
||||
AdminDashboard.fetchProblems().then(d => {
|
||||
this.set('problems', d.problems);
|
||||
}).finally(() => {
|
||||
this.set('loadingProblems', false);
|
||||
});
|
||||
},
|
||||
|
||||
problemsTimestamp: function() {
|
||||
return moment(this.get('problemsFetchedAt')).format('LLL');
|
||||
}.property('problemsFetchedAt'),
|
||||
@computed('problemsFetchedAt')
|
||||
problemsTimestamp(problemsFetchedAt) {
|
||||
return moment(problemsFetchedAt).format('LLL');
|
||||
},
|
||||
|
||||
updatedTimestamp: function() {
|
||||
return moment(this.get('updated_at')).format('LLL');
|
||||
}.property('updated_at'),
|
||||
@computed('updated_at')
|
||||
updatedTimestamp(updatedAt) {
|
||||
return moment(updatedAt).format('LLL');
|
||||
},
|
||||
|
||||
actions: {
|
||||
refreshProblems: function() {
|
||||
refreshProblems() {
|
||||
this.loadProblems();
|
||||
},
|
||||
showTrafficReport: function() {
|
||||
showTrafficReport() {
|
||||
this.set("showTrafficReport", true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,48 +1,5 @@
|
|||
import AdminDashboard from 'admin/models/admin-dashboard';
|
||||
import VersionCheck from 'admin/models/version-check';
|
||||
import Report from 'admin/models/report';
|
||||
import AdminUser from 'admin/models/admin-user';
|
||||
|
||||
export default Discourse.Route.extend({
|
||||
|
||||
setupController: function(c) {
|
||||
this.fetchDashboardData(c);
|
||||
},
|
||||
|
||||
fetchDashboardData: function(c) {
|
||||
if( !c.get('dashboardFetchedAt') || moment().subtract(30, 'minutes').toDate() > c.get('dashboardFetchedAt') ) {
|
||||
c.set('dashboardFetchedAt', new Date());
|
||||
var versionChecks = this.siteSettings.version_checks;
|
||||
AdminDashboard.find().then(function(d) {
|
||||
if (versionChecks) {
|
||||
c.set('versionCheck', VersionCheck.create(d.version_check));
|
||||
}
|
||||
|
||||
['global_reports', 'page_view_reports', 'private_message_reports', 'http_reports', 'user_reports', 'mobile_reports'].forEach(name => {
|
||||
c.set(name, d[name].map(r => Report.create(r)));
|
||||
});
|
||||
|
||||
var topReferrers = d.top_referrers;
|
||||
if (topReferrers && topReferrers.data) {
|
||||
d.top_referrers.data = topReferrers.data.map(function (user) {
|
||||
return AdminUser.create(user);
|
||||
});
|
||||
c.set('top_referrers', topReferrers);
|
||||
}
|
||||
|
||||
[ 'disk_space','admins', 'moderators', 'blocked', 'suspended',
|
||||
'top_traffic_sources', 'top_referred_topics', 'updated_at'].forEach(function(x) {
|
||||
c.set(x, d[x]);
|
||||
});
|
||||
|
||||
c.set('loading', false);
|
||||
});
|
||||
}
|
||||
|
||||
if( !c.get('problemsFetchedAt') || moment().subtract(c.problemsCheckMinutes, 'minutes').toDate() > c.get('problemsFetchedAt') ) {
|
||||
c.set('problemsFetchedAt', new Date());
|
||||
c.loadProblems();
|
||||
}
|
||||
setupController(controller) {
|
||||
controller.fetchDashboard();
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,161 +1,149 @@
|
|||
{{plugin-outlet "admin-dashboard-top"}}
|
||||
|
||||
<div class="dashboard-left">
|
||||
{{#if showVersionChecks}}
|
||||
{{partial 'admin/templates/version-checks'}}
|
||||
{{/if}}
|
||||
{{#conditional-loading-spinner condition=loading}}
|
||||
<div class="dashboard-left">
|
||||
{{#if showVersionChecks}}
|
||||
{{partial 'admin/templates/version-checks'}}
|
||||
{{/if}}
|
||||
|
||||
<div class="dashboard-stats trust-levels">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>0</th>
|
||||
<th>1</th>
|
||||
<th>2</th>
|
||||
<th>3</th>
|
||||
<th>4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats trust-levels">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>0</th>
|
||||
<th>1</th>
|
||||
<th>2</th>
|
||||
<th>3</th>
|
||||
<th>4</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each user_reports as |r|}}
|
||||
{{admin-report-trust-level-counts report=r}}
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats totals">
|
||||
<table>
|
||||
<tr>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.admins'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.suspended'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.moderators'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'moderators'}}{{moderators}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.blocked'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'blocked'}}{{blocked}}{{/link-to}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<div class="dashboard-stats totals">
|
||||
<table>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.admins'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.suspended'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<tr>
|
||||
<td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.moderators'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'moderators'}}{{moderators}}{{/link-to}}</td>
|
||||
<td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.blocked'}}</td>
|
||||
<td class="value">{{#link-to 'adminUsersList.show' 'blocked'}}{{blocked}}{{/link-to}}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each global_reports as |r|}}
|
||||
{{admin-report-counts report=r}}
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.page_views'}}">{{i18n 'admin.dashboard.page_views_short'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.page_views'}}">{{i18n 'admin.dashboard.page_views_short'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each page_view_reports as |r|}}
|
||||
{{admin-report-counts report=r}}
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.private_messages_title'}}">{{fa-icon "envelope"}} {{i18n 'admin.dashboard.private_messages_short'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.private_messages_title'}}">{{fa-icon "envelope"}} {{i18n 'admin.dashboard.private_messages_short'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each private_message_reports as |r|}}
|
||||
{{admin-report-counts report=r}}
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.mobile_title'}}">{{i18n 'admin.dashboard.mobile_title'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title" title="{{i18n 'admin.dashboard.mobile_title'}}">{{i18n 'admin.dashboard.mobile_title'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.today'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
|
||||
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each mobile_reports as |r|}}
|
||||
{{admin-report-counts report=r}}
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{i18n 'admin.dashboard.uploads'}}</td>
|
||||
<td>{{disk_space.uploads_used}} ({{i18n 'admin.dashboard.space_free' size=disk_space.uploads_free}})</td>
|
||||
<td>{{#if currentUser.admin}}<a href="/admin/backups">{{i18n 'admin.dashboard.backups'}}</a>{{/if}}</td>
|
||||
<td>{{disk_space.backups_used}} ({{i18n 'admin.dashboard.space_free' size=disk_space.backups_free}})</td>
|
||||
</tr>
|
||||
{{/unless}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{#unless loading}}
|
||||
{{#if showTrafficReport}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
|
@ -183,54 +171,53 @@
|
|||
<a href {{action 'showTrafficReport'}}>{{i18n 'admin.dashboard.show_traffic_report'}}</a>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-right">
|
||||
|
||||
{{#if foundProblems}}
|
||||
<div class="dashboard-stats detected-problems">
|
||||
<div class="look-here">{{fa-icon "exclamation-triangle"}}</div>
|
||||
<div class="problem-messages">
|
||||
<p class="{{if loadingProblems 'invisible'}}">
|
||||
{{i18n 'admin.dashboard.problems_found'}}
|
||||
<ul class="{{if loadingProblems 'invisible'}}">
|
||||
{{#each problems as |problem|}}
|
||||
<li>{{{problem}}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</p>
|
||||
<p class="actions">
|
||||
<small>{{i18n 'admin.dashboard.last_checked'}}: {{problemsTimestamp}}</small>
|
||||
{{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if thereWereProblems}}
|
||||
<div class="dashboard-right">
|
||||
{{#if foundProblems}}
|
||||
<div class="dashboard-stats detected-problems">
|
||||
<div class="look-here"> </div>
|
||||
<div class="look-here">{{fa-icon "exclamation-triangle"}}</div>
|
||||
<div class="problem-messages">
|
||||
<p>
|
||||
{{i18n 'admin.dashboard.no_problems'}}
|
||||
{{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}}
|
||||
</p>
|
||||
{{#conditional-loading-spinner condition=loadingProblems}}
|
||||
<p>
|
||||
{{i18n 'admin.dashboard.problems_found'}}
|
||||
<ul class="{{if loadingProblems 'invisible'}}">
|
||||
{{#each problems as |problem|}}
|
||||
<li>{{{problem}}}</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</p>
|
||||
<p class="actions">
|
||||
<small>{{i18n 'admin.dashboard.last_checked'}}: {{problemsTimestamp}}</small>
|
||||
{{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}}
|
||||
</p>
|
||||
{{/conditional-loading-spinner}}
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{else}}
|
||||
{{#if thereWereProblems}}
|
||||
<div class="dashboard-stats detected-problems">
|
||||
<div class="look-here"> </div>
|
||||
<div class="problem-messages">
|
||||
<p>
|
||||
{{i18n 'admin.dashboard.no_problems'}}
|
||||
{{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}}
|
||||
</p>
|
||||
</div>
|
||||
<div class="clearfix"></div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_referred_topics.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_referred_topics.ytitles.num_clicks}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_referred_topics.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_referred_topics.ytitles.num_clicks}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#each top_referred_topics.data as |data|}}
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -245,20 +232,18 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_traffic_sources.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_traffic_sources.ytitles.num_clicks}}</th>
|
||||
<th>{{top_traffic_sources.ytitles.num_topics}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_traffic_sources.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_traffic_sources.ytitles.num_clicks}}</th>
|
||||
<th>{{top_traffic_sources.ytitles.num_topics}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#each top_traffic_sources.data as |s|}}
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -268,20 +253,18 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</div>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_referrers.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_referrers.ytitles.num_clicks}}</th>
|
||||
<th>{{top_referrers.ytitles.num_topics}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
<div class="dashboard-stats">
|
||||
<table class="table table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="title">{{top_referrers.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
|
||||
<th>{{top_referrers.ytitles.num_clicks}}</th>
|
||||
<th>{{top_referrers.ytitles.num_topics}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#each top_referrers.data as |r|}}
|
||||
<tbody>
|
||||
<tr>
|
||||
|
@ -291,14 +274,14 @@
|
|||
</tr>
|
||||
</tbody>
|
||||
{{/each}}
|
||||
{{/unless}}
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
|
||||
<div class="dashboard-stats pull-right">
|
||||
<div class="pull-right">{{i18n 'admin.dashboard.last_updated'}} {{updatedTimestamp}}</div>
|
||||
<div class='clearfix'></div>
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
|
||||
<div class="dashboard-stats pull-right">
|
||||
<div class="pull-right">{{i18n 'admin.dashboard.last_updated'}} {{updatedTimestamp}}</div>
|
||||
<div class='clearfix'></div>
|
||||
</div>
|
||||
<div class='clearfix'></div>
|
||||
{{/conditional-loading-spinner}}
|
||||
|
|
|
@ -8,65 +8,63 @@
|
|||
<th colspan="3">{{i18n 'admin.dashboard.latest_version'}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{{#unless loading}}
|
||||
<tbody>
|
||||
<td class="title">{{i18n 'admin.dashboard.version'}}</td>
|
||||
<td class="version-number"><a href={{versionCheck.gitLink}} target="_blank">{{dash-if-empty versionCheck.installed_describe}}</a></td>
|
||||
<tbody>
|
||||
<td class="title">{{i18n 'admin.dashboard.version'}}</td>
|
||||
<td class="version-number"><a href={{versionCheck.gitLink}} target="_blank">{{dash-if-empty versionCheck.installed_describe}}</a></td>
|
||||
|
||||
{{#if versionCheck.noCheckPerformed}}
|
||||
<td class="version-number">—</td>
|
||||
{{#if versionCheck.noCheckPerformed}}
|
||||
<td class="version-number">—</td>
|
||||
<td class="face">
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
<span class="normal-note">{{i18n 'admin.dashboard.no_check_performed'}}</span>
|
||||
</td>
|
||||
{{else}}
|
||||
{{#if versionCheck.staleData}}
|
||||
<td class="version-number">{{#if versionCheck.version_check_pending}}{{dash-if-empty versionCheck.installed_version}}{{/if}}</td>
|
||||
<td class="face">
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
{{#if versionCheck.version_check_pending}}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
<span class="normal-note">{{i18n 'admin.dashboard.no_check_performed'}}</span>
|
||||
<span class="normal-note">
|
||||
{{#if versionCheck.version_check_pending}}
|
||||
{{i18n 'admin.dashboard.version_check_pending'}}
|
||||
{{else}}
|
||||
{{i18n 'admin.dashboard.stale_data'}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</td>
|
||||
{{else}}
|
||||
{{#if versionCheck.staleData}}
|
||||
<td class="version-number">{{#if versionCheck.version_check_pending}}{{dash-if-empty versionCheck.installed_version}}{{/if}}</td>
|
||||
<td class="face">
|
||||
{{#if versionCheck.version_check_pending}}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
<span class="normal-note">
|
||||
{{#if versionCheck.version_check_pending}}
|
||||
{{i18n 'admin.dashboard.version_check_pending'}}
|
||||
<td class="version-number">{{dash-if-empty versionCheck.latest_version}}</td>
|
||||
<td class="face">
|
||||
{{#if versionCheck.upToDate }}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon {{if versionCheck.critical_updates 'critical-updates-available' 'updates-available'}}">
|
||||
{{#if versionCheck.behindByOneVersion}}
|
||||
{{fa-icon "meh-o"}}
|
||||
{{else}}
|
||||
{{i18n 'admin.dashboard.stale_data'}}
|
||||
{{fa-icon "frown-o"}}
|
||||
{{/if}}
|
||||
</span>
|
||||
</td>
|
||||
{{else}}
|
||||
<td class="version-number">{{dash-if-empty versionCheck.latest_version}}</td>
|
||||
<td class="face">
|
||||
{{#if versionCheck.upToDate }}
|
||||
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
|
||||
{{else}}
|
||||
<span class="icon {{if versionCheck.critical_updates 'critical-updates-available' 'updates-available'}}">
|
||||
{{#if versionCheck.behindByOneVersion}}
|
||||
{{fa-icon "meh-o"}}
|
||||
{{else}}
|
||||
{{fa-icon "frown-o"}}
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
{{#if versionCheck.upToDate }}
|
||||
{{i18n 'admin.dashboard.up_to_date'}}
|
||||
{{else}}
|
||||
<span class="critical-note">{{i18n 'admin.dashboard.critical_available'}}</span>
|
||||
<span class="normal-note">{{i18n 'admin.dashboard.updates_available'}}</span>
|
||||
{{i18n 'admin.dashboard.please_upgrade'}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="version-notes">
|
||||
{{#if versionCheck.upToDate }}
|
||||
{{i18n 'admin.dashboard.up_to_date'}}
|
||||
{{else}}
|
||||
<span class="critical-note">{{i18n 'admin.dashboard.critical_available'}}</span>
|
||||
<span class="normal-note">{{i18n 'admin.dashboard.updates_available'}}</span>
|
||||
{{i18n 'admin.dashboard.please_upgrade'}}
|
||||
{{/if}}
|
||||
</td>
|
||||
{{/if}}
|
||||
</tbody>
|
||||
{{/unless}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue