From 4668a9fae504f2e31cb839635bf82d077503330b Mon Sep 17 00:00:00 2001 From: Chris Brame Date: Wed, 30 Jan 2019 00:35:17 -0500 Subject: [PATCH] chore(mailcheck): polling interval configurable --- .../js/angularjs/controllers/settings.js | 7 ++++++ src/settings/settingsUtil.js | 1 + src/views/settings.hbs | 22 +++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/src/public/js/angularjs/controllers/settings.js b/src/public/js/angularjs/controllers/settings.js index 673c2b3a9..acf9b3896 100644 --- a/src/public/js/angularjs/controllers/settings.js +++ b/src/public/js/angularjs/controllers/settings.js @@ -119,6 +119,8 @@ define([ $scope.shortDateFormat = SettingsService.getSettings().shortDateFormat.value $scope.longDateFormat = SettingsService.getSettings().longDateFormat.value + $scope.mailerCheckPolling = $scope.mailerCheckPolling / 60000 + var $uploadButton = $('#logo-upload-select').parent() var uploadLogoSettings = { action: '/settings/general/uploadlogo', @@ -1029,6 +1031,10 @@ define([ .attr('disabled', !newVal) .parent() .toggleClass('md-input-wrapper-disabled', !newVal) + $('input#mailerCheckPolling') + .attr('disabled', !newVal) + .parent() + .toggleClass('md-input-wrapper-disabled', !newVal) $('button#mailerCheckSubmit') .attr('disabled', !newVal) .parent() @@ -1102,6 +1108,7 @@ define([ .put( '/api/v1/settings', [ + { name: 'mailer:check:polling', value: $scope.mailerCheckPolling * 60000 }, { name: 'mailer:check:host', value: $scope.mailerCheckHost }, { name: 'mailer:check:port', value: $scope.mailerCheckPort }, { diff --git a/src/settings/settingsUtil.js b/src/settings/settingsUtil.js index 56fda1c17..e2c1a5685 100644 --- a/src/settings/settingsUtil.js +++ b/src/settings/settingsUtil.js @@ -82,6 +82,7 @@ util.getSettings = function (callback) { s.mailerFrom = parseSetting(settings, 'mailer:from', '') s.mailerCheckEnabled = parseSetting(settings, 'mailer:check:enable', false) + s.mailerCheckPolling = parseSetting(settings, 'mailer:check:polling', 600000) s.mailerCheckHost = parseSetting(settings, 'mailer:check:host', '') s.mailerCheckPort = parseSetting(settings, 'mailer:check:port', 143) s.mailerCheckUsername = parseSetting(settings, 'mailer:check:username', '') diff --git a/src/views/settings.hbs b/src/views/settings.hbs index 4a6ea229c..38fd3430f 100644 --- a/src/views/settings.hbs +++ b/src/views/settings.hbs @@ -16,6 +16,7 @@ mailerFrom='{{data.settings.mailerFrom.value}}'; mailerCheckEnabled={{data.settings.mailerCheckEnabled.value}}; + mailerCheckPolling={{data.settings.mailerCheckPolling.value}}; mailerCheckHost='{{data.settings.mailerCheckHost.value}}'; mailerCheckPort={{data.settings.mailerCheckPort.value}}; mailerCheckUsername='{{data.settings.mailerCheckUsername.value}}'; @@ -923,6 +924,27 @@ +
+
+
Polling Interval + error +
+
+ How often to poll the server for new messages. (Minutes) +
+
+
+
+ +
+
+
+
Create Account