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/07/09 22:20:42 UTC

[solr] 01/02: SOLR-16096: Add createNodeSet to Advanced Collection Creation Options (#745)

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

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

commit 5adcfea745f6c9b5e865b7c3b537ef2b21855f01
Author: Eric Pugh <ep...@opensourceconnections.com>
AuthorDate: Sat Jul 9 18:17:08 2022 -0400

    SOLR-16096: Add createNodeSet to Advanced Collection Creation Options (#745)
---
 dev-docs/FAQ.adoc                                     |  9 ++++++++-
 solr/webapp/web/js/angular/controllers/collections.js | 19 +++++++++----------
 solr/webapp/web/partials/collections.html             | 12 +++++++++++-
 3 files changed, 28 insertions(+), 12 deletions(-)

diff --git a/dev-docs/FAQ.adoc b/dev-docs/FAQ.adoc
index 5d6b004972a..dd5163b6ebd 100644
--- a/dev-docs/FAQ.adoc
+++ b/dev-docs/FAQ.adoc
@@ -4,7 +4,7 @@
 
 == FAQ
 
-This document provides a quick reference for frequently questioned concepts and features in Credentials.
+This document provides a quick reference for common developer questions.
 
 === What do I do with NOTICE.txt if I don't have one to satisfy Gradle?
 
@@ -18,3 +18,10 @@ branch to avoid extra mailing list traffic etc.
 
 Periodically review https://github.com/apache/solr/branches/all to see if you have
 created a branch that can be deleted.
+
+=== Whats the fastest build lifecycle for frontend work on Solr Admin?
+
+Run `gradle dev`, and then `cd ./packaging/build/dev/`.  Fire up your cluster
+via `bin/solr start -e cloud -noprompt` and then as you make changes to assets in `/solr/webapp/web`,
+run `gradle dev` to redeploy the web assets. Do a  hard refresh in your browser
+to pick up your changes.
diff --git a/solr/webapp/web/js/angular/controllers/collections.js b/solr/webapp/web/js/angular/controllers/collections.js
index 0abf7b3e65a..b9187736adc 100644
--- a/solr/webapp/web/js/angular/controllers/collections.js
+++ b/solr/webapp/web/js/angular/controllers/collections.js
@@ -23,6 +23,14 @@ solrAdminApp.controller('CollectionsController',
 
           $scope.rootUrl = Constants.ROOT_URL + "#/~collections/" + $routeParams.collection;
 
+          Zookeeper.liveNodes({}, function(data) {
+            $scope.availableNodeSet = [];
+            var children = data.tree[0].children;
+            for (var child in children) {
+              $scope.availableNodeSet.push(children[child].text);
+            }
+          });
+
           Collections.status(function (data) {
               $scope.collections = [];
               for (var name in data.cluster.collections) {
@@ -157,6 +165,7 @@ solrAdminApp.controller('CollectionsController',
             };
             if (coll.shards) params.shards = coll.shards;
             if (coll.routerField) params["router.field"] = coll.routerField;
+            if (coll.createNodeSet) params.createNodeSet = coll.createNodeSet.join(",");
             Collections.add(params, function(data) {
               $scope.cancelAddCollection();
               $scope.resetMenu("collections", Constants.IS_ROOT_PAGE);
@@ -277,13 +286,3 @@ solrAdminApp.controller('CollectionsController',
       $scope.refresh();
     }
 );
-
-var flatten = function(data) {
-    var list = [];
-    for (var name in data) {
-       var entry = data[name];
-        entry.name = name;
-        list.push(entry);
-    }
-    return list;
-}
diff --git a/solr/webapp/web/partials/collections.html b/solr/webapp/web/partials/collections.html
index b4d4c2b7487..1fc2029a246 100644
--- a/solr/webapp/web/partials/collections.html
+++ b/solr/webapp/web/partials/collections.html
@@ -19,7 +19,7 @@ limitations under the License.
   <div id="ui-block" style="display:none">&nbsp;</div><!-- @todo what is this for? -->
 
   <div class="actions clearfix">
-    <div class="action add" data-rel="add" ng-show="showAdd" style="left:0px">
+    <div class="action add" data-rel="add" ng-show="showAdd" style="left:0px;width:500px">
 
       <form>
 
@@ -55,6 +55,16 @@ limitations under the License.
           <p class="clearfix"><label for="add_routerField">router.field:</label>
             <input type="text" name="routerField" id="add_routerField" ng-model="newCollection.routerField"></p>
 
+          <p class="clearfix"><label for="add_createNodeSet">createNodeSet:</label>
+            <select
+              chosen
+              multiple
+              disable-search="true"
+              ng-model="newCollection.createNodeSet"
+              ng-options="node for node in availableNodeSet">
+            </select>
+          </p>
+
         </div>
         <p class="clearfix note error" ng-show="addMessage">
           <span>{{addMessage}}</span>