mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-29 03:10:51 +00:00
- set default_max_team_member
- generate traffic for all users
This commit is contained in:
@@ -24,7 +24,7 @@
|
|||||||
"/chunks/app-language.js": "/chunks/app-language.js?id=21a381da055e57280eed",
|
"/chunks/app-language.js": "/chunks/app-language.js?id=21a381da055e57280eed",
|
||||||
"/chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-items~chunks/page~7dbb6a42.js": "/chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-items~chunks/page~7dbb6a42.js?id=3cbb19b80e635b3524e5",
|
"/chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-items~chunks/page~7dbb6a42.js": "/chunks/app-language~chunks/dashboard~chunks/files~chunks/invoices~chunks/my-shared-items~chunks/page~7dbb6a42.js?id=3cbb19b80e635b3524e5",
|
||||||
"/chunks/app-language~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan-creat~1a92dd55.js": "/chunks/app-language~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan-creat~1a92dd55.js?id=75317652be9e911b6013",
|
"/chunks/app-language~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan-creat~1a92dd55.js": "/chunks/app-language~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan-creat~1a92dd55.js?id=75317652be9e911b6013",
|
||||||
"/chunks/app-others.js": "/chunks/app-others.js?id=d763956aafc730e5bdcb",
|
"/chunks/app-others.js": "/chunks/app-others.js?id=2789aac07c894eeb29ea",
|
||||||
"/chunks/app-payments.js": "/chunks/app-payments.js?id=8ca6c120a8ba6f3659f6",
|
"/chunks/app-payments.js": "/chunks/app-payments.js?id=8ca6c120a8ba6f3659f6",
|
||||||
"/chunks/app-settings.js": "/chunks/app-settings.js?id=2a96295eef59bd6c8921",
|
"/chunks/app-settings.js": "/chunks/app-settings.js?id=2a96295eef59bd6c8921",
|
||||||
"/chunks/app-setup.js": "/chunks/app-setup.js?id=1b7698981735d7173309",
|
"/chunks/app-setup.js": "/chunks/app-setup.js?id=1b7698981735d7173309",
|
||||||
@@ -250,5 +250,6 @@
|
|||||||
"/chunks/user-storage.0e8d7663b9f8cd40de17.hot-update.js": "/chunks/user-storage.0e8d7663b9f8cd40de17.hot-update.js",
|
"/chunks/user-storage.0e8d7663b9f8cd40de17.hot-update.js": "/chunks/user-storage.0e8d7663b9f8cd40de17.hot-update.js",
|
||||||
"/chunks/user-storage.4eff070ff2a92236c8b2.hot-update.js": "/chunks/user-storage.4eff070ff2a92236c8b2.hot-update.js",
|
"/chunks/user-storage.4eff070ff2a92236c8b2.hot-update.js": "/chunks/user-storage.4eff070ff2a92236c8b2.hot-update.js",
|
||||||
"/chunks/settings-storage.4ecc7c38e789439da637.hot-update.js": "/chunks/settings-storage.4ecc7c38e789439da637.hot-update.js",
|
"/chunks/settings-storage.4ecc7c38e789439da637.hot-update.js": "/chunks/settings-storage.4ecc7c38e789439da637.hot-update.js",
|
||||||
"/chunks/user-storage.4ecc7c38e789439da637.hot-update.js": "/chunks/user-storage.4ecc7c38e789439da637.hot-update.js"
|
"/chunks/user-storage.4ecc7c38e789439da637.hot-update.js": "/chunks/user-storage.4ecc7c38e789439da637.hot-update.js",
|
||||||
|
"/chunks/app-others.753478462556c2b747a9.hot-update.js": "/chunks/app-others.753478462556c2b747a9.hot-update.js"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
</AppInputSwitch>
|
</AppInputSwitch>
|
||||||
|
|
||||||
<AppInputText v-if="app.storageLimitation" :title="$t('admin_settings.others.default_storage')">
|
<AppInputText v-if="app.storageLimitation" :title="$t('admin_settings.others.default_storage')">
|
||||||
<input @input="$updateText('/admin/settings', 'default_storage_amount', app.defaultStorage)"
|
<input @input="$updateText('/admin/settings', 'default_max_storage_amount', app.defaultStorage)"
|
||||||
v-model="app.defaultStorage"
|
v-model="app.defaultStorage"
|
||||||
min="1"
|
min="1"
|
||||||
max="999999999"
|
max="999999999"
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
mounted() {
|
mounted() {
|
||||||
axios.get('/api/admin/settings', {
|
axios.get('/api/admin/settings', {
|
||||||
params: {
|
params: {
|
||||||
column: 'contact_email|google_analytics|default_storage_amount|registration|storage_limitation|mimetypes_blacklist|upload_limit|user_verification'
|
column: 'contact_email|google_analytics|default_max_storage_amount|registration|storage_limitation|mimetypes_blacklist|upload_limit|user_verification'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(response => {
|
.then(response => {
|
||||||
@@ -149,7 +149,7 @@
|
|||||||
this.app = {
|
this.app = {
|
||||||
contactMail: response.data.contact_email,
|
contactMail: response.data.contact_email,
|
||||||
googleAnalytics: response.data.google_analytics,
|
googleAnalytics: response.data.google_analytics,
|
||||||
defaultStorage: response.data.default_storage_amount,
|
defaultStorage: response.data.default_max_storage_amount,
|
||||||
userRegistration: parseInt(response.data.registration),
|
userRegistration: parseInt(response.data.registration),
|
||||||
storageLimitation: parseInt(response.data.storage_limitation),
|
storageLimitation: parseInt(response.data.storage_limitation),
|
||||||
mimetypesBlacklist: response.data.mimetypes_blacklist,
|
mimetypesBlacklist: response.data.mimetypes_blacklist,
|
||||||
|
|||||||
@@ -60,8 +60,8 @@
|
|||||||
userRegistration: {{ $settings->registration ?? 1 }},
|
userRegistration: {{ $settings->registration ?? 1 }},
|
||||||
userVerification: {{ $settings->user_verification ?? 0 }},
|
userVerification: {{ $settings->user_verification ?? 0 }},
|
||||||
storageLimit: {{ $settings->storage_limitation ?? 1 }},
|
storageLimit: {{ $settings->storage_limitation ?? 1 }},
|
||||||
storageDefaultSpace: {{ $settings->default_storage_amount ?? 5 }},
|
storageDefaultSpace: {{ $settings->default_max_storage_amount ?? 5 }},
|
||||||
storageDefaultSpaceFormatted: '{{ isset($settings->default_storage_amount) ? format_gigabytes($settings->default_storage_amount) : format_gigabytes(5) }}',
|
storageDefaultSpaceFormatted: '{{ isset($settings->default_max_storage_amount) ? format_gigabytes($settings->default_max_storage_amount) : format_gigabytes(5) }}',
|
||||||
mimetypesBlacklist: '{{ isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist: null}}',
|
mimetypesBlacklist: '{{ isset($settings->mimetypes_blacklist) ? $settings->mimetypes_blacklist: null}}',
|
||||||
uploadLimit: {{ isset($settings->upload_limit) ? format_bytes($settings->upload_limit) : 'undefined' }},
|
uploadLimit: {{ isset($settings->upload_limit) ? format_bytes($settings->upload_limit) : 'undefined' }},
|
||||||
uploadLimitFormatted: '{{ isset($settings->upload_limit) ? format_megabytes($settings->upload_limit) : null }}',
|
uploadLimitFormatted: '{{ isset($settings->upload_limit) ? format_megabytes($settings->upload_limit) : null }}',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Users\Models\User;
|
use App\Users\Models\User;
|
||||||
@@ -38,7 +39,8 @@ class SetupDevEnvironment extends Command
|
|||||||
private SeedDefaultSettingsAction $seedDefaultSettings,
|
private SeedDefaultSettingsAction $seedDefaultSettings,
|
||||||
private SeedDefaultLanguageAction $seedDefaultLanguage,
|
private SeedDefaultLanguageAction $seedDefaultLanguage,
|
||||||
private SeedDefaultPagesAction $seedDefaultPages,
|
private SeedDefaultPagesAction $seedDefaultPages,
|
||||||
) {
|
)
|
||||||
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->setUpFaker();
|
$this->setUpFaker();
|
||||||
}
|
}
|
||||||
@@ -71,10 +73,10 @@ class SetupDevEnvironment extends Command
|
|||||||
|
|
||||||
$this->info('Creating default demo content...');
|
$this->info('Creating default demo content...');
|
||||||
$this->create_admin_default_content();
|
$this->create_admin_default_content();
|
||||||
$this->generate_traffic();
|
|
||||||
$this->create_team_folders_content();
|
$this->create_team_folders_content();
|
||||||
$this->create_share_with_me_team_folders_content();
|
$this->create_share_with_me_team_folders_content();
|
||||||
$this->create_share_records();
|
$this->create_share_records();
|
||||||
|
$this->generate_traffic();
|
||||||
|
|
||||||
$this->info('Clearing application cache...');
|
$this->info('Clearing application cache...');
|
||||||
$this->clear_cache();
|
$this->clear_cache();
|
||||||
@@ -119,23 +121,6 @@ class SetupDevEnvironment extends Command
|
|||||||
$this->info('Default admin account created. Email: howdy@hi5ve.digital and Password: vuefilemanager');
|
$this->info('Default admin account created. Email: howdy@hi5ve.digital and Password: vuefilemanager');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function generate_traffic(): void
|
|
||||||
{
|
|
||||||
$user = User::whereEmail('howdy@hi5ve.digital')
|
|
||||||
->first();
|
|
||||||
|
|
||||||
foreach (range(0, 45) as $day) {
|
|
||||||
DB::table('traffic')->insert([
|
|
||||||
'id' => Str::uuid(),
|
|
||||||
'user_id' => $user->id,
|
|
||||||
'upload' => random_int(1111111, 9999999),
|
|
||||||
'download' => random_int(11111111, 99999999),
|
|
||||||
'created_at' => now()->subDays($day),
|
|
||||||
'updated_at' => now()->subDays($day),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create default admin account
|
* Create default admin account
|
||||||
*/
|
*/
|
||||||
@@ -1030,9 +1015,13 @@ class SetupDevEnvironment extends Command
|
|||||||
'value' => 1,
|
'value' => 1,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'default_storage_amount',
|
'name' => 'default_max_storage_amount',
|
||||||
'value' => 5,
|
'value' => 5,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'name' => 'default_max_team_member',
|
||||||
|
'value' => 10,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'name' => 'setup_wizard_success',
|
'name' => 'setup_wizard_success',
|
||||||
'value' => 1,
|
'value' => 1,
|
||||||
@@ -1091,6 +1080,30 @@ class SetupDevEnvironment extends Command
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate demo traffic data
|
||||||
|
*/
|
||||||
|
private function generate_traffic(): void
|
||||||
|
{
|
||||||
|
$user = User::all();
|
||||||
|
|
||||||
|
foreach (range(0, 45) as $day) {
|
||||||
|
|
||||||
|
$user
|
||||||
|
->each(fn($user) => DB::table('traffic')
|
||||||
|
->insert([
|
||||||
|
'id' => Str::uuid(),
|
||||||
|
'user_id' => $user->id,
|
||||||
|
'upload' => random_int(1111111, 9999999),
|
||||||
|
'download' => random_int(11111111, 99999999),
|
||||||
|
'created_at' => now()->subDays($day),
|
||||||
|
'updated_at' => now()->subDays($day),
|
||||||
|
])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Migrate database and generate application keys
|
* Migrate database and generate application keys
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -125,9 +125,13 @@ class SetupProdEnvironment extends Command
|
|||||||
'value' => 1,
|
'value' => 1,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'default_storage_amount',
|
'name' => 'default_max_storage_amount',
|
||||||
'value' => 5,
|
'value' => 5,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'name' => 'default_max_team_member',
|
||||||
|
'value' => 10,
|
||||||
|
],
|
||||||
[
|
[
|
||||||
'name' => 'setup_wizard_success',
|
'name' => 'setup_wizard_success',
|
||||||
'value' => 1,
|
'value' => 1,
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class CreateNewUserAction extends Controller
|
|||||||
RegisterUserRequest $request
|
RegisterUserRequest $request
|
||||||
): Application | ResponseFactory | Response {
|
): Application | ResponseFactory | Response {
|
||||||
$settings = get_settings([
|
$settings = get_settings([
|
||||||
'default_storage_amount', 'registration', 'user_verification',
|
'default_max_storage_amount', 'registration', 'user_verification',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Check if account registration is enabled
|
// Check if account registration is enabled
|
||||||
|
|||||||
@@ -209,8 +209,8 @@ class User extends Authenticatable implements MustVerifyEmail
|
|||||||
|
|
||||||
// Create default limitations
|
// Create default limitations
|
||||||
$user->limitations()->create([
|
$user->limitations()->create([
|
||||||
'max_storage_amount' => get_settings('default_storage_amount') ?? 1,
|
'max_storage_amount' => get_settings('default_max_storage_amount') ?? 1,
|
||||||
'max_team_members' => 5,
|
'max_team_members' => get_settings('default_max_team_member') ?? 10,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Create user directory for his files
|
// Create user directory for his files
|
||||||
|
|||||||
@@ -61,9 +61,13 @@ class StoreAppSettingsController extends Controller
|
|||||||
'value' => $request->input('storageLimitation'),
|
'value' => $request->input('storageLimitation'),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'name' => 'default_storage_amount',
|
'name' => 'default_max_storage_amount',
|
||||||
'value' => $request->input('defaultStorage') ?? 5,
|
'value' => $request->input('defaultStorage') ?? 5,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'name' => 'default_max_team_member',
|
||||||
|
'value' => $request->input('defaultMaxTeamMember') ?? 10,
|
||||||
|
],
|
||||||
])->each(function ($col) {
|
])->each(function ($col) {
|
||||||
Setting::forceCreate([
|
Setting::forceCreate([
|
||||||
'name' => $col['name'],
|
'name' => $col['name'],
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class SubscriptionEventSubscriber
|
|||||||
public function handleSubscriptionWasExpired($event)
|
public function handleSubscriptionWasExpired($event)
|
||||||
{
|
{
|
||||||
$event->subscription->user->limitations()->update([
|
$event->subscription->user->limitations()->update([
|
||||||
'max_storage_amount' => get_settings('default_storage_amount') ?? 1,
|
'max_storage_amount' => get_settings('default_max_storage_amount') ?? 5,
|
||||||
'max_team_members' => 5,
|
'max_team_members' => 5,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class SignFlowTest extends TestCase
|
|||||||
{
|
{
|
||||||
collect([
|
collect([
|
||||||
[
|
[
|
||||||
'name' => 'default_storage_amount',
|
'name' => 'default_max_storage_amount',
|
||||||
'value' => 12,
|
'value' => 12,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class UserSubscriptionTest extends TestCase
|
|||||||
SubscriptionWasExpired::dispatch($user->subscription);
|
SubscriptionWasExpired::dispatch($user->subscription);
|
||||||
|
|
||||||
$this->assertDatabaseHas('user_limitations', [
|
$this->assertDatabaseHas('user_limitations', [
|
||||||
'max_storage_amount' => 1,
|
'max_storage_amount' => 5,
|
||||||
'max_team_members' => 5,
|
'max_team_members' => 5,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class SetupWizardTest extends TestCase
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$this->assertDatabaseHas('settings', [
|
$this->assertDatabaseHas('settings', [
|
||||||
'name' => 'default_storage_amount',
|
'name' => 'default_max_storage_amount',
|
||||||
'value' => '10',
|
'value' => '10',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,26 @@ class TeamLimitsTest extends TestCase
|
|||||||
'email' => 'test@doe.com',
|
'email' => 'test@doe.com',
|
||||||
'permission' => 'can-edit',
|
'permission' => 'can-edit',
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'email' => 'test2@doe.com',
|
||||||
|
'permission' => 'can-edit',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'email' => 'test3@doe.com',
|
||||||
|
'permission' => 'can-edit',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'email' => 'test4@doe.com',
|
||||||
|
'permission' => 'can-edit',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'email' => 'test5@doe.com',
|
||||||
|
'permission' => 'can-edit',
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'email' => 'test6@doe.com',
|
||||||
|
'permission' => 'can-edit',
|
||||||
|
],
|
||||||
],
|
],
|
||||||
])
|
])
|
||||||
->assertStatus(423);
|
->assertStatus(423);
|
||||||
|
|||||||
Reference in New Issue
Block a user