forked from Archives/Athou_commafeed
remove deprecated duplicate feed detection
This commit is contained in:
@@ -1399,53 +1399,6 @@ module.controller('ManageUserCtrl', ['$scope', '$state', '$stateParams', '$dialo
|
||||
};
|
||||
}]);
|
||||
|
||||
module.controller('ManageDuplicateFeedsCtrl', ['$scope', 'AdminCleanupService', function($scope, AdminCleanupService) {
|
||||
|
||||
$scope.limit = 10;
|
||||
$scope.page = 0;
|
||||
$scope.minCount = 1;
|
||||
$scope.mode = 'NORMALIZED_URL';
|
||||
$scope.mergeData = {};
|
||||
$scope.refreshData = function() {
|
||||
AdminCleanupService.findDuplicateFeeds({
|
||||
mode : $scope.mode,
|
||||
limit : $scope.limit,
|
||||
page : $scope.page,
|
||||
minCount : $scope.minCount
|
||||
}, function(data) {
|
||||
$scope.counts = data;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.autoMerge = function() {
|
||||
var callback = function() {
|
||||
alert('done!');
|
||||
};
|
||||
for (var i = 0; i < $scope.counts.length; i++) {
|
||||
var count = $scope.counts[i];
|
||||
if (count.autoMerge) {
|
||||
AdminCleanupService.mergeFeeds({
|
||||
intoFeedId : count.feeds[0].id,
|
||||
feedIds : _.pluck(count.feeds, 'id')
|
||||
}, callback);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$scope.focus = function(count) {
|
||||
$scope.current = count;
|
||||
$scope.mergeData.intoFeedId = count.feeds[0].id;
|
||||
$scope.mergeData.feedIds = _.pluck(count.feeds, 'id');
|
||||
};
|
||||
|
||||
$scope.merge = function() {
|
||||
AdminCleanupService.mergeFeeds($scope.mergeData, function() {
|
||||
alert('done!');
|
||||
});
|
||||
};
|
||||
|
||||
}]);
|
||||
|
||||
module.controller('SettingsCtrl', ['$scope', '$location', 'SettingsService', 'AnalyticsService', 'ServerService',
|
||||
function($scope, $location, SettingsService, AnalyticsService, ServerService) {
|
||||
|
||||
@@ -1535,9 +1488,6 @@ module.controller('ManageSettingsCtrl', ['$scope', '$location', '$state', 'Admin
|
||||
$scope.toUsers = function() {
|
||||
$state.transitionTo('admin.userlist');
|
||||
};
|
||||
$scope.toCleanup = function() {
|
||||
$state.transitionTo('admin.duplicate_feeds');
|
||||
};
|
||||
}]);
|
||||
|
||||
module.controller('HelpController', ['$scope', 'CategoryService', 'AnalyticsService', 'ServerService',
|
||||
|
||||
@@ -95,11 +95,6 @@ app.config(['$routeProvider', '$stateProvider', '$urlRouterProvider', '$httpProv
|
||||
templateUrl : 'templates/admin.useredit.html',
|
||||
controller : 'ManageUserCtrl'
|
||||
});
|
||||
$stateProvider.state('admin.duplicate_feeds', {
|
||||
url : '/feeds/duplicates',
|
||||
templateUrl : 'templates/admin.duplicate_feeds.html',
|
||||
controller : 'ManageDuplicateFeedsCtrl'
|
||||
});
|
||||
$stateProvider.state('admin.settings', {
|
||||
url : '/settings',
|
||||
templateUrl : 'templates/admin.settings.html',
|
||||
|
||||
@@ -315,26 +315,6 @@ module.factory('AdminMetricsService', ['$resource', function($resource) {
|
||||
return res;
|
||||
}]);
|
||||
|
||||
module.factory('AdminCleanupService', ['$resource', function($resource) {
|
||||
var actions = {
|
||||
findDuplicateFeeds : {
|
||||
method : 'GET',
|
||||
isArray : true,
|
||||
params : {
|
||||
_method : 'findDuplicateFeeds'
|
||||
}
|
||||
},
|
||||
mergeFeeds : {
|
||||
method : 'POST',
|
||||
params : {
|
||||
_method : 'merge'
|
||||
}
|
||||
}
|
||||
};
|
||||
var res = $resource('rest/admin/cleanup/:_method', {}, actions);
|
||||
return res;
|
||||
}]);
|
||||
|
||||
module.factory('ServerService', ['$resource', function($resource) {
|
||||
var res = $resource('rest/server/get');
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user