Deuglify the admin dashboard loading state. Also clean up the code

This commit is contained in:
Robin Ward 2016-08-03 15:36:41 -04:00
parent 19fa24d888
commit 331135a88e
4 changed files with 301 additions and 324 deletions

View file

@ -1,56 +1,95 @@
import { setting } from 'discourse/lib/computed'; import { setting } from 'discourse/lib/computed';
import AdminDashboard from 'admin/models/admin-dashboard'; 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. // This controller supports the default interface when you enter the admin section.
export default Ember.Controller.extend({ export default Ember.Controller.extend({
loading: true, loading: null,
versionCheck: null, versionCheck: null,
problemsCheckMinutes: 1, dashboardFetchedAt: null,
showVersionChecks: setting('version_checks'), showVersionChecks: setting('version_checks'),
foundProblems: function() { @computed('problems.length')
return(Discourse.User.currentProp('admin') && this.get('problems') && this.get('problems').length > 0); foundProblems(problemsLength) {
}.property('problems'), return this.currentUser.get('admin') && (problemsLength || 0) > 1;
},
thereWereProblems: function() { @computed('foundProblems')
if(!Discourse.User.currentProp('admin')) { return false; } thereWereProblems(foundProblems) {
if( this.get('foundProblems') ) { if (!this.currentUser.get('admin')) { return false; }
if (foundProblems) {
this.set('hadProblems', true); this.set('hadProblems', true);
return true; return true;
} else { } else {
return this.get('hadProblems') || false; 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('loadingProblems', true);
this.set('problemsFetchedAt', new Date()); this.set('problemsFetchedAt', new Date());
var c = this; AdminDashboard.fetchProblems().then(d => {
AdminDashboard.fetchProblems().then(function(d) { this.set('problems', d.problems);
c.set('problems', d.problems); }).finally(() => {
c.set('loadingProblems', false); this.set('loadingProblems', false);
if( d.problems && d.problems.length > 0 ) {
c.problemsCheckInterval = 1;
} else {
c.problemsCheckInterval = 10;
}
}); });
}, },
problemsTimestamp: function() { @computed('problemsFetchedAt')
return moment(this.get('problemsFetchedAt')).format('LLL'); problemsTimestamp(problemsFetchedAt) {
}.property('problemsFetchedAt'), return moment(problemsFetchedAt).format('LLL');
},
updatedTimestamp: function() { @computed('updated_at')
return moment(this.get('updated_at')).format('LLL'); updatedTimestamp(updatedAt) {
}.property('updated_at'), return moment(updatedAt).format('LLL');
},
actions: { actions: {
refreshProblems: function() { refreshProblems() {
this.loadProblems(); this.loadProblems();
}, },
showTrafficReport: function() { showTrafficReport() {
this.set("showTrafficReport", true); this.set("showTrafficReport", true);
} }
} }

View file

@ -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({ export default Discourse.Route.extend({
setupController(controller) {
setupController: function(c) { controller.fetchDashboard();
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();
}
} }
}); });

View file

@ -1,161 +1,149 @@
{{plugin-outlet "admin-dashboard-top"}} {{plugin-outlet "admin-dashboard-top"}}
<div class="dashboard-left"> {{#conditional-loading-spinner condition=loading}}
{{#if showVersionChecks}} <div class="dashboard-left">
{{partial 'admin/templates/version-checks'}} {{#if showVersionChecks}}
{{/if}} {{partial 'admin/templates/version-checks'}}
{{/if}}
<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>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th>0</th> <th>0</th>
<th>1</th> <th>1</th>
<th>2</th> <th>2</th>
<th>3</th> <th>3</th>
<th>4</th> <th>4</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#unless loading}}
{{#each user_reports as |r|}} {{#each user_reports as |r|}}
{{admin-report-trust-level-counts report=r}} {{admin-report-trust-level-counts report=r}}
{{/each}} {{/each}}
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="dashboard-stats totals"> <div class="dashboard-stats totals">
<table> <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>
<tr> <tr>
<th>&nbsp;</th> <td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.admins'}}</td>
<th>{{i18n 'admin.dashboard.reports.today'}}</th> <td class="value">{{#link-to 'adminUsersList.show' 'admins'}}{{admins}}{{/link-to}}</td>
<th>{{i18n 'admin.dashboard.reports.yesterday'}}</th> <td class="title">{{fa-icon "ban"}} {{i18n 'admin.dashboard.suspended'}}</td>
<th>{{i18n 'admin.dashboard.reports.last_7_days'}}</th> <td class="value">{{#link-to 'adminUsersList.show' 'suspended'}}{{suspended}}{{/link-to}}</td>
<th>{{i18n 'admin.dashboard.reports.last_30_days'}}</th>
<th>{{i18n 'admin.dashboard.reports.all'}}</th>
</tr> </tr>
</thead> <tr>
<tbody> <td class="title">{{fa-icon "shield"}} {{i18n 'admin.dashboard.moderators'}}</td>
{{#unless loading}} <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>&nbsp;</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|}} {{#each global_reports as |r|}}
{{admin-report-counts report=r}} {{admin-report-counts report=r}}
{{/each}} {{/each}}
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title" title="{{i18n 'admin.dashboard.page_views'}}">{{i18n 'admin.dashboard.page_views_short'}}</th> <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.today'}}</th>
<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> <th>{{i18n 'admin.dashboard.reports.all'}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#unless loading}}
{{#each page_view_reports as |r|}} {{#each page_view_reports as |r|}}
{{admin-report-counts report=r}} {{admin-report-counts report=r}}
{{/each}} {{/each}}
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title" title="{{i18n 'admin.dashboard.private_messages_title'}}">{{fa-icon "envelope"}} {{i18n 'admin.dashboard.private_messages_short'}}</th> <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.today'}}</th>
<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> <th>{{i18n 'admin.dashboard.reports.all'}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#unless loading}}
{{#each private_message_reports as |r|}} {{#each private_message_reports as |r|}}
{{admin-report-counts report=r}} {{admin-report-counts report=r}}
{{/each}} {{/each}}
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title" title="{{i18n 'admin.dashboard.mobile_title'}}">{{i18n 'admin.dashboard.mobile_title'}}</th> <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.today'}}</th>
<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> <th>{{i18n 'admin.dashboard.reports.all'}}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#unless loading}}
{{#each mobile_reports as |r|}} {{#each mobile_reports as |r|}}
{{admin-report-counts report=r}} {{admin-report-counts report=r}}
{{/each}} {{/each}}
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th>&nbsp;</th> <th>&nbsp;</th>
<th></th> <th></th>
<th></th> <th></th>
<th></th> <th></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{{#unless loading}}
<tr> <tr>
<td>{{i18n 'admin.dashboard.uploads'}}</td> <td>{{i18n 'admin.dashboard.uploads'}}</td>
<td>{{disk_space.uploads_used}} ({{i18n 'admin.dashboard.space_free' size=disk_space.uploads_free}})</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>{{#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> <td>{{disk_space.backups_used}} ({{i18n 'admin.dashboard.space_free' size=disk_space.backups_free}})</td>
</tr> </tr>
{{/unless}} </tbody>
</tbody> </table>
</table> </div>
</div>
{{#unless loading}}
{{#if showTrafficReport}} {{#if showTrafficReport}}
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
@ -183,54 +171,53 @@
<a href {{action 'showTrafficReport'}}>{{i18n 'admin.dashboard.show_traffic_report'}}</a> <a href {{action 'showTrafficReport'}}>{{i18n 'admin.dashboard.show_traffic_report'}}</a>
</div> </div>
{{/if}} {{/if}}
{{/unless}} </div>
</div>
<div class="dashboard-right"> <div class="dashboard-right">
{{#if foundProblems}}
{{#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-stats detected-problems"> <div class="dashboard-stats detected-problems">
<div class="look-here">&nbsp;</div> <div class="look-here">{{fa-icon "exclamation-triangle"}}</div>
<div class="problem-messages"> <div class="problem-messages">
<p> {{#conditional-loading-spinner condition=loadingProblems}}
{{i18n 'admin.dashboard.no_problems'}} <p>
{{d-button action="refreshProblems" class="btn-small" icon="refresh" label="admin.dashboard.refresh_problems"}} {{i18n 'admin.dashboard.problems_found'}}
</p> <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>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
{{else}}
{{#if thereWereProblems}}
<div class="dashboard-stats detected-problems">
<div class="look-here">&nbsp;</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}}
{{/if}}
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title">{{top_referred_topics.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th> <th class="title">{{top_referred_topics.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th>
<th>{{top_referred_topics.ytitles.num_clicks}}</th> <th>{{top_referred_topics.ytitles.num_clicks}}</th>
</tr> </tr>
</thead> </thead>
{{#unless loading}}
{{#each top_referred_topics.data as |data|}} {{#each top_referred_topics.data as |data|}}
<tbody> <tbody>
<tr> <tr>
@ -245,20 +232,18 @@
</tr> </tr>
</tbody> </tbody>
{{/each}} {{/each}}
{{/unless}} </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title">{{top_traffic_sources.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th> <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_clicks}}</th>
<th>{{top_traffic_sources.ytitles.num_topics}}</th> <th>{{top_traffic_sources.ytitles.num_topics}}</th>
</tr> </tr>
</thead> </thead>
{{#unless loading}}
{{#each top_traffic_sources.data as |s|}} {{#each top_traffic_sources.data as |s|}}
<tbody> <tbody>
<tr> <tr>
@ -268,20 +253,18 @@
</tr> </tr>
</tbody> </tbody>
{{/each}} {{/each}}
{{/unless}} </table>
</table> </div>
</div>
<div class="dashboard-stats"> <div class="dashboard-stats">
<table class="table table-condensed table-hover"> <table class="table table-condensed table-hover">
<thead> <thead>
<tr> <tr>
<th class="title">{{top_referrers.title}} ({{i18n 'admin.dashboard.reports.last_30_days'}})</th> <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_clicks}}</th>
<th>{{top_referrers.ytitles.num_topics}}</th> <th>{{top_referrers.ytitles.num_topics}}</th>
</tr> </tr>
</thead> </thead>
{{#unless loading}}
{{#each top_referrers.data as |r|}} {{#each top_referrers.data as |r|}}
<tbody> <tbody>
<tr> <tr>
@ -291,14 +274,14 @@
</tr> </tr>
</tbody> </tbody>
{{/each}} {{/each}}
{{/unless}} </table>
</table> </div>
</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 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}}

View file

@ -8,65 +8,63 @@
<th colspan="3">{{i18n 'admin.dashboard.latest_version'}}</th> <th colspan="3">{{i18n 'admin.dashboard.latest_version'}}</th>
</tr> </tr>
</thead> </thead>
{{#unless loading}} <tbody>
<tbody> <td class="title">{{i18n 'admin.dashboard.version'}}</td>
<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>
<td class="version-number"><a href={{versionCheck.gitLink}} target="_blank">{{dash-if-empty versionCheck.installed_describe}}</a></td>
{{#if versionCheck.noCheckPerformed}} {{#if versionCheck.noCheckPerformed}}
<td class="version-number">&mdash;</td> <td class="version-number">&mdash;</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"> <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>
<td class="version-notes"> <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> </td>
{{else}} {{else}}
{{#if versionCheck.staleData}} <td class="version-number">{{dash-if-empty versionCheck.latest_version}}</td>
<td class="version-number">{{#if versionCheck.version_check_pending}}{{dash-if-empty versionCheck.installed_version}}{{/if}}</td> <td class="face">
<td class="face"> {{#if versionCheck.upToDate }}
{{#if versionCheck.version_check_pending}} <span class='icon up-to-date'>{{fa-icon "smile-o"}}</span>
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span> {{else}}
{{else}} <span class="icon {{if versionCheck.critical_updates 'critical-updates-available' 'updates-available'}}">
<span class="icon critical-updates-available">{{fa-icon "frown-o"}}</span> {{#if versionCheck.behindByOneVersion}}
{{/if}} {{fa-icon "meh-o"}}
</td>
<td class="version-notes">
<span class="normal-note">
{{#if versionCheck.version_check_pending}}
{{i18n 'admin.dashboard.version_check_pending'}}
{{else}} {{else}}
{{i18n 'admin.dashboard.stale_data'}} {{fa-icon "frown-o"}}
{{/if}} {{/if}}
</span> </span>
</td> {{/if}}
{{else}} </td>
<td class="version-number">{{dash-if-empty versionCheck.latest_version}}</td> <td class="version-notes">
<td class="face"> {{#if versionCheck.upToDate }}
{{#if versionCheck.upToDate }} {{i18n 'admin.dashboard.up_to_date'}}
<span class='icon up-to-date'>{{fa-icon "smile-o"}}</span> {{else}}
{{else}} <span class="critical-note">{{i18n 'admin.dashboard.critical_available'}}</span>
<span class="icon {{if versionCheck.critical_updates 'critical-updates-available' 'updates-available'}}"> <span class="normal-note">{{i18n 'admin.dashboard.updates_available'}}</span>
{{#if versionCheck.behindByOneVersion}} {{i18n 'admin.dashboard.please_upgrade'}}
{{fa-icon "meh-o"}} {{/if}}
{{else}} </td>
{{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}} {{/if}}
</tbody> {{/if}}
{{/unless}} </tbody>
</table> </table>
</div> </div>