From 908480c98aa48a9d1caf09ee00f3cfe0863afec2 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Fri, 31 Oct 2014 15:20:42 +0800 Subject: Bug 1062739: add the ability for administrators to limit the number of emails sent to a user per minute and hour r=dylan,a=glob --- template/en/default/admin/admin.html.tmpl | 6 ++ .../en/default/admin/reports/job_queue.html.tmpl | 74 ++++++++++++++++++++++ template/en/default/global/user-error.html.tmpl | 2 + 3 files changed, 82 insertions(+) create mode 100644 template/en/default/admin/reports/job_queue.html.tmpl (limited to 'template') diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl index 9f60eb662..01e9f309b 100644 --- a/template/en/default/admin/admin.html.tmpl +++ b/template/en/default/admin/admin.html.tmpl @@ -118,6 +118,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 %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index e9bdb63c4..78d8823f5 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -191,6 +191,8 @@ group access [% ELSIF object == "groups" %] groups + [% ELSIF object == "job_queue" %] + the job queue [% ELSIF object == "keywords" %] keywords [% ELSIF object == "milestones" %] -- cgit v1.2.3-24-g4f1b