mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 01:44:45 +02:00

* add custom statblock * add custom datablock * Use real values, not placeholders * More Changes * remove unused var * Remove old code * Remove more * Updates * Add LineHeight Changing the font size cut off the j/g and _ * Fix invisible console selection Closes #874 * Add Missing to `offline` detection * Use helper * Update * Removals * Move to `SmallStatBlock`
49 lines
892 B
PHP
49 lines
892 B
PHP
<?php
|
|
|
|
namespace App\Filament\Server\Components;
|
|
|
|
use Filament\Widgets\StatsOverviewWidget\Stat;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
use Illuminate\Contracts\View\View;
|
|
|
|
class StatBlock extends Stat
|
|
{
|
|
protected string|Htmlable $label;
|
|
|
|
protected $value;
|
|
|
|
public function label(string|Htmlable $label): static
|
|
{
|
|
$this->label = $label;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function value($value): static
|
|
{
|
|
$this->value = $value;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getLabel(): string|Htmlable
|
|
{
|
|
return $this->label;
|
|
}
|
|
|
|
public function getValue()
|
|
{
|
|
return value($this->value);
|
|
}
|
|
|
|
public function toHtml(): string
|
|
{
|
|
return $this->render()->render();
|
|
}
|
|
|
|
public function render(): View
|
|
{
|
|
return view('filament.components.server-data-block', $this->data());
|
|
}
|
|
}
|