From 5a900b413492464136f794418b408181d5ac8aa5 Mon Sep 17 00:00:00 2001 From: Erin Clark Date: Wed, 5 Apr 2017 16:13:14 -0700 Subject: [PATCH 1/2] Add confirmation dialog for entercrypted volume creation Ticket: #22893 --- .../storage/inspectors/volume-creator.reel/volume-creator.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/sections/storage/inspectors/volume-creator.reel/volume-creator.html b/ui/sections/storage/inspectors/volume-creator.reel/volume-creator.html index d5369550c1..88579c9058 100644 --- a/ui/sections/storage/inspectors/volume-creator.reel/volume-creator.html +++ b/ui/sections/storage/inspectors/volume-creator.reel/volume-creator.html @@ -29,11 +29,13 @@ "canRevert": true, "scrollViewDelegate": {"@": "owner"}, "controller": {"@": "owner"}, + "confirmSaveMessage": "Are you sure you want to use encryption for this volume? Data loss can result if keys or passwords are lost!", "canSave": true }, "bindings": { "isLoading": {"<-": "@owner.isLoading"}, "context": {"<-": "@owner.context"}, + "needSaveConfirmation": {"<-": "@owner.object._password || @owner.object.key_encrypted"}, "isSaveDisabled": {"<-": "@owner.object.topology.data.length == 0"} } }, From f7f7ec69c62d651a3046e6282df76f348b36d866 Mon Sep 17 00:00:00 2001 From: Erin Clark Date: Wed, 5 Apr 2017 16:13:55 -0700 Subject: [PATCH 2/2] Add confirmation message for upgrading your volume Ticket: #22893 --- .../storage/inspectors/volume.reel/volume.html | 15 +++++++++++++++ .../storage/inspectors/volume.reel/volume.js | 15 ++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ui/sections/storage/inspectors/volume.reel/volume.html b/ui/sections/storage/inspectors/volume.reel/volume.html index c990f55c4d..825ad1f9b4 100644 --- a/ui/sections/storage/inspectors/volume.reel/volume.html +++ b/ui/sections/storage/inspectors/volume.reel/volume.html @@ -57,6 +57,7 @@ }, "bindings": { "context": {"<-": "@owner.context"}, + "classList.has('other-confirmation-is-visible')": {"<-": "@owner.isUpgradeConfirmationVisible"}, "isConfirmationVisible": {"<-": "@owner.isConfirmationVisible"} } }, @@ -161,6 +162,19 @@ "classList.has('hide')": {"<-": "@owner.object.status == 'LOCKED'"} } }, + "confirmationUpgrade": { + "prototype": "ui/inspectors/inspector.reel/inspector-confirmation.reel", + "properties": { + "element": {"#": "confirmationUpgrade"}, + "inspector": {"@": "owner"}, + "confirmMethod": "confirmUpgrade", + "cancelMethod": "cancelUpgrade", + "confirmLabel": "Upgrade" + }, + "bindings": { + "confirmMessage": {"<-": "'Are you sure you want to upgrade your volume? Once it is upgraded you will no longer be able to import it on previous versions of FreeNAS.'"} + } + }, "upgrade": { "prototype": "blue-shark/ui/button.reel", "properties": { @@ -196,6 +210,7 @@
+
diff --git a/ui/sections/storage/inspectors/volume.reel/volume.js b/ui/sections/storage/inspectors/volume.reel/volume.js index 3648ae3a81..55412d7afb 100644 --- a/ui/sections/storage/inspectors/volume.reel/volume.js +++ b/ui/sections/storage/inspectors/volume.reel/volume.js @@ -45,6 +45,7 @@ exports.Volume = AbstractInspector.specialize({ this._setVolumeDatasets(); this.sharesEventListener = this.eventDispatcherService.addEventListener('sharesChange', this._handleSharesChange.bind(this)); this.datasetsEventListener = this.eventDispatcherService.addEventListener('volumeDatasetsChange', this._handleDatasetsChange.bind(this)); + this.isUpgradeConfirmationVisible = false; } }, @@ -114,7 +115,19 @@ exports.Volume = AbstractInspector.specialize({ }, handleUpgradeAction: { - value: function () { + value: function() { + this.isUpgradeConfirmationVisible = true; + } + }, + + cancelUpgrade: { + value: function() { + this.isUpgradeConfirmationVisible = false; + } + }, + + confirmUpgrade: { + value: function() { this._sectionService.upgradeVolume(this.object); } },