Merge pull request 'Dashboard: make domains clickable links opening in new tab' (#8) from feature/domain-links into master
Reviewed-on: http://gitea.lan:3000/robbond/pleskSaas/pulls/8
This commit was merged in pull request #8.
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({
|
||||
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}
|
||||
|
||||
Reference in New Issue
Block a user