You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by ep...@apache.org on 2022/06/29 13:55:55 UTC

[solr] branch solr-paramset-impl updated: hack in making the page url include the specific selected paramset to facilitate sharing links

This is an automated email from the ASF dual-hosted git repository.

epugh pushed a commit to branch solr-paramset-impl
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/solr-paramset-impl by this push:
     new 23138a5d069 hack in making the page url include the specific selected paramset to facilitate sharing links
23138a5d069 is described below

commit 23138a5d069ba495bf5674c869ba04a239a0981b
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Wed Jun 29 07:55:48 2022 -0600

    hack in making the page url include the specific selected paramset to facilitate sharing links
---
 .../webapp/web/js/angular/controllers/paramsets.js | 37 +++++++++++++++++++++-
 1 file changed, 36 insertions(+), 1 deletion(-)

diff --git a/solr/webapp/web/js/angular/controllers/paramsets.js b/solr/webapp/web/js/angular/controllers/paramsets.js
index 869a8a4dce9..562731459c4 100644
--- a/solr/webapp/web/js/angular/controllers/paramsets.js
+++ b/solr/webapp/web/js/angular/controllers/paramsets.js
@@ -17,7 +17,7 @@
 //helper for formatting JSON and others
 
 solrAdminApp.controller('ParamSetsController',
-  function($scope, $routeParams, ParamSet, Constants) {
+  function($scope, $location, $routeParams, ParamSet, Constants) {
 
     $scope.paramsetList = [];
 
@@ -34,15 +34,48 @@ solrAdminApp.controller('ParamSetsController',
     }
 
     $scope.selectParamset = function() {
+      $location.search("paramset", $scope.name);
       $scope.getParamsets(true);
     }
 
+    $scope.getAllParamsets = function () {
+      $scope.refresh();
+
+      var params = {};
+      params.core = $routeParams.core;
+      params.wt = "json";
+
+      ParamSet.get(params, callback, failure);
+
+      ///////
+
+      function callback(success) {
+        $scope.responseStatus = "success";
+        delete success.$promise;
+        delete success.$resolved;
+        $scope.response = JSON.stringify(success, null, '  ');
+        $scope.paramsetList = success.response.params ? Object.keys(success.response.params) : [];
+      }
+
+      function failure (failure) {
+        $scope.responseStatus = failure;
+      }
+    }
+    
+
     $scope.getParamsets = function (isSelected) {
       $scope.refresh();
 
       var params = {};
       params.core = $routeParams.core;
       params.wt = "json";
+
+      if ($routeParams.paramset){
+        isSelected = true;
+        $scope.name = $routeParams.paramset;
+        $scope.getAllParamsets();
+      }
+      console.log("isSelected?" + isSelected);
       params.name = isSelected ? $scope.name : null;
 
       ParamSet.get(params, callback, failure);
@@ -72,6 +105,8 @@ solrAdminApp.controller('ParamSetsController',
         $scope.responseStatus = failure;
       }
     }
+
+
     $scope.getParamsets();
 
     $scope.refresh = function () {