All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.scripts.4b7b602e.js Maven / Gradle / Ivy

The newest version!
"use strict";angular.module("sluiceApp",["sluiceApp.services","sluiceApp.directives","ngAnimate","ngCookies","ngResource","ngRoute","ngSanitize","ui.bootstrap","cgNotify"]).config(["$routeProvider",function(a){a.when("/",{templateUrl:"views/dashboard.html",controller:"DashboardController",section:"dashboard",resolve:{rivers:["DashboardService",function(a){return a.availableRivers()}]}}).when("/amazon-s3",{templateUrl:"views/amazon-s3.html",controller:"AmazonS3Controller",section:"amazon-s3",resolve:{rivers:["AmazonS3Service",function(a){return a.list()}]}}).when("/google-drive",{templateUrl:"views/google-drive.html",controller:"GoogleDriveController",section:"google-drive",resolve:{rivers:["GoogleDriveService",function(a){return a.list()}]}}).otherwise({redirectTo:"/"})}]),angular.module("sluiceApp").controller("RootController",["$rootScope","$scope","$http",function(a,b,c){a.isViewLoading=!1,a.isProcessingData=function(){return c.pendingRequests.some(function(a){return"GET"!==a.method?(console.log(a),!0):void 0})},a.$on("$routeChangeStart",function(){a.isViewLoading=!0}),a.$on("$routeChangeSuccess",function(b,c){a.isViewLoading=!1,c.$$route&&c.$$route.section&&(a.section=c.$$route.section)})}]),angular.module("sluiceApp").controller("DashboardController",["$rootScope","$scope","rivers","DashboardService",function(a,b,c,d){b.rivers=c,b.installRiver=function(a){d.installRiver(a)}}]);var services=angular.module("sluiceApp.services",[]).value("version","0.1");services.factory("DashboardService",["$http","$q",function(a,b){var c={availableRivers:function(){var c=b.defer();return a.get("http://localhost:9200/_sluice/river").success(function(a){c.resolve(a)}),c.promise},installRiver:function(c){var d=b.defer();return a.post("http://localhost:9200/_sluice/river/"+c.name),d.promise}};return c}]),angular.module("sluiceApp").controller("AmazonS3Controller",["$rootScope","$scope","$modal","notify","rivers","AmazonS3Service",function(a,b,c,d,e,f){function g(a,b){return c.open({templateUrl:"views/dialogs/"+b,controller:h,resolve:{river:function(){return a}}})}function h(a,b,c){a.river=c,a.ok=function(a){b.close({river:a})},a.cancel=function(){b.dismiss("cancel")}}b.rivers=e,b.addRiver=function(a){a={update_rate:6e5,bulk_size:2};var b=g(a,"edit-amazon-s3.html");b.result.then(function(a){var b=a.river;f.create(b).then(function(a){console.log("Creation result: "+a),d({message:'River "'+b.name+'" has been created !',classes:"alert-success"})})})},b.editRiver=function(a){var b=g(a,"edit-amazon-s3.html");b.result.then(function(a){var b=a.river;f.update(b).then(function(a){console.log("Update result: "+a),d('River "'+b.name+'" has been updated !')})})},h.$inject=["$scope","$modalInstance","river"]}]);var services=angular.module("sluiceApp.services");services.factory("AmazonS3Service",["$http","$q",function(a,b){function c(a){return{type:"amazon-s3","amazon-s3":{name:a.name,accessKey:a.accessKey,secretKey:a.secretKey,bucket:a.bucket,pathPrefix:a.pathPrefix,update_rate:parseInt(a.update_rate),includes:a.includes,excludes:a.excludes},index:{index:a.index,type:a.type,bulk_size:parseInt(a.bulk_size)}}}var d={list:function(){var c=b.defer();return a.get("http://localhost:9200/_river/_search?q=type:amazon-s3").success(function(a){c.resolve(a.hits.hits.map(function(a){var b=a._source["amazon-s3"];return a._source.index&&(b.bulk_size=a._source.index.bulk_size,b.index=a._source.index.index,b.type=a._source.index.type),b.id=a._type,b}))}),c.promise},get:function(c){var d=b.defer();return a.get("http://localhost:9200/_river/"+c+"/_meta").success(function(a){d.resolve(a.source)}),d.promise},create:function(d){var e=b.defer(),f=c(d);return a.post("http://localhost:9200/_river/"+d.id+"/_meta",f).success(function(){e.resolve(d)}),e.promise},update:function(d){var e=b.defer(),f=c(d);return a.put("http://localhost:9200/_river/"+d.id+"/_meta",f).success(function(){e.resolve(d)}),e.promise},"delete":function(c){var d=b.defer();return a.delete("http://localhost:9200/_river/"+c+"/_meta"),d.promise}};return d}]),angular.module("sluiceApp").controller("GoogleDriveController",["$rootScope","$scope","$modal","notify","rivers","GoogleDriveService",function(a,b,c,d,e,f){function g(a,b){return c.open({templateUrl:"views/dialogs/"+b,controller:h,resolve:{river:function(){return a}}})}function h(a,b,c){a.river=c,a.ok=function(a){b.close({river:a})},a.cancel=function(){b.dismiss("cancel")}}b.rivers=e,b.addRiver=function(a){a={update_rate:6e5,bulk_size:2};var b=g(a,"edit-google-drive.html");b.result.then(function(a){var b=a.river;f.create(b).then(function(a){console.log("Creation result: "+a),d({message:'River "'+b.name+'" has been created !',classes:"alert-success"})})})},b.editRiver=function(a){var b=g(a,"edit-google-drive.html");b.result.then(function(a){var b=a.river;f.update(b).then(function(a){console.log("Update result: "+a),d('River "'+b.name+'" has been updated !')})})},h.$inject=["$scope","$modalInstance","river"]}]);var services=angular.module("sluiceApp.services");services.factory("GoogleDriveService",["$http","$q",function(a,b){function c(a){return{type:"google-drive","google-drive":{name:a.name,clientId:a.clientId,clientSecret:a.clientSecret,refreshToken:a.refreshToken,folder:a.folder,update_rate:parseInt(a.update_rate),includes:a.includes,excludes:a.excludes},index:{index:a.index,type:a.type,bulk_size:parseInt(a.bulk_size)}}}var d={list:function(){var c=b.defer();return a.get("http://localhost:9200/_river/_search?q=type:google-drive").success(function(a){c.resolve(a.hits.hits.map(function(a){var b=a._source["google-drive"];return a._source.index&&(b.bulk_size=a._source.index.bulk_size,b.index=a._source.index.index,b.type=a._source.index.type),b.id=a._type,b}))}),c.promise},get:function(c){var d=b.defer();return a.get("http://localhost:9200/_river/"+c+"/_meta").success(function(a){d.resolve(a.source)}),d.promise},create:function(d){var e=b.defer(),f=c(d);return a.post("http://localhost:9200/_river/"+d.id+"/_meta",f).success(function(){e.resolve(d)}),e.promise},update:function(d){var e=b.defer(),f=c(d);return a.put("http://localhost:9200/_river/"+d.id+"/_meta",f).success(function(){e.resolve(d)}),e.promise},"delete":function(c){var d=b.defer();return a.delete("http://localhost:9200/_river/"+c+"/_meta"),d.promise}};return d}]),angular.module("sluiceApp.directives",[]).directive("sluiceNavigation",function(){return{scope:{current:"@"},restrict:"E",replace:!0,templateUrl:"directives/sluice-navigation.html"}});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy