SOLR-7568: Dataimport non-existence error lingers across new admin UI tabs

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1680457 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erick Erickson 2015-05-20 05:10:18 +00:00
parent 144b4e8f12
commit bea194df80
3 changed files with 19 additions and 5 deletions

View File

@ -280,6 +280,9 @@ solrAdminApp.config([
}; };
var failed = function(rejection) { var failed = function(rejection) {
if (rejection.config.params.doNotIntercept) {
return rejection;
}
activeRequests--; activeRequests--;
if (activeRequests == 0) { if (activeRequests == 0) {
$rootScope.$broadcast('loadingStatusInactive'); $rootScope.$broadcast('loadingStatusInactive');

View File

@ -40,9 +40,14 @@ solrAdminApp.controller('DataImportController',
}); });
DataImport.config({core: $routeParams.core}, function (data) { DataImport.config({core: $routeParams.core}, function (data) {
try {
var xml = $.parseXML(data.config);
} catch (err) {
$scope.hasHandlers = false;
return;
}
$scope.config = data.config; $scope.config = data.config;
$scope.entities = []; $scope.entities = [];
var xml = $.parseXML($scope.config);
$('document > entity', xml).each(function (i, element) { $('document > entity', xml).each(function (i, element) {
$scope.entities.push($(element).attr('name')); $scope.entities.push($(element).attr('name'));
}); });
@ -134,6 +139,10 @@ solrAdminApp.controller('DataImportController',
$scope.isStatusLoading = true; $scope.isStatusLoading = true;
DataImport.status({core: $routeParams.core}, function (data) { DataImport.status({core: $routeParams.core}, function (data) {
if (data[0] == "<") {
$scope.hasHandlers = false;
return;
}
var now = new Date(); var now = new Date();
$scope.lastUpdate = now.toTimeString().split(' ').shift(); $scope.lastUpdate = now.toTimeString().split(' ').shift();

View File

@ -133,10 +133,12 @@ solrAdminServices.factory('System',
.factory('DataImport', .factory('DataImport',
['$resource', function($resource) { ['$resource', function($resource) {
return $resource('/solr/:core/dataimport', {core: '@core', indent:'on', wt:'json', _:Date.now()}, { return $resource('/solr/:core/dataimport', {core: '@core', indent:'on', wt:'json', _:Date.now()}, {
"config": {params: {command: "show-config"}, transformResponse: function(data) { "config": {params: {command: "show-config", doNotIntercept: "true"},
return {config: data}; transformResponse: function(data) {
}}, return {config: data};
"status": {params: {command: "status"}}, }
},
"status": {params: {command: "status", doNotIntercept: "true"}},
"reload": {params: {command: "reload-config"}}, "reload": {params: {command: "reload-config"}},
"post": {method: "POST", "post": {method: "POST",
headers: {'Content-type': 'application/x-www-form-urlencoded'}, headers: {'Content-type': 'application/x-www-form-urlencoded'},