package app import ( "encoding/base64" "encoding/json" "fmt" "reflect" "strings" "github.com/seaweedfs/seaweedfs/weed/admin/maintenance" "github.com/seaweedfs/seaweedfs/weed/worker/tasks" "github.com/seaweedfs/seaweedfs/weed/admin/config" "github.com/seaweedfs/seaweedfs/weed/admin/view/components" ) // Helper function to convert task schema to JSON string func taskSchemaToJSON(schema *tasks.TaskConfigSchema) string { if schema == nil { return "{}" } data := map[string]interface{}{ "fields": schema.Fields, } jsonBytes, err := json.Marshal(data) if err != nil { return "{}" } return string(jsonBytes) } // Helper function to base64 encode the JSON to avoid HTML escaping issues func taskSchemaToBase64JSON(schema *tasks.TaskConfigSchema) string { jsonStr := taskSchemaToJSON(schema) return base64.StdEncoding.EncodeToString([]byte(jsonStr)) } templ TaskConfigSchema(data *maintenance.TaskConfigData, schema *tasks.TaskConfigSchema, config interface{}) {
{schema.Description}
Performance: Vacuum operations are I/O intensive and may impact cluster performance.
Safety: Only volumes meeting age and garbage thresholds will be processed.
Recommendation: Monitor cluster load and adjust concurrent limits accordingly.
} else if schema.TaskName == "balance" {Performance: Volume balancing involves data movement and can impact cluster performance.
Safety: Requires adequate server count to ensure data safety during moves.
Recommendation: Run during off-peak hours to minimize impact on production workloads.
} else if schema.TaskName == "erasure_coding" {Performance: Erasure coding is CPU and I/O intensive. Consider running during off-peak hours.
Durability: With 10+4 configuration, can tolerate up to 4 shard failures.
Configuration: Fullness ratio should be between 0.5 and 1.0 (e.g., 0.90 for 90%).
}