Browse Source

adjust volume server link

pull/7423/head
chrislu 3 weeks ago
parent
commit
fb46a8a61f
  1. 30
      weed/admin/view/app/cluster_volume_servers.templ
  2. 408
      weed/admin/view/app/cluster_volume_servers_templ.go

30
weed/admin/view/app/cluster_volume_servers.templ

@ -113,10 +113,17 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) {
for _, host := range data.VolumeServers { for _, host := range data.VolumeServers {
<tr> <tr>
<td> <td>
if host.PublicURL != "" {
<a href={templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", host.PublicURL))} target="_blank" class="text-decoration-none"> <a href={templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", host.PublicURL))} target="_blank" class="text-decoration-none">
{host.Address} {host.Address}
<i class="fas fa-external-link-alt ms-1 text-muted"></i> <i class="fas fa-external-link-alt ms-1 text-muted"></i>
</a> </a>
} else {
<a href={templ.SafeURL(fmt.Sprintf("http://%s/ui/index.html", host.Address))} target="_blank" class="text-decoration-none">
{host.Address}
<i class="fas fa-external-link-alt ms-1 text-muted"></i>
</a>
}
</td> </td>
<td> <td>
<span class="badge bg-light text-dark">{host.DataCenter}</span> <span class="badge bg-light text-dark">{host.DataCenter}</span>
@ -165,6 +172,7 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) {
</div> </div>
</td> </td>
<td> <td>
if host.PublicURL != "" {
<button type="button" <button type="button"
class="btn btn-outline-primary btn-sm" class="btn btn-outline-primary btn-sm"
title="View Details" title="View Details"
@ -183,6 +191,26 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) {
data-last-heartbeat={host.LastHeartbeat.Format("2006-01-02 15:04:05")}> data-last-heartbeat={host.LastHeartbeat.Format("2006-01-02 15:04:05")}>
<i class="fas fa-eye"></i> <i class="fas fa-eye"></i>
</button> </button>
} else {
<button type="button"
class="btn btn-outline-primary btn-sm"
title="View Details"
data-action="view-details"
data-id={host.ID}
data-address={host.Address}
data-public-url={host.Address}
data-datacenter={host.DataCenter}
data-rack={host.Rack}
data-volumes={fmt.Sprintf("%d", host.Volumes)}
data-max-volumes={fmt.Sprintf("%d", host.MaxVolumes)}
data-disk-usage={fmt.Sprintf("%d", host.DiskUsage)}
data-disk-capacity={fmt.Sprintf("%d", host.DiskCapacity)}
data-ec-volumes={fmt.Sprintf("%d", host.EcVolumes)}
data-ec-shards={fmt.Sprintf("%d", host.EcShards)}
data-last-heartbeat={host.LastHeartbeat.Format("2006-01-02 15:04:05")}>
<i class="fas fa-eye"></i>
</button>
}
</td> </td>
</tr> </tr>
} }
@ -306,7 +334,7 @@ templ ClusterVolumeServers(data dash.ClusterVolumeServersData) {
'<div class="col-12">' + '<div class="col-12">' +
'<h6 class="text-primary"><i class="fas fa-link me-1"></i>Quick Actions</h6>' + '<h6 class="text-primary"><i class="fas fa-link me-1"></i>Quick Actions</h6>' +
'<div class="d-grid gap-2 d-md-flex">' + '<div class="d-grid gap-2 d-md-flex">' +
'<a href="http://' + server.publicUrl + '/ui/index.html" target="_blank" class="btn btn-outline-primary">' +
'<a href="http://' + (server.publicUrl || server.address) + '/ui/index.html" target="_blank" class="btn btn-outline-primary">' +
'<i class="fas fa-external-link-alt me-1"></i>Open Volume Server UI' + '<i class="fas fa-external-link-alt me-1"></i>Open Volume Server UI' +
'</a>' + '</a>' +
'<a href="/cluster/volumes?server=' + encodeURIComponent(server.address) + '" class="btn btn-outline-info">' + '<a href="/cluster/volumes?server=' + encodeURIComponent(server.address) + '" class="btn btn-outline-info">' +

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

Loading…
Cancel
Save