aboutsummaryrefslogtreecommitdiff
path: root/weed/server/volume_server_ui
diff options
context:
space:
mode:
Diffstat (limited to 'weed/server/volume_server_ui')
-rw-r--r--weed/server/volume_server_ui/templates.go191
-rw-r--r--weed/server/volume_server_ui/volume.html194
2 files changed, 198 insertions, 187 deletions
diff --git a/weed/server/volume_server_ui/templates.go b/weed/server/volume_server_ui/templates.go
index 79f1a14a0..8034d8218 100644
--- a/weed/server/volume_server_ui/templates.go
+++ b/weed/server/volume_server_ui/templates.go
@@ -1,6 +1,7 @@
package volume_server_ui
import (
+ _ "embed"
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"html/template"
@@ -26,191 +27,7 @@ var funcMap = template.FuncMap{
"percentFrom": percentFrom,
}
-var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(`<!DOCTYPE html>
-<html>
- <head>
- <title>SeaweedFS {{ .Version }}</title>
- <link rel="stylesheet" href="/seaweedfsstatic/bootstrap/3.3.1/css/bootstrap.min.css">
- <script type="text/javascript" src="/seaweedfsstatic/javascript/jquery-3.6.0.min.js"></script>
- <script type="text/javascript" src="/seaweedfsstatic/javascript/jquery-sparklines/2.1.2/jquery.sparkline.min.js"></script>
- <script type="text/javascript">
- $(function() {
- var periods = ['second', 'minute', 'hour', 'day'];
- for (i = 0; i < periods.length; i++) {
- var period = periods[i];
- $('.inlinesparkline-'+period).sparkline('html', {
- type: 'line',
- barColor: 'red',
- tooltipSuffix:' request per '+period,
- });
- }
- });
- </script>
- <style>
- #jqstooltip{
- height: 28px !important;
- width: 150px !important;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="page-header">
- <h1>
- <a href="https://github.com/chrislusf/seaweedfs"><img src="/seaweedfsstatic/seaweed50x50.png"></img></a>
- SeaweedFS <small>{{ .Version }}</small>
- </h1>
- </div>
-
- <div class="row">
- <div class="col-sm-6">
- <h2>Disk Stats</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Path</th>
- <th>Disk</th>
- <th>Total</th>
- <th>Free</th>
- <th>Usage</th>
- </tr>
- </thead>
- <tbody>
- {{ range .DiskStatuses }}
- <tr>
- <td>{{ .Dir }}</td>
- <td>{{ .DiskType }}</td>
- <td>{{ bytesToHumanReadable .All }}</td>
- <td>{{ bytesToHumanReadable .Free }}</td>
- <td>{{ percentFrom .All .Used}}%</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- </div>
-
- <div class="col-sm-6">
- <h2>System Stats</h2>
- <table class="table table-condensed table-striped">
- <tr>
- <th>Masters</th>
- <td>{{.Masters}}</td>
- </tr>
- <tr>
- <th>Weekly # ReadRequests</th>
- <td><span class="inlinesparkline-day">{{ .Counters.ReadRequests.WeekCounter.ToList | join }}</span></td>
- </tr>
- <tr>
- <th>Daily # ReadRequests</th>
- <td><span class="inlinesparkline-hour">{{ .Counters.ReadRequests.DayCounter.ToList | join }}</span></td>
- </tr>
- <tr>
- <th>Hourly # ReadRequests</th>
- <td><span class="inlinesparkline-minute">{{ .Counters.ReadRequests.HourCounter.ToList | join }}</span></td>
- </tr>
- <tr>
- <th>Last Minute # ReadRequests</th>
- <td><span class="inlinesparkline-second">{{ .Counters.ReadRequests.MinuteCounter.ToList | join }}</span></td>
- </tr>
- {{ range $key, $val := .Stats }}
- <tr>
- <th>{{ $key }}</th>
- <td>{{ $val }}</td>
- </tr>
- {{ end }}
- </table>
- </div>
- </div>
-
- <div class="row">
- <h2>Volumes</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Collection</th>
- <th>Disk</th>
- <th>Data Size</th>
- <th>Files</th>
- <th>Trash</th>
- <th>TTL</th>
- <th>ReadOnly</th>
- </tr>
- </thead>
- <tbody>
- {{ range .Volumes }}
- <tr>
- <td><code>{{ .Id }}</code></td>
- <td>{{ .Collection }}</td>
- <td>{{ .DiskType }}</td>
- <td>{{ bytesToHumanReadable .Size }}</td>
- <td>{{ .FileCount }}</td>
- <td>{{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}}</td>
- <td>{{ .Ttl }}</td>
- <td>{{ .ReadOnly }}</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- </div>
-
- <div class="row">
- <h2>Remote Volumes</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Collection</th>
- <th>Size</th>
- <th>Files</th>
- <th>Trash</th>
- <th>Remote</th>
- <th>Key</th>
- </tr>
- </thead>
- <tbody>
- {{ range .RemoteVolumes }}
- <tr>
- <td><code>{{ .Id }}</code></td>
- <td>{{ .Collection }}</td>
- <td>{{ bytesToHumanReadable .Size }}</td>
- <td>{{ .FileCount }}</td>
- <td>{{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}}</td>
- <td>{{ .RemoteStorageName }}</td>
- <td>{{ .RemoteStorageKey }}</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- </div>
-
- <div class="row">
- <h2>Erasure Coding Shards</h2>
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Id</th>
- <th>Collection</th>
- <th>Shard Size</th>
- <th>Shards</th>
- <th>CreatedAt</th>
- </tr>
- </thead>
- <tbody>
- {{ range .EcVolumes }}
- <tr>
- <td><code>{{ .VolumeId }}</code></td>
- <td>{{ .Collection }}</td>
- <td>{{ bytesToHumanReadable .ShardSize }}</td>
- <td>{{ .ShardIdList }}</td>
- <td>{{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }}</td>
- </tr>
- {{ end }}
- </tbody>
- </table>
- </div>
+//go:embed volume.html
+var volumeHtml string
- </div>
- </body>
-</html>
-`))
+var StatusTpl = template.Must(template.New("status").Funcs(funcMap).Parse(volumeHtml))
diff --git a/weed/server/volume_server_ui/volume.html b/weed/server/volume_server_ui/volume.html
new file mode 100644
index 000000000..973b0bfbe
--- /dev/null
+++ b/weed/server/volume_server_ui/volume.html
@@ -0,0 +1,194 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>SeaweedFS {{ .Version }}</title>
+ <link rel="stylesheet" href="/seaweedfsstatic/bootstrap/3.3.1/css/bootstrap.min.css">
+ <script type="text/javascript" src="/seaweedfsstatic/javascript/jquery-3.6.0.min.js"></script>
+ <script type="text/javascript"
+ src="/seaweedfsstatic/javascript/jquery-sparklines/2.1.2/jquery.sparkline.min.js"></script>
+ <script type="text/javascript">
+ $(function () {
+ var periods = ['second', 'minute', 'hour', 'day'];
+ for (i = 0; i < periods.length; i++) {
+ var period = periods[i];
+ $('.inlinesparkline-' + period).sparkline('html', {
+ type: 'line',
+ barColor: 'red',
+ tooltipSuffix: ' request per ' + period,
+ });
+ }
+ });
+ </script>
+ <style>
+ #jqstooltip {
+ height: 28px !important;
+ width: 150px !important;
+ }
+ </style>
+</head>
+<body>
+<div class="container">
+ <div class="page-header">
+ <h1>
+ <a href="https://github.com/chrislusf/seaweedfs"><img src="/seaweedfsstatic/seaweed50x50.png"></img></a>
+ SeaweedFS <small>{{ .Version }}</small>
+ </h1>
+ </div>
+
+ <div class="row">
+ <div class="col-sm-6">
+ <h2>Disk Stats</h2>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Path</th>
+ <th>Disk</th>
+ <th>Total</th>
+ <th>Free</th>
+ <th>Usage</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .DiskStatuses }}
+ <tr>
+ <td>{{ .Dir }}</td>
+ <td>{{ .DiskType }}</td>
+ <td>{{ bytesToHumanReadable .All }}</td>
+ <td>{{ bytesToHumanReadable .Free }}</td>
+ <td>{{ percentFrom .All .Used}}%</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </div>
+
+ <div class="col-sm-6">
+ <h2>System Stats</h2>
+ <table class="table table-condensed table-striped">
+ <tr>
+ <th>Masters</th>
+ <td>{{.Masters}}</td>
+ </tr>
+ <tr>
+ <th>Weekly # ReadRequests</th>
+ <td><span class="inlinesparkline-day">{{ .Counters.ReadRequests.WeekCounter.ToList | join }}</span>
+ </td>
+ </tr>
+ <tr>
+ <th>Daily # ReadRequests</th>
+ <td><span class="inlinesparkline-hour">{{ .Counters.ReadRequests.DayCounter.ToList | join }}</span>
+ </td>
+ </tr>
+ <tr>
+ <th>Hourly # ReadRequests</th>
+ <td><span
+ class="inlinesparkline-minute">{{ .Counters.ReadRequests.HourCounter.ToList | join }}</span>
+ </td>
+ </tr>
+ <tr>
+ <th>Last Minute # ReadRequests</th>
+ <td><span
+ class="inlinesparkline-second">{{ .Counters.ReadRequests.MinuteCounter.ToList | join }}</span>
+ </td>
+ </tr>
+ {{ range $key, $val := .Stats }}
+ <tr>
+ <th>{{ $key }}</th>
+ <td>{{ $val }}</td>
+ </tr>
+ {{ end }}
+ </table>
+ </div>
+ </div>
+
+ <div class="row">
+ <h2>Volumes</h2>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>Collection</th>
+ <th>Disk</th>
+ <th>Data Size</th>
+ <th>Files</th>
+ <th>Trash</th>
+ <th>TTL</th>
+ <th>ReadOnly</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .Volumes }}
+ <tr>
+ <td><code>{{ .Id }}</code></td>
+ <td>{{ .Collection }}</td>
+ <td>{{ .DiskType }}</td>
+ <td>{{ bytesToHumanReadable .Size }}</td>
+ <td>{{ .FileCount }}</td>
+ <td>{{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}}</td>
+ <td>{{ .Ttl }}</td>
+ <td>{{ .ReadOnly }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </div>
+
+ <div class="row">
+ <h2>Remote Volumes</h2>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>Collection</th>
+ <th>Size</th>
+ <th>Files</th>
+ <th>Trash</th>
+ <th>Remote</th>
+ <th>Key</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .RemoteVolumes }}
+ <tr>
+ <td><code>{{ .Id }}</code></td>
+ <td>{{ .Collection }}</td>
+ <td>{{ bytesToHumanReadable .Size }}</td>
+ <td>{{ .FileCount }}</td>
+ <td>{{ .DeleteCount }} / {{bytesToHumanReadable .DeletedByteCount}}</td>
+ <td>{{ .RemoteStorageName }}</td>
+ <td>{{ .RemoteStorageKey }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </div>
+
+ <div class="row">
+ <h2>Erasure Coding Shards</h2>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th>Id</th>
+ <th>Collection</th>
+ <th>Shard Size</th>
+ <th>Shards</th>
+ <th>CreatedAt</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{ range .EcVolumes }}
+ <tr>
+ <td><code>{{ .VolumeId }}</code></td>
+ <td>{{ .Collection }}</td>
+ <td>{{ bytesToHumanReadable .ShardSize }}</td>
+ <td>{{ .ShardIdList }}</td>
+ <td>{{ .CreatedAt.Format "02 Jan 06 15:04 -0700" }}</td>
+ </tr>
+ {{ end }}
+ </tbody>
+ </table>
+ </div>
+
+</div>
+</body>
+</html>