From f4bf18c1b43e5133ca604a1fae7da422c5d57269 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 15 Jan 2019 08:44:46 +0100 Subject: [PATCH] cmd/syncthing, gui: Settings dialog upgrades/reporting for candidates (fixes #4216) (#5457) This adds booleans to the /system/version response to advice the GUI whether the running version is a candidate release or not. (We could parse it from the version string, but why duplicate the logic.) Additionally the settings dialog locks down the upgrade and usage reporting options on candidate releases. This matches the current behavior, it just makes it obvious what actually *can* be chosen. --- cmd/syncthing/gui.go | 5 ++++- gui/default/index.html | 2 +- gui/default/syncthing/core/syncthingController.js | 2 +- gui/default/syncthing/settings/settingsModalView.html | 9 ++++++--- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index aaf9c2ed6..04f383880 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -609,12 +609,15 @@ func (s *apiService) getJSMetadata(w http.ResponseWriter, r *http.Request) { } func (s *apiService) getSystemVersion(w http.ResponseWriter, r *http.Request) { - sendJSON(w, map[string]string{ + sendJSON(w, map[string]interface{}{ "version": Version, "codename": Codename, "longVersion": LongVersion, "os": runtime.GOOS, "arch": runtime.GOARCH, + "isBeta": IsBeta, + "isCandidate": IsCandidate, + "isRelease": IsRelease, }) } diff --git a/gui/default/index.html b/gui/default/index.html index c1d260e9c..e2fc7167c 100644 --- a/gui/default/index.html +++ b/gui/default/index.html @@ -30,7 +30,7 @@ -
+