Copy chart link button

This commit is contained in:
Geomitron
2024-01-17 17:25:56 -06:00
parent 8855d532b9
commit ad5d6fab9c
3 changed files with 12 additions and 0 deletions

View File

@@ -74,6 +74,7 @@
@if (displayVersions.length > 1) {
<th></th>
}
<th></th>
<th class="text-neutral-content">Uploaded</th>
<th>
<span
@@ -105,6 +106,13 @@
[formControl]="selectedVersion" />
</td>
}
<td class="px-0">
<div class="tooltip tooltip-accent tooltip-right" data-tip="Copy chart link">
<button class="btn btn-circle btn-ghost btn-xs" (click)="copyLink(version.md5)">
<i class="bi bi-link-45deg text-lg -mt-0.5"></i>
</button>
</div>
</td>
<td>{{ version.modifiedTime | date: 'y/MM/dd' }}</td>
<td>
<div class="flex flex-nowrap items-center">

View File

@@ -73,6 +73,9 @@ export class ChartSidebarMenutComponent implements OnInit {
.replace(/^\/|\/$/g, '')
}
copyLink(hash: string) {
navigator.clipboard.writeText(`https://enchor.us/?hash=${hash}`)
}
copyHash(hash: string) {
navigator.clipboard.writeText(hash)
}

View File

@@ -172,6 +172,7 @@ export class ChartSidebarComponent implements OnInit {
.uniq()
.value(),
}))
.filter(g => g.issues.length > 0)
.value()
}