@@ -21,6 +21,19 @@ type Props = {
|
||||
slug: string;
|
||||
is_active: boolean;
|
||||
} | null;
|
||||
installation?: {
|
||||
deployment_type: 'managed_cloud' | 'self_hosted';
|
||||
domain: string | null;
|
||||
status: string;
|
||||
activated_at: string | null;
|
||||
} | null;
|
||||
license?: {
|
||||
plan: string;
|
||||
status: string;
|
||||
max_devices: number;
|
||||
max_users: number;
|
||||
expires_at: string | null;
|
||||
} | null;
|
||||
stats: Record<string, number | boolean>;
|
||||
};
|
||||
|
||||
@@ -30,7 +43,13 @@ const roleLabels = {
|
||||
'TENANT USER': 'Tenant User',
|
||||
};
|
||||
|
||||
export default function Dashboard({ role, tenant, stats }: Props) {
|
||||
export default function Dashboard({
|
||||
role,
|
||||
tenant,
|
||||
installation,
|
||||
license,
|
||||
stats,
|
||||
}: Props) {
|
||||
const { auth } = usePage().props;
|
||||
const isMaster = role === 'MASTER ADMIN';
|
||||
const isTenantAdmin = role === 'TENANT ADMIN';
|
||||
@@ -144,6 +163,42 @@ export default function Dashboard({ role, tenant, stats }: Props) {
|
||||
: 'Akses perangkat Anda mengikuti kebijakan yang ditetapkan oleh Tenant Admin.')}
|
||||
</CardContent>
|
||||
</Card>
|
||||
{!isMaster && installation && (
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<CardTitle>Deployment Tenant</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="flex flex-col justify-between gap-4 text-sm md:flex-row md:items-center">
|
||||
<div>
|
||||
<p className="font-medium">
|
||||
{installation.deployment_type ===
|
||||
'managed_cloud'
|
||||
? 'Cloud RADIQ'
|
||||
: 'Self-hosted / Local'}
|
||||
</p>
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
Status: {installation.status}
|
||||
{installation.domain
|
||||
? ` · ${installation.domain}`
|
||||
: ''}
|
||||
</p>
|
||||
<p className="mt-1 text-muted-foreground">
|
||||
Paket: {license?.plan ?? 'belum ada'} ·
|
||||
Lisensi {license?.status ?? 'belum aktif'}
|
||||
{license?.expires_at &&
|
||||
license.plan !== 'cloud_free'
|
||||
? ` · sampai ${new Date(license.expires_at).toLocaleDateString('id-ID')}`
|
||||
: ''}
|
||||
</p>
|
||||
</div>
|
||||
<Button variant="outline" asChild>
|
||||
<Link href="/documentation/deployment">
|
||||
Panduan Instalasi & Migrasi
|
||||
</Link>
|
||||
</Button>
|
||||
</CardContent>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user