duplicati/Duplicati/Server/webroot/ngax/scripts/controllers/ThrottleController.js
2017-06-07 21:03:05 +02:00

22 lines
831 B
JavaScript

backupApp.controller('ThrottleController', function($scope, AppService, ServerStatus, SystemInfo, AppUtils) {
$scope.speedMultipliers = AppUtils.speedMultipliers;
$scope.selection = $scope.$parent.state.CurrentItem;
AppService.get('/serversettings').then(function(data) {
$scope.selection.uploadspeed = data.data['max-upload-speed'];
$scope.selection.downloadspeed = data.data['max-download-speed'];
$scope.selection.uploadthrottleenabled = ($scope.selection.uploadspeed != '');
$scope.selection.downloadthrottleenabled = ($scope.selection.downloadspeed != '');
// Nicer looking UI
if (!$scope.selection.uploadthrottleenabled)
$scope.selection.uploadspeed = "10MB";
if (!$scope.selection.downloadthrottleenabled)
$scope.selection.downloadspeed = "10MB";
}, AppUtils.connectionError);
});