webadmin: Give better feedback on update schedule saving

This commit is contained in:
Johannes Zellner
2017-01-28 14:49:07 -08:00
parent 21e3300396
commit 8dc9d4c083
2 changed files with 6 additions and 2 deletions

View File

@@ -394,7 +394,7 @@
<div class="col-md-12">
Configure the auto-update schedule for the platform and for the installed apps:<br/>
<br/>
<p class="text-danger text-center" ng-show="autoUpdate.error">{{ autoUpdate.error }}</p>
<p class="text-danger text-center text-bold" ng-show="autoUpdate.error">{{ autoUpdate.error }}</p>
</div>
</div>
@@ -423,7 +423,8 @@
<div class="row">
<div class="col-md-12">
<button class="btn btn-outline btn-primary pull-right" ng-click="autoUpdate.submit()" ng-disabled="autoUpdate.busy || autoUpdate.pattern === autoUpdate.currentPattern"><i class="fa fa-circle-o-notch fa-spin" ng-show="autoUpdate.busy"></i> Save</button>
<p class="text-success pull-right text-bold" ng-show="autoUpdate.success && autoUpdate.pattern === autoUpdate.currentPattern">Saved</p>
<button class="btn btn-outline btn-primary pull-right" ng-hide="autoUpdate.success && autoUpdate.pattern === autoUpdate.currentPattern" ng-click="autoUpdate.submit()" ng-disabled="autoUpdate.busy || autoUpdate.pattern === autoUpdate.currentPattern"><i class="fa fa-circle-o-notch fa-spin" ng-show="autoUpdate.busy"></i> Save</button>
</div>
</div>
</div>

View File

@@ -422,6 +422,7 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.autoUpdate = {
busy: false,
success: false,
error: '',
pattern: '',
currentPattern: '',
@@ -431,12 +432,14 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
$scope.autoUpdate.error = '';
$scope.autoUpdate.busy = true;
$scope.autoUpdate.success = false;
Client.setAutoupdatePattern($scope.autoUpdate.pattern, function (error) {
if (error) $scope.autoUpdate.error = error.message;
else $scope.autoUpdate.currentPattern = $scope.autoUpdate.pattern;
$scope.autoUpdate.busy = false;
$scope.autoUpdate.success = true;
});
}
};