wip
This commit is contained in:
1 parent
eb884603d9
commit
0518e9563f
15 files changed
+108
-37
No files matched your search
+31
@@ -6,7 +6,10 @@ use App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\StatistikoPlaye
|
|||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
use Filament\Actions\Action;
|
use Filament\Actions\Action;
|
||||||
use Filament\Actions\CreateAction;
|
use Filament\Actions\CreateAction;
|
||||||
|
use Filament\Infolists\Components\TextEntry;
|
||||||
use Filament\Resources\Pages\ListRecords;
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
|
||||||
class ListStatistikoPlayers extends ListRecords
|
class ListStatistikoPlayers extends ListRecords
|
||||||
{
|
{
|
||||||
@@ -15,6 +18,34 @@ class ListStatistikoPlayers extends ListRecords
|
|||||||
protected function getHeaderActions(): array
|
protected function getHeaderActions(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Action::make('missing')
|
||||||
|
->modalHeading('Missing Player')
|
||||||
|
->icon('phosphor-magnifying-glass')
|
||||||
|
// ->action(fn(StatistikoPlayer $record) => StatistikoPlayer::doesntHave('details')->get())
|
||||||
|
// ->modalContent(fn($record = StatistikoPlayer::doesntHave('details')->get()): View => view(
|
||||||
|
// 'filament.pages.list-missing-player',
|
||||||
|
// ['record' => $record],
|
||||||
|
// ))
|
||||||
|
// ->action(fn(Contract $record) => $record = StatistikoPlayer::doesntHave('details')->get())
|
||||||
|
// ->action(fn() => StatistikoPlayer::doesntHave('details')->get())
|
||||||
|
// ->modalContent(view('filament.pages.list-missing-player'))
|
||||||
|
// ->modalContent(fn(Contract $record): View => view(
|
||||||
|
// 'filament.pages.list-missing-player',
|
||||||
|
// ['record' => $record],
|
||||||
|
// ))
|
||||||
|
->color('gray'),
|
||||||
|
Action::make('double')
|
||||||
|
->icon('phosphor-magnifying-glass')
|
||||||
|
->color('gray')
|
||||||
|
->schema([
|
||||||
|
TextEntry::make('created_at')
|
||||||
|
->dateTime(),
|
||||||
|
TextEntry::make('updated_at')
|
||||||
|
->dateTime(),
|
||||||
|
])
|
||||||
|
->action(function () {
|
||||||
|
// StatistikoPlayer::truncate();
|
||||||
|
}),
|
||||||
Action::make('truncate')
|
Action::make('truncate')
|
||||||
->icon('phosphor-trash')
|
->icon('phosphor-trash')
|
||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
|
|||||||
+35
-35
@@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Tables;
|
namespace App\Filament\Clusters\StaticData\Resources\StatistikoPlayers\Tables;
|
||||||
|
|
||||||
|
use Filament\Tables\Table;
|
||||||
use App\Models\StatistikoPlayer;
|
use App\Models\StatistikoPlayer;
|
||||||
use Filament\Actions\BulkActionGroup;
|
|
||||||
use Filament\Actions\DeleteAction;
|
|
||||||
use Filament\Actions\DeleteBulkAction;
|
|
||||||
use Filament\Actions\EditAction;
|
use Filament\Actions\EditAction;
|
||||||
|
use Filament\Actions\DeleteAction;
|
||||||
|
use Filament\Tables\Filters\Filter;
|
||||||
|
use Filament\Actions\BulkActionGroup;
|
||||||
|
use Filament\Actions\DeleteBulkAction;
|
||||||
use Filament\Forms\Components\Checkbox;
|
use Filament\Forms\Components\Checkbox;
|
||||||
use Filament\Tables\Columns\TextColumn;
|
use Filament\Tables\Columns\TextColumn;
|
||||||
use Filament\Tables\Enums\FiltersLayout;
|
use Filament\Tables\Enums\FiltersLayout;
|
||||||
use Filament\Tables\Filters\Filter;
|
|
||||||
use Filament\Tables\Table;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
|
||||||
class StatistikoPlayersTable
|
class StatistikoPlayersTable
|
||||||
@@ -26,40 +26,40 @@ class StatistikoPlayersTable
|
|||||||
->label('Player')
|
->label('Player')
|
||||||
->searchable()
|
->searchable()
|
||||||
->tooltip(fn($record) => $record->details->full_name),
|
->tooltip(fn($record) => $record->details->full_name),
|
||||||
TextColumn::make('event.home.name')->searchable()->color('primary'),
|
TextColumn::make('event.home.ss_team_name')->searchable()->color('primary'),
|
||||||
TextColumn::make('event.away.name')->searchable()->color('success'),
|
TextColumn::make('event.away.ss_team_name')->searchable()->color('success'),
|
||||||
])
|
])
|
||||||
->filters([
|
// ->filters([
|
||||||
Filter::make('player_filters')
|
// Filter::make('player_filters')
|
||||||
->schema([
|
// ->schema([
|
||||||
Checkbox::make('find_double'),
|
// Checkbox::make('find_double'),
|
||||||
])->query(function (Builder $query, array $data): Builder {
|
// ])->query(function (Builder $query, array $data): Builder {
|
||||||
return $query->when(
|
// return $query->when(
|
||||||
$data['find_double'],
|
// $data['find_double'],
|
||||||
function (Builder $query) {
|
// function (Builder $query) {
|
||||||
$arr = [];
|
// $arr = [];
|
||||||
$events = StatistikoPlayer::query()->select('match_id', 'ss_player_id')->get()->toArray();
|
// $events = StatistikoPlayer::query()->select('match_id', 'ss_player_id')->get()->toArray();
|
||||||
foreach ($events as $value) {
|
// foreach ($events as $value) {
|
||||||
$match_id = $value['match_id'];
|
// $match_id = $value['match_id'];
|
||||||
$player_id = $value['ss_player_id'];
|
// $player_id = $value['ss_player_id'];
|
||||||
|
|
||||||
if (isset($arr[$match_id]) && in_array($player_id, $arr[$match_id])) {
|
// if (isset($arr[$match_id]) && in_array($player_id, $arr[$match_id])) {
|
||||||
return $query->where('match_id', $match_id)->where('ss_player_id', $player_id);
|
// return $query->where('match_id', $match_id)->where('ss_player_id', $player_id);
|
||||||
}
|
// }
|
||||||
$arr[$match_id][] = $player_id;
|
// $arr[$match_id][] = $player_id;
|
||||||
}
|
// }
|
||||||
|
|
||||||
return $query->where('match_id', 0);
|
// return $query->where('match_id', 0);
|
||||||
}
|
// }
|
||||||
);
|
// );
|
||||||
})->indicateUsing(function (array $data): ?string {
|
// })->indicateUsing(function (array $data): ?string {
|
||||||
if (! $data['find_double']) {
|
// if (! $data['find_double']) {
|
||||||
return null;
|
// return null;
|
||||||
}
|
// }
|
||||||
return 'Find Double';
|
// return 'Find Double';
|
||||||
}),
|
// }),
|
||||||
|
|
||||||
], layout: FiltersLayout::AboveContent)
|
// ], layout: FiltersLayout::AboveContent)
|
||||||
->emptyStateHeading('No player double in an event')
|
->emptyStateHeading('No player double in an event')
|
||||||
->deferFilters(false)
|
->deferFilters(false)
|
||||||
->recordActions([
|
->recordActions([
|
||||||
|
|||||||
@@ -199,9 +199,12 @@ class LoadEvents
|
|||||||
$events = [];
|
$events = [];
|
||||||
$results = ['w' => 0, 'd' => 0, 'l' => 0, 'w2' => 0, 'l2' => 0];
|
$results = ['w' => 0, 'd' => 0, 'l' => 0, 'w2' => 0, 'l2' => 0];
|
||||||
|
|
||||||
|
// dd($res);
|
||||||
|
|
||||||
foreach ($res as $value) {
|
foreach ($res as $value) {
|
||||||
|
|
||||||
$labels[] = round($value['starttime']->diffInDays(Carbon::now()));
|
$labels[] = round($value['starttime']->diffInDays(Carbon::now()));
|
||||||
|
|
||||||
// $labels[] = $value['starttime']->format('Y-m-d H:i');
|
// $labels[] = $value['starttime']->format('Y-m-d H:i');
|
||||||
|
|
||||||
$playing_date[] = $value['starttime']->format('d. F Y H:i');
|
$playing_date[] = $value['starttime']->format('d. F Y H:i');
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
||||||
use MongoDB\Laravel\Eloquent\Model;
|
use MongoDB\Laravel\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class StatistikoEvent extends Model
|
class StatistikoEvent extends Model
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
->globalSearchKeyBindings(['command+k', 'ctrl+k'])
|
->globalSearchKeyBindings(['command+k', 'ctrl+k'])
|
||||||
->brandLogo(asset('logo/statistiko.svg'))
|
->brandLogo(asset('logo/statistiko.svg'))
|
||||||
->darkModeBrandLogo(asset('logo/statistiko-d.svg'))
|
->darkModeBrandLogo(asset('logo/statistiko-d.svg'))
|
||||||
->favicon(asset('logo/sta.svg'))
|
->favicon(asset('favicon/favicon.ico'))
|
||||||
->brandName('')
|
->brandName('')
|
||||||
->brandLogoHeight('2rem')
|
->brandLogoHeight('2rem')
|
||||||
->unsavedChangesAlerts()
|
->unsavedChangesAlerts()
|
||||||
|
|||||||
Whitespace-only changes.
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1,5 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="100%" height="100%" viewBox="0 0 200 169" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><metadata><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"><rdf:Description><dc:creator>RealFaviconGenerator</dc:creator><dc:source>https://realfavicongenerator.net</dc:source></rdf:Description></rdf:RDF></metadata><g transform="matrix(0.1,0,0,-0.172449,0,169)">
|
||||||
|
<path d="M146,877C78,788 54,665 85,569C95,539 123,475 148,425C187,348 194,326 194,275C194,211 174,160 124,101C110,83 100,67 103,64C113,54 393,60 405,70C430,90 469,178 481,238C497,321 484,379 420,509C393,563 367,626 362,648C346,718 372,798 436,878L463,910L171,910L146,877Z" style="fill-rule:nonzero;"></path>
|
||||||
|
<path d="M510,910L510,730L700,730L700,60L960,60L960,729L1037,732L1113,735L1136,820C1149,867 1160,906 1160,908C1160,909 1014,910 835,910L510,910Z" style="fill-rule:nonzero;"></path>
|
||||||
|
<path d="M1237,853C1165,691 1145,560 1154,321C1157,224 1163,127 1168,105L1175,65L1308,62C1380,61 1440,63 1440,67C1440,71 1434,109 1426,150C1418,191 1410,256 1408,293L1405,361L1615,361L1612,293C1609,231 1597,139 1583,82L1578,59L1844,65L1852,104C1867,174 1875,389 1868,496C1860,614 1832,737 1791,838L1763,905L1513,908L1263,910L1237,853ZM1543,783C1566,731 1610,579 1610,551C1610,544 1575,540 1510,540C1445,540 1410,544 1410,551C1410,604 1492,840 1510,840C1514,840 1529,814 1543,783Z" style="fill-rule:nonzero;"></path>
|
||||||
|
</g></svg>
|
||||||
|
After Width: | Height: | Size: 1.6 KiB |
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"name": "Statistiko.at",
|
||||||
|
"short_name": "Statistiko",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "/web-app-manifest-192x192.png",
|
||||||
|
"sizes": "192x192",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "/web-app-manifest-512x512.png",
|
||||||
|
"sizes": "512x512",
|
||||||
|
"type": "image/png",
|
||||||
|
"purpose": "maskable"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"theme_color": "#ffffff",
|
||||||
|
"background_color": "#ffffff",
|
||||||
|
"display": "standalone"
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
<div>
|
||||||
|
<div>Hallo</div>
|
||||||
|
{{ dd($record)}}
|
||||||
|
</div>
|
||||||
@@ -10,6 +10,13 @@
|
|||||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||||
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />
|
<link href="https://fonts.bunny.net/css?family=instrument-sans:400,500,600" rel="stylesheet" />
|
||||||
|
|
||||||
|
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
||||||
|
<link rel="shortcut icon" href="/favicon.ico" />
|
||||||
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="statistiko.at" />
|
||||||
|
<link rel="manifest" href="/site.webmanifest" />
|
||||||
|
|
||||||
<!-- Styles / Scripts -->
|
<!-- Styles / Scripts -->
|
||||||
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
|
@if (file_exists(public_path('build/manifest.json')) || file_exists(public_path('hot')))
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
|
|||||||
Reference in new issue
Block a user