From 37d1a8ad12a8ea537d6fc6aa1682045a2fab6a03 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Feb 2026 02:07:30 -0800 Subject: [PATCH] feat(plugin): Add job monitoring page template --- weed/admin/view/app/plugin_jobs.templ | 154 ++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 weed/admin/view/app/plugin_jobs.templ diff --git a/weed/admin/view/app/plugin_jobs.templ b/weed/admin/view/app/plugin_jobs.templ new file mode 100644 index 000000000..eda01f2cb --- /dev/null +++ b/weed/admin/view/app/plugin_jobs.templ @@ -0,0 +1,154 @@ +package app + +import ( + "fmt" + "github.com/seaweedfs/seaweedfs/weed/admin/plugin" +) + +type PluginJobsPageData struct { + JobType string + Jobs []plugin.ExecutionRecord + StateFilter string +} + +templ PluginJobsMonitoring(data PluginJobsPageData) { +
+

+ Jobs - { data.JobType } +

+
+
+ + + Back + +
+
+
+ + +
+
+
Filter
+
+
+ +
+
+ + +
+
+
Recent Jobs
+
+
+ if len(data.Jobs) == 0 { +
No jobs found
+ } else { +
+ + + + + + + + + + + + + + + + for _, job := range data.Jobs { + if data.StateFilter == "" || job.State.String() == data.StateFilter { + + + + + + + + + + + + } + } + +
Job IDStatePluginCreatedStartedCompletedRetriesErrorActions
{ job.JobID } + if job.State.String() == "PENDING" { + PENDING + } else if job.State.String() == "RUNNING" { + RUNNING + } else if job.State.String() == "COMPLETED" { + COMPLETED + } else if job.State.String() == "FAILED" { + FAILED + } else if job.State.String() == "CANCELLED" { + CANCELLED + } else { + { job.State.String() } + } + { job.PluginID }{ job.CreatedAt.Format("2006-01-02 15:04:05") } + if job.StartedAt != nil { + { job.StartedAt.Format("2006-01-02 15:04:05") } + } else { + - + } + + if job.CompletedAt != nil { + { job.CompletedAt.Format("2006-01-02 15:04:05") } + } else { + - + } + { fmt.Sprintf("%d", job.RetryCount) } + if job.LastError != "" { + { job.LastError } + } else { + - + } + + if job.State.String() == "PENDING" || job.State.String() == "SCHEDULED" { + + } +
+
+ } +
+
+ + +}