Skip to content

Commit

Permalink
SOLR-16466: Admin UI - Make it optional to sort list of commandline a…
Browse files Browse the repository at this point in the history
…rgs (#2246)

(cherry picked from commit 7813f0e)
  • Loading branch information
freedev authored and cpoerschke committed Apr 12, 2024
1 parent 1f54c82 commit b8aaa54
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 5 deletions.
2 changes: 2 additions & 0 deletions solr/CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,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,
Expand Down
16 changes: 16 additions & 0 deletions solr/webapp/web/css/angular/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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; }

23 changes: 19 additions & 4 deletions solr/webapp/web/js/angular/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,26 @@ solrAdminApp.controller('IndexController', function($scope, System, Cores, Const
data.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 ) {
Expand Down
5 changes: 4 additions & 1 deletion solr/webapp/web/partials/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ <h2><span>JVM</span></h2>
<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>
Expand Down

0 comments on commit b8aaa54

Please sign in to comment.