wip layout filter and performance
This commit is contained in:
1 parent
0221ace4d2
commit
54a409f344
13 files changed
+268
-52
No files matched your search
@@ -6,6 +6,7 @@ use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadEvents;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartEvent extends ChartWidget
|
||||
@@ -13,19 +14,32 @@ class ChartEvent extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Events';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
protected bool $isCollapsible = false;
|
||||
|
||||
protected $f;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 256 256"><path d="M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"></path></svg>
|
||||
Events
|
||||
</span>
|
||||
<span>'.$this->type.'</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$data = LoadEvents::load($this->filters);
|
||||
|
||||
$this->description = ucfirst(HelperStatisticType::get($this->filters));
|
||||
$this->type = ucfirst(HelperStatisticType::get($this->filters));
|
||||
|
||||
if (isset($data['description'])) {
|
||||
$this->description .= $data['description'];
|
||||
|
||||
@@ -7,6 +7,7 @@ use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadEvents;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartEventMoAv extends ChartWidget
|
||||
@@ -14,17 +15,30 @@ class ChartEventMoAv extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Events';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
protected bool $isCollapsible = false;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 256 256"><path d="M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"></path></svg>
|
||||
Events
|
||||
</span>
|
||||
<span>'.$this->type.' Moving Average</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$data = LoadEvents::load($this->filters);
|
||||
|
||||
$this->description = ucfirst(HelperStatisticType::get($this->filters)).' Moving Average';
|
||||
$this->type = ucfirst(HelperStatisticType::get($this->filters));
|
||||
|
||||
if ($data) {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Widgets;
|
||||
use App\Filament\Widgets\Data\LoadPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartEventPerf extends ChartWidget
|
||||
@@ -12,14 +13,25 @@ class ChartEventPerf extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Events';
|
||||
|
||||
protected ?string $description = 'Performance';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 256 256"><path d="M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"></path></svg>
|
||||
Events
|
||||
</span>
|
||||
<span>'.$this->type.' Performance</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
return LoadPerformance::load($this->filters);
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Filament\Widgets\Data\HelperMoveingAveragePerformens;
|
||||
use App\Filament\Widgets\Data\LoadPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartEventPerfMoAv extends ChartWidget
|
||||
@@ -13,13 +14,24 @@ class ChartEventPerfMoAv extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Events';
|
||||
|
||||
protected ?string $description = 'Performance Moving Average';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
protected bool $isCollapsible = false;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="22" height="22" fill="currentColor" viewBox="0 0 256 256"><path d="M232,64H208V48a8,8,0,0,0-8-8H56a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80V96a40,40,0,0,0,40,40h3.65A80.13,80.13,0,0,0,120,191.61V216H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16H136V191.58c31.94-3.23,58.44-25.64,68.08-55.58H208a40,40,0,0,0,40-40V80A16,16,0,0,0,232,64ZM48,120A24,24,0,0,1,24,96V80H48v32q0,4,.39,8Zm144-8.9c0,35.52-29,64.64-64,64.9a64,64,0,0,1-64-64V56H192ZM232,96a24,24,0,0,1-24,24h-.5a81.81,81.81,0,0,0,.5-8.9V80h24Z"></path></svg>
|
||||
Events
|
||||
</span>
|
||||
<span>'.$this->type.' Performance Moving Average</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
|
||||
@@ -6,6 +6,7 @@ use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadPlayer;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartPlayer extends ChartWidget
|
||||
@@ -13,23 +14,46 @@ class ChartPlayer extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
public ?string $player = 'Player';
|
||||
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
// protected bool $isCollapsible = true;
|
||||
|
||||
protected static ?bool $isCollapsed = true;
|
||||
|
||||
protected ?string $heading = 'Player';
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 font-bold flex flex-row gap-2">
|
||||
<svg viewBox="0 0 15 15" version="1.1" id="soccer" class="h-5 w-5"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M11,1.5C11,2.3284,10.3284,3,9.5,3S8,2.3284,8,1.5S8.6716,0,9.5,0S11,0.6716,11,1.5z M11,11c-0.5523,0-1,0.4477-1,1
|
||||
s0.4477,1,1,1s1-0.4477,1-1S11.5523,11,11,11z M12.84,6.09l-1.91-1.91l0,0C10.8399,4.0675,10.7041,4.0014,10.56,4H3.5
|
||||
C3.2239,4,3,4.2239,3,4.5S3.2239,5,3.5,5h2.7L3,11.3l0,0c-0.0138,0.066-0.0138,0.134,0,0.2c-0.058,0.2761,0.1189,0.547,0.395,0.605
|
||||
C3.6711,12.163,3.942,11.9861,4,11.71l0,0L5,10h2l-1.93,4.24l0,0C5.0228,14.3184,4.9986,14.4085,5,14.5
|
||||
c-0.0552,0.2761,0.1239,0.5448,0.4,0.6c0.2761,0.0552,0.5448-0.1239,0.6-0.4l0,0l4.7-9.38l1.44,1.48
|
||||
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
'.$this->player.'
|
||||
</span>
|
||||
<span>'.$this->type.'</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$data = LoadPlayer::load($this->filters);
|
||||
|
||||
if ($data) {
|
||||
$this->description = ucfirst(HelperStatisticType::get($this->filters));
|
||||
if ($data['player_name']) {
|
||||
$this->description .= ' '.$data['player_name'];
|
||||
}
|
||||
$this->player = $data['player_name'] ?? '';
|
||||
$this->type = ucfirst(HelperStatisticType::get($this->filters));
|
||||
}
|
||||
|
||||
return $data;
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadPlayer;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartPlayerMoAv extends ChartWidget
|
||||
@@ -13,18 +15,46 @@ class ChartPlayerMoAv extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
public ?string $player = 'Player';
|
||||
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
// protected bool $isCollapsible = true;
|
||||
|
||||
protected ?string $heading = 'Player';
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg viewBox="0 0 15 15" version="1.1" id="soccer" class="h-6 w-6"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M11,1.5C11,2.3284,10.3284,3,9.5,3S8,2.3284,8,1.5S8.6716,0,9.5,0S11,0.6716,11,1.5z M11,11c-0.5523,0-1,0.4477-1,1
|
||||
s0.4477,1,1,1s1-0.4477,1-1S11.5523,11,11,11z M12.84,6.09l-1.91-1.91l0,0C10.8399,4.0675,10.7041,4.0014,10.56,4H3.5
|
||||
C3.2239,4,3,4.2239,3,4.5S3.2239,5,3.5,5h2.7L3,11.3l0,0c-0.0138,0.066-0.0138,0.134,0,0.2c-0.058,0.2761,0.1189,0.547,0.395,0.605
|
||||
C3.6711,12.163,3.942,11.9861,4,11.71l0,0L5,10h2l-1.93,4.24l0,0C5.0228,14.3184,4.9986,14.4085,5,14.5
|
||||
c-0.0552,0.2761,0.1239,0.5448,0.4,0.6c0.2761,0.0552,0.5448-0.1239,0.6-0.4l0,0l4.7-9.38l1.44,1.48
|
||||
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
'.$this->player.'
|
||||
</span>
|
||||
<span>'.$this->type.'</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$data = LoadPlayer::load($this->filters);
|
||||
|
||||
if ($data) {
|
||||
$this->description = 'Moving Average '.$data['player_name'];
|
||||
$this->player = $data['player_name'] ?? '';
|
||||
$this->type = ucfirst(HelperStatisticType::get($this->filters));
|
||||
|
||||
HelperMoveingAverage::get($data);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Filament\Widgets;
|
||||
use App\Filament\Widgets\Data\LoadPlayerPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartPlayerPerf extends ChartWidget
|
||||
@@ -12,16 +13,46 @@ class ChartPlayerPerf extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Player';
|
||||
public ?string $player = 'Player';
|
||||
|
||||
protected ?string $description = 'Performance';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
protected bool $isCollapsible = false;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg viewBox="0 0 15 15" version="1.1" id="soccer" class="h-6 w-6"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M11,1.5C11,2.3284,10.3284,3,9.5,3S8,2.3284,8,1.5S8.6716,0,9.5,0S11,0.6716,11,1.5z M11,11c-0.5523,0-1,0.4477-1,1
|
||||
s0.4477,1,1,1s1-0.4477,1-1S11.5523,11,11,11z M12.84,6.09l-1.91-1.91l0,0C10.8399,4.0675,10.7041,4.0014,10.56,4H3.5
|
||||
C3.2239,4,3,4.2239,3,4.5S3.2239,5,3.5,5h2.7L3,11.3l0,0c-0.0138,0.066-0.0138,0.134,0,0.2c-0.058,0.2761,0.1189,0.547,0.395,0.605
|
||||
C3.6711,12.163,3.942,11.9861,4,11.71l0,0L5,10h2l-1.93,4.24l0,0C5.0228,14.3184,4.9986,14.4085,5,14.5
|
||||
c-0.0552,0.2761,0.1239,0.5448,0.4,0.6c0.2761,0.0552,0.5448-0.1239,0.6-0.4l0,0l4.7-9.38l1.44,1.48
|
||||
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
'.$this->player.'
|
||||
</span>
|
||||
<span>Performance</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
$data = LoadPlayerPerformance::load($this->filters);
|
||||
if ($data) {
|
||||
$this->player = $data['player_name'] ?? '';
|
||||
}
|
||||
|
||||
return LoadPlayerPerformance::load($this->filters);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,11 @@
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\LoadPlayerPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Support\HtmlString;
|
||||
use Livewire\Attributes\Reactive;
|
||||
|
||||
class ChartPlayerPerfMoAv extends ChartWidget
|
||||
@@ -12,17 +14,50 @@ class ChartPlayerPerfMoAv extends ChartWidget
|
||||
#[Reactive]
|
||||
public ?array $filters = [];
|
||||
|
||||
protected ?string $heading = 'Player';
|
||||
public ?string $player = 'Player';
|
||||
|
||||
protected ?string $description = 'Performance Moving Average';
|
||||
public ?string $type = '';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
protected bool $isCollapsible = false;
|
||||
|
||||
public function getHeading(): HtmlString
|
||||
{
|
||||
return new HtmlString('
|
||||
<span class="flex justify-between">
|
||||
<span class="text-primary-600 flex flex-row gap-2">
|
||||
<svg viewBox="0 0 15 15" version="1.1" id="soccer" class="h-6 w-6"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="currentColor">
|
||||
<g id="SVGRepo_bgCarrier" stroke-width="0"></g>
|
||||
<g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
|
||||
<g id="SVGRepo_iconCarrier">
|
||||
<path d="M11,1.5C11,2.3284,10.3284,3,9.5,3S8,2.3284,8,1.5S8.6716,0,9.5,0S11,0.6716,11,1.5z M11,11c-0.5523,0-1,0.4477-1,1
|
||||
s0.4477,1,1,1s1-0.4477,1-1S11.5523,11,11,11z M12.84,6.09l-1.91-1.91l0,0C10.8399,4.0675,10.7041,4.0014,10.56,4H3.5
|
||||
C3.2239,4,3,4.2239,3,4.5S3.2239,5,3.5,5h2.7L3,11.3l0,0c-0.0138,0.066-0.0138,0.134,0,0.2c-0.058,0.2761,0.1189,0.547,0.395,0.605
|
||||
C3.6711,12.163,3.942,11.9861,4,11.71l0,0L5,10h2l-1.93,4.24l0,0C5.0228,14.3184,4.9986,14.4085,5,14.5
|
||||
c-0.0552,0.2761,0.1239,0.5448,0.4,0.6c0.2761,0.0552,0.5448-0.1239,0.6-0.4l0,0l4.7-9.38l1.44,1.48
|
||||
c0.211,0.1782,0.5264,0.1516,0.7046-0.0593C13.0037,6.5523,13.0018,6.2761,12.84,6.09z"></path>
|
||||
</g>
|
||||
</svg>
|
||||
'.$this->player.'
|
||||
</span>
|
||||
<span>Performance Moving Average</span>
|
||||
</span>
|
||||
');
|
||||
}
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
return LoadPlayerPerformance::load($this->filters);
|
||||
$data = LoadPlayerPerformance::load($this->filters);
|
||||
|
||||
if ($data) {
|
||||
$this->player = $data['player_name'] ?? '';
|
||||
|
||||
HelperMoveingAverage::get($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getType(): string
|
||||
|
||||
@@ -100,11 +100,11 @@ class LoadEvents
|
||||
})
|
||||
->pluck('match_id')->toArray();
|
||||
|
||||
if (! $matches_played) {
|
||||
return [];
|
||||
}
|
||||
$description = ' with '.StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name').' ('.\count($matches_played).')';
|
||||
|
||||
$description = ' (with '.StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name').')';
|
||||
if (! $matches_played) {
|
||||
$matches_played[] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Filament\Widgets\Data;
|
||||
|
||||
use App\Models\StatistikoDetail;
|
||||
use App\Models\StatistikoPlayer;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
@@ -35,6 +36,8 @@ class LoadPlayerPerformance
|
||||
return [];
|
||||
}
|
||||
|
||||
$player_name = StatistikoDetail::where('tm_player_id', (int) $tm_player_id)->value('name');
|
||||
|
||||
if ($statistic_type == 'none') {
|
||||
$statistic_type = 'gls';
|
||||
}
|
||||
@@ -52,9 +55,9 @@ class LoadPlayerPerformance
|
||||
|
||||
$tmp = [];
|
||||
foreach ($matches_played as $value) {
|
||||
$key = round($value->event->starttime->diffInDays(Carbon::now()));
|
||||
$val = $value->playerrating_value;
|
||||
$tmp[$key] = $val;
|
||||
$key = round($value->event->starttime->diffInDays(Carbon::now()));
|
||||
$tmp["$key"] = $val;
|
||||
}
|
||||
|
||||
ksort($tmp);
|
||||
@@ -77,6 +80,7 @@ class LoadPlayerPerformance
|
||||
],
|
||||
],
|
||||
'labels' => $labels,
|
||||
'player_name' => $player_name,
|
||||
];
|
||||
|
||||
self::$last_query = $data;
|
||||
|
||||
@@ -30,19 +30,22 @@ class StatsMedianAverage extends StatsOverviewWidget
|
||||
// dd($data);
|
||||
|
||||
$this->columns = [
|
||||
'default' => 2,
|
||||
'sm' => 3,
|
||||
'xl' => ! isset($data['similar_past_matches']) || $data['similar_past_matches'] == 'none' ? 6 : 3,
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'md' => 6,
|
||||
];
|
||||
|
||||
$statistic_type = ucfirst(HelperStatisticType::get($this->filters));
|
||||
|
||||
if (! isset($data['datasets'][0])) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$data['datasets'][0]['data'] = [];
|
||||
$data['datasets'][1]['data'] = [];
|
||||
} else {
|
||||
$arr_home = $data['datasets'][0]['data'];
|
||||
$arr_away = $data['datasets'][1]['data'];
|
||||
}
|
||||
|
||||
$total_home = count($arr_home);
|
||||
$total_away = count($arr_away);
|
||||
$summe_home = array_sum($arr_home);
|
||||
@@ -51,7 +54,42 @@ class StatsMedianAverage extends StatsOverviewWidget
|
||||
$away_team = $data['away_team'];
|
||||
|
||||
if (! $total_home) {
|
||||
return [];
|
||||
return [
|
||||
Stat::make('stat1', 'stat1')->view('filament.resources.events.widgets.statistic-regular', [
|
||||
'titel' => 'Number of events',
|
||||
'value' => '0',
|
||||
'hidden' => false,
|
||||
]),
|
||||
Stat::make('stat2', 'stat2')->view('filament.resources.events.widgets.statistic-average', [
|
||||
'titel' => 'Average '.$statistic_type,
|
||||
'value1' => 0,
|
||||
'value2' => 0,
|
||||
'home' => $home_team,
|
||||
'away' => $away_team,
|
||||
]),
|
||||
Stat::make('stat3', 'stat3')->view('filament.resources.events.widgets.statistic-average', [
|
||||
'titel' => 'Median '.$statistic_type,
|
||||
'value1' => 0,
|
||||
'value2' => 0,
|
||||
'home' => $home_team,
|
||||
'away' => $away_team,
|
||||
]),
|
||||
Stat::make('stat4', 'stat4')->view('filament.resources.events.widgets.statistic-regular', [
|
||||
'titel' => 'Win',
|
||||
'value' => 0,
|
||||
'hidden' => false,
|
||||
]),
|
||||
Stat::make('stat5', 'stat5')->view('filament.resources.events.widgets.statistic-regular', [
|
||||
'titel' => 'Draw',
|
||||
'value' => 0,
|
||||
'hidden' => false,
|
||||
]),
|
||||
Stat::make('stat6', 'stat6')->view('filament.resources.events.widgets.statistic-regular', [
|
||||
'titel' => 'Lost',
|
||||
'value' => 0,
|
||||
'hidden' => false,
|
||||
]),
|
||||
];
|
||||
}
|
||||
// if (! $total_home || ! $total_away) {
|
||||
// return [];
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<div class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
|
||||
<div
|
||||
class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
|
||||
<span class="font-bold flex items-center justify-center">{{ $titel }}</span>
|
||||
<div class="grid grid-cols-2 justify-center font-bold text-2xl">
|
||||
<span class="font-bold text-2xl flex items-center justify-center">{{ $value1 }}</span>
|
||||
<span class="font-bold text-2xl flex items-center justify-center">{{ $value2 }}</span>
|
||||
<span class="font-bold text-2xl text-center">{{ $value1 }}</span>
|
||||
<span class="font-bold text-2xl text-center">{{ $value2 }}</span>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 justify-center">
|
||||
<span class=" flex items-center justify-center text-xs">{{ $home }}</span>
|
||||
<span class=" flex items-center justify-center text-xs">{{ $away }}</span>
|
||||
<span class="text-center text-xs">{{ $home }}</span>
|
||||
<span class="text-center text-xs">{{ $away }}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,6 +1,7 @@
|
||||
@if (!$hidden)
|
||||
<div class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
|
||||
<span class="font-bold flex items-center justify-center">{{ $titel }}</span>
|
||||
<span class="font-bold text-2xl flex items-center justify-center">{{ $value }}</span>
|
||||
<div
|
||||
class="h-full rounded-lg p-0 lg:py-2 grid grid-rows-3 gap-0 bg-green-50 dark:bg-green-900 border border-green-300 dark:border-green-700">
|
||||
<span class="font-bold text-center">{{ $titel }}</span>
|
||||
<span class="font-bold text-2xl text-center">{{ $value }}</span>
|
||||
</div>
|
||||
@endif
|
||||
Reference in new issue
Block a user