diff --git a/app/extensions/storidge/models/profile.js b/app/extensions/storidge/models/profile.js index 9b433825e..e78f7fa52 100644 --- a/app/extensions/storidge/models/profile.js +++ b/app/extensions/storidge/models/profile.js @@ -10,8 +10,8 @@ function StoridgeProfileDefaultModel() { this.MaxBandwidth = 100; this.Filesystem = 'btrfs'; this.SnapshotEnabled = false; - this.SnapshotInterval = 60; - this.SnapshotMax = 1; + this.SnapshotInterval = 0; + this.SnapshotMax = 0; this.EncryptionEnabled = false; this.InterfaceType = 'nfs'; this.InterfaceDriver = ''; diff --git a/app/extensions/storidge/views/profiles/create/createProfileController.js b/app/extensions/storidge/views/profiles/create/createProfileController.js index da767dca3..c46f62f28 100644 --- a/app/extensions/storidge/views/profiles/create/createProfileController.js +++ b/app/extensions/storidge/views/profiles/create/createProfileController.js @@ -50,6 +50,17 @@ function ($scope, $state, $transition$, Notifications, StoridgeProfileService) { delete profile.MaxBandwidth; } + if (profile.SnapshotEnabled && $scope.state.RecurringSnapshotEnabled) { + if (!profile.SnapshotInterval) { + profile.SnapshotInterval = 1; + } + profile.SnapshotInterval *= 60; + } + + if (!$scope.state.RecurringSnapshotEnabled) { + profile.SnapshotInterval = 0; + } + prepareLabels(profile); $scope.state.actionInProgress = true; diff --git a/app/extensions/storidge/views/profiles/create/createprofile.html b/app/extensions/storidge/views/profiles/create/createprofile.html index 038438ad2..2d3ae352b 100644 --- a/app/extensions/storidge/views/profiles/create/createprofile.html +++ b/app/extensions/storidge/views/profiles/create/createprofile.html @@ -105,36 +105,44 @@
- Snapshot interval (s) + Snapshot interval (minutes)
- Snapshot interval (s) + Snapshot interval (minutes)