diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 49c20e4d2..a10c24c4b 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -686,7 +686,8 @@ func restGetSystemUpgrade(w http.ResponseWriter, r *http.Request) { res := make(map[string]interface{}) res["running"] = Version res["latest"] = rel.Tag - res["newer"] = upgrade.CompareVersions(rel.Tag, Version) == 1 + res["newer"] = upgrade.CompareVersions(rel.Tag, Version) == upgrade.Newer + res["majorNewer"] = upgrade.CompareVersions(rel.Tag, Version) == upgrade.MajorNewer w.Header().Set("Content-Type", "application/json; charset=utf-8") json.NewEncoder(w).Encode(res) @@ -727,7 +728,7 @@ func restPostSystemUpgrade(w http.ResponseWriter, r *http.Request) { return } - if upgrade.CompareVersions(rel.Tag, Version) == 1 { + if upgrade.CompareVersions(rel.Tag, Version) > upgrade.Equal { err = upgrade.To(rel) if err != nil { l.Warnln("upgrading:", err) diff --git a/gui/assets/lang/lang-en.json b/gui/assets/lang/lang-en.json index 89e40177e..1f8d30337 100644 --- a/gui/assets/lang/lang-en.json +++ b/gui/assets/lang/lang-en.json @@ -1,4 +1,5 @@ { + "A new major version may not be compatible with previous versions.": "A new major version may not be compatible with previous versions.", "API Key": "API Key", "About": "About", "Add": "Add", @@ -71,6 +72,7 @@ "Later": "Later", "Local Discovery": "Local Discovery", "Local State": "Local State", + "Major Upgrade": "Major Upgrade", "Maximum Age": "Maximum Age", "Metadata Only": "Metadata Only", "Move to top of queue": "Move to top of queue", @@ -89,11 +91,13 @@ "Override Changes": "Override Changes", "Path to the folder on the local computer. Will be created if it does not exist. The tilde character (~) can be used as a shortcut for": "Path to the folder on the local computer. Will be created if it does not exist. The tilde character (~) can be used as a shortcut for", "Path where versions should be stored (leave empty for the default .stversions folder in the folder).": "Path where versions should be stored (leave empty for the default .stversions folder in the folder).", + "Please consult the release notes before performing a major upgrade.": "Please consult the release notes before performing a major upgrade.", "Please wait": "Please wait", "Preview": "Preview", "Preview Usage Report": "Preview Usage Report", "Quick guide to supported patterns": "Quick guide to supported patterns", "RAM Utilization": "RAM Utilization", + "Release Notes": "Release Notes", "Rescan": "Rescan", "Rescan All": "Rescan All", "Rescan Interval": "Rescan Interval", @@ -151,10 +155,12 @@ "The number of versions must be a number and cannot be blank.": "The number of versions must be a number and cannot be blank.", "The path cannot be blank.": "The path cannot be blank.", "The rescan interval must be a non-negative number of seconds.": "The rescan interval must be a non-negative number of seconds.", + "This is a major version upgrade.": "This is a major version upgrade.", "Unknown": "Unknown", "Unshared": "Unshared", "Unused": "Unused", "Up to Date": "Up to Date", + "Upgrade": "Upgrade", "Upgrade To {%version%}": "Upgrade To {{version}}", "Upgrading": "Upgrading", "Upload Rate": "Upload Rate", diff --git a/gui/index.html b/gui/index.html index b6eca55ea..50e9ea581 100644 --- a/gui/index.html +++ b/gui/index.html @@ -38,6 +38,12 @@ Upgrade To {%version%} +