From 50cb62e56d0f68320f2aea93cb0571398c314e05 Mon Sep 17 00:00:00 2001 From: Jan Klattenhoff Date: Tue, 21 Jan 2025 10:54:12 +0100 Subject: [PATCH] feat(dashboard): add copy link button to dashboard table --- src/app/dashboard/dashboard.component.html | 5 ++++- src/app/dashboard/dashboard.component.ts | 4 ++++ src/app/view-link/view-link.component.html | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/dashboard/dashboard.component.html b/src/app/dashboard/dashboard.component.html index 66e4837..6ab4fff 100644 --- a/src/app/dashboard/dashboard.component.html +++ b/src/app/dashboard/dashboard.component.html @@ -13,7 +13,10 @@ ID - {{element.id}} + + {{element.id}} + + diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index f792206..dbb31e0 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -20,6 +20,10 @@ export class DashboardComponent { constructor(private linkService: LinkService, private router: Router) { }; + copyLink(id: string) { + navigator.clipboard.writeText(window.location.hostname + '/' + id); + } + ngOnInit(): void { this.linkService.getLinks().then(links => { this.links = links; diff --git a/src/app/view-link/view-link.component.html b/src/app/view-link/view-link.component.html index 061042f..a80c841 100644 --- a/src/app/view-link/view-link.component.html +++ b/src/app/view-link/view-link.component.html @@ -1 +1,3 @@

Your are being redirected.

+