add inter-section dependency for settings

Currently used to hide all email sections when [email]/method is blank
(disabled).
This commit is contained in:
Harvey Tindall
2021-01-31 18:50:04 +00:00
parent ce98b2eb5a
commit 456ef556b1
7 changed files with 136 additions and 126 deletions
+5 -3
View File
@@ -138,8 +138,10 @@ type configDTO map[string]interface{}
// Below are for sending config
type meta struct {
Name string `json:"name"`
Description string `json:"description"`
Name string `json:"name"`
Description string `json:"description"`
DependsTrue string `json:"depends_true,omitempty"`
DependsFalse string `json:"depends_false,omitempty"`
}
type setting struct {
@@ -149,7 +151,7 @@ type setting struct {
RequiresRestart bool `json:"requires_restart"`
Type string `json:"type"` // Type (string, number, bool, etc.)
Value interface{} `json:"value"`
Options []string `json:"options,omitempty"`
Options [][2]string `json:"options,omitempty"`
DependsTrue string `json:"depends_true,omitempty"` // If specified, this field is enabled when the specified bool setting is enabled.
DependsFalse string `json:"depends_false,omitempty"` // If specified, opposite behaviour of DependsTrue.
}