Dashboard: make domains clickable links opening in new tab
This commit is contained in:
@@ -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({
|
export function DashboardControls({
|
||||||
instances,
|
instances,
|
||||||
subscriptions,
|
subscriptions,
|
||||||
@@ -589,7 +595,14 @@ export function DashboardControls({
|
|||||||
filteredDomains.map((domain) => (
|
filteredDomains.map((domain) => (
|
||||||
<tr key={domain.id} className="border-b border-slate-100">
|
<tr key={domain.id} className="border-b border-slate-100">
|
||||||
<td className="px-2 py-2 font-medium text-slate-900">
|
<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 ? (
|
{domain.subscription_id ? (
|
||||||
<p className="text-xs font-normal text-slate-500">
|
<p className="text-xs font-normal text-slate-500">
|
||||||
Subscription: {domain.subscription_id}
|
Subscription: {domain.subscription_id}
|
||||||
|
|||||||
Reference in New Issue
Block a user