mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 10:58:57 +00:00
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.
This commit is contained in:
parent
b01edca420
commit
f4bf18c1b4
@ -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,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
<body>
|
||||
<script type="text/javascript" src="syncthing/development/logbar.js"></script>
|
||||
<div ng-if="version.isDevelopmentVersion" ng-include="'syncthing/development/logbar.html'"></div>
|
||||
<div ng-if="version.isBeta" ng-include="'syncthing/development/logbar.html'"></div>
|
||||
<!-- Top bar -->
|
||||
|
||||
<nav class="navbar navbar-top navbar-default" role="navigation">
|
||||
|
@ -124,6 +124,7 @@ angular.module('syncthing.core')
|
||||
refreshThemes();
|
||||
|
||||
$http.get(urlbase + '/system/version').success(function (data) {
|
||||
console.log("version", data);
|
||||
if ($scope.version.version && $scope.version.version !== data.version) {
|
||||
// We already have a version response, but it differs from
|
||||
// the new one. Reload the full GUI in case it's changed.
|
||||
@ -131,7 +132,6 @@ angular.module('syncthing.core')
|
||||
}
|
||||
|
||||
$scope.version = data;
|
||||
$scope.version.isDevelopmentVersion = data.version.indexOf('-') > 0;
|
||||
}).error($scope.emitHTTPError);
|
||||
|
||||
$http.get(urlbase + '/svc/report').success(function (data) {
|
||||
|
@ -70,7 +70,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label translate for="urVersion">Anonymous Usage Reporting</label> (<a href="" translate data-toggle="modal" data-target="#urPreview">Preview</a>)
|
||||
<div ng-if="tmpOptions.upgrades != 'candidate'">
|
||||
<div ng-if="tmpOptions.upgrades != 'candidate' && !version.isCandidate">
|
||||
<select class="form-control" id="urVersion" ng-model="tmpOptions._urAcceptedStr">
|
||||
<option ng-repeat="n in urVersions()" value="{{n}}">{{'Version' | translate}} {{n}}</option>
|
||||
<!-- 1 does not exist, as we did not support incremental formats back then. -->
|
||||
@ -78,7 +78,7 @@
|
||||
<option value="-1" translate>Disabled</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block" ng-if="tmpOptions.upgrades == 'candidate'">
|
||||
<p class="help-block" ng-if="tmpOptions.upgrades == 'candidate' || version.isCandidate"">
|
||||
<span translate>Usage reporting is always enabled for candidate releases.</span>
|
||||
</p>
|
||||
</div>
|
||||
@ -87,13 +87,16 @@
|
||||
<div class="form-group">
|
||||
<label translate>Automatic upgrades</label> <a href="https://docs.syncthing.net/users/releases.html" target="_blank"><span class="fas fa-question-circle"></span> <span translate>Help</span></a>
|
||||
<select class="form-control" ng-model="tmpOptions.upgrades" ng-if="upgradeInfo">
|
||||
<option value="none" translate>No upgrades</option>
|
||||
<option ng-if="!version.isCandidate" value="none" translate>No upgrades</option>
|
||||
<option value="stable" translate>Stable releases only</option>
|
||||
<option value="candidate" translate>Stable releases and release candidates</option>
|
||||
</select>
|
||||
<p class="help-block" ng-if="!upgradeInfo">
|
||||
<span translate>Unavailable/Disabled by administrator or maintainer</span>
|
||||
</p>
|
||||
<p class="help-block" ng-if="version.isCandidate"">
|
||||
<span translate>Automatic upgrades are always enabled for candidate releases.</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user