mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-28 19:10:40 +00:00
latest database backups included into the admin settings
This commit is contained in:
@@ -13,7 +13,8 @@ class IndexController
|
||||
{
|
||||
public function __construct(
|
||||
public GetServerSetupStatusAction $getServerSetupStatus,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Show index page
|
||||
@@ -34,7 +35,8 @@ class IndexController
|
||||
|
||||
// Get all settings
|
||||
$settings = get_settings_in_json();
|
||||
} catch (PDOException $e) {}
|
||||
} catch (PDOException $e) {
|
||||
}
|
||||
|
||||
if ($setup_status === 'installation-needed') {
|
||||
$status_check = ($this->getServerSetupStatus)();
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Settings\Controllers;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Storage;
|
||||
use Support\Status\Actions\GetServerSetupStatusAction;
|
||||
|
||||
class GetServerStatusController
|
||||
{
|
||||
public function __construct(
|
||||
public GetServerSetupStatusAction $getServerSetupStatus,
|
||||
) {}
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(): array
|
||||
{
|
||||
// Get server data
|
||||
$status = ($this->getServerSetupStatus)();
|
||||
|
||||
// Add latest database backups
|
||||
$status['backups'] = collect(Storage::allFiles('app-backup'))
|
||||
->map(fn ($path) => str_replace('app-backup/', '', $path))
|
||||
->reverse()
|
||||
->values()
|
||||
->take(5);
|
||||
|
||||
// Add cron info
|
||||
$status['cron'] = [
|
||||
'running' => isRunningCron(),
|
||||
@@ -24,4 +31,4 @@ class GetServerStatusController
|
||||
|
||||
return $status;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\Settings\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use Domain\Settings\Requests\StoreEmailCredentialsRequest;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Requests\StoreEmailCredentialsRequest;
|
||||
|
||||
class StoreEmailCredentialsController
|
||||
{
|
||||
@@ -17,8 +15,7 @@ class StoreEmailCredentialsController
|
||||
// Abort in demo mode
|
||||
abort_if(is_demo(), 204, 'Done.');
|
||||
|
||||
if (!app()->runningUnitTests()) {
|
||||
|
||||
if (! app()->runningUnitTests()) {
|
||||
$mail = [
|
||||
'log' => [
|
||||
'MAIL_DRIVER' => 'log',
|
||||
|
||||
@@ -23,10 +23,10 @@ class StoreEmailCredentialsRequest extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'mailDriver' => 'required|string',
|
||||
'smtp' => 'sometimes|array',
|
||||
'ses' => 'sometimes|array',
|
||||
'mailgun' => 'sometimes|array',
|
||||
'mailDriver' => 'required|string',
|
||||
'smtp' => 'sometimes|array',
|
||||
'ses' => 'sometimes|array',
|
||||
'mailgun' => 'sometimes|array',
|
||||
'postmark' => 'sometimes|array',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Artisan;
|
||||
use App\Users\Models\User;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
@@ -61,9 +61,9 @@ class CreateAdminAccountController extends Controller
|
||||
],
|
||||
])->each(function ($col) {
|
||||
Setting::updateOrCreate([
|
||||
'name' => $col['name']
|
||||
'name' => $col['name'],
|
||||
], [
|
||||
'value' => $col['value']
|
||||
'value' => $col['value'],
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -82,9 +82,9 @@ class StoreAppSettingsController extends Controller
|
||||
],
|
||||
])->each(function ($col) {
|
||||
Setting::updateOrCreate([
|
||||
'name' => $col['name']
|
||||
'name' => $col['name'],
|
||||
], [
|
||||
'value' => $col['value']
|
||||
'value' => $col['value'],
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use Artisan;
|
||||
use DB;
|
||||
use Artisan;
|
||||
use Illuminate\Http\Response;
|
||||
use Domain\Settings\Models\Setting;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Doctrine\DBAL\Driver\PDOException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\SetupWizard\Controllers;
|
||||
|
||||
use Artisan;
|
||||
@@ -14,9 +13,8 @@ class StoreEnvironmentSettingsController extends Controller
|
||||
*/
|
||||
public function __invoke(
|
||||
StoreEnvironmentSetupRequest $request,
|
||||
): Response
|
||||
{
|
||||
if (!app()->runningUnitTests()) {
|
||||
): Response {
|
||||
if (! app()->runningUnitTests()) {
|
||||
$drivers = [
|
||||
'local' => [
|
||||
'FILESYSTEM_DRIVER' => 'local',
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace Domain\SetupWizard\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
namespace Domain\Teams\Controllers;
|
||||
|
||||
use App\Users\Models\User;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Domain\Teams\Models\TeamFolderMember;
|
||||
use Domain\Teams\Models\TeamFolderInvitation;
|
||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||
use Domain\Teams\Resources\TeamInvitationResource;
|
||||
|
||||
@@ -31,13 +31,15 @@ class TeamFolderInvitation extends Model
|
||||
|
||||
protected $keyType = 'string';
|
||||
|
||||
public function accept() {
|
||||
public function accept()
|
||||
{
|
||||
$this->update([
|
||||
'status' => 'accepted',
|
||||
]);
|
||||
}
|
||||
|
||||
public function reject() {
|
||||
public function reject()
|
||||
{
|
||||
$this->update([
|
||||
'status' => 'rejected',
|
||||
]);
|
||||
|
||||
@@ -13,11 +13,11 @@ class TeamInvitationResource extends JsonResource
|
||||
'id' => $this->id,
|
||||
'type' => 'invitation',
|
||||
'attributes' => [
|
||||
'parent_id' => $this->parent_id,
|
||||
'email' => $this->email,
|
||||
'color' => $this->color,
|
||||
'status' => $this->status,
|
||||
'permission' => $this->permission,
|
||||
'parent_id' => $this->parent_id,
|
||||
'email' => $this->email,
|
||||
'color' => $this->color,
|
||||
'status' => $this->status,
|
||||
'permission' => $this->permission,
|
||||
'isExistedUser' => User::where('email', $this->email)->exists(),
|
||||
],
|
||||
'relationships' => [
|
||||
|
||||
Reference in New Issue
Block a user