Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js')
-rw-r--r--Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js21
1 files changed, 2 insertions, 19 deletions
diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js
index 3b6266fb0..f66252270 100644
--- a/Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js
+++ b/Duplicati/Server/webroot/ngax/scripts/controllers/HomeController.js
@@ -1,4 +1,4 @@
-backupApp.controller('HomeController', function ($scope, $location, ServerStatus, BackupList, AppService, DialogService, gettextCatalog) {
+backupApp.controller('HomeController', function ($scope, $location, ServerStatus, BackupList, AppService, AppUtils, DialogService, gettextCatalog) {
$scope.backups = BackupList.watch($scope);
$scope.doRun = function(id) {
@@ -57,22 +57,5 @@ backupApp.controller('HomeController', function ($scope, $location, ServerStatus
AppService.post('/backup/' + id + '/createreport');
};
- $scope.formatDuration = function(duration) {
- // parse days if timespan is over 24 hours long
- var days = 0;
- if (duration != null && duration.indexOf(".") < 7) {
- days = duration.substring(0, duration.indexOf("."));
- duration = duration.substring(duration.indexOf(".")+1, duration.length);
- }
-
- // strip miliseconds
- if (duration != null && duration.indexOf(".") > 0)
- duration = duration.substring(0, duration.indexOf("."));
-
- // prefix the days if applicable
- if (days != 0)
- return days + ":" + duration;
- else
- return duration;
- };
+ $scope.formatDuration = AppUtils.formatDuration;
});