Apache Solr open-source search software
SOLR-14336 Warn users running old version of Solr (#1297)
Jan Høydahl2296d7ebe2d0
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 8c5e2cf5915..3671e59d17a 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -222,6 +222,8 @@ Other Changes* SOLR-16534: Jaegertracer-Configurator is now deprecated. From v10.0 we'll only support OpenTelemetry (janhoy)+* SOLR-14336: Warning about potentially old Solr version in Admin UI dashboard (janhoy)+* SOLR-13243: Correct the initial capacity of the ZK operations to run in ShardLeaderElectionContextBase#runLeaderProcess (Haythem Khiri)* SOLR-16544: Improve documentation on how to contribute to Solr (Justin Sweeney)diff --git a/solr/webapp/web/js/angular/controllers/index.js b/solr/webapp/web/js/angular/controllers/index.jsindex e931d59e1eb..68803bcf2ea 100644--- a/solr/webapp/web/js/angular/controllers/index.js+++ b/solr/webapp/web/js/angular/controllers/index.js@@ -20,6 +20,8 @@ solrAdminApp.controller('IndexController', function($scope, System, Cores, Const$scope.reload = function() {System.get(function(data) {$scope.system = data;+ const releaseDate = parse_release_date($scope.system.lucene['solr-impl-version'])+ $scope.releaseDaysOld = (new Date() - releaseDate)/1000/60/60/24;if ("username" in data.security) {// Needed for Kerberos, since this is the only place from where@@ -84,6 +86,11 @@ var parse_memory_value = function( value ) {return value;};+const parse_release_date = function(value) {+ const match = value.match( /.* (20\d\d-[0-1]\d-[0-3]\d) .*/ );+ return match === null ? new Date() : new Date(match[1]);+};+var pretty_print_bytes = function(byte_value) {var unit = null;diff --git a/solr/webapp/web/partials/index.html b/solr/webapp/web/partials/index.htmlindex 5f77bffae38..3fe47efa64a 100644--- a/solr/webapp/web/partials/index.html+++ b/solr/webapp/web/partials/index.html@@ -97,6 +97,9 @@ limitations under the License.</div>+ <div class="content" ng-show="releaseDaysOld > 365">+ <p class="warning-msg"><img src="img/ico/exclamation-button.png"/> WARNING: This Solr release is more than a year old. Consider upgrading.</p>+ </div></div></div>