mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-25 14:33:18 +00:00
Update AdminSettings, add max_account_size support
This commit is contained in:
parent
ec2fdd61f7
commit
2dcbc1d5ef
2 changed files with 6 additions and 3 deletions
|
@ -739,6 +739,7 @@ trait AdminSettingsController
|
|||
$this->validate($request, [
|
||||
'require_email_verification' => 'required',
|
||||
'enforce_account_limit' => 'required',
|
||||
'max_account_size' => 'required|integer|min:50000',
|
||||
'admin_autofollow' => 'required',
|
||||
'admin_autofollow_accounts' => 'sometimes',
|
||||
'max_user_blocks' => 'required',
|
||||
|
@ -779,6 +780,7 @@ trait AdminSettingsController
|
|||
|
||||
ConfigCacheService::put('pixelfed.enforce_email_verification', $request->boolean('require_email_verification'));
|
||||
ConfigCacheService::put('pixelfed.enforce_account_limit', $request->boolean('enforce_account_limit'));
|
||||
ConfigCacheService::put('pixelfed.max_account_size', $request->input('max_account_size'));
|
||||
ConfigCacheService::put('account.autofollow', $request->boolean('admin_autofollow'));
|
||||
ConfigCacheService::put('instance.user_filters.max_user_blocks', (int) $request->input('max_user_blocks'));
|
||||
ConfigCacheService::put('instance.user_filters.max_user_mutes', (int) $request->input('max_user_mutes'));
|
||||
|
|
|
@ -928,16 +928,16 @@
|
|||
return '0.00 MB';
|
||||
}
|
||||
|
||||
const mb = (this.users.max_account_size / 1000);
|
||||
const mb = (this.users.max_account_size / 1024);
|
||||
|
||||
if(mb > 1000000) {
|
||||
return (mb / 1000000).toFixed(1) + 'TB';
|
||||
}
|
||||
|
||||
if(mb > 1000) {
|
||||
return (mb / 1000).toFixed(2) + 'GB';
|
||||
return (mb / 1024).toFixed(2) + 'GB';
|
||||
}
|
||||
return (this.users.max_account_size / 1000).toFixed(2) + ' MB';
|
||||
return (this.users.max_account_size / 1024).toFixed(2) + ' MB';
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1388,6 +1388,7 @@
|
|||
axios.post('/i/admin/api/settings/update/users', {
|
||||
require_email_verification: this.users.require_email_verification,
|
||||
enforce_account_limit: this.users.enforce_account_limit,
|
||||
max_account_size: this.users.max_account_size,
|
||||
admin_autofollow: this.users.admin_autofollow,
|
||||
admin_autofollow_accounts: this.users.admin_autofollow_accounts,
|
||||
max_user_blocks: this.users.max_user_blocks,
|
||||
|
|
Loading…
Reference in a new issue