Files
s3/weed/admin/view/app/mount_clients.templ
zooqueen dd74d3e6d6 Replace AGPL MinIO fork with Apache-2.0 SeaweedFS fork; rebrand CLI weed->s3
hanzoai/s3 was an AGPL-3.0 MinIO fork whose network-copyleft blocks embedding
and reselling as a managed service. Replace it wholesale with a fork of
SeaweedFS (github.com/seaweedfs/seaweedfs, Apache-2.0, Go) which ships a
built-in S3 gateway + Filer.

- License: AGPL-3.0 -> Apache-2.0 (upstream LICENSE kept verbatim, incl.
  "Copyright 2025 Chris Lu"); NOTICE added crediting SeaweedFS. No AGPL/BUSL/
  SSPL/GPL or enterprise ("ee") files remain.
- Module: go.mod path set to github.com/hanzoai/s3 with a self-replace
  (replace github.com/seaweedfs/seaweedfs => ./) so the ~1800 internal Go files
  keep their upstream import paths with zero churn. Internal identifiers and
  import paths are intentionally NOT renamed.
- CLI rebrand: the binary is built as `s3` (was `weed`); root usage, per-command
  help/usage/flag strings, shell autocomplete program name, and the product name
  in CLI output now read "Hanzo S3" / `s3`. Users never see `weed`.
  (e.g. `s3 server`, `s3 filer`, `s3 master`, `s3 volume`, `s3 s3`, `s3 mount`.)
- Build: `make` (or `go build -o s3 ./weed`) builds the `s3` binary green;
  `cmd/weed-db` and `cmd/weed-sql` also build; `go vet ./weed/command/` clean.
- README/LLM.md rewritten for Hanzo S3; AGENTS.md/CLAUDE.md symlinks preserved.
- Dropped a 33MB prebuilt Mach-O `stress` binary upstream had committed; `.gitignore`
  updated to ignore the `s3` build output.
2026-06-18 23:41:25 -07:00

140 lines
4.1 KiB
Templ

package app
import (
"fmt"
"github.com/seaweedfs/seaweedfs/weed/admin/dash"
)
templ MountClients(data dash.MountClientsData) {
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
<h1 class="h2">
<i class="fas fa-plug me-2"></i>Mount Clients
</h1>
<div class="btn-toolbar mb-2 mb-md-0">
<div class="btn-group me-2">
<button type="button" class="btn btn-sm btn-outline-primary" onclick="exportMountClients()">
<i class="fas fa-download me-1"></i>Export
</button>
</div>
</div>
</div>
<div id="mount-clients-content">
<!-- Summary Cards -->
<div class="row mb-4">
<div class="col-xl-12 col-md-12 mb-4">
<div class="card border-left-info shadow h-100 py-2">
<div class="card-body">
<div class="row no-gutters align-items-center">
<div class="col mr-2">
<div class="text-xs font-weight-bold text-info text-uppercase mb-1">
Connected Mount Clients
</div>
<div class="h5 mb-0 font-weight-bold text-gray-800">
{ fmt.Sprintf("%d", data.TotalMountClients) }
</div>
</div>
<div class="col-auto">
<i class="fas fa-plug fa-2x text-gray-300"></i>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Mount Clients Table -->
<div class="card shadow mb-4">
<div class="card-header py-3">
<h6 class="m-0 font-weight-bold text-primary">
<i class="fas fa-plug me-2"></i>Mount Clients
</h6>
</div>
<div class="card-body">
if len(data.MountClients) > 0 {
<div class="table-responsive">
<table class="table table-hover" id="mountClientsTable">
<thead>
<tr>
<th>Address</th>
<th>Type</th>
<th>Path Prefix</th>
<th>Client ID</th>
<th>Connected Since</th>
<th>Filer</th>
</tr>
</thead>
<tbody>
for _, c := range data.MountClients {
<tr>
<td><code>{ c.Address }</code></td>
<td>
<span class="badge bg-info text-dark">{ c.ClientType }</span>
</td>
<td><code>{ c.PathPrefix }</code></td>
<td>{ fmt.Sprintf("%d", c.ClientId) }</td>
<td>
if !c.ConnectedAt.IsZero() {
{ c.ConnectedAt.Format("2006-01-02 15:04:05") }
} else {
<span class="text-muted">N/A</span>
}
</td>
<td>
<span class="badge bg-light text-dark">{ c.FilerAddress }</span>
</td>
</tr>
}
</tbody>
</table>
</div>
} else {
<div class="text-center py-5">
<i class="fas fa-plug fa-3x text-muted mb-3"></i>
<h5 class="text-muted">No Mount Clients Found</h5>
<p class="text-muted">No FUSE or VFS mounts are currently connected to the cluster's filers.</p>
</div>
}
</div>
</div>
<!-- Last Updated -->
<div class="row">
<div class="col-12">
<small class="text-muted">
<i class="fas fa-clock me-1"></i>
Last updated: { data.LastUpdated.Format("2006-01-02 15:04:05") }
</small>
</div>
</div>
</div>
<script>
function exportMountClients() {
const rows = Array.from(document.querySelectorAll('#mountClientsTable tbody tr')).map(row => {
const cells = row.querySelectorAll('td');
if (cells.length > 1) {
return Array.from(cells).slice(0, 6).map(c => c.textContent.trim());
}
return null;
}).filter(row => row !== null);
// Quote every field and escape embedded quotes so special characters in
// paths (#, ?, %, commas) survive. Build a Blob rather than a data: URI.
const esc = v => '"' + String(v).replace(/"/g, '""') + '"';
const csv = "Address,Type,Path Prefix,Client ID,Connected Since,Filer\n" +
rows.map(r => r.map(esc).join(",")).join("\n");
const blob = new Blob([csv], { type: "text/csv;charset=utf-8;" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.href = url;
link.download = "mount-clients.csv";
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
URL.revokeObjectURL(url);
}
</script>
}