CL3.6b instance overview and CL3.7 domain status badges
This commit is contained in:
@@ -49,6 +49,18 @@ type Props = {
|
||||
>;
|
||||
};
|
||||
|
||||
function getDomainStatusBadge(status: string | null) {
|
||||
const normalized = (status ?? "unknown").toLowerCase();
|
||||
|
||||
if (normalized === "active") return "bg-emerald-100 text-emerald-700";
|
||||
|
||||
if (normalized === "suspended") return "bg-rose-100 text-rose-700";
|
||||
|
||||
if (normalized === "inactive") return "bg-amber-100 text-amber-700";
|
||||
|
||||
return "bg-slate-100 text-slate-600";
|
||||
}
|
||||
|
||||
export function DashboardControls({
|
||||
instances,
|
||||
subscriptions,
|
||||
@@ -351,14 +363,28 @@ export function DashboardControls({
|
||||
<span className="font-medium">{instance.status}</span>
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">
|
||||
Last sync: {formatDateTime(instance.last_sync_at)}
|
||||
{instance.last_sync_status
|
||||
? ` (${instance.last_sync_status})`
|
||||
: ""}
|
||||
Subscriptions: {instance.last_sync_subscriptions ?? 0}
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">
|
||||
Last counts: {instance.last_sync_subscriptions ?? 0}{" "}
|
||||
subscriptions, {instance.last_sync_domains ?? 0} domains
|
||||
Domains: {instance.last_sync_domains ?? 0}
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">
|
||||
Last sync status:{" "}
|
||||
<span
|
||||
className={`inline-flex rounded px-2 py-0.5 text-[11px] font-medium ${
|
||||
instance.last_sync_status === "success"
|
||||
? "bg-emerald-100 text-emerald-700"
|
||||
: instance.last_sync_status === "failed" ||
|
||||
instance.last_sync_status === "error"
|
||||
? "bg-rose-100 text-rose-700"
|
||||
: "bg-slate-100 text-slate-600"
|
||||
}`}
|
||||
>
|
||||
{instance.last_sync_status ?? "unknown"}
|
||||
</span>
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">
|
||||
Last sync time: {formatDateTime(instance.last_sync_at)}
|
||||
</p>
|
||||
<p className="text-xs text-slate-500">
|
||||
Last connected:{" "}
|
||||
@@ -525,7 +551,11 @@ export function DashboardControls({
|
||||
{domain.domain_name}
|
||||
</td>
|
||||
<td className="px-2 py-2">
|
||||
{domain.status ?? "unknown"}
|
||||
<span
|
||||
className={`inline-flex rounded px-2 py-0.5 text-xs font-medium ${getDomainStatusBadge(domain.status)}`}
|
||||
>
|
||||
{domain.status ?? "unknown"}
|
||||
</span>
|
||||
</td>
|
||||
<td className="px-2 py-2">
|
||||
{domain.hosting_type ?? "unknown"}
|
||||
|
||||
Reference in New Issue
Block a user