Files
duplicati/Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js
T

62 lines
1.8 KiB
JavaScript
Raw Normal View History

backupApp.controller('HomeController', function ($scope, $location, ServerStatus, BackupList, AppService, AppUtils, DialogService, gettextCatalog) {
$scope.backups = BackupList.watch($scope);
2015-10-04 17:07:30 +02:00
$scope.doRun = function(id) {
AppService.post('/backup/' + id + '/run').then(function() {
if (ServerStatus.state.programState == 'Paused') {
2016-10-02 16:47:40 +02:00
DialogService.dialog(gettextCatalog.getString('Server paused'), gettextCatalog.getString('Server is currently paused, do you want to resume now?'), [gettextCatalog.getString('No'), gettextCatalog.getString('Yes')], function(ix) {
if (ix == 1)
ServerStatus.resume();
});
}
}, function() {});
2015-10-04 17:07:30 +02:00
};
$scope.doRestore = function(id) {
$location.path('/restore/' + id);
};
$scope.doEdit = function(id) {
$location.path('/edit/' + id);
};
$scope.doExport = function(id) {
$location.path('/export/' + id);
};
2016-08-04 14:31:18 +02:00
$scope.doCompact = function(id) {
AppService.post('/backup/' + id + '/compact');
};
$scope.doDelete = function(id, name) {
2016-10-13 21:45:31 +02:00
$location.path('/delete/' + id);
};
$scope.doLocalDb = function(id) {
$location.path('/localdb/' + id);
};
$scope.doRepairLocalDb = function(id, name) {
AppService.post('/backup/' + id + '/repair');
};
$scope.doVerifyRemote = function(id, name) {
AppService.post('/backup/' + id + '/verify');
};
$scope.doShowLog = function(id, name) {
$location.path('/log/' + id);
};
$scope.doCommandLine = function(id, name) {
$location.path('/commandline/' + id);
};
$scope.doCreateBugReport = function(id, name) {
AppService.post('/backup/' + id + '/createreport');
};
$scope.formatDuration = AppUtils.formatDuration;
});