55 lines
1.8 KiB
PHP
55 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Filament\Widgets\Dashboard;
|
|
|
|
use App\Models\Tenant;
|
|
use App\Support\TenantDashboard\TenantDashboardSummaryBuilder;
|
|
use Filament\Facades\Filament;
|
|
use Filament\Widgets\Widget;
|
|
|
|
class TenantDashboardOverview extends Widget
|
|
{
|
|
protected static bool $isLazy = false;
|
|
|
|
protected int|string|array $columnSpan = 'full';
|
|
|
|
protected string $view = 'filament.widgets.dashboard.tenant-dashboard-overview';
|
|
|
|
/**
|
|
* @return array<string, mixed>
|
|
*/
|
|
protected function getViewData(): array
|
|
{
|
|
$tenant = Filament::getTenant();
|
|
|
|
if (! $tenant instanceof Tenant) {
|
|
return [
|
|
'context' => [
|
|
'workspace' => __('localization.dashboard.overview.context_workspace'),
|
|
'tenant' => __('localization.dashboard.overview.context_no_tenant'),
|
|
'provider' => null,
|
|
'providerKey' => null,
|
|
'latestActivity' => null,
|
|
],
|
|
'posture' => [
|
|
'status' => __('localization.dashboard.overview.status_unavailable'),
|
|
'tone' => 'gray',
|
|
'headline' => __('localization.dashboard.overview.tenant_context_unavailable_headline'),
|
|
'summary' => __('localization.dashboard.overview.tenant_context_unavailable_summary'),
|
|
],
|
|
'kpis' => [],
|
|
'recommendedActions' => [],
|
|
'governanceStatus' => [],
|
|
'readinessCards' => [],
|
|
'recentOperations' => [],
|
|
'pollingInterval' => null,
|
|
];
|
|
}
|
|
|
|
return app(TenantDashboardSummaryBuilder::class)
|
|
->build($tenant)
|
|
->toArray();
|
|
}
|
|
} |