|
|
@ -17,7 +17,7 @@ type GlobalSettings struct { |
|
|
|
MaxRequestRetries int |
|
|
|
WaitBeforeRetry int |
|
|
|
WebTemplatePrefix string |
|
|
|
WebTemplateRoute string |
|
|
|
WebFrontPlaceholder string |
|
|
|
} |
|
|
|
|
|
|
|
type GlobalSettingsJson struct { |
|
|
@ -27,7 +27,7 @@ type GlobalSettingsJson struct { |
|
|
|
MaxRequestRetries int `json:"maxRequestRetries"` |
|
|
|
WaitBeforeRetry int `json:"waitBeforeRetry"` |
|
|
|
WebTemplatePrefix string `json:"webTemplatePrefix"` |
|
|
|
WebTemplateRoute string `json:"webTemplateRoute"` |
|
|
|
WebFrontPlaceholder string `json:"webFrontPlaceholder"` |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -60,14 +60,14 @@ func (tapit *Tapit) updateGlobalSettings(w http.ResponseWriter, r *http.Request) |
|
|
|
http.Error(w, "Bad request", 400) |
|
|
|
return |
|
|
|
} |
|
|
|
if globalSettingsJson.SecretRegistrationCode != "" && globalSettingsJson.ThreadsPerCampaign != 0 && globalSettingsJson.BcryptCost != 0 && globalSettingsJson.WebTemplatePrefix != "" && globalSettingsJson.WebTemplateRoute != "" { |
|
|
|
if globalSettingsJson.SecretRegistrationCode != "" && globalSettingsJson.ThreadsPerCampaign != 0 && globalSettingsJson.BcryptCost != 0 && globalSettingsJson.WebTemplatePrefix != "" { |
|
|
|
globalSettings.SecretRegistrationCode = globalSettingsJson.SecretRegistrationCode |
|
|
|
globalSettings.ThreadsPerCampaign = globalSettingsJson.ThreadsPerCampaign |
|
|
|
globalSettings.BcryptCost = globalSettingsJson.BcryptCost |
|
|
|
globalSettings.MaxRequestRetries = globalSettingsJson.MaxRequestRetries |
|
|
|
globalSettings.WaitBeforeRetry = globalSettingsJson.WaitBeforeRetry |
|
|
|
globalSettings.WebTemplatePrefix = globalSettingsJson.WebTemplatePrefix |
|
|
|
globalSettings.WebTemplateRoute = globalSettingsJson.WebTemplateRoute |
|
|
|
globalSettings.WebFrontPlaceholder = globalSettingsJson.WebFrontPlaceholder |
|
|
|
err = tapit.db.Save(&globalSettings).Error |
|
|
|
|
|
|
|
if err != nil { |
|
|
@ -96,7 +96,7 @@ func (tapit *Tapit) getGlobalSettings(w http.ResponseWriter, r *http.Request) { |
|
|
|
globalSettingsJson.MaxRequestRetries = globalSettings.MaxRequestRetries |
|
|
|
globalSettingsJson.WaitBeforeRetry = globalSettings.WaitBeforeRetry |
|
|
|
globalSettingsJson.WebTemplatePrefix = globalSettings.WebTemplatePrefix |
|
|
|
globalSettingsJson.WebTemplateRoute = globalSettings.WebTemplateRoute |
|
|
|
globalSettingsJson.WebFrontPlaceholder = globalSettings.WebFrontPlaceholder |
|
|
|
|
|
|
|
jsonResults, err := json.Marshal(globalSettingsJson) |
|
|
|
if err != nil { |
|
|
|