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;
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<div class="row">
|
||||
|
||||
<div>
|
||||
Limit <input type="number" ng-model="limit" />
|
||||
Page <input type="number" ng-model="page" />
|
||||
Min. count <input type="number" ng-model="minCount" />
|
||||
</div>
|
||||
<div>
|
||||
Mode
|
||||
<select ng-model="mode">
|
||||
<option value="NORMALIZED_URL">Normalized URLs</option>
|
||||
<option value="LAST_CONTENT">Last content</option>
|
||||
<option value="PUSH_TOPIC">Pubsubhubbub topic URL</option>
|
||||
</select>
|
||||
<input type="button" class="btn" ng-click="refreshData()" value="Refresh" />
|
||||
<input type="button" class="btn" ng-click="autoMerge()" value="Auto merge selected" />
|
||||
</div>
|
||||
|
||||
<table class="table table-condensed table-hover" ng-if="counts">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>url</th>
|
||||
<th>count</h>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr ng-repeat="count in counts" ng-click="focus(count)" class="pointer">
|
||||
<td><input type="checkbox" ng-model="count.autoMerge" /> </td>
|
||||
<td>{{count.feeds[0].url}}</td>
|
||||
<td>{{count.feeds.length}}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div ng-if="current">
|
||||
<div>
|
||||
Merge
|
||||
<select ng-model="mergeData.feedIds" size="30" multiple="multiple" class="input-block-level"
|
||||
ng-options="feed.id as feed.url for feed in current.feeds">
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
Into
|
||||
<select ng-model="mergeData.intoFeedId" ng-options="feed.id as feed.url for feed in current.feeds" class="input-block-level">
|
||||
</select>
|
||||
</div>
|
||||
<input type="button" class="btn" ng-click="merge()" value="Merge" />
|
||||
</div>
|
||||
</div>
|
||||
@@ -5,10 +5,6 @@
|
||||
<small>
|
||||
<a ng-click="toUsers()" class="pointer">Manage users</a>
|
||||
</small>
|
||||
-
|
||||
<small>
|
||||
<a ng-click="toCleanup()" class="pointer">Cleanup feeds</a>
|
||||
</small>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user