ui/app: per-job overlap policy in job dialog and details panel
- job_dialog.go: add overlap-policy widget.Select with "(Use global default)" → empty, "skip", and "queue" options; pre-selects the job's current value; on save maps the inherit label back to empty string. - app/format.go: add DisplayOverlapPolicy(job, globalPolicy) — returns the policy name when overridden, else "skip/queue (global default)". - ui/jobs_view.go: add "Overlap policy" detail row updated in updateDetails using DisplayOverlapPolicy. - settings_view.go: rename "Overlap policy" label to "Default overlap policy" to clarify it is the global default jobs can override. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -92,6 +92,16 @@ func DisplayStats(rt *domain.JobRuntime) string {
|
||||
rt.RunCount, rt.FailCount, rt.LastDurationMS, rt.AvgDurationMS, rt.MaxDurationMS)
|
||||
}
|
||||
|
||||
// DisplayOverlapPolicy formats a job's effective overlap policy for the details
|
||||
// panel. When the job has its own policy it is shown as-is; when empty (inherit
|
||||
// global), the global default is shown with "(global default)" appended.
|
||||
func DisplayOverlapPolicy(job domain.Job, globalPolicy domain.OverlapPolicy) string {
|
||||
if p := domain.OverlapPolicy(strings.TrimSpace(job.OverlapPolicy)); p != "" {
|
||||
return string(p)
|
||||
}
|
||||
return string(globalPolicy) + " (global default)"
|
||||
}
|
||||
|
||||
// DisplayIndex returns the position of jobIndex in the given slice of indexes,
|
||||
// or 0 if not found.
|
||||
func DisplayIndex(indexes []int, jobIndex int) int {
|
||||
|
||||
Reference in New Issue
Block a user