Dashboard: make domains clickable links opening in new tab #8

Merged
robbond merged 1 commits from feature/domain-links into master 2026-03-05 11:56:14 +00:00
Showing only changes of commit b221ad45fa - Show all commits

View File

@@ -82,6 +82,12 @@ function isDomainActive(status: string | null) {
);
}
function getDomainHref(domainName: string) {
const normalized = domainName.trim();
if (/^https?:\/\//i.test(normalized)) return normalized;
return `https://${normalized}`;
}
export function DashboardControls({
instances,
subscriptions,
@@ -589,7 +595,14 @@ export function DashboardControls({
filteredDomains.map((domain) => (
<tr key={domain.id} className="border-b border-slate-100">
<td className="px-2 py-2 font-medium text-slate-900">
<p>{domain.domain_name}</p>
<a
href={getDomainHref(domain.domain_name)}
target="_blank"
rel="noopener noreferrer"
className="underline decoration-slate-300 underline-offset-2 hover:text-brand-700"
>
{domain.domain_name}
</a>
{domain.subscription_id ? (
<p className="text-xs font-normal text-slate-500">
Subscription: {domain.subscription_id}