mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-04 23:42:34 +00:00
Add database and database users sync (#537)
* Add database and database users sync * get mysl users * add mariadb and postgres * fix phpstan
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
namespace App\Web\Pages\Servers\Databases;
|
||||
|
||||
use App\Actions\Database\CreateDatabase;
|
||||
use App\Actions\Database\SyncDatabases;
|
||||
use App\Models\Database;
|
||||
use App\Models\Server;
|
||||
use App\Web\Contracts\HasSecondSubNav;
|
||||
@ -85,6 +86,26 @@ public static function getCollationInput(Server $server): Select
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('sync')
|
||||
->color('gray')
|
||||
->label('Sync Databases')
|
||||
->icon('heroicon-o-arrow-path')
|
||||
->authorize(fn () => auth()->user()?->can('create', [Database::class, $this->server]))
|
||||
->requiresConfirmation()
|
||||
->modalDescription('This will create databases that exist on the server but not in Vito.')
|
||||
->modalSubmitActionLabel('Sync')
|
||||
->action(function () {
|
||||
run_action($this, function () {
|
||||
app(SyncDatabases::class)->sync($this->server);
|
||||
|
||||
$this->dispatch('$refresh');
|
||||
|
||||
Notification::make()
|
||||
->success()
|
||||
->title('Databases synced!')
|
||||
->send();
|
||||
});
|
||||
}),
|
||||
Action::make('create')
|
||||
->label('Create Database')
|
||||
->icon('heroicon-o-plus')
|
||||
|
Reference in New Issue
Block a user