From 9877c3cc2ecd8a9c1436ead2f286c410fb35ccf5 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 27 Nov 2016 12:00:51 +0100 Subject: [PATCH 1/3] Changed some size options to include the size suffix in the default value --- Duplicati/Library/Main/Options.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Duplicati/Library/Main/Options.cs b/Duplicati/Library/Main/Options.cs index 6f04434a3..88eb42596 100644 --- a/Duplicati/Library/Main/Options.cs +++ b/Duplicati/Library/Main/Options.cs @@ -428,8 +428,8 @@ namespace Duplicati.Library.Main new CommandLineArgument("disable-streaming-transfers", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DisableStreamingShort, Strings.Options.DisableStreamingLong, "false"), - new CommandLineArgument("throttle-upload", CommandLineArgument.ArgumentType.Size, Strings.Options.ThrottleuploadShort, Strings.Options.ThrottleuploadLong, "0"), - new CommandLineArgument("throttle-download", CommandLineArgument.ArgumentType.Size, Strings.Options.ThrottledownloadShort, Strings.Options.ThrottledownloadLong, "0"), + new CommandLineArgument("throttle-upload", CommandLineArgument.ArgumentType.Size, Strings.Options.ThrottleuploadShort, Strings.Options.ThrottleuploadLong, "0kb"), + new CommandLineArgument("throttle-download", CommandLineArgument.ArgumentType.Size, Strings.Options.ThrottledownloadShort, Strings.Options.ThrottledownloadLong, "0kb"), new CommandLineArgument("skip-files-larger-than", CommandLineArgument.ArgumentType.Size, Strings.Options.SkipfileslargerthanShort, Strings.Options.SkipfileslargerthanLong), new CommandLineArgument("upload-unchanged-backups", CommandLineArgument.ArgumentType.Boolean, Strings.Options.UploadUnchangedBackupsShort, Strings.Options.UploadUnchangedBackupsLong, "false"), @@ -469,14 +469,14 @@ namespace Duplicati.Library.Main new CommandLineArgument("dbpath", CommandLineArgument.ArgumentType.Path, Strings.Options.DbpathShort, Strings.Options.DbpathLong), new CommandLineArgument("blocksize", CommandLineArgument.ArgumentType.Size, Strings.Options.BlocksizeShort, Strings.Options.BlocksizeLong, DEFAULT_BLOCKSIZE), - new CommandLineArgument("file-read-buffer-size", CommandLineArgument.ArgumentType.Size, Strings.Options.FilereadbuffersizeShort, Strings.Options.FilereadbuffersizeLong, "0"), + new CommandLineArgument("file-read-buffer-size", CommandLineArgument.ArgumentType.Size, Strings.Options.FilereadbuffersizeShort, Strings.Options.FilereadbuffersizeLong, "0kb"), new CommandLineArgument("store-metadata", CommandLineArgument.ArgumentType.Boolean, Strings.Options.StoremetadataShort, Strings.Options.StoremetadataLong, "true", null, null, Strings.Options.StoremetadataDeprecated), new CommandLineArgument("skip-metadata", CommandLineArgument.ArgumentType.Boolean, Strings.Options.SkipmetadataShort, Strings.Options.SkipmetadataLong, "false"), new CommandLineArgument("restore-permissions", CommandLineArgument.ArgumentType.Boolean, Strings.Options.RestorepermissionsShort, Strings.Options.RestorepermissionsLong, "false"), new CommandLineArgument("skip-restore-verification", CommandLineArgument.ArgumentType.Boolean, Strings.Options.SkiprestoreverificationShort, Strings.Options.SkiprestoreverificationLong, "false"), - new CommandLineArgument("blockhash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.BlockhashlookupsizeShort, Strings.Options.BlockhashlookupsizeLong, "0"), - new CommandLineArgument("filehash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.FilehashlookupsizeShort, Strings.Options.FilehashlookupsizeLong, "0"), - new CommandLineArgument("metadatahash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.MetadatahashlookupsizeShort, Strings.Options.MetadatahashlookupsizeLong, "0"), + new CommandLineArgument("blockhash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.BlockhashlookupsizeShort, Strings.Options.BlockhashlookupsizeLong, "0mb"), + new CommandLineArgument("filehash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.FilehashlookupsizeShort, Strings.Options.FilehashlookupsizeLong, "0mb"), + new CommandLineArgument("metadatahash-lookup-memory", CommandLineArgument.ArgumentType.Size, Strings.Options.MetadatahashlookupsizeShort, Strings.Options.MetadatahashlookupsizeLong, "0mb"), new CommandLineArgument("old-lookup-memory-defaults", CommandLineArgument.ArgumentType.Size, Strings.Options.OldmemorylookupdefaultsShort, Strings.Options.OldmemorylookupdefaultsLong, "false"), new CommandLineArgument("disable-filepath-cache", CommandLineArgument.ArgumentType.Boolean, Strings.Options.DisablefilepathcacheShort, Strings.Options.DisablefilepathcacheLong, "true"), new CommandLineArgument("changed-files", CommandLineArgument.ArgumentType.Path, Strings.Options.ChangedfilesShort, Strings.Options.ChangedfilesLong), From 83762d5664714cb8a554d6028166364f4d37189d Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 27 Nov 2016 12:01:37 +0100 Subject: [PATCH 2/3] Fixed not parsing partially selected size values into invalid size strings. This fixes #2099 --- .../webroot/ngax/scripts/directives/parseAdvancedOption.js | 4 ++-- .../Server/webroot/ngax/scripts/directives/parseSizeNumber.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js b/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js index fde2b57af..7e41f3835 100644 --- a/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js +++ b/Duplicati/Server/webroot/ngax/scripts/directives/parseAdvancedOption.js @@ -179,7 +179,7 @@ backupApp.directive('parseAdvancedOptionSizeNumber', function(AppUtils) { if (name == null) return null; - return name + '=' + txt + multiplier; + return name + '=' + (txt || '0') + (multiplier || ''); }); ctrl[0].$formatters.push(function(src) { @@ -231,7 +231,7 @@ backupApp.directive('parseAdvancedOptionSizeMultiplier', function(AppUtils) { if (name == null) return null; - return name + '=' + (number || '') + txt; + return name + '=' + (number || '0') + (txt || ''); }); ctrl[0].$formatters.push(function(src) { diff --git a/Duplicati/Server/webroot/ngax/scripts/directives/parseSizeNumber.js b/Duplicati/Server/webroot/ngax/scripts/directives/parseSizeNumber.js index 05f6b7466..708a210f7 100644 --- a/Duplicati/Server/webroot/ngax/scripts/directives/parseSizeNumber.js +++ b/Duplicati/Server/webroot/ngax/scripts/directives/parseSizeNumber.js @@ -9,8 +9,7 @@ backupApp.directive('parseSizeNumber', function(AppUtils) { var multiplier = null; ctrl[0].$parsers.push(function(txt) { - txt = txt || '0'; - return txt + (multiplier || ''); + return (txt || '0') + (multiplier || ''); }); ctrl[0].$formatters.push(function(src) { From e2074dcb869932cd56f4135f746ee86f705ee086 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Sun, 27 Nov 2016 12:02:34 +0100 Subject: [PATCH 3/3] Added check to ensure advanced options are expanded by default if the backup contains advanced options. Otherwise they would be hidden by default, making it harder to understand what was happening. --- .../webroot/ngax/scripts/controllers/EditBackupController.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js index 58825ce24..1241585dc 100644 --- a/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js +++ b/Duplicati/Server/webroot/ngax/scripts/controllers/EditBackupController.js @@ -506,6 +506,8 @@ backupApp.controller('EditBackupController', function ($scope, $routeParams, $lo $scope.ExtendedOptions = AppUtils.serializeAdvancedOptionsToArray(extopts); + $scope.showAdvanced = $scope.ExtendedOptions.length > 0; + var now = new Date(); if ($scope.Schedule != null) { var time = AppUtils.parseDate($scope.Schedule.Time);