diff --git a/src/translation/en.json b/src/translation/en.json
index c0bf7ba60..db3ecda54 100644
--- a/src/translation/en.json
+++ b/src/translation/en.json
@@ -520,7 +520,8 @@
"solrConfig": {
"title": "Full Text Search (Solr)",
"description": "Solr can be used to provide fast full-text search for emails. Solr is only run if the mail service has been allocated at least 3GB RAM.",
- "enableSolrCheckbox": "Enable Full Text Search using Solr"
+ "enableSolrCheckbox": "Enable Full Text Search using Solr",
+ "notEnoughMemory": "Please allocate atleast 3GB to the mail service to enable solr."
}
},
"network": {
diff --git a/src/views/emails.html b/src/views/emails.html
index 94a74a787..b1ecdebde 100644
--- a/src/views/emails.html
+++ b/src/views/emails.html
@@ -79,17 +79,21 @@
{{ 'emails.solrConfig.title' | tr }}
-
-
+
+
+
+
+
{{ 'emails.solrConfig.notEnoughMemory' | tr }}
+
@@ -242,7 +246,7 @@
{{ 'emails.settings.solrFts' | tr }}
-
+
{{ 'emails.settings.solrEnabled' | tr }}
/ {{ 'emails.settings.solrRunning' | tr }}
diff --git a/src/views/emails.js b/src/views/emails.js
index 734c9868d..ab930eaaa 100644
--- a/src/views/emails.js
+++ b/src/views/emails.js
@@ -216,19 +216,22 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
$scope.solrConfig = {
busy: false,
error: {},
- currentConfig: {},
+ currentConfig: null, // null means not loaded yet
enabled: false,
running: false,
+ enoughMemory: false,
refresh: function () {
Client.getService('mail', function (error, result) {
if (error) return console.log('Error getting status of mail conatiner', error);
+ $scope.solrConfig.enoughMemory = result.config.memorySwap > (1024*1024*1024*2);
+ $scope.solrConfig.running = result.healthcheck && result.healthcheck.solr.status;
+
Client.getSolrConfig(function (error, config) {
if (error) return console.error('Failed to get solr config', error);
$scope.solrConfig.currentConfig = config;
- $scope.solrConfig.running = result.healthcheck && result.healthcheck.solr.status;
});
});
},