diff --git a/solr/webapp/web/css/angular/common.css b/solr/webapp/web/css/angular/common.css index 9cc7a18957e..4bdd4bbadd3 100644 --- a/solr/webapp/web/css/angular/common.css +++ b/solr/webapp/web/css/angular/common.css @@ -352,6 +352,18 @@ ul display: none; } +.exception +{ + background-color: #f00; + background-image: url( ../../img/ico/construction.png ); + background-position: 10px 50%; + color: #fff; + font-weight: bold; + margin-bottom: 20px; + padding: 10px; + padding-left: 35px; +} + #content-wrapper { margin-left: 150px; @@ -722,3 +734,16 @@ pre.syntax .tex .formula -webkit-box-shadow: 1px 1px 0 #d8d8d8; color: #333; } + +.exception .show-exception { + margin-top: 4px; + display: block; + position: absolute; + right: 10px; + top: 7px; + color: #fff; +} + +#exception .show-exception a:hover { + color: #333; +} diff --git a/solr/webapp/web/index.html b/solr/webapp/web/index.html index 7a44b56a634..1184828d445 100644 --- a/solr/webapp/web/index.html +++ b/solr/webapp/web/index.html @@ -90,10 +90,12 @@ limitations under the License.
-
+

SolrCore Initialization Failures

-
    +
      +
    • {{core}}: {{error}}
    • +

    Please check your logs for more information

    @@ -113,11 +115,8 @@ limitations under the License.

    Continuing to load data...

    - -
    -

    Exception

    -

    {{exception}}

    - hide exception +
    +
    {{exception.msg}}
    diff --git a/solr/webapp/web/js/angular/app.js b/solr/webapp/web/js/angular/app.js index 7882289baa6..fbb487bd92b 100644 --- a/solr/webapp/web/js/angular/app.js +++ b/solr/webapp/web/js/angular/app.js @@ -265,6 +265,9 @@ solrAdminApp.config([ if (activeRequests == 0) { $rootScope.$broadcast('loadingStatusActive'); } + if ($rootScope.exceptions[config.url]) { + delete $rootScope.exceptions[config.url]; + } activeRequests++; config.timeout = 10000; return config || $q.when(config); @@ -302,7 +305,7 @@ solrAdminApp.config([ var result = $http(rejection.config); return result; } else { - $rootScope.exception = rejection; + $rootScope.exceptions[rejection.config.url] = rejection.data.error; } return $q.reject(rejection); } @@ -330,7 +333,11 @@ solrAdminApp.config([ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $location, Cores, Collections, System, Ping, Constants) { - $rootScope.hideException = function() {delete $rootScope.exception}; + $rootScope.exceptions={}; + + $rootScope.toggleException = function() { + $scope.showException=!$scope.showException; + }; $scope.refresh = function() { $scope.cores = []; @@ -350,6 +357,8 @@ solrAdminApp.controller('MainController', function($scope, $route, $rootScope, $ $scope.currentCore = core; } } + $scope.showInitFailures = Object.keys(data.initFailures).length>0; + $scope.initFailures = data.initFailures; }); System.get(function(data) { diff --git a/solr/webapp/web/js/angular/controllers/cores.js b/solr/webapp/web/js/angular/controllers/cores.js index 5dc2d72196e..36765ade0eb 100644 --- a/solr/webapp/web/js/angular/controllers/cores.js +++ b/solr/webapp/web/js/angular/controllers/cores.js @@ -140,17 +140,25 @@ solrAdminApp.controller('CoreAdminController', } $scope.reloadCore = function() { + if ($scope.initFailures[$scope.selectedCore]) { + delete $scope.initFailures[$scope.selectedCore]; + $scope.showInitFailures = Object.keys(data.initFailures).length>0; + } Cores.reload({core: $scope.selectedCore}, - function(successData) { - $scope.reloadSuccess = true; - $timeout(function() {$scope.reloadSuccess=false}, 1000); - }, - function(failureData) { - $scope.reloadFailure = true; - $timeout(function() {$scope.reloadFailure=false}, 1000); - $scope.selectedCore = null; - $scope.refresh(); - $location.path("/~cores"); + function(data) { + if (data.error) { + $scope.reloadFailure = true; + $timeout(function() { + $scope.reloadFailure = false; + $route.reload(); + }, 1000); + } else { + $scope.reloadSuccess = true; + $timeout(function () { + $scope.reloadSuccess = false; + $route.reload(); + }, 1000); + } }); }; diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js index 4498912b079..9789b642e4b 100644 --- a/solr/webapp/web/js/angular/services.js +++ b/solr/webapp/web/js/angular/services.js @@ -31,7 +31,7 @@ solrAdminServices.factory('System', "unload": {params:{action: "UNLOAD", core: "@core"}}, "rename": {params:{action: "RENAME"}}, "swap": {params:{}}, - "reload": {method: "GET", params:{action:"RELOAD", core: "@core"}}, + "reload": {method: "GET", params:{action:"RELOAD", core: "@core", doNotIntercept: "true"}}, "optimize": {params:{}} }); }])