Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-10529: Solr UI Health Check enable/disable ping Button doesn't work (#398)

Jan Høydahldf70f902fb9a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index c12d3483e39..ac0643591ab 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -403,6 +403,8 @@ Bug Fixes
* SOLR-15653: Fix collection creation race that assumes a local clusterstate when the collection has only just been created. (Mark Miller)
+* SOLR-10529: Solr UI Health Check enable/disable ping Button doesn't work (Oscar Wang via janhoy)
+
================== 8.11.0 ==================
Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release.
diff --git a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
index a09070be5cd..4e368e616e6 100644
--- a/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
+++ b/solr/server/solr/configsets/sample_techproducts_configs/conf/solrconfig.xml
@@ -1421,4 +1421,13 @@
<str name="fvCacheName">QUERY_DOC_FV</str>
</transformer>
+ <!-- Example of ping handler with a healthcheckFile -->
+ <requestHandler name="/admin/ping" class="solr.PingRequestHandler">
+ <!-- relative paths are resolved against the data dir -->
+ <str name="healthcheckFile">server-enabled.txt</str>
+ <lst name="invariants">
+ <str name="qt">/query</str><!-- handler to delegate to -->
+ <str name="q">*:*</str>
+ </lst>
+ </requestHandler>
</config>
diff --git a/solr/webapp/web/js/angular/controllers/core-overview.js b/solr/webapp/web/js/angular/controllers/core-overview.js
index 3f07c2400fc..8605411c371 100644
--- a/solr/webapp/web/js/angular/controllers/core-overview.js
+++ b/solr/webapp/web/js/angular/controllers/core-overview.js
@@ -70,11 +70,13 @@ function($scope, $rootScope, $routeParams, Luke, CoreSystem, Update, Replication
$scope.toggleHealthcheck = function() {
if ($scope.healthcheckStatus) {
Ping.disable(
+ {core: $routeParams.core},
function(data) {$scope.healthcheckStatus = false},
function(error) {$scope.healthcheckMessage = error}
);
} else {
Ping.enable(
+ {core: $routeParams.core},
function(data) {$scope.healthcheckStatus = true},
function(error) {$scope.healthcheckMessage = error}
);
diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js
index 6da98c27189..f8b0b0082bc 100644
--- a/solr/webapp/web/js/angular/services.js
+++ b/solr/webapp/web/js/angular/services.js
@@ -182,6 +182,8 @@ solrAdminServices.factory('System',
['$resource', function($resource) {
return $resource(':core/admin/ping', {wt:'json', core: '@core', ts:Date.now(), _:Date.now()}, {
"ping": {},
+ "enable": {params:{action:"enable"}, headers: {doNotIntercept: "true"}},
+ "disable": {params:{action:"disable"}, headers: {doNotIntercept: "true"}},
"status": {params:{action:"status"}, headers: {doNotIntercept: "true"}
}});
}])
diff --git a/solr/webapp/web/partials/core_overview.html b/solr/webapp/web/partials/core_overview.html
index b1d651a15e8..a17b5aa0cab 100644
--- a/solr/webapp/web/partials/core_overview.html
+++ b/solr/webapp/web/partials/core_overview.html
@@ -186,10 +186,10 @@ limitations under the License.
<dl>
<dt class="status">Status:</dt>
- <dd class="status value ico ico-1" ng-show="healthcheckStatus">
+ <dd class="status value ico ico-1" ng-show="healthcheckStatus" ng-click="toggleHealthcheck()">
<button class="healthcheck-status enabled">Healthcheck Status</button>
</dd>
- <dd class="status value ico ico-0" ng-show="!healthcheckStatus">
+ <dd class="status value ico ico-0" ng-show="!healthcheckStatus" ng-click="toggleHealthcheck()">
<button class="healthcheck-status">enable ping</button>
</dd>
</dl>