Browse Source

link to volume detail page

pull/6943/head
chrislu 3 months ago
parent
commit
fc55d2d8e0
  1. 15
      weed/admin/view/app/cluster_volumes.templ
  2. 379
      weed/admin/view/app/cluster_volumes_templ.go

15
weed/admin/view/app/cluster_volumes.templ

@ -313,7 +313,11 @@ templ ClusterVolumes(data dash.ClusterVolumesData) {
for _, volume := range data.Volumes { for _, volume := range data.Volumes {
<tr> <tr>
<td> <td>
<code>{fmt.Sprintf("%d", volume.Id)}</code>
<code class="volume-id-link" style="cursor: pointer; text-decoration: underline; color: #0d6efd;"
data-volume-id={fmt.Sprintf("%d", volume.Id)}
title="Click to view volume details">
{fmt.Sprintf("%d", volume.Id)}
</code>
</td> </td>
<td> <td>
<a href={templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", volume.Server))} target="_blank" class="text-decoration-none"> <a href={templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", volume.Server))} target="_blank" class="text-decoration-none">
@ -533,6 +537,15 @@ templ ClusterVolumes(data dash.ClusterVolumesData) {
}); });
}); });
// Add click handlers to volume ID links
document.querySelectorAll('.volume-id-link').forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
const volumeId = this.getAttribute('data-volume-id');
viewVolumeDetails(volumeId);
});
});
// Add click handlers to vacuum buttons // Add click handlers to vacuum buttons
document.querySelectorAll('.vacuum-btn').forEach(button => { document.querySelectorAll('.vacuum-btn').forEach(button => {
button.addEventListener('click', function(e) { button.addEventListener('click', function(e) {

379
weed/admin/view/app/cluster_volumes_templ.go
File diff suppressed because it is too large
View File

Loading…
Cancel
Save