You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ja...@apache.org on 2023/01/19 21:36:44 UTC
[solr] branch main updated: SOLR-14336 Warn users running old version of Solr (#1297)
This is an automated email from the ASF dual-hosted git repository.
janhoy pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/main by this push:
new 2296d7ebe2d SOLR-14336 Warn users running old version of Solr (#1297)
2296d7ebe2d is described below
commit 2296d7ebe2d0f695c40f4baac9b21433d26f04dd
Author: Jan Høydahl <ja...@users.noreply.github.com>
AuthorDate: Thu Jan 19 22:36:38 2023 +0100
SOLR-14336 Warn users running old version of Solr (#1297)
---
solr/CHANGES.txt | 2 ++
solr/webapp/web/js/angular/controllers/index.js | 7 +++++++
solr/webapp/web/partials/index.html | 3 +++
3 files changed, 12 insertions(+)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 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.js
index 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.html
index 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>