forked from beam/freenas-proxmox
-
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from TheGrandWazoo/master
Fixes for Proxmox 6 and 7 with TrueNAS-Scale support.
- Loading branch information
Showing
3 changed files
with
211 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,189 @@ | ||
--- pvemanagerlib.js.orig 2021-05-27 08:28:35.000000000 -0400 | ||
+++ pvemanagerlib.js 2021-06-10 11:03:15.380175988 -0400 | ||
@@ -7900,6 +7900,7 @@ | ||
alias: ['widget.pveiScsiProviderSelector'], | ||
comboItems: [ | ||
['comstar', 'Comstar'], | ||
+ ['freenas', 'FreeNAS-API'], | ||
['istgt', 'istgt'], | ||
['iet', 'IET'], | ||
['LIO', 'LIO'], | ||
@@ -47367,6 +47368,7 @@ | ||
data: { | ||
isLIO: false, | ||
isComstar: true, | ||
+ isFreeNAS: false, | ||
hasWriteCacheOption: true, | ||
}, | ||
}, | ||
@@ -47379,10 +47381,26 @@ | ||
}, | ||
}, | ||
changeISCSIProvider: function(f, newVal, oldVal) { | ||
+ var me = this; | ||
var vm = this.getViewModel(); | ||
vm.set('isLIO', newVal === 'LIO'); | ||
vm.set('isComstar', newVal === 'comstar'); | ||
- vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'istgt'); | ||
+ vm.set('isFreeNAS', newVal === 'freenas'); | ||
+ vm.set('hasWriteCacheOption', newVal === 'comstar' || newVal === 'freenas' || newVal === 'istgt'); | ||
+ if (newVal !== 'freenas') { | ||
+ me.lookupReference('freenas_use_ssl_field').setValue(false); | ||
+ me.lookupReference('freenas_apiv4_host_field').setValue(''); | ||
+ me.lookupReference('freenas_user_field').setValue(''); | ||
+ me.lookupReference('freenas_user_field').allowBlank = true; | ||
+ me.lookupReference('freenas_password_field').setValue(''); | ||
+ me.lookupReference('freenas_password_field').allowBlank = true; | ||
+ me.lookupReference('freenas_confirmpw_field').setValue(''); | ||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = true; | ||
+ } else { | ||
+ me.lookupReference('freenas_user_field').allowBlank = false; | ||
+ me.lookupReference('freenas_password_field').allowBlank = false; | ||
+ me.lookupReference('freenas_confirmpw_field').allowBlank = false; | ||
+ } | ||
}, | ||
}, | ||
|
||
@@ -47400,6 +47418,7 @@ | ||
}, | ||
|
||
setValues: function(values) { | ||
+ values.freenas_confirmpw = values.freenas_password; | ||
values.writecache = values.nowritecache ? 0 : 1; | ||
this.callParent([values]); | ||
}, | ||
@@ -47416,7 +47435,7 @@ | ||
allowBlank: false, | ||
}, | ||
{ | ||
- xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
+ xtype: 'textfield', | ||
name: 'pool', | ||
value: '', | ||
fieldLabel: gettext('Pool'), | ||
@@ -47426,11 +47445,11 @@ | ||
xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
name: 'blocksize', | ||
value: '4k', | ||
- fieldLabel: gettext('Block Size'), | ||
+ fieldLabel: gettext('ZFS Block Size'), | ||
allowBlank: false, | ||
}, | ||
{ | ||
- xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
+ xtype: 'textfield', | ||
name: 'target', | ||
value: '', | ||
fieldLabel: gettext('Target'), | ||
@@ -47441,9 +47460,34 @@ | ||
name: 'comstar_tg', | ||
value: '', | ||
fieldLabel: gettext('Target group'), | ||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' }, | ||
+ bind: { | ||
+ hidden: '{!isComstar}' | ||
+ }, | ||
allowBlank: true, | ||
}, | ||
+ { | ||
+ xtype: 'proxmoxcheckbox', | ||
+ name: 'freenas_use_ssl', | ||
+ reference: 'freenas_use_ssl_field', | ||
+ inputId: 'freenas_use_ssl_field', | ||
+ checked: false, | ||
+ bind: { | ||
+ hidden: '{!isFreeNAS}' | ||
+ }, | ||
+ uncheckedValue: 0, | ||
+ fieldLabel: gettext('API use SSL'), | ||
+ }, | ||
+ { | ||
+ xtype: 'textfield', | ||
+ name: 'freenas_user', | ||
+ reference: 'freenas_user_field', | ||
+ inputId: 'freenas_user_field', | ||
+ value: '', | ||
+ fieldLabel: gettext('API Username'), | ||
+ bind: { | ||
+ hidden: '{!isFreeNAS}' | ||
+ }, | ||
+ }, | ||
]; | ||
|
||
me.column2 = [ | ||
@@ -47473,7 +47517,9 @@ | ||
xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
name: 'comstar_hg', | ||
value: '', | ||
- bind: me.isCreate ? { disabled: '{!isComstar}' } : { hidden: '{!isComstar}' }, | ||
+ bind: { | ||
+ hidden: '{!isComstar}' | ||
+ }, | ||
fieldLabel: gettext('Host group'), | ||
allowBlank: true, | ||
}, | ||
@@ -47481,9 +47527,62 @@ | ||
xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
name: 'lio_tpg', | ||
value: '', | ||
- bind: me.isCreate ? { disabled: '{!isLIO}' } : { hidden: '{!isLIO}' }, | ||
- allowBlank: false, | ||
+ bind: { | ||
+ hidden: '{!isLIO}' | ||
+ }, | ||
fieldLabel: gettext('Target portal group'), | ||
+ allowBlank: true | ||
+ }, | ||
+ { | ||
+ xtype: 'proxmoxtextfield', | ||
+ name: 'freenas_apiv4_host', | ||
+ reference: 'freenas_apiv4_host_field', | ||
+ value: '', | ||
+ editable: true, | ||
+ emptyText: Proxmox.Utils.noneText, | ||
+ bind: { | ||
+ hidden: '{!isFreeNAS}' | ||
+ }, | ||
+ fieldLabel: gettext('API IPv4 Host'), | ||
+ }, | ||
+ { | ||
+ xtype: 'proxmoxtextfield', | ||
+ name: 'freenas_password', | ||
+ reference: 'freenas_password_field', | ||
+ inputType: me.isCreate ? '' : 'password', | ||
+ value: '', | ||
+ editable: true, | ||
+ emptyText: Proxmox.Utils.noneText, | ||
+ bind: { | ||
+ hidden: '{!isFreeNAS}' | ||
+ }, | ||
+ fieldLabel: gettext('API Password'), | ||
+ change: function(f, value) { | ||
+ if (f.rendered) { | ||
+ f.up().down('field[name=freenas_confirmpw]').validate(); | ||
+ } | ||
+ }, | ||
+ }, | ||
+ { | ||
+ xtype: 'proxmoxtextfield', | ||
+ name: 'freenas_confirmpw', | ||
+ reference: 'freenas_confirmpw_field', | ||
+ inputType: me.isCreate ? '' : 'password', | ||
+ value: '', | ||
+ editable: true, | ||
+ submitValue: false, | ||
+ emptyText: Proxmox.Utils.noneText, | ||
+ bind: { | ||
+ hidden: '{!isFreeNAS}' | ||
+ }, | ||
+ fieldLabel: gettext('Confirm Password'), | ||
+ validator: function(value) { | ||
+ var pw = this.up().down('field[name=freenas_password]').getValue(); | ||
+ if (pw !== value) { | ||
+ return "Passwords do not match!"; | ||
+ } | ||
+ return true; | ||
+ }, | ||
}, | ||
]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters