mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-23 07:08:24 +00:00
Remove dead code from previous commit
This commit is contained in:
parent
f40f3b3b7b
commit
9cd6b85c09
@ -108,8 +108,6 @@ func startGUI(cfg config.GUIConfiguration, assetDir string, m *model.Model) erro
|
|||||||
router.Post("/rest/error", restPostError)
|
router.Post("/rest/error", restPostError)
|
||||||
router.Post("/rest/error/clear", restClearErrors)
|
router.Post("/rest/error/clear", restClearErrors)
|
||||||
router.Post("/rest/discovery/hint", restPostDiscoveryHint)
|
router.Post("/rest/discovery/hint", restPostDiscoveryHint)
|
||||||
router.Post("/rest/report/enable", restPostReportEnable)
|
|
||||||
router.Post("/rest/report/disable", restPostReportDisable)
|
|
||||||
|
|
||||||
mr := martini.New()
|
mr := martini.New()
|
||||||
mr.Use(csrfMiddleware)
|
mr.Use(csrfMiddleware)
|
||||||
@ -388,33 +386,6 @@ func getQR(w http.ResponseWriter, params martini.Params) {
|
|||||||
w.Write(code.PNG())
|
w.Write(code.PNG())
|
||||||
}
|
}
|
||||||
|
|
||||||
func restPostReportEnable(m *model.Model) {
|
|
||||||
if cfg.Options.UREnabled {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.Options.UREnabled = true
|
|
||||||
cfg.Options.URDeclined = false
|
|
||||||
cfg.Options.URAccepted = usageReportVersion
|
|
||||||
|
|
||||||
go usageReportingLoop(m)
|
|
||||||
sendUsageRport(m)
|
|
||||||
saveConfig()
|
|
||||||
}
|
|
||||||
|
|
||||||
func restPostReportDisable(m *model.Model) {
|
|
||||||
if !cfg.Options.UREnabled {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg.Options.UREnabled = false
|
|
||||||
cfg.Options.URDeclined = true
|
|
||||||
cfg.Options.URAccepted = 0
|
|
||||||
|
|
||||||
stopUsageReporting()
|
|
||||||
saveConfig()
|
|
||||||
}
|
|
||||||
|
|
||||||
func basic(username string, passhash string) http.HandlerFunc {
|
func basic(username string, passhash string) http.HandlerFunc {
|
||||||
return func(res http.ResponseWriter, req *http.Request) {
|
return func(res http.ResponseWriter, req *http.Request) {
|
||||||
if validAPIKey(req.Header.Get("X-API-Key")) {
|
if validAPIKey(req.Header.Get("X-API-Key")) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user