Added manual ftp synchronization ftp button in production temp
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 18s
This commit is contained in:
@@ -25,6 +25,8 @@ use Filament\Tables\Table;
|
|||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
use Illuminate\Database\Eloquent\SoftDeletingScope;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
|
use Filament\Notifications\Notification;
|
||||||
|
use Illuminate\Support\Facades\Artisan;
|
||||||
|
|
||||||
class ProductionTempResource extends Resource
|
class ProductionTempResource extends Resource
|
||||||
{
|
{
|
||||||
@@ -1745,6 +1747,28 @@ class ProductionTempResource extends Resource
|
|||||||
]),
|
]),
|
||||||
])
|
])
|
||||||
->headerActions([
|
->headerActions([
|
||||||
|
Tables\Actions\Action::make('Manual Synchronization FTP')
|
||||||
|
->label('Manual Synchronization FTP')
|
||||||
|
->action(function (array $data) {
|
||||||
|
|
||||||
|
$exitCode = Artisan::call('ftp:sync');
|
||||||
|
|
||||||
|
if ($exitCode === 0) {
|
||||||
|
Notification::make()
|
||||||
|
->title('FTP synchronization completed')
|
||||||
|
->success()
|
||||||
|
->send();
|
||||||
|
} else {
|
||||||
|
Notification::make()
|
||||||
|
->title('FTP synchronization failed')
|
||||||
|
->danger()
|
||||||
|
->send();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
->visible(function () {
|
||||||
|
return Filament::auth()->user()->can('view manual synchronization ftp');
|
||||||
|
}),
|
||||||
ImportAction::make()
|
ImportAction::make()
|
||||||
->label('Import Production Temp')
|
->label('Import Production Temp')
|
||||||
->color('warning')
|
->color('warning')
|
||||||
|
|||||||
Reference in New Issue
Block a user