[pve-devel] [PATCH manager] Rename 'create' to 'isCreate' in pveWindowEdit and subclasses
Emmanuel Kasper
e.kasper at proxmox.com
Tue Feb 28 14:26:49 CET 2017
This fixes around 20 jslint type confusion warnings.
Also reduce the scope and document jslint warnings along the way.
No functional changes.
---
www/manager6/ceph/Monitor.js | 4 ++--
www/manager6/ceph/OSD.js | 11 +++++----
www/manager6/ceph/Pool.js | 5 +----
www/manager6/dc/ACLView.js | 4 ++--
www/manager6/dc/AuthEdit.js | 20 ++++++++---------
www/manager6/dc/Backup.js | 18 ++++++++-------
www/manager6/dc/GroupEdit.js | 8 +++----
www/manager6/dc/PoolEdit.js | 8 +++----
www/manager6/dc/SecurityGroups.js | 8 +++----
www/manager6/dc/UserEdit.js | 12 +++++-----
www/manager6/grid/FirewallAliases.js | 13 +++++------
www/manager6/grid/FirewallRules.js | 24 ++++++++++----------
www/manager6/grid/PoolMembers.js | 21 +++++++++---------
www/manager6/ha/GroupEdit.js | 12 +++++-----
www/manager6/ha/ResourceEdit.js | 16 ++++++-------
www/manager6/lxc/CreateWizard.js | 7 ++----
www/manager6/lxc/DNS.js | 2 +-
www/manager6/lxc/Network.js | 14 ++++++------
www/manager6/lxc/ResourceEdit.js | 14 ++++++------
www/manager6/node/NetworkEdit.js | 42 +++++++++++++++++------------------
www/manager6/panel/IPSet.js | 14 ++++++------
www/manager6/qemu/CDEdit.js | 4 +---
www/manager6/qemu/CreateWizard.js | 5 +----
www/manager6/qemu/HDEdit.js | 19 ++++++++++------
www/manager6/qemu/HDEfi.js | 5 +----
www/manager6/qemu/HDThrottle.js | 4 +---
www/manager6/qemu/NetworkEdit.js | 4 ++--
www/manager6/storage/DirEdit.js | 18 +++++++--------
www/manager6/storage/GlusterFsEdit.js | 22 +++++++++---------
www/manager6/storage/IScsiEdit.js | 20 ++++++++---------
www/manager6/storage/LVMEdit.js | 22 +++++++++---------
www/manager6/storage/LvmThinEdit.js | 30 ++++++++++++-------------
www/manager6/storage/NFSEdit.js | 20 ++++++++---------
www/manager6/storage/RBDEdit.js | 20 ++++++++---------
www/manager6/storage/SheepdogEdit.js | 16 ++++++-------
www/manager6/storage/ZFSEdit.js | 28 +++++++++++------------
www/manager6/storage/ZFSPoolEdit.js | 16 ++++++-------
www/manager6/window/Edit.js | 18 +++++++--------
38 files changed, 268 insertions(+), 280 deletions(-)
diff --git a/www/manager6/ceph/Monitor.js b/www/manager6/ceph/Monitor.js
index 2e0a448..af7ffe7 100644
--- a/www/manager6/ceph/Monitor.js
+++ b/www/manager6/ceph/Monitor.js
@@ -14,7 +14,7 @@ Ext.define('PVE.CephCreateMon', {
},
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
if (!me.nodename) {
@@ -23,7 +23,7 @@ Ext.define('PVE.CephCreateMon', {
me.setNode(me.nodename);
- me.create = true;
+ me.isCreate = true;
Ext.applyIf(me, {
method: 'POST',
diff --git a/www/manager6/ceph/OSD.js b/www/manager6/ceph/OSD.js
index af96741..8170f17 100644
--- a/www/manager6/ceph/OSD.js
+++ b/www/manager6/ceph/OSD.js
@@ -82,14 +82,13 @@ Ext.define('PVE.CephCreateOsd', {
showProgress: true,
initComponent : function() {
- /*jslint confusion: true */
var me = this;
if (!me.nodename) {
throw "no node name specified";
}
- me.create = true;
+ me.isCreate = true;
Ext.applyIf(me, {
url: "/nodes/" + me.nodename + "/ceph/osd",
@@ -139,7 +138,7 @@ Ext.define('PVE.CephRemoveOsd', {
}
],
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
if (!me.nodename) {
@@ -149,12 +148,12 @@ Ext.define('PVE.CephRemoveOsd', {
throw "no osdid specified";
}
- me.create = true;
+ me.isCreate = true;
- me.title = gettext('Remove') + ': ' + 'Ceph OSD osd.' + me.osdid;
+ me.title = gettext('Remove') + ': ' + 'Ceph OSD osd.' + me.osdid.toString();
Ext.applyIf(me, {
- url: "/nodes/" + me.nodename + "/ceph/osd/" + me.osdid
+ url: "/nodes/" + me.nodename + "/ceph/osd/" + me.osdid.toString()
});
me.callParent();
diff --git a/www/manager6/ceph/Pool.js b/www/manager6/ceph/Pool.js
index 240cc2c..914c27a 100644
--- a/www/manager6/ceph/Pool.js
+++ b/www/manager6/ceph/Pool.js
@@ -1,12 +1,9 @@
-// Ext.create is a function, but
-// we defined create a bool in PVE.window.Edit
-/*jslint confusion: true*/
Ext.define('PVE.CephCreatePool', {
extend: 'PVE.window.Edit',
alias: ['widget.pveCephCreatePool'],
subject: 'Ceph Pool',
- create: true,
+ isCreate: true,
method: 'POST',
items: [
{
diff --git a/www/manager6/dc/ACLView.js b/www/manager6/dc/ACLView.js
index 561f4c4..f6688f9 100644
--- a/www/manager6/dc/ACLView.js
+++ b/www/manager6/dc/ACLView.js
@@ -5,10 +5,10 @@ Ext.define('PVE.dc.ACLAdd', {
method: 'PUT',
isAdd: true,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
- me.create = true;
+ me.isCreate = true;
var items = [
{
diff --git a/www/manager6/dc/AuthEdit.js b/www/manager6/dc/AuthEdit.js
index 980348d..91a722e 100644
--- a/www/manager6/dc/AuthEdit.js
+++ b/www/manager6/dc/AuthEdit.js
@@ -7,13 +7,13 @@ Ext.define('PVE.dc.AuthEdit', {
initComponent : function() {
var me = this;
- me.create = !me.realm;
+ me.isCreate = !me.realm;
var url;
var method;
var serverlist;
- if (me.create) {
+ if (me.isCreate) {
url = '/api2/extjs/access/domains';
method = 'POST';
} else {
@@ -23,7 +23,7 @@ Ext.define('PVE.dc.AuthEdit', {
var column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'realm',
fieldLabel: gettext('Realm'),
value: me.realm,
@@ -64,7 +64,7 @@ Ext.define('PVE.dc.AuthEdit', {
});
} else if (me.authType === 'pve') {
- if (me.create) {
+ if (me.isCreate) {
throw 'unknown auth type';
}
@@ -72,7 +72,7 @@ Ext.define('PVE.dc.AuthEdit', {
} else if (me.authType === 'pam') {
- if (me.create) {
+ if (me.isCreate) {
throw 'unknown auth type';
}
@@ -102,7 +102,7 @@ Ext.define('PVE.dc.AuthEdit', {
{
xtype: 'pvetextfield',
fieldLabel: gettext('Fallback Server'),
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
name: 'server2'
},
{
@@ -128,7 +128,7 @@ Ext.define('PVE.dc.AuthEdit', {
column2.push({
xtype: 'pveKVComboBox',
name: 'tfa',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
value: '',
fieldLabel: gettext('TFA'),
comboItems: [ ['__default__', PVE.Utils.noneText], ['oath', 'OATH'], ['yubico', 'Yubico']],
@@ -200,13 +200,13 @@ Ext.define('PVE.dc.AuthEdit', {
}],
onGetValues: function(values) {
if (!values.port) {
- if (!me.create) {
+ if (!me.isCreate) {
PVE.Utils.assemble_field_data(values, { 'delete': 'port' });
}
delete values.port;
}
- if (me.create) {
+ if (me.isCreate) {
values.type = me.authType;
}
@@ -250,7 +250,7 @@ Ext.define('PVE.dc.AuthEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var data = response.result.data || {};
diff --git a/www/manager6/dc/Backup.js b/www/manager6/dc/Backup.js
index 5e92685..8ae399c 100644
--- a/www/manager6/dc/Backup.js
+++ b/www/manager6/dc/Backup.js
@@ -3,15 +3,14 @@ Ext.define('PVE.dc.BackupEdit', {
alias: ['widget.pveDcBackupEdit'],
initComponent : function() {
- /*jslint confusion: true */
var me = this;
- me.create = !me.jobid;
+ me.isCreate = !me.jobid;
var url;
var method;
- if (me.create) {
+ if (me.isCreate) {
url = '/api2/extjs/cluster/backup';
method = 'POST';
} else {
@@ -23,6 +22,8 @@ Ext.define('PVE.dc.BackupEdit', {
name: 'vmid'
});
+ /*jslint confusion: true*/
+ // 'value' can be assigned a string or an array
var selModeField = Ext.create('PVE.form.KVComboBox', {
xtype: 'pveKVComboBox',
comboItems: [
@@ -162,14 +163,14 @@ Ext.define('PVE.dc.BackupEdit', {
xtype: 'pveEmailNotificationSelector',
fieldLabel: gettext('Email notification'),
name: 'mailnotification',
- deleteEmpty: me.create ? false : true,
- value: me.create ? 'always' : ''
+ deleteEmpty: me.isCreate ? false : true,
+ value: me.isCreate ? 'always' : ''
},
{
xtype: 'pveCompressionSelector',
fieldLabel: gettext('Compression'),
name: 'compress',
- deleteEmpty: me.create ? false : true,
+ deleteEmpty: me.isCreate ? false : true,
value: 'lzo'
},
{
@@ -188,13 +189,14 @@ Ext.define('PVE.dc.BackupEdit', {
},
vmidField
];
+ /*jslint confusion: false*/
var ipanel = Ext.create('PVE.panel.InputPanel', {
column1: column1,
column2: column2,
onGetValues: function(values) {
if (!values.node) {
- if (!me.create) {
+ if (!me.isCreate) {
PVE.Utils.assemble_field_data(values, { 'delete': 'node' });
}
delete values.node;
@@ -279,7 +281,7 @@ Ext.define('PVE.dc.BackupEdit', {
me.callParent();
- if (me.create) {
+ if (me.isCreate) {
selModeField.setValue('include');
} else {
me.load({
diff --git a/www/manager6/dc/GroupEdit.js b/www/manager6/dc/GroupEdit.js
index cb5a433..0d881a3 100644
--- a/www/manager6/dc/GroupEdit.js
+++ b/www/manager6/dc/GroupEdit.js
@@ -5,12 +5,12 @@ Ext.define('PVE.dc.GroupEdit', {
initComponent : function() {
var me = this;
- me.create = !me.groupid;
+ me.isCreate = !me.groupid;
var url;
var method;
- if (me.create) {
+ if (me.isCreate) {
url = '/api2/extjs/access/groups';
method = 'POST';
} else {
@@ -24,7 +24,7 @@ Ext.define('PVE.dc.GroupEdit', {
method: method,
items: [
{
- xtype: me.create ? 'pvetextfield' : 'displayfield',
+ xtype: me.isCreate ? 'pvetextfield' : 'displayfield',
fieldLabel: gettext('Name'),
name: 'groupid',
value: me.groupid,
@@ -41,7 +41,7 @@ Ext.define('PVE.dc.GroupEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load();
}
}
diff --git a/www/manager6/dc/PoolEdit.js b/www/manager6/dc/PoolEdit.js
index 42196e7..c2a2d25 100644
--- a/www/manager6/dc/PoolEdit.js
+++ b/www/manager6/dc/PoolEdit.js
@@ -5,12 +5,12 @@ Ext.define('PVE.dc.PoolEdit', {
initComponent : function() {
var me = this;
- me.create = !me.poolid;
+ me.isCreate = !me.poolid;
var url;
var method;
- if (me.create) {
+ if (me.isCreate) {
url = '/api2/extjs/pools';
method = 'POST';
} else {
@@ -24,7 +24,7 @@ Ext.define('PVE.dc.PoolEdit', {
method: method,
items: [
{
- xtype: me.create ? 'pvetextfield' : 'displayfield',
+ xtype: me.isCreate ? 'pvetextfield' : 'displayfield',
fieldLabel: gettext('Name'),
name: 'poolid',
value: me.poolid,
@@ -41,7 +41,7 @@ Ext.define('PVE.dc.PoolEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load();
}
}
diff --git a/www/manager6/dc/SecurityGroups.js b/www/manager6/dc/SecurityGroups.js
index 62c7ac0..8022ae3 100644
--- a/www/manager6/dc/SecurityGroups.js
+++ b/www/manager6/dc/SecurityGroups.js
@@ -6,10 +6,9 @@ Ext.define('PVE.SecurityGroupEdit', {
allow_iface: false,
initComponent : function() {
- /*jslint confusion: true */
var me = this;
- me.create = (me.group_name === undefined);
+ me.isCreate = (me.group_name === undefined);
var subject;
@@ -32,7 +31,7 @@ Ext.define('PVE.SecurityGroupEdit', {
}
];
- if (me.create) {
+ if (me.isCreate) {
subject = gettext('Security Group');
} else {
subject = gettext('Security Group') + " '" + me.group_name + "'";
@@ -44,7 +43,8 @@ Ext.define('PVE.SecurityGroupEdit', {
}
var ipanel = Ext.create('PVE.panel.InputPanel', {
- create: me.create,
+ // InputPanel does not have a 'create' property, does it need a 'isCreate'
+ isCreate: me.isCreate,
items: items
});
diff --git a/www/manager6/dc/UserEdit.js b/www/manager6/dc/UserEdit.js
index ee4d298..17c6460 100644
--- a/www/manager6/dc/UserEdit.js
+++ b/www/manager6/dc/UserEdit.js
@@ -7,13 +7,13 @@ Ext.define('PVE.dc.UserEdit', {
initComponent : function() {
var me = this;
- me.create = !me.userid;
+ me.isCreate = !me.userid;
var url;
var method;
var realm;
- if (me.create) {
+ if (me.isCreate) {
url = '/api2/extjs/access/users';
method = 'POST';
} else {
@@ -68,12 +68,12 @@ Ext.define('PVE.dc.UserEdit', {
var column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'userid',
fieldLabel: gettext('User name'),
value: me.userid,
allowBlank: false,
- submitValue: me.create ? true : false
+ submitValue: me.isCreate ? true : false
},
pwfield, verifypw,
{
@@ -133,7 +133,7 @@ Ext.define('PVE.dc.UserEdit', {
}
];
- if (me.create) {
+ if (me.isCreate) {
column1.splice(1,0,{
xtype: 'pveRealmComboBox',
name: 'realm',
@@ -185,7 +185,7 @@ Ext.define('PVE.dc.UserEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var data = response.result.data;
diff --git a/www/manager6/grid/FirewallAliases.js b/www/manager6/grid/FirewallAliases.js
index 8ae3e41..93238e8 100644
--- a/www/manager6/grid/FirewallAliases.js
+++ b/www/manager6/grid/FirewallAliases.js
@@ -6,12 +6,12 @@ Ext.define('PVE.FirewallAliasEdit', {
alias_name: undefined,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
- me.create = (me.alias_name === undefined);
+ me.isCreate = (me.alias_name === undefined);
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs' + me.base_url;
me.method = 'POST';
} else {
@@ -22,7 +22,7 @@ Ext.define('PVE.FirewallAliasEdit', {
var items = [
{
xtype: 'textfield',
- name: me.create ? 'name' : 'rename',
+ name: me.isCreate ? 'name' : 'rename',
fieldLabel: gettext('Name'),
allowBlank: false
},
@@ -40,7 +40,7 @@ Ext.define('PVE.FirewallAliasEdit', {
];
var ipanel = Ext.create('PVE.panel.InputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
items: items
});
@@ -52,7 +52,7 @@ Ext.define('PVE.FirewallAliasEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
@@ -78,7 +78,6 @@ Ext.define('PVE.FirewallAliases', {
title: gettext('Alias'),
initComponent : function() {
- /*jslint confusion: true */
var me = this;
diff --git a/www/manager6/grid/FirewallRules.js b/www/manager6/grid/FirewallRules.js
index 2d7f517..92c3d35 100644
--- a/www/manager6/grid/FirewallRules.js
+++ b/www/manager6/grid/FirewallRules.js
@@ -108,7 +108,7 @@ Ext.define('PVE.FirewallRulePanel', {
me.column1.push({
xtype: 'pvetextfield',
name: 'iface',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
value: '',
fieldLabel: gettext('Interface')
});
@@ -230,7 +230,7 @@ Ext.define('PVE.FirewallRuleEdit', {
allow_iface: false,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
if (!me.base_url) {
@@ -240,9 +240,9 @@ Ext.define('PVE.FirewallRuleEdit', {
throw "no list_refs_url specified";
}
- me.create = (me.rule_pos === undefined);
+ me.isCreate = (me.rule_pos === undefined);
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs' + me.base_url;
me.method = 'POST';
} else {
@@ -251,7 +251,7 @@ Ext.define('PVE.FirewallRuleEdit', {
}
var ipanel = Ext.create('PVE.FirewallRulePanel', {
- create: me.create,
+ isCreate: me.isCreate,
list_refs_url: me.list_refs_url,
allow_iface: me.allow_iface,
rule_pos: me.rule_pos
@@ -265,7 +265,7 @@ Ext.define('PVE.FirewallRuleEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
@@ -294,12 +294,12 @@ Ext.define('PVE.FirewallGroupRuleEdit', {
allow_iface: false,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
- me.create = (me.rule_pos === undefined);
+ me.isCreate = (me.rule_pos === undefined);
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs' + me.base_url;
me.method = 'POST';
} else {
@@ -326,14 +326,14 @@ Ext.define('PVE.FirewallGroupRuleEdit', {
column1.push({
xtype: 'pvetextfield',
name: 'iface',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
value: '',
fieldLabel: gettext('Interface')
});
}
var ipanel = Ext.create('PVE.panel.InputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
column1: column1,
column2: [
{
@@ -362,7 +362,7 @@ Ext.define('PVE.FirewallGroupRuleEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/grid/PoolMembers.js b/www/manager6/grid/PoolMembers.js
index 15765b1..76261c8 100644
--- a/www/manager6/grid/PoolMembers.js
+++ b/www/manager6/grid/PoolMembers.js
@@ -1,14 +1,11 @@
-// Ext.create is a function
-// but we defined create as a bool in PVE.window.Edit
-/*jslint confusion: true*/
Ext.define('PVE.pool.AddVM', {
extend: 'PVE.window.Edit',
width: 600,
height: 400,
isAdd: true,
- create: true,
+ isCreate: true,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
if (!me.pool) {
@@ -26,10 +23,12 @@ Ext.define('PVE.pool.AddVM', {
var vmStore = Ext.create('Ext.data.Store', {
model: 'PVEResources',
- sorters: {
- property: 'vmid',
- order: 'ASC'
- },
+ sorters: [
+ {
+ property: 'vmid',
+ order: 'ASC'
+ }
+ ],
filters: [
function(item) {
return ((item.data.type === 'lxc' || item.data.type === 'qemu') && item.data.pool === '');
@@ -101,14 +100,14 @@ Ext.define('PVE.pool.AddStorage', {
extend: 'PVE.window.Edit',
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
if (!me.pool) {
throw "no pool specified";
}
- me.create = true;
+ me.isCreate = true;
me.isAdd = true;
me.url = "/pools/" + me.pool;
me.method = 'PUT';
diff --git a/www/manager6/ha/GroupEdit.js b/www/manager6/ha/GroupEdit.js
index 0d4aa45..46314fe 100644
--- a/www/manager6/ha/GroupEdit.js
+++ b/www/manager6/ha/GroupEdit.js
@@ -7,7 +7,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'group';
}
@@ -151,7 +151,7 @@ Ext.define('PVE.ha.GroupInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'group',
value: me.groupId || '',
fieldLabel: 'ID',
@@ -197,9 +197,9 @@ Ext.define('PVE.ha.GroupEdit', {
initComponent : function() {
var me = this;
- me.create = !me.groupId;
+ me.isCreate = !me.groupId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/cluster/ha/groups';
me.method = 'POST';
} else {
@@ -208,7 +208,7 @@ Ext.define('PVE.ha.GroupEdit', {
}
var ipanel = Ext.create('PVE.ha.GroupInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
groupId: me.groupId
});
@@ -219,7 +219,7 @@ Ext.define('PVE.ha.GroupEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/ha/ResourceEdit.js b/www/manager6/ha/ResourceEdit.js
index 66de504..49dcfaa 100644
--- a/www/manager6/ha/ResourceEdit.js
+++ b/www/manager6/ha/ResourceEdit.js
@@ -6,16 +6,16 @@ Ext.define('PVE.ha.VMResourceInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.sid = values.vmid;
}
delete values.vmid;
- PVE.Utils.delete_if_default(values, 'group', '', me.create);
- PVE.Utils.delete_if_default(values, 'max_restart', '1', me.create);
- PVE.Utils.delete_if_default(values, 'max_relocate', '1', me.create);
+ PVE.Utils.delete_if_default(values, 'group', '', me.isCreate);
+ PVE.Utils.delete_if_default(values, 'max_restart', '1', me.isCreate);
+ PVE.Utils.delete_if_default(values, 'max_relocate', '1', me.isCreate);
return values;
},
@@ -151,9 +151,9 @@ Ext.define('PVE.ha.VMResourceEdit', {
initComponent : function() {
var me = this;
- me.create = !me.vmid;
+ me.isCreate = !me.vmid;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/cluster/ha/resources';
me.method = 'POST';
} else {
@@ -162,7 +162,7 @@ Ext.define('PVE.ha.VMResourceEdit', {
}
var ipanel = Ext.create('PVE.ha.VMResourceInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
vmid: me.vmid,
guestType: me.guestType
});
@@ -176,7 +176,7 @@ Ext.define('PVE.ha.VMResourceEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/lxc/CreateWizard.js b/www/manager6/lxc/CreateWizard.js
index 8c89648..40b7300 100644
--- a/www/manager6/lxc/CreateWizard.js
+++ b/www/manager6/lxc/CreateWizard.js
@@ -55,12 +55,10 @@ Ext.define('PVE.lxc.CreateWizard', {
}
});
- /*jslint confusion: true */
- /* type confusion for 'create' between boolean and function */
var rootfspanel = Ext.create('PVE.lxc.MountPointInputPanel', {
title: gettext('Root Disk'),
insideWizard: true,
- create: true,
+ isCreate: true,
unused: false,
confid: 'rootfs'
});
@@ -69,9 +67,8 @@ Ext.define('PVE.lxc.CreateWizard', {
title: gettext('Network'),
insideWizard: true,
dataCache: {},
- create: true
+ isCreate: true
});
- /*jslint confusion: false */
var passwordfield = Ext.createWidget('textfield', {
inputType: 'password',
diff --git a/www/manager6/lxc/DNS.js b/www/manager6/lxc/DNS.js
index 08e63e0..cf7d460 100644
--- a/www/manager6/lxc/DNS.js
+++ b/www/manager6/lxc/DNS.js
@@ -111,7 +111,7 @@ Ext.define('PVE.lxc.DNSEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/lxc/Network.js b/www/manager6/lxc/Network.js
index 5eb61fe..1620a7a 100644
--- a/www/manager6/lxc/Network.js
+++ b/www/manager6/lxc/Network.js
@@ -23,7 +23,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
var me = this;
var id;
- if (me.create) {
+ if (me.isCreate) {
id = values.id;
delete values.id;
} else {
@@ -60,7 +60,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
cdata.name = 'eth0';
}
- if (!me.create) {
+ if (!me.isCreate) {
if (!me.ifname) {
throw "no interface name specified";
}
@@ -73,7 +73,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
var i;
for (i = 0; i < 10; i++) {
- if (me.create && !me.dataCache['net'+i.toString()]) {
+ if (me.isCreate && !me.dataCache['net'+i.toString()]) {
me.ifname = 'net' + i.toString();
break;
}
@@ -291,7 +291,7 @@ Ext.define('PVE.lxc.NetworkInputPanel', {
}
});
-/*jslint confusion: true */
+
Ext.define('PVE.lxc.NetworkEdit', {
extend: 'PVE.window.Edit',
@@ -312,7 +312,7 @@ Ext.define('PVE.lxc.NetworkEdit', {
ifname: me.ifname,
nodename: me.nodename,
dataCache: me.dataCache,
- create: me.create
+ isCreate: me.isCreate
});
Ext.apply(me, {
@@ -327,7 +327,7 @@ Ext.define('PVE.lxc.NetworkEdit', {
Ext.define('PVE.lxc.NetworkView', {
extend: 'Ext.grid.GridPanel',
- alias: ['widget.pveLxcNetworkView'],
+ alias: 'widget.pveLxcNetworkView',
onlineHelp: 'pct_container_network',
@@ -467,7 +467,7 @@ Ext.define('PVE.lxc.NetworkView', {
var win = Ext.create('PVE.lxc.NetworkEdit', {
url: me.url,
nodename: nodename,
- create: true,
+ isCreate: true,
dataCache: me.dataCache
});
win.on('destroy', me.load, me);
diff --git a/www/manager6/lxc/ResourceEdit.js b/www/manager6/lxc/ResourceEdit.js
index 156c99f..61a5539 100644
--- a/www/manager6/lxc/ResourceEdit.js
+++ b/www/manager6/lxc/ResourceEdit.js
@@ -49,19 +49,19 @@ Ext.define('PVE.lxc.MountPointEdit', {
var unused = me.confid && me.confid.match(/^unused\d+$/);
- me.create = me.confid ? unused : true;
+ me.isCreate = me.confid ? unused : true;
var ipanel = Ext.create('PVE.lxc.MountPointInputPanel', {
confid: me.confid,
nodename: nodename,
unused: unused,
- create: me.create
+ isCreate: me.isCreate
});
var subject;
if (unused) {
subject = gettext('Unused Disk');
- } else if (me.create) {
+ } else if (me.isCreate) {
subject = gettext('Mount Point');
} else {
subject = gettext('Mount Point') + ' (' + me.confid + ')';
@@ -231,7 +231,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
if (me.unused) {
me.mpdata.file = me.vmconfig[values.unusedId];
confid = values.mpsel;
- } else if (me.create) {
+ } else if (me.isCreate) {
me.mpdata.file = values.storage + ':' + values.disksize;
}
@@ -371,7 +371,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
storageContent: 'rootdir',
allowBlank: false,
autoSelect: true,
- hidden: me.unused || !me.create,
+ hidden: me.unused || !me.isCreate,
listeners: {
change: function(f, value) {
if (!value) { // initial store loading fires an unwanted 'change'
@@ -393,7 +393,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
} else {
me.quota.setDisabled(false);
}
- if (me.unused || !me.create) {
+ if (me.unused || !me.isCreate) {
return;
}
if (rec.data.type === 'iscsi') {
@@ -444,7 +444,7 @@ Ext.define('PVE.lxc.MountPointInputPanel', {
}
});
me.column1.push(me.unusedDisks);
- } else if (me.create) {
+ } else if (me.isCreate) {
me.hdfilesel = Ext.create('PVE.form.FileSelector', {
name: 'file',
nodename: me.nodename,
diff --git a/www/manager6/node/NetworkEdit.js b/www/manager6/node/NetworkEdit.js
index 592802b..aa99569 100644
--- a/www/manager6/node/NetworkEdit.js
+++ b/www/manager6/node/NetworkEdit.js
@@ -14,7 +14,7 @@ Ext.define('PVE.node.NetworkEdit', {
throw "no network device type specified";
}
- me.create = !me.iface;
+ me.isCreate = !me.iface;
var iface_vtype;
@@ -22,9 +22,9 @@ Ext.define('PVE.node.NetworkEdit', {
iface_vtype = 'BridgeName';
} else if (me.iftype === 'bond') {
iface_vtype = 'BondName';
- } else if (me.iftype === 'eth' && !me.create) {
+ } else if (me.iftype === 'eth' && !me.isCreate) {
iface_vtype = 'InterfaceName';
- } else if (me.iftype === 'vlan' && !me.create) {
+ } else if (me.iftype === 'vlan' && !me.isCreate) {
iface_vtype = 'InterfaceName';
} else if (me.iftype === 'OVSBridge') {
iface_vtype = 'BridgeName';
@@ -50,7 +50,7 @@ Ext.define('PVE.node.NetworkEdit', {
fieldLabel: gettext('Autostart'),
name: 'autostart',
uncheckedValue: 0,
- checked: me.create ? true : undefined
+ checked: me.isCreate ? true : undefined
});
}
@@ -59,7 +59,7 @@ Ext.define('PVE.node.NetworkEdit', {
xtype: 'pvecheckbox',
fieldLabel: gettext('VLAN aware'),
name: 'bridge_vlan_aware',
- deleteEmpty: !me.create
+ deleteEmpty: !me.isCreate
});
column2.push({
xtype: 'textfield',
@@ -79,7 +79,7 @@ Ext.define('PVE.node.NetworkEdit', {
});
} else if (me.iftype === 'OVSPort' || me.iftype === 'OVSIntPort') {
column2.push({
- xtype: me.create ? 'PVE.form.BridgeSelector' : 'displayfield',
+ xtype: me.isCreate ? 'PVE.form.BridgeSelector' : 'displayfield',
fieldLabel: PVE.Utils.render_network_iface_type('OVSBridge'),
allowBlank: false,
nodename: nodename,
@@ -88,7 +88,7 @@ Ext.define('PVE.node.NetworkEdit', {
});
column2.push({
xtype: 'pveVlanField',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
name: 'ovs_tag',
value: ''
});
@@ -107,7 +107,7 @@ Ext.define('PVE.node.NetworkEdit', {
var policySelector = Ext.createWidget('bondPolicySelector', {
fieldLabel: gettext('Hash policy'),
name: 'bond_xmit_hash_policy',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
disabled: true
});
@@ -115,7 +115,7 @@ Ext.define('PVE.node.NetworkEdit', {
xtype: 'bondModeSelector',
fieldLabel: gettext('Mode'),
name: 'bond_mode',
- value: me.create ? 'balance-rr' : undefined,
+ value: me.isCreate ? 'balance-rr' : undefined,
listeners: {
change: function(f, value) {
if (value === 'balance-xor' ||
@@ -134,7 +134,7 @@ Ext.define('PVE.node.NetworkEdit', {
} else if (me.iftype === 'OVSBond') {
column2.push({
- xtype: me.create ? 'PVE.form.BridgeSelector' : 'displayfield',
+ xtype: me.isCreate ? 'PVE.form.BridgeSelector' : 'displayfield',
fieldLabel: PVE.Utils.render_network_iface_type('OVSBridge'),
allowBlank: false,
nodename: nodename,
@@ -143,7 +143,7 @@ Ext.define('PVE.node.NetworkEdit', {
});
column2.push({
xtype: 'pveVlanField',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
name: 'ovs_tag',
value: ''
});
@@ -165,7 +165,7 @@ Ext.define('PVE.node.NetworkEdit', {
var url;
var method;
- if (me.create) {
+ if (me.isCreate) {
url = "/api2/extjs/nodes/" + nodename + "/network";
method = 'POST';
} else {
@@ -180,7 +180,7 @@ Ext.define('PVE.node.NetworkEdit', {
value: me.iftype
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
fieldLabel: gettext('Name'),
name: 'iface',
value: me.iface,
@@ -196,7 +196,7 @@ Ext.define('PVE.node.NetworkEdit', {
fieldLabel: gettext('Mode'),
name: 'bond_mode',
openvswitch: true,
- value: me.create ? 'active-backup' : undefined,
+ value: me.isCreate ? 'active-backup' : undefined,
allowBlank: false
},
{
@@ -210,14 +210,14 @@ Ext.define('PVE.node.NetworkEdit', {
column1.push(
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('IP address'),
vtype: 'IPAddress',
name: 'address'
},
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('Subnet mask'),
vtype: 'IPAddress',
name: 'netmask',
@@ -242,21 +242,21 @@ Ext.define('PVE.node.NetworkEdit', {
},
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('Gateway'),
vtype: 'IPAddress',
name: 'gateway'
},
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('IPv6 address'),
vtype: 'IP6Address',
name: 'address6'
},
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('Prefix length'),
vtype: 'IP6PrefixLength',
name: 'netmask6',
@@ -283,7 +283,7 @@ Ext.define('PVE.node.NetworkEdit', {
},
{
xtype: 'pvetextfield',
- deleteEmpty: !me.create,
+ deleteEmpty: !me.isCreate,
fieldLabel: gettext('Gateway'),
vtype: 'IP6Address',
name: 'gateway6'
@@ -303,7 +303,7 @@ Ext.define('PVE.node.NetworkEdit', {
me.callParent();
- if (me.create) {
+ if (me.isCreate) {
me.down('field[name=iface]').setValue(me.iface_default);
} else {
me.load({
diff --git a/www/manager6/panel/IPSet.js b/www/manager6/panel/IPSet.js
index 5e90ec4..beae5dc 100644
--- a/www/manager6/panel/IPSet.js
+++ b/www/manager6/panel/IPSet.js
@@ -14,7 +14,7 @@ Ext.define('PVE.IPSetList', {
editBtn: undefined,
initComponent: function() {
- /*jslint confusion: true */
+
var me = this;
if (me.ipset_panel == undefined) {
@@ -178,13 +178,13 @@ Ext.define('PVE.IPSetCidrEdit', {
cidr: undefined,
initComponent : function() {
- /*jslint confusion: true */
+
var me = this;
- me.create = (me.cidr === undefined);
+ me.isCreate = (me.cidr === undefined);
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs' + me.base_url;
me.method = 'POST';
} else {
@@ -194,7 +194,7 @@ Ext.define('PVE.IPSetCidrEdit', {
var column1 = [];
- if (me.create) {
+ if (me.isCreate) {
if (!me.list_refs_url) {
throw "no alias_base_url specified";
}
@@ -219,7 +219,7 @@ Ext.define('PVE.IPSetCidrEdit', {
}
var ipanel = Ext.create('PVE.panel.InputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
column1: column1,
column2: [
{
@@ -247,7 +247,7 @@ Ext.define('PVE.IPSetCidrEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/qemu/CDEdit.js b/www/manager6/qemu/CDEdit.js
index 1a6617d..1fd3677 100644
--- a/www/manager6/qemu/CDEdit.js
+++ b/www/manager6/qemu/CDEdit.js
@@ -1,5 +1,3 @@
-// fixme: howto avoid jslint type confusion?
-/*jslint confusion: true */
Ext.define('PVE.qemu.CDInputPanel', {
extend: 'PVE.panel.InputPanel',
alias: 'widget.PVE.qemu.CDInputPanel',
@@ -158,7 +156,7 @@ Ext.define('PVE.qemu.CDEdit', {
throw "no node name specified";
}
- me.create = me.confid ? false : true;
+ me.isCreate = me.confid ? false : true;
var ipanel = Ext.create('PVE.qemu.CDInputPanel', {
confid: me.confid,
diff --git a/www/manager6/qemu/CreateWizard.js b/www/manager6/qemu/CreateWizard.js
index 19c584e..30bf887 100644
--- a/www/manager6/qemu/CreateWizard.js
+++ b/www/manager6/qemu/CreateWizard.js
@@ -25,14 +25,11 @@ Ext.define('PVE.qemu.CreateWizard', {
insideWizard: true
});
- /*jslint confusion: true */
- /* type confusion for 'create' between boolean and function */
var hdpanel = Ext.create('PVE.qemu.HDInputPanel', {
title: gettext('Hard Disk'),
- create: true,
+ isCreate: true,
insideWizard: true
});
- /*jslint confusion: false */
var networkpanel = Ext.create('PVE.qemu.NetworkInputPanel', {
title: gettext('Network'),
diff --git a/www/manager6/qemu/HDEdit.js b/www/manager6/qemu/HDEdit.js
index 219fe9d..0060394 100644
--- a/www/manager6/qemu/HDEdit.js
+++ b/www/manager6/qemu/HDEdit.js
@@ -1,5 +1,5 @@
-// fixme: howto avoid jslint type confusion?
/*jslint confusion: true */
+/* 'change' property is assigned a string and then a function */
Ext.define('PVE.qemu.HDInputPanel', {
extend: 'PVE.panel.InputPanel',
alias: 'widget.PVE.qemu.HDInputPanel',
@@ -74,7 +74,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
if (me.unused) {
me.drive.file = me.vmconfig[values.unusedId];
confid = values.controller + values.deviceid;
- } else if (me.create) {
+ } else if (me.isCreate) {
if (values.hdimage) {
me.drive.file = values.hdimage;
} else {
@@ -188,7 +188,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
allowBlank: false
});
me.column1.push(me.unusedDisks);
- } else if (me.create) {
+ } else if (me.isCreate) {
me.formatsel = Ext.create('PVE.form.DiskFormatSelector', {
name: 'diskformat',
fieldLabel: gettext('Format'),
@@ -269,6 +269,7 @@ Ext.define('PVE.qemu.HDInputPanel', {
me.callParent();
}
});
+/*jslint confusion: false */
Ext.define('PVE.qemu.HDEdit', {
extend: 'PVE.window.Edit',
@@ -285,19 +286,19 @@ Ext.define('PVE.qemu.HDEdit', {
var unused = me.confid && me.confid.match(/^unused\d+$/);
- me.create = me.confid ? unused : true;
+ me.isCreate = me.confid ? unused : true;
var ipanel = Ext.create('PVE.qemu.HDInputPanel', {
confid: me.confid,
nodename: nodename,
unused: unused,
- create: me.create
+ isCreate: me.isCreate
});
var subject;
if (unused) {
me.subject = gettext('Unused Disk');
- } else if (me.create) {
+ } else if (me.isCreate) {
me.subject = gettext('Hard Disk');
} else {
me.subject = gettext('Hard Disk') + ' (' + me.confid + ')';
@@ -306,7 +307,10 @@ Ext.define('PVE.qemu.HDEdit', {
me.items = [ ipanel ];
me.callParent();
-
+ /*jslint confusion: true*/
+ /* 'data' is assigned an empty array in same file, and here we
+ * use it like an object
+ */
me.load({
success: function(response, options) {
ipanel.setVMConfig(response.result.data);
@@ -323,5 +327,6 @@ Ext.define('PVE.qemu.HDEdit', {
}
}
});
+ /*jslint confusion: false*/
}
});
diff --git a/www/manager6/qemu/HDEfi.js b/www/manager6/qemu/HDEfi.js
index 20ef712..45c9d70 100644
--- a/www/manager6/qemu/HDEfi.js
+++ b/www/manager6/qemu/HDEfi.js
@@ -122,16 +122,13 @@ Ext.define('PVE.qemu.EFIDiskEdit', {
throw "no node name specified";
}
- /*jslint confusion: true */
- /* because create is a method above..., really jslint? */
me.items = [{
xtype: 'pveEFIDiskInputPanel',
onlineHelp: 'qm_bios_and_uefi',
confid: me.confid,
nodename: nodename,
- create: true
+ isCreate: true
}];
- /* jslint confusion: false */
me.callParent();
}
diff --git a/www/manager6/qemu/HDThrottle.js b/www/manager6/qemu/HDThrottle.js
index 60a699c..8d2af2a 100644
--- a/www/manager6/qemu/HDThrottle.js
+++ b/www/manager6/qemu/HDThrottle.js
@@ -1,5 +1,3 @@
-// fixme: howto avoid jslint type confusion?
-/*jslint confusion: true */
Ext.define('PVE.qemu.HDThrottleInputPanel', {
extend: 'PVE.panel.InputPanel',
alias: 'widget.PVE.qemu.HDThrottleInputPanel',
@@ -174,7 +172,7 @@ Ext.define('PVE.qemu.HDThrottle', {
var unused = me.confid && me.confid.match(/^unused\d+$/);
- me.create = me.confid ? unused : true;
+ me.isCreate = me.confid ? unused : true;
var ipanel = Ext.create('PVE.qemu.HDThrottleInputPanel', {
confid: me.confid,
diff --git a/www/manager6/qemu/NetworkEdit.js b/www/manager6/qemu/NetworkEdit.js
index a23af65..b63f5ff 100644
--- a/www/manager6/qemu/NetworkEdit.js
+++ b/www/manager6/qemu/NetworkEdit.js
@@ -183,7 +183,7 @@ Ext.define('PVE.qemu.NetworkEdit', {
throw "no node name specified";
}
- me.create = me.confid ? false : true;
+ me.isCreate = me.confid ? false : true;
var ipanel = Ext.create('PVE.qemu.NetworkInputPanel', {
confid: me.confid,
@@ -201,7 +201,7 @@ Ext.define('PVE.qemu.NetworkEdit', {
success: function(response, options) {
var i, confid;
me.vmconfig = response.result.data;
- if (!me.create) {
+ if (!me.isCreate) {
var value = me.vmconfig[me.confid];
var network = PVE.Parser.parseQemuNetwork(me.confid, value);
if (!network) {
diff --git a/www/manager6/storage/DirEdit.js b/www/manager6/storage/DirEdit.js
index fa94065..cdfa6dd 100644
--- a/www/manager6/storage/DirEdit.js
+++ b/www/manager6/storage/DirEdit.js
@@ -4,7 +4,7 @@ Ext.define('PVE.storage.DirInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'dir';
} else {
delete values.storage;
@@ -22,7 +22,7 @@ Ext.define('PVE.storage.DirInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -30,7 +30,7 @@ Ext.define('PVE.storage.DirInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'path',
value: '',
fieldLabel: gettext('Directory'),
@@ -66,12 +66,12 @@ Ext.define('PVE.storage.DirInputPanel', {
name: 'maxfiles',
minValue: 0,
maxValue: 365,
- value: me.create ? '1' : undefined,
+ value: me.isCreate ? '1' : undefined,
allowBlank: false
}
];
- if (me.create || me.storageId !== 'local') {
+ if (me.isCreate || me.storageId !== 'local') {
me.column2.unshift({
xtype: 'pveNodeSelector',
name: 'nodes',
@@ -93,9 +93,9 @@ Ext.define('PVE.storage.DirEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -104,7 +104,7 @@ Ext.define('PVE.storage.DirEdit', {
}
var ipanel = Ext.create('PVE.storage.DirInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -116,7 +116,7 @@ Ext.define('PVE.storage.DirEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/GlusterFsEdit.js b/www/manager6/storage/GlusterFsEdit.js
index 9a4918a..2cde74c 100644
--- a/www/manager6/storage/GlusterFsEdit.js
+++ b/www/manager6/storage/GlusterFsEdit.js
@@ -63,7 +63,7 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'glusterfs';
} else {
delete values.storage;
@@ -81,7 +81,7 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -89,14 +89,14 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'server',
value: '',
fieldLabel: gettext('Server'),
allowBlank: false,
listeners: {
change: function(f, value) {
- if (me.create) {
+ if (me.isCreate) {
var volumeField = me.down('field[name=volume]');
volumeField.setServer(value);
volumeField.setValue('');
@@ -105,14 +105,14 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
}
},
{
- xtype: me.create ? 'pvetextfield' : 'displayfield',
+ xtype: me.isCreate ? 'pvetextfield' : 'displayfield',
name: 'server2',
value: '',
fieldLabel: gettext('Second Server'),
allowBlank: true
},
{
- xtype: me.create ? 'pveGlusterFsScan' : 'displayfield',
+ xtype: me.isCreate ? 'pveGlusterFsScan' : 'displayfield',
name: 'volume',
value: '',
fieldLabel: 'Volume name',
@@ -152,7 +152,7 @@ Ext.define('PVE.storage.GlusterFsInputPanel', {
name: 'maxfiles',
minValue: 0,
maxValue: 365,
- value: me.create ? '1' : undefined,
+ value: me.isCreate ? '1' : undefined,
allowBlank: false
}
];
@@ -167,9 +167,9 @@ Ext.define('PVE.storage.GlusterFsEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -178,7 +178,7 @@ Ext.define('PVE.storage.GlusterFsEdit', {
}
var ipanel = Ext.create('PVE.storage.GlusterFsInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -190,7 +190,7 @@ Ext.define('PVE.storage.GlusterFsEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/IScsiEdit.js b/www/manager6/storage/IScsiEdit.js
index fdcbfbc..68a4d8a 100644
--- a/www/manager6/storage/IScsiEdit.js
+++ b/www/manager6/storage/IScsiEdit.js
@@ -62,7 +62,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'iscsi';
} else {
delete values.storage;
@@ -83,7 +83,7 @@ Ext.define('PVE.storage.IScsiInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -91,14 +91,14 @@ Ext.define('PVE.storage.IScsiInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'portal',
value: '',
fieldLabel: 'Portal',
allowBlank: false,
listeners: {
change: function(f, value) {
- if (me.create) {
+ if (me.isCreate) {
var exportField = me.down('field[name=target]');
exportField.setPortal(value);
exportField.setValue('');
@@ -107,8 +107,8 @@ Ext.define('PVE.storage.IScsiInputPanel', {
}
},
{
- readOnly: !me.create,
- xtype: me.create ? 'pveIScsiScan' : 'displayfield',
+ readOnly: !me.isCreate,
+ xtype: me.isCreate ? 'pveIScsiScan' : 'displayfield',
name: 'target',
value: '',
fieldLabel: 'Target',
@@ -151,9 +151,9 @@ Ext.define('PVE.storage.IScsiEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -162,7 +162,7 @@ Ext.define('PVE.storage.IScsiEdit', {
}
var ipanel = Ext.create('PVE.storage.IScsiInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -174,7 +174,7 @@ Ext.define('PVE.storage.IScsiEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/LVMEdit.js b/www/manager6/storage/LVMEdit.js
index 8b7607b..c146989 100644
--- a/www/manager6/storage/LVMEdit.js
+++ b/www/manager6/storage/LVMEdit.js
@@ -89,7 +89,7 @@ Ext.define('PVE.storage.LVMInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'lvm';
} else {
delete values.storage;
@@ -106,26 +106,26 @@ Ext.define('PVE.storage.LVMInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
vtype: 'StorageId',
- submitValue: !!me.create,
+ submitValue: !!me.isCreate,
allowBlank: false
}
];
- var vgnameField = Ext.createWidget(me.create ? 'textfield' : 'displayfield', {
+ var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
name: 'vgname',
- hidden: !!me.create,
- disabled: !!me.create,
+ hidden: !!me.isCreate,
+ disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Volume group'),
allowBlank: false
});
- if (me.create) {
+ if (me.isCreate) {
var vgField = Ext.create('PVE.storage.VgSelector', {
name: 'vgname',
fieldLabel: gettext('Volume group'),
@@ -225,9 +225,9 @@ Ext.define('PVE.storage.LVMEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -236,7 +236,7 @@ Ext.define('PVE.storage.LVMEdit', {
}
var ipanel = Ext.create('PVE.storage.LVMInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -248,7 +248,7 @@ Ext.define('PVE.storage.LVMEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/LvmThinEdit.js b/www/manager6/storage/LvmThinEdit.js
index d4c89ae..44be72b 100644
--- a/www/manager6/storage/LvmThinEdit.js
+++ b/www/manager6/storage/LvmThinEdit.js
@@ -97,7 +97,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'lvmthin';
} else {
delete values.storage;
@@ -114,35 +114,35 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
vtype: 'StorageId',
- submitValue: !!me.create,
+ submitValue: !!me.isCreate,
allowBlank: false
}
];
- var vgnameField = Ext.createWidget(me.create ? 'textfield' : 'displayfield', {
+ var vgnameField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
name: 'vgname',
- hidden: !!me.create,
- disabled: !!me.create,
+ hidden: !!me.isCreate,
+ disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Volume group'),
allowBlank: false
});
- var thinpoolField = Ext.createWidget(me.create ? 'textfield' : 'displayfield', {
+ var thinpoolField = Ext.createWidget(me.isCreate ? 'textfield' : 'displayfield', {
name: 'thinpool',
- hidden: !!me.create,
- disabled: !!me.create,
+ hidden: !!me.isCreate,
+ disabled: !!me.isCreate,
value: '',
fieldLabel: gettext('Thin Pool'),
allowBlank: false
});
- if (me.create) {
+ if (me.isCreate) {
var vgField = Ext.create('PVE.storage.TPoolSelector', {
name: 'thinpool',
fieldLabel: gettext('Thin Pool'),
@@ -155,7 +155,7 @@ Ext.define('PVE.storage.LvmThinInputPanel', {
fieldLabel: gettext('Volume group'),
listeners: {
change: function(f, value) {
- if (me.create) {
+ if (me.isCreate) {
vgField.setVG(value);
vgField.setValue('');
}
@@ -213,9 +213,9 @@ Ext.define('PVE.storage.LvmThinEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -224,7 +224,7 @@ Ext.define('PVE.storage.LvmThinEdit', {
}
var ipanel = Ext.create('PVE.storage.LvmThinInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -236,7 +236,7 @@ Ext.define('PVE.storage.LvmThinEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/NFSEdit.js b/www/manager6/storage/NFSEdit.js
index f24209a..e1f48e7 100644
--- a/www/manager6/storage/NFSEdit.js
+++ b/www/manager6/storage/NFSEdit.js
@@ -63,7 +63,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'nfs';
// hack: for now we always create nvf v3
// fixme: make this configurable
@@ -84,7 +84,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -92,14 +92,14 @@ Ext.define('PVE.storage.NFSInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'server',
value: '',
fieldLabel: gettext('Server'),
allowBlank: false,
listeners: {
change: function(f, value) {
- if (me.create) {
+ if (me.isCreate) {
var exportField = me.down('field[name=export]');
exportField.setServer(value);
exportField.setValue('');
@@ -108,7 +108,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
}
},
{
- xtype: me.create ? 'pveNFSScan' : 'displayfield',
+ xtype: me.isCreate ? 'pveNFSScan' : 'displayfield',
name: 'export',
value: '',
fieldLabel: 'Export',
@@ -147,7 +147,7 @@ Ext.define('PVE.storage.NFSInputPanel', {
name: 'maxfiles',
minValue: 0,
maxValue: 365,
- value: me.create ? '1' : undefined,
+ value: me.isCreate ? '1' : undefined,
allowBlank: false
}
];
@@ -162,9 +162,9 @@ Ext.define('PVE.storage.NFSEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -173,7 +173,7 @@ Ext.define('PVE.storage.NFSEdit', {
}
var ipanel = Ext.create('PVE.storage.NFSInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -185,7 +185,7 @@ Ext.define('PVE.storage.NFSEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/RBDEdit.js b/www/manager6/storage/RBDEdit.js
index a95e617..d8ae300 100644
--- a/www/manager6/storage/RBDEdit.js
+++ b/www/manager6/storage/RBDEdit.js
@@ -4,7 +4,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'rbd';
} else {
delete values.storage;
@@ -22,7 +22,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -30,14 +30,14 @@ Ext.define('PVE.storage.RBDInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'pool',
value: 'rbd',
fieldLabel: gettext('Pool'),
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'monhost',
vtype: 'HostList',
value: '',
@@ -45,7 +45,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'username',
value: 'admin',
fieldLabel: gettext('User name'),
@@ -82,7 +82,7 @@ Ext.define('PVE.storage.RBDInputPanel', {
];
/*jslint confusion: false*/
- if (me.create || me.storageId !== 'local') {
+ if (me.isCreate || me.storageId !== 'local') {
me.column2.unshift({
xtype: 'pveNodeSelector',
name: 'nodes',
@@ -104,9 +104,9 @@ Ext.define('PVE.storage.RBDEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -115,7 +115,7 @@ Ext.define('PVE.storage.RBDEdit', {
}
var ipanel = Ext.create('PVE.storage.RBDInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -127,7 +127,7 @@ Ext.define('PVE.storage.RBDEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/SheepdogEdit.js b/www/manager6/storage/SheepdogEdit.js
index 5d7c736..da56b5c 100644
--- a/www/manager6/storage/SheepdogEdit.js
+++ b/www/manager6/storage/SheepdogEdit.js
@@ -4,7 +4,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'sheepdog';
values.content = 'images';
@@ -24,7 +24,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -32,7 +32,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'portal',
value: '127.0.0.1:7000',
fieldLabel: gettext('Gateway'),
@@ -50,7 +50,7 @@ Ext.define('PVE.storage.SheepdogInputPanel', {
}
];
- if (me.create || me.storageId !== 'local') {
+ if (me.isCreate || me.storageId !== 'local') {
me.column2.unshift({
xtype: 'pveNodeSelector',
name: 'nodes',
@@ -72,9 +72,9 @@ Ext.define('PVE.storage.SheepdogEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -83,7 +83,7 @@ Ext.define('PVE.storage.SheepdogEdit', {
}
var ipanel = Ext.create('PVE.storage.SheepdogInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -95,7 +95,7 @@ Ext.define('PVE.storage.SheepdogEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/ZFSEdit.js b/www/manager6/storage/ZFSEdit.js
index 12d6af1..0f0f470 100644
--- a/www/manager6/storage/ZFSEdit.js
+++ b/www/manager6/storage/ZFSEdit.js
@@ -4,7 +4,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'zfs';
values.content = 'images';
} else {
@@ -22,7 +22,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -30,35 +30,35 @@ Ext.define('PVE.storage.ZFSInputPanel', {
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'portal',
value: '',
fieldLabel: gettext('Portal'),
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'pool',
value: '',
fieldLabel: gettext('Pool'),
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'blocksize',
value: '4k',
fieldLabel: gettext('Block Size'),
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'target',
value: '',
fieldLabel: gettext('Target'),
allowBlank: false
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'comstar_tg',
value: '',
fieldLabel: gettext('Target group'),
@@ -75,7 +75,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
fieldLabel: gettext('Enable')
},
{
- xtype: me.create ? 'pveiScsiProviderSelector' : 'displayfield',
+ xtype: me.isCreate ? 'pveiScsiProviderSelector' : 'displayfield',
name: 'iscsiprovider',
value: 'comstar',
fieldLabel: gettext('iSCSI Provider'),
@@ -96,7 +96,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
fieldLabel: gettext('Write cache')
},
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'comstar_hg',
value: '',
fieldLabel: gettext('Host group'),
@@ -104,7 +104,7 @@ Ext.define('PVE.storage.ZFSInputPanel', {
}
];
- if (me.create || me.storageId !== 'local') {
+ if (me.isCreate || me.storageId !== 'local') {
me.column2.unshift({
xtype: 'pveNodeSelector',
name: 'nodes',
@@ -126,9 +126,9 @@ Ext.define('PVE.storage.ZFSEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -137,7 +137,7 @@ Ext.define('PVE.storage.ZFSEdit', {
}
var ipanel = Ext.create('PVE.storage.ZFSInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -149,7 +149,7 @@ Ext.define('PVE.storage.ZFSEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/storage/ZFSPoolEdit.js b/www/manager6/storage/ZFSPoolEdit.js
index 6d4e70d..cd544b6 100644
--- a/www/manager6/storage/ZFSPoolEdit.js
+++ b/www/manager6/storage/ZFSPoolEdit.js
@@ -40,7 +40,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
onGetValues: function(values) {
var me = this;
- if (me.create) {
+ if (me.isCreate) {
values.type = 'zfspool';
} else {
delete values.storage;
@@ -57,7 +57,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
me.column1 = [
{
- xtype: me.create ? 'textfield' : 'displayfield',
+ xtype: me.isCreate ? 'textfield' : 'displayfield',
name: 'storage',
value: me.storageId || '',
fieldLabel: 'ID',
@@ -66,7 +66,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
}
];
- if (me.create) {
+ if (me.isCreate) {
me.column1.push(Ext.create('PVE.storage.ZFSPoolSelector', {
name: 'pool',
fieldLabel: gettext('ZFS Pool'),
@@ -118,7 +118,7 @@ Ext.define('PVE.storage.ZFSPoolInputPanel', {
}
];
- if (me.create || me.storageId !== 'local') {
+ if (me.isCreate || me.storageId !== 'local') {
me.column2.unshift({
xtype: 'pveNodeSelector',
name: 'nodes',
@@ -140,9 +140,9 @@ Ext.define('PVE.storage.ZFSPoolEdit', {
initComponent : function() {
var me = this;
- me.create = !me.storageId;
+ me.isCreate = !me.storageId;
- if (me.create) {
+ if (me.isCreate) {
me.url = '/api2/extjs/storage';
me.method = 'POST';
} else {
@@ -151,7 +151,7 @@ Ext.define('PVE.storage.ZFSPoolEdit', {
}
var ipanel = Ext.create('PVE.storage.ZFSPoolInputPanel', {
- create: me.create,
+ isCreate: me.isCreate,
storageId: me.storageId
});
@@ -163,7 +163,7 @@ Ext.define('PVE.storage.ZFSPoolEdit', {
me.callParent();
- if (!me.create) {
+ if (!me.isCreate) {
me.load({
success: function(response, options) {
var values = response.result.data;
diff --git a/www/manager6/window/Edit.js b/www/manager6/window/Edit.js
index 0ac5120..147aa0b 100644
--- a/www/manager6/window/Edit.js
+++ b/www/manager6/window/Edit.js
@@ -1,5 +1,3 @@
-// fixme: how can we avoid those lint errors?
-/*jslint confusion: true */
Ext.define('PVE.window.Edit', {
extend: 'Ext.window.Window',
alias: 'widget.pveWindowEdit',
@@ -10,9 +8,9 @@ Ext.define('PVE.window.Edit', {
// Create: <subject>
subject: undefined,
- // set create to true if you want a Create button (instead
+ // set isCreate to true if you want a Create button (instead of
// OK and RESET)
- create: false,
+ isCreate: false,
// set to true if you want an Add button (instead of Create)
isAdd: false,
@@ -184,6 +182,8 @@ Ext.define('PVE.window.Edit', {
throw "no url specified";
}
+ if (me.create) {throw "deprecated parameter, use isCreate";}
+
var items = Ext.isArray(me.items) ? me.items : [ me.items ];
me.items = undefined;
@@ -207,7 +207,7 @@ Ext.define('PVE.window.Edit', {
var form = me.formPanel.getForm();
var submitText;
- if (me.create) {
+ if (me.isCreate) {
if (me.isAdd) {
submitText = gettext('Add');
} else if (me.isRemove) {
@@ -221,7 +221,7 @@ Ext.define('PVE.window.Edit', {
var submitBtn = Ext.create('Ext.Button', {
text: submitText,
- disabled: !me.create,
+ disabled: !me.isCreate,
handler: function() {
me.submit();
}
@@ -238,7 +238,7 @@ Ext.define('PVE.window.Edit', {
var set_button_status = function() {
var valid = form.isValid();
var dirty = form.isDirty();
- submitBtn.setDisabled(!valid || !(dirty || me.create));
+ submitBtn.setDisabled(!valid || !(dirty || me.isCreate));
resetBtn.setDisabled(!dirty);
};
@@ -254,10 +254,10 @@ Ext.define('PVE.window.Edit', {
var twoColumn = items[0].column1 || items[0].column2;
if (me.subject && !me.title) {
- me.title = PVE.Utils.dialog_title(me.subject, me.create, me.isAdd);
+ me.title = PVE.Utils.dialog_title(me.subject, me.isCreate, me.isAdd);
}
- if (me.create) {
+ if (me.isCreate) {
me.buttons = [ submitBtn ] ;
} else {
me.buttons = [ submitBtn, resetBtn ];
--
2.1.4
More information about the pve-devel
mailing list