Apache Solr open-source search software
Admin UI: fixed node list display bug caused by different hostname with same front part (duplicates PR #2449) (#2475)
Eric Pugh6d945eb75f4a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex ee81feb5631..7200712707f 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -137,6 +137,8 @@ Bug Fixes* SOLR-17275: SolrJ ZkClientClusterStateProvider, revert SOLR-17153 for perf regression when aliases are used. (Aparna Suresh)+* PR-2475: Fixed node listing bug in Admin UI when different hostnames start with the same front part. (@hgdharold via Eric Pugh)+Dependency Upgrades---------------------(No changes)diff --git a/solr/webapp/web/js/angular/controllers/cloud.js b/solr/webapp/web/js/angular/controllers/cloud.jsindex 75eef23dae5..01e284b2001 100644--- a/solr/webapp/web/js/angular/controllers/cloud.js+++ b/solr/webapp/web/js/angular/controllers/cloud.js@@ -155,7 +155,7 @@ var nodesSubController = function($scope, Collections, System, Metrics) {$scope.isFirstNodeForHost = function(node) {var hostName = node.split(":")[0];var nodesInHost = $scope.filteredNodes.filter(function (node) {- return node.startsWith(hostName);+ return node.split(":")[0] === hostName;});return nodesInHost[0] === node;};@@ -164,7 +164,7 @@ var nodesSubController = function($scope, Collections, System, Metrics) {$scope.firstLiveNodeForHost = function(key) {var hostName = key.split(":")[0];var liveNodesInHost = $scope.filteredNodes.filter(function (key) {- return key.startsWith(hostName);+ return key.split(":")[0] === hostName;}).filter(function (key) {return $scope.live_nodes.includes(key);});@@ -329,7 +329,7 @@ var nodesSubController = function($scope, Collections, System, Metrics) {hostsToShow.push(hostName);if (isFiltered) { // Only show the nodes per host matching active filternodesToShow = nodesToShow.concat(filteredNodes.filter(function (node) {- return node.startsWith(hostName);+ return node.split(":")[0] === hostName;}));} else {nodesToShow = nodesToShow.concat(hosts[hostName]['nodes']);