mirror of
https://github.com/octoleo/syncthing.git
synced 2025-01-03 07:12:27 +00:00
This commit is contained in:
parent
3938b61c3f
commit
4465cdf8bc
@ -306,7 +306,7 @@ func (s *service) Serve(ctx context.Context) error {
|
||||
|
||||
configBuilder.registerConfig("/rest/config")
|
||||
configBuilder.registerConfigInsync("/rest/config/insync") // deprecated
|
||||
configBuilder.registerConfigInsync("/rest/config/restart-required")
|
||||
configBuilder.registerConfigRequiresRestart("/rest/config/restart-required")
|
||||
configBuilder.registerFolders("/rest/config/folders")
|
||||
configBuilder.registerDevices("/rest/config/devices")
|
||||
configBuilder.registerFolder("/rest/config/folders/:id")
|
||||
|
@ -51,6 +51,12 @@ func (c *configMuxBuilder) registerConfigInsync(path string) {
|
||||
})
|
||||
}
|
||||
|
||||
func (c *configMuxBuilder) registerConfigRequiresRestart(path string) {
|
||||
c.HandlerFunc(http.MethodGet, path, func(w http.ResponseWriter, _ *http.Request) {
|
||||
sendJSON(w, map[string]bool{"requiresRestart": c.cfg.RequiresRestart()})
|
||||
})
|
||||
}
|
||||
|
||||
func (c *configMuxBuilder) registerFolders(path string) {
|
||||
c.HandlerFunc(http.MethodGet, path, func(w http.ResponseWriter, _ *http.Request) {
|
||||
sendJSON(w, c.cfg.FolderList())
|
||||
|
Loading…
Reference in New Issue
Block a user