wip layout filter and performance

This commit is contained in:
salam committed 2026-06-03 09:47:30 +02:00
1 parent 0221ace4d2
commit 54a409f344
13 files changed
+270 -54

No files matched your search

+17 -3
View File
@@ -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'];