feat: add Cancel and Defaults buttons to Settings
Cancel discards unsaved edits by reloading the saved config; Defaults loads built-in default values into the form for review before saving. Extracts the default config into domain.DefaultConfig() so the store and settings UI share one source of truth. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -62,6 +62,25 @@ type Config struct {
|
||||
Theme Theme `json:"theme,omitempty"`
|
||||
}
|
||||
|
||||
// DefaultConfig returns the built-in default settings. It is the config used
|
||||
// when gosentry.json does not yet exist, and is also what the Settings UI
|
||||
// offers to restore via its "Defaults" button.
|
||||
func DefaultConfig() Config {
|
||||
return Config{
|
||||
JobsDir: ".",
|
||||
LogsDir: "logs",
|
||||
MaxLogFiles: 100,
|
||||
MaxLogAgeDays: 30,
|
||||
StartOnLogin: false,
|
||||
KeepRunningInTray: true,
|
||||
NotifyOnFailure: true,
|
||||
ExecutionMode: ExecutionModeParallel,
|
||||
OverlapPolicy: OverlapPolicySkip,
|
||||
Theme: ThemeDefault,
|
||||
DefaultTimeoutSeconds: 30,
|
||||
}
|
||||
}
|
||||
|
||||
// JobsFile is the on-disk shape of jobs.json. Wrapping the slice in a top-level
|
||||
// object leaves room for future metadata without breaking the basic file format.
|
||||
type JobsFile struct {
|
||||
|
||||
Reference in New Issue
Block a user