diff --git a/weed/admin/view/app/plugins.templ b/weed/admin/view/app/plugins.templ new file mode 100644 index 000000000..7627ebc1e --- /dev/null +++ b/weed/admin/view/app/plugins.templ @@ -0,0 +1,207 @@ +package app + +import ( + "fmt" + "github.com/seaweedfs/seaweedfs/weed/admin/plugin" +) + +type PluginsPageData struct { + Plugins []plugin.ConnectedPlugin + JobTypes map[string]interface{} +} + +templ PluginsOverview(data PluginsPageData) { +
+

+ Plugins +

+
+ +
+
+ + +
+
+
+
+
+
+
Connected Plugins
+
{ fmt.Sprintf("%d", len(data.Plugins)) }
+
+
+ +
+
+
+
+
+
+
+
+
+
+
Active Jobs
+
+ { + activeJobs := 0 + for _, p := range data.Plugins { + activeJobs += p.ActiveJobs + } + fmt.Sprintf("%d", activeJobs) + } +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
Completed Jobs
+
+ { + completedJobs := 0 + for _, p := range data.Plugins { + completedJobs += p.CompletedJobs + } + fmt.Sprintf("%d", completedJobs) + } +
+
+
+ +
+
+
+
+
+
+
+
+
+
+
Failed Jobs
+
+ { + failedJobs := 0 + for _, p := range data.Plugins { + failedJobs += p.FailedJobs + } + fmt.Sprintf("%d", failedJobs) + } +
+
+
+ +
+
+
+
+
+
+ + +
+
+
Connected Plugins
+
+
+ if len(data.Plugins) == 0 { +
No plugins connected
+ } else { +
+ + + + + + + + + + + + + + + for _, p := range data.Plugins { + + + + + + + + + + + } + +
PluginStatusActiveCompletedFailedCapabilitiesConnectedActions
+ { p.Name }
+ { p.Version } +
+ if p.Status == "healthy" { + Healthy + } else if p.Status == "degraded" { + Degraded + } else { + { p.Status } + } + { fmt.Sprintf("%d", p.ActiveJobs) }{ fmt.Sprintf("%d", p.CompletedJobs) }{ fmt.Sprintf("%d", p.FailedJobs) } + for i, cap := range p.Capabilities { + if i > 0 { + ,  + } + { cap } + } + { p.ConnectedAt.Format("2006-01-02 15:04:05") } + + Config + +
+
+ } +
+
+ + + if len(data.JobTypes) > 0 { +
+
+
Available Job Types
+
+
+
+ for jobType := range data.JobTypes { +
+
+ +
+
+ } +
+
+
+ } +}