From 405e2812180a9714f95a4b6042a2bc972cfe9004 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Tue, 17 Feb 2026 02:07:48 -0800 Subject: [PATCH] feat(plugin): Add configuration page template --- weed/admin/view/app/plugin_config.templ | 245 ++++++++++++++++++++++++ 1 file changed, 245 insertions(+) create mode 100644 weed/admin/view/app/plugin_config.templ diff --git a/weed/admin/view/app/plugin_config.templ b/weed/admin/view/app/plugin_config.templ new file mode 100644 index 000000000..6d393b50f --- /dev/null +++ b/weed/admin/view/app/plugin_config.templ @@ -0,0 +1,245 @@ +package app + +import ( + "fmt" + "github.com/seaweedfs/seaweedfs/weed/admin/plugin" +) + +type PluginConfigPageData struct { + JobType string + Config plugin.JobTypeConfig + DetectionHistory []plugin.DetectionRecord + ExecutionHistory []plugin.ExecutionRecord + ActiveTab string +} + +templ PluginConfiguration(data PluginConfigPageData) { +
+

+ Configuration - { data.JobType } +

+
+ +
+
+ + +
+
+ +
+
+
+ +
+
+
+ +
+ + +
+
+ +
+
+
+ + +
+
+
+
+ + +
+
+
+ +
+ + +
+ +
+ + +
+ + +
+
+ + +
+ if len(data.DetectionHistory) == 0 { +
No detection records
+ } else { +
+ + + + + + + + + + + + for _, record := range data.DetectionHistory { + + + + + + + + } + +
TimestampTypeSeverityDescriptionResource
{ record.Timestamp.Format("2006-01-02 15:04:05") }{ record.DetectionType } + if record.Severity == "high" { + HIGH + } else if record.Severity == "medium" { + MEDIUM + } else if record.Severity == "low" { + LOW + } else { + { record.Severity } + } + { record.Description }{ record.AffectedResource }
+
+ } +
+ + +
+ if len(data.ExecutionHistory) == 0 { +
No execution records
+ } else { +
+ + + + + + + + + + + + + + for _, record := range data.ExecutionHistory { + + + + + + + + + + } + +
Job IDStateCreatedStartedCompletedRetriesError
{ record.JobID } + if record.State.String() == "COMPLETED" { + COMPLETED + } else if record.State.String() == "FAILED" { + FAILED + } else if record.State.String() == "RUNNING" { + RUNNING + } else { + { record.State.String() } + } + { record.CreatedAt.Format("2006-01-02 15:04:05") } + if record.StartedAt != nil { + { record.StartedAt.Format("2006-01-02 15:04:05") } + } else { + - + } + + if record.CompletedAt != nil { + { record.CompletedAt.Format("2006-01-02 15:04:05") } + } else { + - + } + { fmt.Sprintf("%d", record.RetryCount) } + if record.LastError != "" { + { record.LastError } + } else { + - + } +
+
+ } +
+
+
+
+ + +}