wip
This commit is contained in:
1 parent
432ccdb3fe
commit
7fc0e2e029
3 files changed
+25
-2
No files matched your search
+22
-1
@@ -4,11 +4,14 @@ namespace App\Filament\Clusters\StaticData\Resources\StatistikoImports\Pages;
|
||||
|
||||
use App\Filament\Clusters\StaticData\Resources\StatistikoImports\StatistikaImportResource;
|
||||
use App\Models\StatistikoImport;
|
||||
use App\Models\User;
|
||||
use Filament\Actions\Action;
|
||||
use Filament\Actions\CreateAction;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Resources\Pages\ListRecords;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class ListStatistikoImports extends ListRecords
|
||||
{
|
||||
@@ -17,6 +20,24 @@ class ListStatistikoImports extends ListRecords
|
||||
protected function getHeaderActions(): array
|
||||
{
|
||||
return [
|
||||
Action::make('precalculation')->color('success')
|
||||
->icon('phosphor-gear')
|
||||
->requiresConfirmation() // Optional: Asks user before running
|
||||
->action(function () {
|
||||
// Run the console command
|
||||
/** @var User|null $user */
|
||||
$user = Auth::user();
|
||||
|
||||
Artisan::queue('update:player', [
|
||||
'--userId' => $user->id(),
|
||||
]);
|
||||
|
||||
// Notify the user of success
|
||||
Notification::make()
|
||||
->title('Background process started')
|
||||
->body('This may take a few minutes. We will notify you when it is finished.')
|
||||
->info();
|
||||
}),
|
||||
CreateAction::make('upload_file')
|
||||
->modalIcon('phosphor-upload')
|
||||
->modalHeading('Upload Statistiko Files')
|
||||
|
||||
@@ -64,7 +64,7 @@ class AdminPanelProvider extends PanelProvider
|
||||
->emailVerification()
|
||||
->emailChangeVerification()
|
||||
->databaseNotifications()
|
||||
->databaseNotificationsPolling('10s') // default is 30
|
||||
->databaseNotificationsPolling('30s') // default is 30
|
||||
->profile(isSimple: false)
|
||||
->default()
|
||||
->globalSearch(false)
|
||||
|
||||
@@ -30,8 +30,10 @@
|
||||
{{-- <x-filament::button icon="phosphor-calculator" tooltip="Calculate" wire:click="calculateAspg(1)" /> --}}
|
||||
<x-filament::button icon="phosphor-copy" color="success"
|
||||
tooltip="Copy results for pasting into a spread sheet" wire:click="copyResult()" />
|
||||
@role('super_admin')
|
||||
<x-filament::button icon="phosphor-copy" color="warning" tooltip="Copy calculation variables"
|
||||
wire:click="copyDevelopment()" />
|
||||
@endrole
|
||||
{{-- --}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user