Apache Solr open-source search software
SOLR-16466: Admin UI - Make it optional to sort list of commandline args (#2246)
Vincenzo D'Amore7813f0e1ae26
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 281a1df199a..bdb44b60dc0 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -97,6 +97,8 @@ New Features* SOLR-16403: A new cluster singleton plugin to automatically remove inactive shards. (Paul McArthur, David Smiley)+* SOLR-16466: Admin UI - Make it optional to sort list of commandline args (Shawn Heisey, Vincenzo D'Amore via Christine Poerschke)+Improvements---------------------* SOLR-17119: When registering or updating a ConfigurablePlugin through the `/cluster/plugin` API,diff --git a/solr/webapp/web/css/angular/index.css b/solr/webapp/web/css/angular/index.cssindex de6ba0a5e70..2f4c5394085 100644--- a/solr/webapp/web/css/angular/index.css+++ b/solr/webapp/web/css/angular/index.css@@ -168,6 +168,21 @@ limitations under the License.#content #index #jvm .processors dt span { background-image: url( ../../img/ico/processor.png ); }#content #index #jvm .command_line_args dt span { background-image: url( ../../img/ico/terminal.png ); }+#content #index #jvm #sort-command-line a+{+ background-image: url( ../../img/ico/ui-check-box-uncheck.png );+ background-position: 0 50%;+ color: #4D4D4D;+ display: block;+ padding-left: 21px;+}++#content #index #jvm #sort-command-line a.on+{+ background-image: url( ../../img/ico/ui-check-box.png );+ color: #333;+}+#content #index #system h2 { background-image: url( ../../img/ico/system-monitor.png ); }#content #index #system@@ -219,3 +234,4 @@ limitations under the License.#content #index #security h2 { background-image: url( ../../img/ico/prohibition.png ); }#content #index #security div { text-align: right; }+diff --git a/solr/webapp/web/js/angular/controllers/index.js b/solr/webapp/web/js/angular/controllers/index.jsindex c744ef44c3f..20a89edebd9 100644--- a/solr/webapp/web/js/angular/controllers/index.js+++ b/solr/webapp/web/js/angular/controllers/index.js@@ -72,11 +72,26 @@ solrAdminApp.controller('IndexController', function($scope, System, Cores, Constdata.system.totalSwapSpaceSize && data.system.freeSwapSpaceSize &&data.system.openFileDescriptorCount && data.system.maxFileDescriptorCount);- // command line args:- $scope.commandLineArgs = data.jvm.jmx.commandLineArgs.sort();- });+ // save a copy of the original commandline args+ $scope.commandLineArgsUnsorted = [...data.jvm.jmx.commandLineArgs];+ // get commandline args latest orderby or defaults to "Unsorted"+ $scope.commandLineOrderBy = sessionStorage.getItem("commandline.orderby") || "Unsorted";+ $scope.showCommandLineArgs();+ });};- $scope.reload();+ $scope.toggleCommandLineOrder = function() {+ $scope.commandLineOrderBy = ($scope.commandLineOrderBy=="Sorted") ? "Unsorted":"Sorted";+ sessionStorage.setItem("commandline.orderby", $scope.commandLineOrderBy);+ $scope.showCommandLineArgs();+ }+ $scope.showCommandLineArgs = function() {+ if ($scope.commandLineOrderBy == "Sorted") {+ $scope.commandLineArgs = [...$scope.commandLineArgsUnsorted].sort();+ } else {+ $scope.commandLineArgs = $scope.commandLineArgsUnsorted;+ }+ }+$scope.reload();});var parse_memory_value = function( value ) {diff --git a/solr/webapp/web/partials/index.html b/solr/webapp/web/partials/index.htmlindex 8e0c2b04882..d96b8228028 100644--- a/solr/webapp/web/partials/index.html+++ b/solr/webapp/web/partials/index.html@@ -214,7 +214,10 @@ limitations under the License.<dt><span>Args</span></dt><dd ng-repeat="arg in commandLineArgs track by $index" ng-class="{'odd':$odd}">{{arg}}</dd></dl></li>-+ <li>+ <div id="sort-command-line" ng-click="toggleCommandLineOrder()"><a ng-class="{on: commandLineOrderBy=='Sorted'}">Sort JVM Command line Args</a></div>+ </li>+</ul></div>