mirror of
https://github.com/wekan/wekan.git
synced 2026-11-08 11:25:19 -05:00
The pane is called Problems in the menu, its address is /admin/problems, and
docs/Features/Admin-Panel/Problems is where it is documented. Two things still
called it Reports, from before it was renamed:
* the route NAME was 'admin-reports', where its three siblings are 'setting',
'people' and 'attachments' - the bare page key. So the one route whose name
did not match its own address;
* the template, and its three files, were adminReports.
Both are 'problems' / adminProblems now, across 41 files.
What did NOT change is `legacyBase: '/admin-reports'`. That is an address people
have bookmarked and it still redirects here - the point of the rename is that
the code agrees with the menu, not that an old link should break. The CHANGELOG
entries describing the old addresses are left alone too: a released section is a
record of what shipped.
Thanks to xet7 !
40 lines
1.3 KiB
JavaScript
40 lines
1.3 KiB
JavaScript
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
|
|
|
|
// Reactive "are there any new problems?" flag, polled from the admin-only
|
|
// eventLogProblemAreas method, so the Problems button turns red when there are
|
|
// unacknowledged Security/Speed/Tests problems.
|
|
const hasProblemsVar = new ReactiveVar(false);
|
|
let problemsTimer = null;
|
|
function refreshProblems() {
|
|
Meteor.call('eventLogProblemAreas', (err, res) => {
|
|
hasProblemsVar.set(!err && Array.isArray(res) && res.length > 0);
|
|
});
|
|
}
|
|
|
|
Template.adminPanelTabs.onCreated(function () {
|
|
refreshProblems();
|
|
problemsTimer = Meteor.setInterval(refreshProblems, 30000);
|
|
});
|
|
Template.adminPanelTabs.onDestroyed(function () {
|
|
if (problemsTimer) Meteor.clearInterval(problemsTimer);
|
|
});
|
|
|
|
Template.adminPanelTabs.helpers({
|
|
isProblemsActive() {
|
|
return FlowRouter.getRouteName() === 'problems' ? 'active' : '';
|
|
},
|
|
// 'has-problems' → red background (see settingHeader.css) when there are new problems.
|
|
problemsClass() {
|
|
return hasProblemsVar.get() ? 'has-problems' : '';
|
|
},
|
|
isSettingsActive() {
|
|
return FlowRouter.getRouteName() === 'setting' ? 'active' : '';
|
|
},
|
|
isPeopleActive() {
|
|
return FlowRouter.getRouteName() === 'people' ? 'active' : '';
|
|
},
|
|
isAttachmentsActive() {
|
|
return FlowRouter.getRouteName() === 'attachments' ? 'active' : '';
|
|
},
|
|
});
|