CluPilotCloud/app/Livewire/Dashboard.php

45 lines
1.8 KiB
PHP

<?php
namespace App\Livewire;
use Livewire\Attributes\Layout;
use Livewire\Component;
#[Layout('layouts.portal-app')]
class Dashboard extends Component
{
public function render()
{
// Fixture data until the provisioning engine (separate handoff) provides
// real instances / provisioning_runs. The dashboard is a pure view (§12.3).
$storageUsed = 172;
$storageQuota = 250;
$storagePercent = (int) round($storageUsed / max(1, $storageQuota) * 100);
$storageTone = $storagePercent >= 90 ? 'danger' : ($storagePercent >= 85 ? 'warning' : 'accent');
return view('livewire.dashboard', [
'storageUsed' => $storageUsed,
'storageQuota' => $storageQuota,
'storagePercent' => $storagePercent,
'storageTone' => $storageTone,
'activeUsers' => 14,
'lastBackup' => __('dashboard.today_time', ['time' => '04:12']),
'uptime' => '99.98',
'instanceUrl' => 'https://kunde-demo.clupilot.com',
'instanceStatus' => 'active',
'provisioning' => false,
'steps' => [
['label' => __('dashboard.steps.validate'), 'state' => 'done'],
['label' => __('dashboard.steps.provision'), 'state' => 'done'],
['label' => __('dashboard.steps.configure'), 'state' => 'done'],
['label' => __('dashboard.steps.acceptance'), 'state' => 'done'],
],
'activity' => [
['label' => __('dashboard.activity_items.backup_ok'), 'time' => '04:12'],
['label' => __('dashboard.activity_items.user_added'), 'time' => __('dashboard.yesterday')],
['label' => __('dashboard.activity_items.login'), 'time' => __('dashboard.yesterday')],
],
]);
}
}