From 7dc675fedb5b2631a8bafd0fb691eac485eff0af Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 4 Nov 2014 13:38:46 +0800 Subject: Bug 1092037: backport bug 1062739 to bmo (add the ability for administrators to limit the number of emails sent to a user per minute and hour) --- template/en/default/admin/admin.html.tmpl | 6 ++ .../en/default/admin/reports/job_queue.html.tmpl | 74 ++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 template/en/default/admin/reports/job_queue.html.tmpl (limited to 'template/en/default/admin') diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl index 98f729b02..86bd8b973 100644 --- a/template/en/default/admin/admin.html.tmpl +++ b/template/en/default/admin/admin.html.tmpl @@ -127,6 +127,12 @@ and time, and get the result of these queries directly per email. This is a good way to create reminders and to keep track of the activity in your installation. + [% IF Param('use_mailer_queue') %] + [% class = user.in_group('admin') ? "" : "forbidden" %] +
Job Queue
+
View the queue of undelivered/deferred jobs/emails.
+ [% END %] + [% Hook.process('end_links_right') %] diff --git a/template/en/default/admin/reports/job_queue.html.tmpl b/template/en/default/admin/reports/job_queue.html.tmpl new file mode 100644 index 000000000..6057eac7f --- /dev/null +++ b/template/en/default/admin/reports/job_queue.html.tmpl @@ -0,0 +1,74 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% INCLUDE global/header.html.tmpl + title = "Job Queue Status" + style_urls = [ "skins/standard/admin.css" ] +%] + +[% IF jobs.size %] + +

+ [% IF too_many_jobs %] + [% job_count FILTER html %] jobs found, + limiting results to [% constants.JOB_QUEUE_VIEW_MAX_JOBS FILTER html %] jobs. + [% ELSE %] + [% jobs.size FILTER none %] jobs(s) in the queue. + [% END %] +

+ + + + + + + + + + [% FOREACH job IN jobs %] + + + + + + + + [% END %] +
Next Attempt AfterError CountError TimeError MessageJob
+ [% IF job.grabbed_until %] + [% time2str("%Y-%m-%d %H:%M:%S %Z", job.grabbed_until) FILTER html %] + [% ELSE %] + [% time2str("%Y-%m-%d %H:%M:%S %Z", job.run_time) FILTER html %] + [% END %] + + [% job.error_count || "-" FILTER html %] + + [% IF job.error_count %] + [% time2str("%Y-%m-%d %H:%M:%S %Z", job.error_time) FILTER html %] + [% ELSE %] + - + [% END %] + + [% IF job.grabbed_until %] + Deferred + [% ELSIF job.error_count %] + [% job.error_message FILTER html %] + [% ELSE %] + - + [% END %] + [% job.subject || '-' FILTER html %]
+ +[% ELSE %] + +

+ The job queue is empty. +

+ +[% END %] + +[% INCLUDE global/footer.html.tmpl %] -- cgit v1.2.3-24-g4f1b