FIX: limit other accounts deletion to 50 accounts otherwise it'll feel too slow
This commit is contained in:
parent
7f9747f55c
commit
7b1c001932
|
@ -41,8 +41,8 @@
|
||||||
{{i18n ip_lookup.other_accounts}}
|
{{i18n ip_lookup.other_accounts}}
|
||||||
<strong>{{other_accounts.length}}</strong>
|
<strong>{{other_accounts.length}}</strong>
|
||||||
{{#if other_accounts.length}}
|
{{#if other_accounts.length}}
|
||||||
<button class="btn btn-danger pull-right" {{action "deleteAllOtherAccounts"}}>
|
<button class="btn btn-danger pull-right" {{action "deleteOtherAccounts"}}>
|
||||||
{{fa-icon "warning"}}{{i18n ip_lookup.delete_all}}
|
{{fa-icon "warning"}}{{i18n ip_lookup.delete_other_accounts}}
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</dt>
|
</dt>
|
||||||
|
|
|
@ -278,6 +278,8 @@ class Admin::UsersController < Admin::AdminController
|
||||||
params.require(:exclude)
|
params.require(:exclude)
|
||||||
params.require(:order)
|
params.require(:order)
|
||||||
|
|
||||||
|
params[:limit] = 50
|
||||||
|
|
||||||
user_destroyer = UserDestroyer.new(current_user)
|
user_destroyer = UserDestroyer.new(current_user)
|
||||||
options = { delete_posts: true, block_email: true, block_urls: true, block_ip: true, delete_as_spammer: true }
|
options = { delete_posts: true, block_email: true, block_urls: true, block_ip: true, delete_as_spammer: true }
|
||||||
|
|
||||||
|
|
|
@ -279,7 +279,7 @@ en:
|
||||||
organisation: Organization
|
organisation: Organization
|
||||||
phone: Phone
|
phone: Phone
|
||||||
other_accounts: "Other accounts with this IP address:"
|
other_accounts: "Other accounts with this IP address:"
|
||||||
delete_all: "Delete all"
|
delete_other_accounts: "Delete up to 50"
|
||||||
username: "username"
|
username: "username"
|
||||||
trust_level: "TL"
|
trust_level: "TL"
|
||||||
read_time: "read time"
|
read_time: "read time"
|
||||||
|
|
|
@ -62,6 +62,11 @@ class AdminUserIndexQuery
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def limit
|
||||||
|
limit = params[:limit].to_i
|
||||||
|
@query.limit(limit > 0 ? limit : 100)
|
||||||
|
end
|
||||||
|
|
||||||
# this might not be needed in rails 4 ?
|
# this might not be needed in rails 4 ?
|
||||||
def append(active_relation)
|
def append(active_relation)
|
||||||
@query = active_relation if active_relation
|
@query = active_relation if active_relation
|
||||||
|
@ -73,6 +78,7 @@ class AdminUserIndexQuery
|
||||||
append filter_by_ip
|
append filter_by_ip
|
||||||
append filter_exclude
|
append filter_exclude
|
||||||
append filter_by_search
|
append filter_by_search
|
||||||
|
append limit
|
||||||
@query
|
@query
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -85,6 +91,5 @@ class AdminUserIndexQuery
|
||||||
.includes(:google_user_info)
|
.includes(:google_user_info)
|
||||||
.includes(:oauth2_user_info)
|
.includes(:oauth2_user_info)
|
||||||
.includes(:user_open_ids)
|
.includes(:user_open_ids)
|
||||||
.take(100)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue