lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From er...@apache.org
Subject svn commit: r1671280 - in /lucene/dev/branches/branch_5x: ./ partials/ solr/ solr/webapp/ solr/webapp/web/ solr/webapp/web/css/angular/ solr/webapp/web/js/angular/ solr/webapp/web/js/angular/controllers/
Date Sat, 04 Apr 2015 17:12:32 GMT
Author: erick
Date: Sat Apr  4 17:12:31 2015
New Revision: 1671280

URL: http://svn.apache.org/r1671280
Log:
SOLR-7241: Add document tab support to AngularJS adminUI

Added:
    lucene/dev/branches/branch_5x/partials/
      - copied from r1671279, lucene/dev/trunk/partials/
    lucene/dev/branches/branch_5x/solr/webapp/web/css/angular/documents.css
      - copied unchanged from r1671279, lucene/dev/trunk/solr/webapp/web/css/angular/documents.css
    lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/controllers/documents.js
      - copied unchanged from r1671279, lucene/dev/trunk/solr/webapp/web/js/angular/controllers/documents.js
Modified:
    lucene/dev/branches/branch_5x/   (props changed)
    lucene/dev/branches/branch_5x/solr/   (props changed)
    lucene/dev/branches/branch_5x/solr/CHANGES.txt   (contents, props changed)
    lucene/dev/branches/branch_5x/solr/webapp/   (props changed)
    lucene/dev/branches/branch_5x/solr/webapp/web/index.html
    lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js
    lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/services.js

Modified: lucene/dev/branches/branch_5x/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/CHANGES.txt?rev=1671280&r1=1671279&r2=1671280&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/CHANGES.txt (original)
+++ lucene/dev/branches/branch_5x/solr/CHANGES.txt Sat Apr  4 17:12:31 2015
@@ -32,6 +32,9 @@ Detailed Change List
 New Features
 ----------------------
 
+* SOLR-7241, SOLR-7263, SOLR-7279: More functionality moving the Admin UI to Angular JS
+  (Upayavira via Erick)
+
 Bug Fixes
 ----------------------
 

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/index.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/index.html?rev=1671280&r1=1671279&r2=1671280&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/index.html (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/index.html Sat Apr  4 17:12:31 2015
@@ -35,7 +35,7 @@ limitations under the License.
   <link rel="stylesheet" type="text/css" href="css/angular/logging.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/menu.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/styles/plugins.css?_=${version}">
-  <link rel="stylesheet" type="text/css" href="css/styles/documents.css?_=${version}">
+  <link rel="stylesheet" type="text/css" href="css/angular/documents.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/angular/query.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/styles/replication.css?_=${version}">
   <link rel="stylesheet" type="text/css" href="css/styles/schema-browser.css?_=${version}">
@@ -63,6 +63,7 @@ limitations under the License.
   <script src="js/angular/controllers/java-properties.js"></script>
   <script src="js/angular/controllers/core-overview.js"></script>
   <script src="js/angular/controllers/analysis.js"></script>
+  <script src="js/angular/controllers/documents.js"></script>
   <script src="js/angular/controllers/query.js"></script>
 
 </head>

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js?rev=1671280&r1=1671279&r2=1671280&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/app.js Sat Apr  4 17:12:31 2015
@@ -67,6 +67,10 @@ solrAdminApp.config([
         templateUrl: 'partials/analysis.html',
         controller: 'AnalysisController'
       }).
+      when('/:core/documents', {
+        templateUrl: 'partials/documents.html',
+        controller: 'DocumentsController'
+      }).
       when('/:core/query', {
         templateUrl: 'partials/query.html',
         controller: 'QueryController'
@@ -197,9 +201,23 @@ solrAdminApp.config([
 
   return {request: started, response: ended, responseError: failed};
 })
-
 .config(function($httpProvider) {
   $httpProvider.interceptors.push("httpInterceptor");
+})
+.directive('fileModel', function ($parse) {
+    return {
+        restrict: 'A',
+        link: function(scope, element, attrs) {
+            var model = $parse(attrs.fileModel);
+            var modelSetter = model.assign;
+
+            element.bind('change', function(){
+                scope.$apply(function(){
+                    modelSetter(scope, element[0].files[0]);
+                });
+            });
+        }
+    };
 });
 
 var solrAdminControllers = angular.module('solrAdminControllers', []);

Modified: lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/services.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/services.js?rev=1671280&r1=1671279&r2=1671280&view=diff
==============================================================================
--- lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/services.js (original)
+++ lucene/dev/branches/branch_5x/solr/webapp/web/js/angular/services.js Sat Apr  4 17:12:31
2015
@@ -77,11 +77,32 @@ solrAdminServices.factory('System',
   }])
 .factory('Update',
   ['$resource', function($resource) {
-    return $resource('/solr/:core/update', {core: '@core', wt:'json', _:Date.now()}, {
+    return $resource('/solr/:core/:handler', {core: '@core', wt:'json', _:Date.now(), handler:'/update'},
{
       "optimize": {params: { optimize: "true"}},
-      "commit": {params: {commit: "true"}}
+      "commit": {params: {commit: "true"}},
+      "post": {method: "POST", params: {handler: '@handler'}}
     });
   }])
+.service('FileUpload', function ($http) {
+    this.upload = function(params, file, success, error){
+        var url = "/solr/" + params.core + "/" + params.handler + "?";
+        raw = params.raw;
+        delete params.core;
+        delete params.handler;
+        delete params.raw;
+        url += $.param(params);
+        if (raw && raw.length>0) {
+            if (raw[0] != "&") raw = "&" + raw;
+            url += raw;
+        }
+        var fd = new FormData();
+        fd.append('file', file);
+        $http.post(url, fd, {
+            transformRequest: angular.identity,
+            headers: {'Content-Type': undefined}
+        }).success(success).error(error);
+    }
+})
 .factory('Luke',
   ['$resource', function($resource) {
     return $resource('/solr/:core/admin/luke', {core: '@core', wt:'json', _:Date.now()},
{



Mime
View raw message