forked from beam/freenas-proxmox
-
-
Notifications
You must be signed in to change notification settings - Fork 41
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 #97 from TheGrandWazoo/master
Damn copy and paste.
- Loading branch information
Showing
1 changed file
with
168 additions
and
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,189 +1,189 @@ | ||
--- pvemanagerlib.js.orig 2021-03-09 02:22:47.000000000 -0500 | ||
+++ pvemanagerlib.js 2021-03-20 11:52:39.694828636 -0400 | ||
--- pvemanagerlib.js.orig 2021-03-09 02:22:47.000000000 -0500 | ||
+++ pvemanagerlib.js 2021-03-20 11:52:39.694828636 -0400 | ||
@@ -7849,6 +7849,7 @@ | ||
alias: ['widget.pveiScsiProviderSelector'], | ||
comboItems: [ | ||
['comstar', 'Comstar'], | ||
+ ['freenas', 'FreeNAS-API'], | ||
['istgt', 'istgt'], | ||
['iet', 'IET'], | ||
['LIO', 'LIO'], | ||
['comstar', 'Comstar'], | ||
+ ['freenas', 'FreeNAS-API'], | ||
['istgt', 'istgt'], | ||
['iet', 'IET'], | ||
['LIO', 'LIO'], | ||
@@ -46874,6 +46875,7 @@ | ||
data: { | ||
isLIO: false, | ||
isComstar: true, | ||
data: { | ||
isLIO: false, | ||
isComstar: true, | ||
+ isFreeNAS: false, | ||
hasWriteCacheOption: true, | ||
}, | ||
hasWriteCacheOption: true, | ||
}, | ||
}, | ||
@@ -46886,10 +46888,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; | ||
+ } | ||
}, | ||
}, | ||
}, | ||
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; | ||
+ } | ||
}, | ||
}, | ||
|
||
@@ -46907,6 +46925,7 @@ | ||
}, | ||
|
||
setValues: function diff(values) { | ||
+ values.freenas_confirmpw = values.freenas_password; | ||
values.writecache = values.nowritecache ? 0 : 1; | ||
this.callParent([values]); | ||
+ values.freenas_confirmpw = values.freenas_password; | ||
values.writecache = values.nowritecache ? 0 : 1; | ||
this.callParent([values]); | ||
}, | ||
@@ -46923,7 +46942,7 @@ | ||
allowBlank: false, | ||
}, | ||
{ | ||
- xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
+ xtype: 'textfield', | ||
name: 'pool', | ||
value: '', | ||
fieldLabel: gettext('Pool'), | ||
allowBlank: false, | ||
}, | ||
{ | ||
- xtype: me.isCreate ? 'textfield' : 'displayfield', | ||
+ xtype: 'textfield', | ||
name: 'pool', | ||
value: '', | ||
fieldLabel: gettext('Pool'), | ||
@@ -46933,11 +46952,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'), | ||
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'), | ||
@@ -46948,9 +46967,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}' | ||
+ }, | ||
+ }, | ||
]; | ||
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 = [ | ||
me.column2 = [ | ||
@@ -46980,7 +47024,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, | ||
}, | ||
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, | ||
}, | ||
@@ -46988,9 +47034,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; | ||
+ }, | ||
}, | ||
]; | ||
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; | ||
+ }, | ||
}, | ||
]; | ||
|