1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
backupApp.controller('HomeController', function ($scope, $location, ServerStatus, BackupList, AppService, DialogService, gettextCatalog) {
$scope.backups = BackupList.watch($scope);
$scope.doRun = function(id) {
AppService.post('/backup/' + id + '/run').then(function() {
if (ServerStatus.state.programState == 'Paused') {
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() {});
};
$scope.doRestore = function(id) {
$location.path('/restore/' + id);
};
$scope.doEdit = function(id) {
$location.path('/edit/' + id);
};
$scope.doExport = function(id) {
$location.path('/export/' + id);
};
$scope.doCompact = function(id) {
AppService.post('/backup/' + id + '/compact');
};
$scope.doDelete = function(id, name) {
$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 = function(duration) {
if (duration != null && duration.indexOf(".") > 0)
return duration.substring(0, duration.length - duration.indexOf("."));
else
return duration;
};
});
|