Merge pull request #769 from AudriusButkevicius/fix

Disable autoupgrade if not supported (fixes #763)
This commit is contained in:
Audrius Butkevicius 2014-10-01 20:08:27 +01:00
commit c4d8d33a60
4 changed files with 9 additions and 6 deletions

View File

@ -1192,6 +1192,9 @@ func autoUpgrade() {
}
rel, err := upgrade.LatestRelease(strings.Contains(Version, "-beta"))
if err == upgrade.ErrUpgradeUnsupported {
return
}
if err != nil {
// Don't complain too loudly here; we might simply not have
// internet connectivity, or the upgrade server might be down.

View File

@ -100,7 +100,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
$scope.reportPreview = false;
$scope.folders = {};
$scope.seenError = '';
$scope.upgradeInfo = {};
$scope.upgradeInfo = null;
$scope.stats = {};
$http.get(urlbase + "/lang").success(function (langs) {
@ -412,7 +412,7 @@ syncthing.controller('SyncthingCtrl', function ($scope, $http, $translate, $loca
$http.get(urlbase + '/upgrade').success(function (data) {
$scope.upgradeInfo = data;
}).error(function () {
$scope.upgradeInfo = {};
$scope.upgradeInfo = null;
});
};

View File

@ -40,7 +40,7 @@
<span class="navbar-brand"><img class="logo" src="img/logo-text-64.png" height="32" width="117"/></span>
<p class="navbar-text hidden-xs">{{thisDeviceName()}}</p>
<ul class="nav navbar-nav navbar-right">
<li ng-if="upgradeInfo.newer">
<li ng-if="upgradeInfo && upgradeInfo.newer">
<button type="button" class="btn navbar-btn btn-primary btn-sm" href="" ng-click="upgrade()">
<span class="glyphicon glyphicon-chevron-up"></span>&emsp;
<span translate translate-value-version="{{upgradeInfo.latest}}">Upgrade To {%version%}</span>
@ -636,7 +636,7 @@
<div class="col-md-6">
<div class="form-group">
<div class="checkbox">
<label>
<label ng-if="upgradeInfo">
<span translate>Automatic upgrades</span> <input id="AutoUpgradeEnabled" type="checkbox" ng-model="tmpOptions.AutoUpgradeEnabled">
</label>
</div>

File diff suppressed because one or more lines are too long