get/set solr config

This commit is contained in:
Girish Ramakrishnan
2020-11-19 17:45:16 -08:00
parent cac8659fbd
commit 3125e1b386
5 changed files with 340 additions and 8 deletions

View File

@@ -213,6 +213,44 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
}
};
$scope.solrConfig = {
busy: false,
error: {},
currentConfig: {},
enabled: false,
refresh: function () {
Client.getSolrConfig(function (error, config) {
if (error) return console.error('Failed to get solr config', error);
$scope.solrConfig.currentConfig = config;
});
},
show: function() {
$scope.solrConfig.busy = false;
$scope.solrConfig.error = null;
$scope.solrConfig.enabled = $scope.solrConfig.currentConfig.enabled;
$('#solrConfigModal').modal('show');
},
submit: function () {
$scope.solrConfig.busy = true;
Client.setSolrConfig($scope.solrConfig.enabled, function (error) {
$scope.solrConfig.busy = false;
if (error) return console.error(error);
$scope.solrConfig.refresh();
$('#solrConfigModal').modal('hide');
});
}
};
$scope.spamConfig = {
busy: false,
error: {},
@@ -361,6 +399,7 @@ angular.module('Application').controller('EmailsController', ['$scope', '$locati
$scope.maxEmailSize.refresh();
$scope.spamConfig.refresh();
$scope.solrConfig.refresh();
});
}