Skip to content
This repository was archived by the owner on Oct 11, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
}
},
Expand Down
15 changes: 15 additions & 0 deletions ui/sections/storage/inspectors/volume.reel/volume.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
},
"bindings": {
"context": {"<-": "@owner.context"},
"classList.has('other-confirmation-is-visible')": {"<-": "@owner.isUpgradeConfirmationVisible"},
"isConfirmationVisible": {"<-": "@owner.isConfirmationVisible"}
}
},
Expand Down Expand Up @@ -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.'"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a property to avoid creating a useless binding.

}
},
"upgrade": {
"prototype": "blue-shark/ui/button.reel",
"properties": {
Expand Down Expand Up @@ -196,6 +210,7 @@
<body>
<div data-montage-id="owner" class="Volume">
<div data-montage-id="inspector">
<div data-montage-id="confirmationUpgrade" class="Inspector-confirmationMessage other-confirmation"></div>
<div class="Volume-header">
<div data-montage-id="volumeIcon" class="Volume-header-icon"></div>
<div class="Volume-header-info">
Expand Down
15 changes: 14 additions & 1 deletion ui/sections/storage/inspectors/volume.reel/volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},

Expand Down Expand Up @@ -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);
}
},
Expand Down