feat(dashboard): add links to element IDs in dashboard table

This commit is contained in:
Jan Gleytenhoover 2025-01-21 11:19:48 +01:00
parent 50fa637a35
commit 8302387aa7
Signed by: jank
GPG key ID: 50620ADD22CD330B
2 changed files with 8 additions and 2 deletions

View file

@ -14,7 +14,9 @@
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef> ID </th>
<td mat-cell *matCellDef="let element">
{{element.id}}
<a href="{{element.id}}">
{{element.id}}
</a>
</td>
</ng-container>

View file

@ -21,7 +21,11 @@ export class DashboardComponent {
constructor(private linkService: LinkService, private router: Router) { };
copyLink(id: string) {
navigator.clipboard.writeText(window.location.hostname + '/' + id);
navigator.clipboard.writeText(this.getShortLink(id));
}
getShortLink(id: string): string {
return window.location.hostname + '/' + id;
}
ngOnInit(): void {