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/28 15:58:54 UTC

[solr] 02/02: colour coded json!

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

commit 0ef049147308da5c3553018c384a3671d0700cbf
Author: epugh@opensourceconnections.com <ep...@opensourceconnections.com>
AuthorDate: Tue Jun 28 09:58:43 2022 -0600

    colour coded json!
---
 solr/webapp/web/js/angular/controllers/paramsets.js | 20 +++++++++++---------
 solr/webapp/web/partials/paramsets.html             |  5 +----
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/solr/webapp/web/js/angular/controllers/paramsets.js b/solr/webapp/web/js/angular/controllers/paramsets.js
index 58ea0fd1830..df25b72c094 100644
--- a/solr/webapp/web/js/angular/controllers/paramsets.js
+++ b/solr/webapp/web/js/angular/controllers/paramsets.js
@@ -23,6 +23,16 @@ solrAdminApp.controller('ParamSetsController',
 
     $scope.resetMenu("paramsets", Constants.IS_COLLECTION_PAGE);
 
+    $scope.sampleCommand = {
+      "set": {
+        "myQueries": {
+          "defType": "edismax",
+          "rows": "5",
+          "df": "text_all"
+        }
+      }
+    }
+
     $scope.showHelp = function (id) {
       if ($scope.helpId && ($scope.helpId === id || id === '')) {
         delete $scope.helpId;
@@ -62,15 +72,7 @@ solrAdminApp.controller('ParamSetsController',
     $scope.getParamsets();
     $scope.refresh = function () {
       $scope.paramsetContent = "";
-      $scope.placeholder = {
-        "set": {
-          "myQueries": {
-            "defType": "edismax",
-            "rows": "5",
-            "df": "text_all"
-          }
-        }
-      }
+      $scope.placeholder = JSON.stringify($scope.sampleCommand, null, '  ');
     };
     $scope.refresh();
 
diff --git a/solr/webapp/web/partials/paramsets.html b/solr/webapp/web/partials/paramsets.html
index fc9d47e223b..b05707adc65 100644
--- a/solr/webapp/web/partials/paramsets.html
+++ b/solr/webapp/web/partials/paramsets.html
@@ -46,10 +46,7 @@
                 </form>
                 <div ng-switch="switch.showSample">
                     <div ng-switch-when="true">
-                      <pre>
-                        
-{{ placeholder | json }}
-                      </pre>
+                      <pre class="syntax language-json"><code ng-bind-html="placeholder | highlight:'json' | unsafe"></code></pre>                      
                     </div>
                 </div>