feat(dashboard): add copy link button to dashboard table

This commit is contained in:
Jan Gleytenhoover 2025-01-21 10:54:12 +01:00
parent 79fc66ef6b
commit 50cb62e56d
Signed by: jank
GPG key ID: 50620ADD22CD330B
3 changed files with 10 additions and 1 deletions

View file

@ -13,7 +13,10 @@
<!-- Position Column -->
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> ID </th>
<td mat-cell *matCellDef="let element"> {{element.id}} </td>
<td mat-cell *matCellDef="let element">
{{element.id}}
<button mat-flat-button class="my-3" (click)="copyLink(element.id)">Copy short url</button>
</td>
</ng-container>
<!-- Name Column -->

View file

@ -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;

View file

@ -1 +1,3 @@
<p>Your are being redirected.</p>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5944102294748899"
crossorigin="anonymous"></script>