just for test
" }).show(); } }], url: './data/lan.json', method: 'get', reader: { type: 'json', root: 'data' }, */ items: [ { xtype: 'combobox', changeEnable:true, fieldLabel: smb.charset.label.connType, id: 'lanChkConnectionType', editable: false, queryMode: 'local', name: 'connType', store: Ext.create('Ext.data.Store',{ fields: ['name', 'value'], data: [ {value: 'static', name: smb.charset.comboBox.staticConn}, {value: 'dynamic', name: smb.charset.comboBox.dynamic} ] }), value: 'dynamic', displayField: 'name', valueField: 'value' }, { xtype: 'detailSettings', id: 'staticLanDetailSetting', hidden: true, disabled: true, type: 'lanConnectionType', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'textfield', id:'lanStaticIp', value: '0.0.0.0', fieldLabel:smb.charset.label.ipAddress, name: 'ipAddress', vtype: 'ip' }, { xtype: 'textfield', id:'lanStaticMask', value: '0.0.0.0', fieldLabel:smb.charset.label.netmask, vtype:'mask', name:'netMask' }, { xtype: 'textfield', id:'lanStaticGateway', vtype: 'ip', value: '0.0.0.0', changeEnable: true, fieldLabel: smb.charset.label.gateway, allowAllZero:true, allowBlank: true, name: 'gateway' } ] }, { xtype: 'detailSettings', id: 'dynamicLanDetailSetting', type: 'lanConnectionType', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.fallbackIp, boxLabel: smb.charset.label.enable, inputWidth: 13, id: 'isUseFallback', name: 'isUseFallback', checked: true }, { xtype: 'textfield', fieldLabel: smb.charset.label.dhcpFallBackIp, id: 'fallbackIp', name: 'fallbackIp', vtype: 'ip' }, { xtype: 'textfield', fieldLabel: smb.charset.label.dhcpFallBackMask, id: 'fallbackMask', name: 'fallbackMask', vtype: 'mask' } ] }, { xtype: 'checkbox', id:'igmpProxy', labelAlign: 'right', inputWidth: 13, fieldLabel: smb.charset.label.igmpProxy, boxLabel: smb.charset.label.enable, name:'igmpProxy' }, { xtype: 'checkbox', id:'lanDhcpServer', labelAlign: 'right', disabled: true, hidden: true, inputWidth: 13, fieldLabel: smb.charset.label.dhcpServer, boxLabel: smb.charset.label.enable, name:'dhcpServer', checked: false }, { xtype: 'smbAdvancedSettings', id: 'dhcpAdvSetting', disabled: true, hidden: true, title: smb.charset.label.dhcpServer, // expandItem: 'advancedSettings', collapsible: true, width: 'auto', items: [ { xtype: 'fieldcontainer', layout: { type: 'hbox' }, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ {xtype: 'textfield', changeEnable:true, vtype: 'ip', id: 'lanStartIpAddress', fieldLabel: smb.charset.label.startIpAddress, name:'startIpAddress'}, {xtype: 'textfield', changeEnable:true, vtype: 'ip', id: 'lanEndIpAddress', endFlag: true, fieldLabel: smb.charset.label.endIpAddress, name: 'endIpAddress', labelWidth: 120} ] }, { xtype: 'fieldcontainer', layout: { type: 'hbox' }, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ {xtype: 'textfield', changeEnable:true, vtype: 'ip', allowBlank: true, allowAllZero:true, id:'lanDefaultGateway', fieldLabel: smb.charset.label.defaultGateway, name: 'defaultGateway'}, {xtype: 'textfield', changeEnable:true, vtype:'domain', allowBlank: true, id:'lanDefaultDomain', fieldLabel: smb.charset.label.defaultDomain, name: 'defaultDomain', labelWidth: 120, maxLength: 30, enforceMaxLength: true} ] }, { xtype: 'fieldcontainer', layout: { type: 'hbox' }, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ {xtype: 'textfield', changeEnable:true, vtype: 'ip', allowAllZero:true, allowBlank: true, id:'lanPrimaryDns', fieldLabel: smb.charset.label.primaryDns, name: 'primaryDns'}, {xtype: 'textfield', changeEnable:true, vtype: 'ip', allowAllZero:true, allowBlank: true, id:'lanSecondaryDns', fieldLabel: smb.charset.label.secondaryDns, name: 'secondaryDns', labelWidth: 120} ] }, { xtype: 'fieldcontainer', layout: { type: 'hbox' }, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ {xtype: 'numberfield', changeEnable:true, fieldLabel:smb.charset.label.dhcpLeaseTime, id:'lanDhcpLeaseTime', decimalPrecision:0, minValue:1, maxValue:2880, name: 'dhcpLeaseTime', labelAlign: 'right'}, {xtype:'displayfield', hideLabel:true, id:'dhcpMinutes', value:smb.charset.label.minutes, disabledCls:'disabledLabel', margin:'3 0 0 5'} ] }, { xtype: 'fieldset', title: smb.charset.label.addrReservation, border: '1 0 0 0', padding: 5, items:[ { xtype: 'smbGrid', store: 'addressReservationGrid', id: 'addressReservationGrid', selModel: false, columns: [ { text: smb.charset.column.enable, hideable: false, dataIndex: 'enable', width: 80, align: 'center', editor: { xtype: 'checkbox' }, defaultValue: true, renderer: function(value) { if(value == true) { return ''; } else if(value == false) { return ''; } } }, { text: smb.charset.column.macAddr, hideable: false, dataIndex:'mac', flex:1, editor: { xtype: 'textfield', allowBlank: false, vtype: 'mac' } }, { text: smb.charset.column.reservedIpAddr, hideable: false, dataIndex:'ip', flex:1, editor: { xtype: 'textfield', allowBlank: false, vtype: 'ip' } } ] } ] } ] } ], buttons: [ { xtype: 'button', id: 'lanSubmit', hidden:false, elemType:'saveBtn', text: smb.charset.button.submit } ], initComponent: function(){ this.callParent(arguments); if( smb.mode.status == 'apRouter' || smb.mode.status == 'apClientRouter' ) { Ext.getCmp('lanChkConnectionType').setReadOnly(true); Ext.getCmp('lanStaticGateway').hide(); //Ext.getCmp('igmpProxy').show(); } } }); Ext.define('smb.model.lan',{ extend: 'Ext.data.Model', fields: [ {mapping: 'connType', name:'connType', type: 'string'}, {mapping: 'isUseFallback', name:'isUseFallback', type: 'boolean'}, {mapping: 'fallbackIp', name:'fallbackIp', type: 'string'}, {mapping: 'fallbackMask', name:'fallbackMask', type: 'string'}, {mapping: 'ipAddress', name:'ipAddress', type: 'string'}, {mapping: 'netMask', name: 'netMask', type: 'string'}, {mapping: 'gateway', name: 'gateway', type: 'string'}, {mapping: 'igmpProxy', name: 'igmpProxy', type: 'boolean'}, {mapping: 'dhcpServer', name: 'dhcpServer', type: 'boolean'}, {mapping: 'startIpAddress', name: 'startIpAddress', type: 'string'}, {mapping: 'endIpAddress', name: 'endIpAddress', type: 'string'}, // {mapping: 'subnetMask', name: 'subnetMask', type: 'auto'}, {mapping: 'defaultGateway', name: 'defaultGateway', type: 'auto'}, {mapping: 'defaultDomain', name: 'defaultDomain', type: 'auto'}, {mapping: 'primaryDns', name: 'primaryDns', type: 'auto'}, {mapping: 'secondaryDns', name: 'secondaryDns', type: 'auto'}, {mapping: 'dhcpLeaseTime', name: 'dhcpLeaseTime', type: 'string'} ], proxy: { type: 'ajax', url: './data/lan.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.wan',{ extend: 'Ext.data.Model', fields: [ {mapping: 'pcMac', name: 'pcMac', type: 'string'}, {mapping: 'factoryMac', name: 'factoryMac', type: 'string'}, {mapping: 'connType', name: 'connType', type: 'string'}, {mapping: 'staticIp', name: 'staticIp', type: 'string'}, {mapping: 'staticMask', name: 'staticMask', type: 'string'}, {mapping: 'staticGateway', name: 'staticGateway', type: 'string'}, {mapping: 'staticDns1', name: 'staticDns1', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'staticDns2', name: 'staticDns2', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'l2tpServerIp', name: 'l2tpServerIp', type: 'string'}, {mapping: 'l2tpUserName', name: 'l2tpUsername', type: 'string'}, {mapping: 'l2tpPassword', name: 'l2tpPassword', type: 'string'}, {mapping: 'l2tpConnMode', name: 'l2tpConnMode', type: 'string'}, {mapping: 'l2tpIdleTime', name: 'l2tpIdleTime', type: 'int'}, {mapping: 'pptpServerIp', name: 'pptpServerIp', type: 'string'}, {mapping: 'pptpUserName', name: 'pptpUsername', type: 'string'}, {mapping: 'pptpPassword', name: 'pptpPassword', type: 'string'}, {mapping: 'pptpConnMode', name: 'pptpConnMode', type: 'string'}, {mapping: 'pptpIdleTime', name: 'pptpIdleTime', type: 'int'}, {mapping: 'pppoeUserName', name: 'pppoeUsername', type: 'string'}, {mapping: 'pppoePassword', name: 'pppoePassword', type: 'string'}, {mapping: 'pppoeConnMode', name: 'pppoeConnMode', type: 'string'}, {mapping: 'pppoeFromHhMm', name: 'pppoeFromHhMm', type: 'string'}, {mapping: 'pppoeToHhMm', name: 'pppoeToHhMm', type: 'string'}, {mapping: 'pppoeIdleTime', name: 'pppoeIdleTime', type: 'int'}, {mapping: 'l2tpConnectionType', name: 'l2tpConnectionType', type: 'string'}, {mapping: 'l2tpConnStaticIp', name: 'l2tpConnStaticIp', type: 'string'}, {mapping: 'l2tpConnStaticMask', name: 'l2tpConnStaticMask', type: 'string'}, {mapping: 'l2tpConnStaticGateway', name: 'l2tpConnStaticGateway', type: 'string'}, {mapping: 'l2tpConnStaticDns1', name: 'l2tpConnStaticDns1', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'pptpConnectionType', name: 'pptpConnectionType', type: 'string'}, {mapping: 'pptpConnStaticIp', name: 'pptpConnStaticIp', type: 'string'}, {mapping: 'pptpConnStaticMask', name: 'pptpConnStaticMask', type: 'string'}, {mapping: 'pptpConnStaticGateway', name: 'pptpConnStaticGateway', type: 'string'}, {mapping: 'pptpConnStaticDns1', name: 'pptpConnStaticDns1', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'dynamicUserDnsServer', name: 'dynamicUserDnsServer', type: 'auto'}, {mapping: 'dynamicDns1', name: 'dynamicDns1', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'dynamicDns2', name: 'dynamicDns2', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'staticMtuSize', name: 'staticMtuSize', type: 'auto', defaultValue:1500}, {mapping: 'dynamicMtuSize', name: 'dynamicMtuSize', type: 'auto', defaultValue:1480}, {mapping: 'l2tpMtuSize', name: 'l2tpMtuSize', type: 'auto', defaultValue:1460}, {mapping: 'pptpMtuSize', name: 'pptpMtuSize', type: 'auto', defaultValue:1420}, {mapping: 'pppoeMtuSize', name: 'pppoeMtuSize', type: 'auto', defaultValue:1480}, {mapping: 'pppoeServiceName', name: 'pppoeServiceName', type: 'string'}, {mapping: 'pppoeAcName', name: 'pppoeAcName', type: 'string'}, {mapping: 'pppoeDetectInterval', name: 'pppoeDetectInterval', type: 'auto'}, {mapping: 'pppoeUserIspIp', name: 'pppoeUserIspIp', type: 'auto'}, {mapping: 'pppoeIspIp', name: 'pppoeIspIp', type: 'string'}, {mapping: 'pppoeUserDnsServer', name: 'pppoeUserDnsServer', type: 'auto'}, {mapping: 'pppoeDns1', name: 'pppoeDns1', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'pppoeDns2', name: 'pppoeDns2', type: 'string', defaultValue:'0.0.0.0'}, {mapping: 'pppoeConnectionType', name: 'pppoeConnectionType', type: 'string'}, {mapping: 'pppoeConnStaticIp', name: 'pppoeConnStaticIp', type: 'string'}, {mapping: 'pppoeConnStaticMask', name: 'pppoeConnStaticMask', type: 'string'}, {mapping: 'mac', name: 'macCloneValue', type: 'string'} ], proxy: { type: 'ajax', url: './data/wan.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.wan', { extend: 'smb.view.module', model: 'wan', id: 'wan', alias: 'widget.wan', title: smb.charset.module.wan, model: 'wan', // queryMode: 'local', // autoLoad: true, url: './data/wan.json', items: [ { xtype: 'container', layout: 'hbox', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'combobox', fieldLabel: smb.charset.label.wanConnectionType, id: 'chkConnectionType', margin: '0 0 5 0', editable: false, labelAlign: 'right', queryMode: 'local', name: 'connType', store: Ext.create('Ext.data.Store', { fields: ['name', 'value'], data: [{ value: 'static', name: smb.charset.comboBox.staticConn }, { value: 'dynamic', name: smb.charset.comboBox.dynamic }, { value: 'pppoe', name: smb.charset.comboBox.pppoe }, { value: 'l2tp', name: smb.charset.comboBox.l2tp }, { value: 'pptp', name: smb.charset.comboBox.pptp }] }), displayField: 'name', valueField: 'value', value: '' }, { xtype: 'smbButton', id: 'wanConn', text: smb.charset.button.connect, hidden: true, margin: '0 5 0 5' }, { xtype: 'smbButton', id: 'wanDisconn', hidden: true, text: smb.charset.button.disconnect }] }, { xtype: 'detailSettings', id: 'staticDetailSetting', type: 'wanConnectionType', hidden: true, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'textfield', vtype: 'ip', fieldLabel: smb.charset.label.ipAddress, changeEnable: true, name: 'staticIp' }, { xtype: 'textfield', vtype: 'mask', fieldLabel: smb.charset.label.netmask, changeEnable: true, name: 'staticMask' }, { xtype: 'textfield', vtype: 'ip', changeEnable: true, fieldLabel: smb.charset.label.gateway, name: 'staticGateway' }, { xtype: 'textfield', vtype: 'ip', value: '0.0.0.0', changeEnable: true, fieldLabel: smb.charset.label.priDns, // allowBlank: true, // allowAllZero: true, name: 'staticDns1' }, { xtype: 'textfield', vtype: 'ip', value: '0.0.0.0', changeEnable: true, fieldLabel: smb.charset.label.secDns, allowBlank: true, allowAllZero: true, name: 'staticDns2' }] }, { xtype: 'detailSettings', id: 'l2tpDetailSetting', type: 'wanConnectionType', hidden: true, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'textfield', changeEnable: true, fieldLabel: smb.charset.label.serverIpName, maxLength: 63, enforceMaxLength: true, name: 'l2tpServerIp', validator: function(value) { if ( smb.verify.ip(value)!=true && smb.verify.domain(value)!=true ) { return smb.charset.validation.invalidIpOrDomain; } else { return true; } } }, { xtype: 'textfield', vtype: 'username', changeEnable: true, fieldLabel: smb.charset.label.username, maxLength: 119, enforceMaxLength: true, allowBlank: true, name: 'l2tpUsername' }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.password, id: 'l2tpPwd', name: 'l2tpPassword', changeEnable: true, inputType: 'password', maxLength: 119, enforceMaxLength: true, allowBlank: true, vtype: 'wanPwd', changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('l2tpPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('l2tpPwdText').setValue(newValue); } Ext.getCmp('l2tpPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'l2tpPwdText', submitValue: false, hidden: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', maxLength: 119, enforceMaxLength: true, allowBlank: true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('l2tpPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('l2tpPwd').setValue(newValue); } Ext.getCmp('l2tpPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showL2tpPwd', margin: '2 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.connectionMode, name: 'l2tpConnMode', editable: false, queryMode: 'local', value: 'automatic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'onDemand', display:smb.charset.label.onDemand}, {value:'automatic', display:smb.charset.label.automatic}, {value:'manual', display:smb.charset.label.manual} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ Ext.getCmp('l2tpManualIdleTime').clearInvalid(); Ext.getCmp('l2tpManualIdleTime').disable(); Ext.getCmp('l2tpManualIdle').hide(); Ext.getCmp('l2tpDemandIdleTime').clearInvalid(); Ext.getCmp('l2tpDemandIdleTime').clearInvalid(); Ext.getCmp('l2tpDemandIdleTime').disable(); Ext.getCmp('l2tpDemandIdle').hide(); if( newValue=='manual') { Ext.getCmp('l2tpManualIdleTime').enable(); Ext.getCmp('l2tpManualIdle').show(); } else if( newValue=='onDemand') { Ext.getCmp('l2tpDemandIdleTime').enable(); Ext.getCmp('l2tpDemandIdle').show(); } } } }, /* { xtype: 'fieldcontainer', fieldLabel: smb.charset.label.connectionMode, name: 'connMode', defaultType: 'radiofield', layout: { type: 'hbox' }, width: 700, items:[ { xtype: 'radiofield', changeEnable: true, inputValue: 'onDemand', width: 100, boxLabel: smb.charset.label.onDemand, name: 'l2tpConnMode', id: 'l2tpDemand' }, { xtype: 'radiofield', changeEnable: true, inputValue: 'automatic', width: 100, boxLabel: smb.charset.label.automatic, name: 'l2tpConnMode', checked: true }, { xtype: 'radiofield', changeEnable: true, inputValue: 'manual', width: 100, boxLabel: smb.charset.label.manual, name: 'l2tpConnMode', id: 'l2tpManual' } ] }, */ { xtype: 'fieldcontainer', id: 'l2tpDemandIdle', hidden: true, layout: 'hbox', width: 700, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'numberfield', minValue: 0, maxValue: 99, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.maxIdleTime, name: 'l2tpIdleTime', id: 'l2tpDemandIdleTime', disabled: true }, { xtype: 'displayfield', hideLabel: true, id: 'l2tpDemandMinutes', value: smb.charset.label.minutes, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'fieldcontainer', id: 'l2tpManualIdle', hidden: true, layout: 'hbox', width: 700, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'numberfield', minValue: 0, maxValue: 99, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.maxIdleTime, name: 'l2tpIdleTime', id: 'l2tpManualIdleTime', disabled: true }, { xtype: 'displayfield', hideLabel: true, id: 'l2tpManualMinutes', value: smb.charset.label.minutes, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.secondConn, id: 'l2tpConnectionType', name: 'l2tpConnectionType', editable: false, queryMode: 'local', value: 'dynamic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'static', display:smb.charset.label.staticIp}, {value:'dynamic', display:smb.charset.label.dynamicIp} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ if(newValue=='static') { Ext.getCmp('l2tpConnStaticIpDetails').show(); Ext.getCmp('l2tpConnStaticIpDetails').enable(); var tempArr = Ext.getCmp('l2tpConnStaticIpDetails').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(item) { if(item.isDisabled()) { item.enable(); } } }); } else { Ext.getCmp('l2tpConnStaticIpDetails').hide(); Ext.getCmp('l2tpConnStaticIpDetails').disable(); } } } }, /* { xtype: 'radiogroup', fieldLabel: smb.charset.label.secondConn, columns: 3, vertical: false, width: 580, height: 24, items: [ { inputValue: 'static', changeEnable: true, id: 'l2tpConnectionTypeStatic', boxLabel: smb.charset.label.staticIp, name: 'l2tpConnectionType', checked: true }, { inputValue: 'dynamic', changeEnable: true, id: 'l2tpConnectionTypedynamic', boxLabel: smb.charset.label.dynamicIp, name: 'l2tpConnectionType' } ] }, */ { xtype: 'container', id: 'l2tpConnStaticIpDetails', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'textfield', vtype: 'ip', fieldLabel: smb.charset.label.ipAddress, changeEnable: true, name: 'l2tpConnStaticIp', id: 'forTest' }, { xtype: 'textfield', vtype: 'mask', fieldLabel: smb.charset.label.netmask, changeEnable: true, name: 'l2tpConnStaticMask' }, { xtype: 'textfield', vtype: 'ip', allowBlank: true, allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.gateway, name: 'l2tpConnStaticGateway' }, { xtype: 'textfield', vtype: 'ip', allowBlank: true, allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.priDns, name: 'l2tpConnStaticDns1' } ] } ] }, { xtype: 'detailSettings', id: 'pptpDetailSetting', type: 'wanConnectionType', hidden: true, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'textfield', changeEnable: true, fieldLabel: smb.charset.label.serverIpName, name: 'pptpServerIp', maxLength: 63, enforceMaxLength: true, validator: function(value) { if ( smb.verify.ip(value)!=true && smb.verify.domain(value)!=true ) { return smb.charset.validation.invalidIpOrDomain; } else { return true; } } }, { xtype: 'textfield', vtype: 'username', changeEnable: true, fieldLabel: smb.charset.label.username, maxLength: 119, enforceMaxLength: true, allowBlank: true, name: 'pptpUsername' }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.password, id: 'pptpPwd', name: 'pptpPassword', changeEnable: true, inputType: 'password', maxLength: 119, enforceMaxLength: true, allowBlank: true, vtype: 'wanPwd', changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pptpPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pptpPwdText').setValue(newValue); } Ext.getCmp('pptpPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'pptpPwdText', submitValue: false, hidden: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', maxLength: 119, enforceMaxLength: true, allowBlank: true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pptpPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pptpPwd').setValue(newValue); } Ext.getCmp('pptpPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showPptpPwd', margin: '2 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.connectionMode, name: 'pptpConnMode', editable: false, queryMode: 'local', value: 'automatic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'onDemand', display:smb.charset.label.onDemand}, {value:'automatic', display:smb.charset.label.automatic}, {value:'manual', display:smb.charset.label.manual} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ Ext.getCmp('pptpManualIdleTime').clearInvalid(); Ext.getCmp('pptpManualIdleTime').disable(); Ext.getCmp('pptpManualIdle').hide(); Ext.getCmp('pptpDemandIdleTime').clearInvalid(); Ext.getCmp('pptpDemandIdleTime').clearInvalid(); Ext.getCmp('pptpDemandIdleTime').disable(); Ext.getCmp('pptpDemandIdle').hide(); if( newValue=='manual') { Ext.getCmp('pptpManualIdleTime').enable(); Ext.getCmp('pptpManualIdle').show(); } else if( newValue=='onDemand') { Ext.getCmp('pptpDemandIdleTime').enable(); Ext.getCmp('pptpDemandIdle').show(); } } } }, /* { xtype: 'fieldcontainer', fieldLabel: smb.charset.label.connectionMode, name: 'connMode', defaultType: 'radiofield', layout: { type: 'hbox' }, width: 700, items:[ { xtype: 'radiofield', changeEnable: true, inputValue: 'onDemand', width: 100, boxLabel: smb.charset.label.onDemand, name: 'pptpConnMode', id: 'pptpDemand' }, { xtype: 'radiofield', changeEnable: true, inputValue: 'automatic', width: 100, boxLabel: smb.charset.label.automatic, name: 'pptpConnMode', checked: true }, { xtype: 'radiofield', changeEnable: true, inputValue: 'manual', width: 100, boxLabel: smb.charset.label.manual, name: 'pptpConnMode', id: 'pptpManual' } ] }, */ { xtype: 'fieldcontainer', id: 'pptpDemandIdle', hidden: true, layout: 'hbox', width: 700, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'numberfield', minValue: 0, maxValue: 99, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.maxIdleTime, name: 'pptpIdleTime', id: 'pptpDemandIdleTime', disabled: true }, { xtype: 'displayfield', id: 'pptpDemandMinutes', value: smb.charset.label.minutes, hideLabel: true, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'fieldcontainer', id: 'pptpManualIdle', hidden: true, layout: 'hbox', width: 700, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'numberfield', fieldLabel: smb.charset.label.maxIdleTime, id: 'pptpManualIdleTime', name: 'pptpIdleTime', changeEnable: true, minValue: 0, maxValue: 99, decimalPrecision:0, disabled: true }, { xtype: 'displayfield', hideLabel: true, id: 'pptpManualMinutes', value: smb.charset.label.minutes, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.secondConn, id: 'pptpConnectionType', name: 'pptpConnectionType', editable: false, queryMode: 'local', value: 'dynamic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'static', display:smb.charset.label.staticIp}, {value:'dynamic', display:smb.charset.label.dynamicIp} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ if(newValue=='static') { Ext.getCmp('pptpConnStaticIpDetails').show(); Ext.getCmp('pptpConnStaticIpDetails').enable(); var tempArr = Ext.getCmp('pptpConnStaticIpDetails').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(item) { if(item.isDisabled()) { item.enable(); } } }); } else { Ext.getCmp('pptpConnStaticIpDetails').hide(); Ext.getCmp('pptpConnStaticIpDetails').disable(); } } } }, /* { xtype: 'radiogroup', fieldLabel: smb.charset.label.secondConn, columns: 3, vertical: false, width: 580, height: 24, defaultType: 'radiofield', items: [{ inputValue: 'static', changeEnable: true, id: 'pptpConnectionTypeStatic', boxLabel: smb.charset.label.staticIp, name: 'pptpConnectionType', checked: true }, { inputValue: 'dynamic', changeEnable: true, id: 'pptpConnectionTypedynamic', boxLabel: smb.charset.label.dynamicIp, name: 'pptpConnectionType' } ] }, */ { xtype: 'container', id: 'pptpConnStaticIpDetails', defaults: { //width: 300, labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'textfield', vtype: 'ip', fieldLabel: smb.charset.label.ipAddress, changeEnable: true, name: 'pptpConnStaticIp' }, { xtype: 'textfield', vtype: 'mask', fieldLabel: smb.charset.label.netmask, changeEnable: true, name: 'pptpConnStaticMask' }, { xtype: 'textfield', vtype: 'ip', allowBlank: true, allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.gateway, name: 'pptpConnStaticGateway' }, { xtype: 'textfield', vtype: 'ip', allowBlank: true, allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.priDns, name: 'pptpConnStaticDns1' }] }] }, { xtype: 'detailSettings', id: 'pppoeDetailSetting', type: 'wanConnectionType', hidden: true, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'textfield', vtype: 'username', changeEnable: true, name: 'pppoeUsername', maxLength: 119, enforceMaxLength: true, allowBlank: true, fieldLabel: smb.charset.label.username }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.password, id: 'pppoePwd', name: 'pppoePassword', changeEnable: true, inputType: 'password', maxLength: 119, enforceMaxLength: true, allowBlank: true, changeFlag: true, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pppoePwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pppoePwdText').setValue(newValue); } Ext.getCmp('pppoePwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'pppoePwdText', submitValue: false, hidden: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', maxLength: 119, enforceMaxLength: true, allowBlank: true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pppoePwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pppoePwd').setValue(newValue); } Ext.getCmp('pppoePwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showPppoePwd', margin: '2 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.connectionMode, name: 'pppoeConnMode', editable: false, queryMode: 'local', value: 'automatic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'onDemand', display:smb.charset.label.onDemand}, {value:'automatic', display:smb.charset.label.automatic}, {value:'timeBased', display:smb.charset.label.timeBased}, {value:'manual', display:smb.charset.label.manual} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ Ext.getCmp('pppoeManualIdleTime').clearInvalid(); Ext.getCmp('pppoeManualIdleTime').disable(); Ext.getCmp('pppoeManualIdle').hide(); Ext.getCmp('pppoeDemandIdleTime').clearInvalid(); Ext.getCmp('pppoeDemandIdleTime').clearInvalid(); Ext.getCmp('pppoeDemandIdleTime').disable(); Ext.getCmp('pppoeDemandIdle').hide(); Ext.getCmp('pppoeManualIdleTime').clearInvalid(); Ext.getCmp('pppoeFromHhMm').clearInvalid(); Ext.getCmp('pppoeToHhMm').clearInvalid(); Ext.getCmp('pppoeFromHhMm').disable(); Ext.getCmp('pppoeToHhMm').disable(); Ext.getCmp('pppoeTimeCnt').hide(); if( newValue=='manual') { Ext.getCmp('pppoeManualIdleTime').enable(); Ext.getCmp('pppoeManualIdle').show(); } else if( newValue=='onDemand') { Ext.getCmp('pppoeDemandIdleTime').enable(); Ext.getCmp('pppoeDemandIdle').show(); } else if( newValue=='timeBased') { Ext.getCmp('pppoeFromHhMm').enable(); Ext.getCmp('pppoeToHhMm').enable(); Ext.getCmp('pppoeTimeCnt').show(); } } } }, /* { xtype: 'fieldcontainer', fieldLabel: smb.charset.label.connectionMode, layout: { type: 'hbox' }, defaultType: 'radiofield', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, width: 900, items: [ { xtype: 'radiofield', inputValue: 'onDemand', inputWidth: 13, width: 100, boxLabel: smb.charset.label.onDemand, name: 'pppoeConnMode', id: 'pppoeDemand', changeEnable: true }, { xtype: 'radiofield', inputValue: 'automatic', inputWidth: 13, width: 100, boxLabel: smb.charset.label.automatic, name: 'pppoeConnMode', checked: true }, { xtype: 'radiofield', inputValue: 'timeBased', inputWidth: 13, width: 100, boxLabel: smb.charset.label.timeBased, id: 'pppoeTimeBased', name: 'pppoeConnMode' }, { xtype: 'radiofield', inputValue: 'manual', inputWidth: 13, width: 100, boxLabel: smb.charset.label.manual, name: 'pppoeConnMode', id: 'pppoeManual' } ] }, */ { xtype: 'fieldcontainer', id: 'pppoeDemandIdle', hidden: true, layout: 'hbox', width: 800, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', minValue: 0, maxValue: 99, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.maxIdleTime, name: 'pppoeIdleTime', id: 'pppoeDemandIdleTime', disabled: true }, { xtype: 'displayfield', hideLabel: true, id: 'pppoeDemandMinutes', value: smb.charset.label.minutes, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'fieldcontainer', id: 'pppoeTimeCnt', hidden: true, changeEnable: true, width: 800, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'textfield', changeEnable: true, fieldLabel: smb.charset.label.fromHhMm, name: 'pppoeFromHhMm', id: 'pppoeFromHhMm', vtype: 'timeStart', disabled: true }, { xtype: 'textfield', changeEnable: true, fieldLabel: smb.charset.label.toHhMm, name: 'pppoeToHhMm', id: 'pppoeToHhMm', vtype: 'timeStart', disabled: true, validator: function(value) { if (smb.verify.timeEnd(value) == true) { var timeStart = smb.format.timeToInt(Ext.getCmp('pppoeFromHhMm').getValue()); var timeEnd = smb.format.timeToInt(value); if (timeStart < timeEnd) { return true; } else { return smb.charset.validation.timeRange; } } else { return smb.charset.validation.timeEnd; } } } ] }, { xtype: 'fieldcontainer', id: 'pppoeManualIdle', hidden: true, layout: 'hbox', width: 800, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', minValue: 0, maxValue: 99, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.maxIdleTime, name: 'pppoeIdleTime', id: 'pppoeManualIdleTime', disabled: true }, { xtype: 'displayfield', hideLabel: true, id: 'pppoeManualMinutes', value: smb.charset.label.minutes, disabledCls: 'disabledLabel', margin: '0 0 0 5' } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.secondConn, name: 'pppoeConnectionType', id: 'pppoeConnectionType', editable: false, queryMode: 'local', value: 'dynamic', store: Ext.create('Ext.data.Store',{ fields: ['value', 'display'], data: [ {value:'dynamic', display:smb.charset.label.dynamicIp}, {value:'static', display:smb.charset.label.staticIp}, {value:'disabled', display:smb.charset.label.disable} ] }), displayField: 'display', valueField: 'value', listeners:{ change:function( item, newValue, oldValue){ if( newValue=='static') { Ext.getCmp('scStaticIp').show(); Ext.getCmp('scStaticIp').enable(); Ext.getCmp('scStaticMask').show(); Ext.getCmp('scStaticMask').enable(); } else { Ext.getCmp('scStaticIp').hide(); Ext.getCmp('scStaticIp').disable(); Ext.getCmp('scStaticMask').hide(); Ext.getCmp('scStaticMask').disable(); } } } }, /* { xtype: 'fieldcontainer', fieldLabel: smb.charset.label.secondConn, defaultType: 'radiofield', width: 580, margin: '0 0 10 0', defaults:{ flex: 3 }, layout: 'hbox', items:[ { boxLabel: smb.charset.label.dynamicIp, name: 'pppoeConnectionType', inputValue: 'dynamic', width: 100, id: 'scDynamic' }, { boxLabel: smb.charset.label.staticIp, name: 'pppoeConnectionType', inputValue: 'static', width: 100, id: 'scStatic' }, { boxLabel: smb.charset.label.disable, name: 'pppoeConnectionType', inputValue: 'disabled', checked: true, width: 80, id: 'scDisable' } ] }, */ { xtype: 'textfield', fieldLabel: smb.charset.label.ipAddress, hidden: true, disabled: true, id: 'scStaticIp', name: 'pppoeConnStaticIp', vtype: 'ip' }, { xtype: 'textfield', fieldLabel: smb.charset.label.netmask, hidden: true, disabled: true, id: 'scStaticMask', name: 'pppoeConnStaticMask', vtype: 'mask' } ] }, { xtype: 'smbAdvancedSettings', title: smb.charset.label.advancedSettings, expandItem: 'advancedSettings', collapsible: true, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'fieldcontainer', id: 'staticAdv', type: 'wanConnectionType', hidden: true, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', defaultValue: 1500, minValue: 576, maxValue: 1500, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.mtuSize, name: 'staticMtuSize' }] }, { xtype: 'fieldcontainer', title: smb.charset.label.advancedSettingsDynamic, type: 'wanConnectionType', id: 'dynamicAdv', defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'numberfield', value: 1500, minValue: 576, maxValue: 1500, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.mtuSize, name: 'dynamicMtuSize' }, { xtype: 'checkboxfield', id: 'dynamicChkDnsServer', inputWidth: 13, fieldLabel: smb.charset.label.userDnsServer, boxLabel: smb.charset.label.enable, name: 'dynamicUserDnsServer', checked: false }, { xtype: 'textfield', vtype: 'ip', changeEnable: true, fieldLabel: smb.charset.label.priDns, hidden: true, disabled: true, name: 'dynamicDns1', id: 'dynamicDns1' }, { xtype: 'textfield', vtype: 'ip', changeEnable: true, fieldLabel: smb.charset.label.secDns, allowAllZero: true, allowBlank: true, hidden: true, disabled: true, name: 'dynamicDns2', id: 'dynamicDns2' }] }, { xtype: 'fieldcontainer', title: smb.charset.label.advancedSettingsPppoe, type: 'wanConnectionType', id: 'pppoeAdv', hidden: true, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', value: 1480, minValue: 576, maxValue: 1492, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.mtuSize, name: 'pppoeMtuSize' }, { xtype: 'textfield', vtype: 'serviceName', changeEnable: true, allowBlank: true, fieldLabel: smb.charset.label.serviceName, maxLength: 31, enforceMaxLength: true, name: 'pppoeServiceName' }, { xtype: 'textfield', vtype: 'acName', changeEnable: true, allowBlank: true, fieldLabel: smb.charset.label.acName, maxLength: 31, enforceMaxLength: true, name: 'pppoeAcName' }, { xtype: 'fieldcontainer', layout: 'column', width: 700, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', changeEnable: true, fieldLabel: smb.charset.label.detectInterval, minValue: 0, maxValue: 120, decimalPrecision:0, name: 'pppoeDetectInterval' // width: 445 }, { xtype: 'label', text: smb.charset.label.seconds, width: 70, margin: '3 0 0 5' } ] }, { xtype: 'checkboxfield', fieldLabel: smb.charset.label.userIspIp, boxLabel: smb.charset.label.enable, // margin: '0 0 5 268', inputWidth: 13, id: 'pppoeUserIspIp', name: 'pppoeUserIspIp', checked: true }, { xtype: 'textfield', fieldLabel: smb.charset.label.ispSpecifiedIp, changeEnable: true, id: 'pppoeIspIp', name: 'pppoeIspIp', vtype: 'ip' }, { xtype: 'checkboxfield', id: 'chkDnsServer', inputWidth: 13, // margin: '0 0 5 268', fieldLabel: smb.charset.label.userDnsServer, boxLabel: smb.charset.label.enable, name: 'pppoeUserDnsServer', checked: true }, { xtype: 'textfield', vtype: 'ip', changeEnable: true, fieldLabel: smb.charset.label.priDns, id: 'pppoeDns1', name: 'pppoeDns1' }, { xtype: 'textfield', vtype: 'ip', allowBlank: true, allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.secDns, id: 'pppoeDns2', name: 'pppoeDns2' } ] }, { xtype: 'fieldcontainer', type: 'wanConnectionType', id: 'l2tpAdv', hidden: true, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [{ xtype: 'numberfield', value: 1460, minValue: 576, maxValue: 1460, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.mtuSize, name: 'l2tpMtuSize' }] }, { xtype: 'fieldcontainer', type: 'wanConnectionType', id: 'pptpAdv', hidden: true, defaults:{ labelWidth: 263, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', value: 1420, minValue: 576, maxValue: 1420, decimalPrecision:0, changeEnable: true, fieldLabel: smb.charset.label.mtuSize, name: 'pptpMtuSize' }] }, { xtype: 'fieldcontainer', id: 'advWanMacFactoryCnt', layout: { type: 'hbox' }, items: [ { xtype: 'textfield', vtype: 'mac', fieldLabel: smb.charset.label.wanMacAddr, labelWidth: 263, inputWidth: 160, id: 'wanMacAddr', name: 'macCloneValue' }, { xtype: 'hiddenfield', id: 'factoryMacRaw', name: 'factoryMac', allowBlank: true, submitValue: false }, { xtype: 'smbButton', id: 'factoryMac', width: 150, margin: '0 0 0 5', text: smb.charset.button.factoryMac, listeners: { click:function(button, event) { Ext.getCmp('wanMacAddr').setValue(Ext.getCmp('factoryMacRaw').getValue()); } } } ] }, { xtype: 'fieldcontainer', id: 'advWanMacCloneCnt', layout: { type: 'hbox' }, // margin: '0 0 0 268', items: [ { xtype: 'textfield', vtype: 'mac', fieldLabel: smb.charset.label.yourPcMac, submitValue: false, disabled: true, labelWidth: 263, inputWidth: 160, id: 'macCloneValue', name: 'pcMac' }, { xtype: 'smbButton', width: 150, margin: '0 0 0 5', id: 'cloneFromPcsMacAddress', text: smb.charset.button.cloneFromPcsMacAddress, listeners: { click:function(button, event) { Ext.getCmp('wanMacAddr').setValue(Ext.getCmp('macCloneValue').getValue()); } } } ] } ] }], initComponent: function() { this.callParent(arguments); if(smb.user.isRemoteLogin) { Ext.getCmp('cloneFromPcsMacAddress').hide(); } } }); Ext.define('smb.model.nat',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enableDmz', name: 'enableDmz', type: 'boolean'}, {mapping: 'dmzIp', name: 'dmzIp', type: 'string'}, {mapping: 'enableUpnp', name: 'enableUpnp', type: 'boolean'}, {mapping: 'enableVirtualServer', name: 'enableVirtualServer', type: 'boolean'}, {mapping: 'enablePortTrigger', name: 'enablePortTrigger', type: 'boolean'}, {mapping: 'ftpAlg', name: 'ftpAlg', type: 'boolean'}, {mapping: 'tftpAlg', name: 'tftpAlg', type: 'boolean'}, {mapping: 'h323Alg', name: 'h323Alg', type: 'boolean'}, {mapping: 'rtspAlg', name: 'rtspAlg', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/nat.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.securityForm',{ extend: 'Ext.data.Model', fields: [ {mapping: 'firewall', name: 'firewall', type: 'boolean'}, {mapping: 'wanPingForbidden', name: 'wanPingForbidden', type: 'boolean'}, {mapping: 'lanPingForbidden', name: 'lanPingForbidden', type: 'boolean'}, {mapping: 'pptpPassthrough', name: 'pptpPassthrough', type: 'boolean'}, {mapping: 'l2tpPassthrough', name: 'l2tpPassthrough', type: 'boolean'}, {mapping: 'ipsecPassthrough', name: 'ipsecPassthrough', type: 'boolean'}, {mapping: 'packetsInterval', name: 'packetsInterval', type: 'string'}, {mapping: 'icmpFlood', name: 'icmpFlood', type: 'boolean'}, {mapping: 'icmpFloodValue', name: 'icmpFloodValue', type: 'int'}, {mapping: 'udpFlood', name: 'udpFlood', type: 'boolean'}, {mapping: 'udpFloodValue', name: 'udpFloodValue', type: 'int'}, {mapping: 'tcpSynFlood', name: 'tcpSynFlood', type: 'boolean'}, {mapping: 'tcpSynFloodValue', name: 'tcpSynFloodValue', type: 'int'}, {mapping: 'dosProtection', name: 'dosProtection', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/security.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.accessControlForm',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'}, {mapping: 'policy', name: 'policy', type: 'int'} ], proxy: { type: 'ajax', url: './data/accessControl.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.staticRoutingForm',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/staticRouting.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.bandWidthControlForm',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'}, {mapping: 'totalIngressBandwidth', name: 'totalIngressBandwidth', type: 'int'}, {mapping: 'totalEgressBandwidth', name: 'totalEgressBandwidth', type: 'int'} ], id: 'bandWidthControlForm', proxy: { type: 'ajax', url: './data/bandWidthControl.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.ipMacBindingForm',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/ipMacBinding.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.tpNetwork',{ extend: 'Ext.container.Container', alias: 'widget.tpNetwork', id: 'tpNetwork', url: './data/lan.json', method: 'get', initComponent: function(){ this.callParent(arguments); /*this.add({ xtype: 'checkbox', checked: true, name: 'advancedSettingsNetwork', id: 'advancedSettingsNetwork', fieldLabel: smb.charset.label.advancedSettings, boxLabel: smb.charset.label.advancedSettings, hideLabel: true, margin: '10 0 10 20' });*/ /* this.insert(0,{ xtype: 'checkbox', checked: false, name: 'advancedSettingsNetwork', id: 'advancedSettingsNetwork', fieldLabel: smb.charset.label.advancedSettings, boxLabel: smb.charset.label.advancedSettings, hideLabel: true, margin: '10 0 10 20' }); */ /* var networkItem = smb.mode.subItems["tpNetwork"][smb.mode.status]; this.insert(1,networkItem); var len = networkItem.length; for(var i = 0; i < len; i++) { smb.modules["tpNetwork"][networkItem[i]["xtype"]].status = "on"; } */ var mode = smb.mode.status; for (var name in smb.mode[mode].tpNetwork){ if(name) { var index = smb.mode[mode].tpNetwork[name]; this.insert(index, { xtype: name }); smb.modules["tpNetwork"][name].status = "on"; } } } }); Ext.define('smb.controller.tpNetwork', { extend: 'Ext.app.Controller', init: function(){ this.control({ '#tpNetwork checkbox[id=advancedSettingsNetwork]': { change: function(checkbox, newValue, oldValue, Opts){ // smb.pages.advancedSettingCheck.call(this, 'tpNetwork', newValue); } }, /* '#wan [id=l2tpConnectionTypeStatic]': { change: function( scope, newValue, oldValue, eOpts){ if(newValue) { Ext.getCmp('l2tpConnStaticIpDetails').show(); Ext.getCmp('l2tpConnStaticIpDetails').enable(); var tempArr = Ext.getCmp('l2tpConnStaticIpDetails').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(item) { if(item.isDisabled()) { item.enable(); } } }); } else { Ext.getCmp('l2tpConnStaticIpDetails').hide(); Ext.getCmp('l2tpConnStaticIpDetails').disable(); } } }, */ /* '#wan [id=pptpConnectionTypeStatic]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pptpConnStaticIpDetails').show(); Ext.getCmp('pptpConnStaticIpDetails').enable(); var tempArr = Ext.getCmp('pptpConnStaticIpDetails').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(item) { if(item.isDisabled()) { item.enable(); } } }); } else { Ext.getCmp('pptpConnStaticIpDetails').hide(); Ext.getCmp('pptpConnStaticIpDetails').disable(); } } }, */ '#wan [id=pppoeManual]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pppoeManualIdleTime').enable(); Ext.getCmp('pppoeManualIdle').show(); Ext.getCmp('pppoeDemandIdleTime').disable(); Ext.getCmp('pppoeDemandIdle').hide(); Ext.getCmp('pppoeFromHhMm').disable(); Ext.getCmp('pppoeToHhMm').disable(); Ext.getCmp('pppoeTimeCnt').hide(); } else { Ext.getCmp('pppoeManualIdleTime').clearInvalid(); Ext.getCmp('pppoeManualIdleTime').disable(); Ext.getCmp('pppoeManualIdle').hide(); Ext.getCmp('pppoeDemandIdleTime').clearInvalid(); } } }, '#wan [id=pppoeDemand]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pppoeDemandIdleTime').enable(); Ext.getCmp('pppoeDemandIdle').show(); Ext.getCmp('pppoeManualIdleTime').disable(); Ext.getCmp('pppoeManualIdle').hide(); Ext.getCmp('pppoeFromHhMm').disable(); Ext.getCmp('pppoeToHhMm').disable(); Ext.getCmp('pppoeTimeCnt').hide(); } else { Ext.getCmp('pppoeDemandIdleTime').clearInvalid(); Ext.getCmp('pppoeDemandIdleTime').disable(); Ext.getCmp('pppoeDemandIdle').hide(); Ext.getCmp('pppoeManualIdleTime').clearInvalid(); } } }, '#wan [id=pppoeTimeBased]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pppoeFromHhMm').enable(); Ext.getCmp('pppoeToHhMm').enable(); Ext.getCmp('pppoeTimeCnt').show(); Ext.getCmp('pppoeManualIdleTime').disable(); Ext.getCmp('pppoeManualIdle').hide(); Ext.getCmp('pppoeDemandIdleTime').disable(); Ext.getCmp('pppoeDemandIdle').hide(); } else { Ext.getCmp('pppoeFromHhMm').clearInvalid(); Ext.getCmp('pppoeToHhMm').clearInvalid(); Ext.getCmp('pppoeFromHhMm').disable(); Ext.getCmp('pppoeToHhMm').disable(); Ext.getCmp('pppoeTimeCnt').hide(); } } }, '#wan [id=l2tpManual]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('l2tpManualIdleTime').enable(); Ext.getCmp('l2tpManualIdle').show(); Ext.getCmp('l2tpDemandIdleTime').disable(); Ext.getCmp('l2tpDemandIdle').hide(); } else { Ext.getCmp('l2tpManualIdleTime').clearInvalid(); Ext.getCmp('l2tpManualIdleTime').disable(); Ext.getCmp('l2tpManualIdle').hide(); Ext.getCmp('l2tpDemandIdleTime').clearInvalid(); } } }, '#wan [id=l2tpDemand]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('l2tpDemandIdleTime').enable(); Ext.getCmp('l2tpDemandIdle').show(); Ext.getCmp('l2tpManualIdleTime').disable(); Ext.getCmp('l2tpManualIdle').hide(); } else { Ext.getCmp('l2tpDemandIdleTime').clearInvalid(); Ext.getCmp('l2tpDemandIdleTime').disable(); Ext.getCmp('l2tpDemandIdle').hide(); Ext.getCmp('l2tpManualIdleTime').clearInvalid(); } } }, '#wan [id=pptpManual]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pptpManualIdleTime').enable(); Ext.getCmp('pptpManualIdle').show(); Ext.getCmp('pptpDemandIdleTime').disable(); Ext.getCmp('pptpDemandIdle').hide(); } else { Ext.getCmp('pptpManualIdleTime').clearInvalid(); Ext.getCmp('pptpManualIdleTime').disable(); Ext.getCmp('pptpManualIdle').hide(); Ext.getCmp('pptpDemandIdleTime').clearInvalid(); } } }, '#wan [id=pptpDemand]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { Ext.getCmp('pptpDemandIdleTime').enable(); Ext.getCmp('pptpDemandIdle').show(); Ext.getCmp('pptpManualIdleTime').disable(); Ext.getCmp('pptpManualIdle').hide(); } else { Ext.getCmp('pptpDemandIdleTime').clearInvalid(); Ext.getCmp('pptpDemandIdleTime').disable(); Ext.getCmp('pptpDemandIdle').hide(); Ext.getCmp('pptpManualIdleTime').clearInvalid(); } } }, '#wan [id=chkConnectionType]': { change: function(checkbox, newValue, oldValue, Opts){ var page = Ext.getCmp('wan'); var panelQuery = page.query('[type=wanConnectionType]'); Ext.each(panelQuery, function(panel) { /* var tempArr = panel.query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(item) { if(!item.disabled) { item.disable(); } } }); */ panel.disable(); panel.hide(); }); if(newValue=='static' || newValue=='dynamic') { Ext.getCmp('wanConn').hide(); Ext.getCmp('wanDisconn').hide(); } else { Ext.getCmp('wanConn').show(); Ext.getCmp('wanDisconn').show(); } /***显示当前的拨号方式基本配置*****/ var id = newValue + 'DetailSetting'; var detailSetting = Ext.getCmp(id); if (detailSetting) { detailSetting.enable(); detailSetting.show(); } /***显示当前的拨号方式高级配置*****/ var idd = newValue + 'Adv'; var advSetting = Ext.getCmp(idd); if (advSetting) { advSetting.enable(); advSetting.show(); } // 配置l2tp和pptp下面的static和dynamic选项 if(newValue=='l2tp') { if(Ext.getCmp('l2tpConnectionType').getValue() =='static') { Ext.getCmp('l2tpConnStaticIpDetails').show(); Ext.getCmp('l2tpConnStaticIpDetails').enable(); } else { Ext.getCmp('l2tpConnStaticIpDetails').hide(); Ext.getCmp('l2tpConnStaticIpDetails').disable(); } } if(newValue=='pptp') { if(Ext.getCmp('pptpConnectionType').getValue()=='static') { Ext.getCmp('pptpConnStaticIpDetails').show(); Ext.getCmp('pptpConnStaticIpDetails').enable(); } else { Ext.getCmp('pptpConnStaticIpDetails').hide(); Ext.getCmp('pptpConnStaticIpDetails').disable(); } } } }, '#lan checkbox[id=isUseFallback]':{ change:function(obj, newValue, oldValue, event) { if(newValue) { Ext.getCmp('fallbackIp').enable(); Ext.getCmp('fallbackMask').enable(); } else { Ext.getCmp('fallbackIp').disable(); Ext.getCmp('fallbackMask').disable(); } } }, '#lan [id=lanChkConnectionType]': { change: function(checkbox, newValue, oldValue, Opts) { if(newValue == 'static') { Ext.getCmp('staticLanDetailSetting').show(); Ext.getCmp('staticLanDetailSetting').enable(); Ext.getCmp('dynamicLanDetailSetting').hide(); Ext.getCmp('dynamicLanDetailSetting').disable(); Ext.getCmp('lanDhcpServer').enable(); Ext.getCmp('lanDhcpServer').show(); if( Ext.getCmp('lanDhcpServer').getValue() ){ Ext.getCmp('dhcpAdvSetting').enable(); Ext.getCmp('dhcpAdvSetting').show(); } } else if(newValue == 'dynamic') { Ext.getCmp('staticLanDetailSetting').hide(); Ext.getCmp('staticLanDetailSetting').disable(); Ext.getCmp('dynamicLanDetailSetting').show(); Ext.getCmp('dynamicLanDetailSetting').enable(); Ext.getCmp('lanDhcpServer').disable(); Ext.getCmp('lanDhcpServer').hide(); Ext.getCmp('dhcpAdvSetting').disable(); Ext.getCmp('dhcpAdvSetting').hide(); } } }, '#lan [id=lanStaticIp]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('lanDefaultGateway').setValue(newValue); } }, '#lan [id=lanDhcpServer]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue()) { /* Ext.getCmp('lanStartIpAddress').enable(); Ext.getCmp('lanEndIpAddress').enable(); Ext.getCmp('lanDefaultGateway').enable(); Ext.getCmp('lanDefaultDomain').enable(); Ext.getCmp('lanPrimaryDns').enable(); Ext.getCmp('lanSecondaryDns').enable(); Ext.getCmp('lanDhcpLeaseTime').enable(); Ext.getCmp('dhcpMinutes').enable(); */ Ext.getCmp('dhcpAdvSetting').enable(); Ext.getCmp('dhcpAdvSetting').show(); } else { /* Ext.getCmp('lanStartIpAddress').disable(); Ext.getCmp('lanEndIpAddress').disable(); Ext.getCmp('lanDefaultGateway').disable(); Ext.getCmp('lanDefaultDomain').disable(); Ext.getCmp('lanPrimaryDns').disable(); Ext.getCmp('lanSecondaryDns').disable(); Ext.getCmp('lanDhcpLeaseTime').disable(); Ext.getCmp('dhcpMinutes').disable(); */ Ext.getCmp('dhcpAdvSetting').disable(); Ext.getCmp('dhcpAdvSetting').hide(); } } }, '#lan button[id=lanSubmit]': { click: function(btn, event) { var form = btn.findParentByType('smbModule'); var formBasic = form.getForm(); if (! formBasic.isValid() ) {return;} function goToNewUrl() { var oriUrl = top.location.href; var stIindex = oriUrl.indexOf('//'); var endIndex = oriUrl.slice(stIindex+2).indexOf(':'); top.location.href = oriUrl.slice(0, stIindex+2) + Ext.getCmp('lanStaticIp').getValue() + oriUrl.slice(stIindex+2).slice(endIndex); } var t; if( Ext.getCmp('lanChkConnectionType').getValue() == 'static' ) { t = setTimeout( goToNewUrl, 4000); } formBasic.submit({ // waitTitle: 'Submitting your data', // waitMsg: 'Submitting your data msg', timeout: 15, clientValidation:true, success: function(thisForm, action) { clearTimeout(t); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); var s = setTimeout(resetApplyChanges, 1000); }, failure: function(form, action) { var formData = Ext.JSON.decode(action.response.responseText); switch (action.failureType) { case Ext.form.action.Action.CLIENT_INVALID: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.formInvalid); break; }; case Ext.form.action.Action.CONNECT_FAILURE: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.dataFailure); break; }; case Ext.form.action.Action.SERVER_INVALID: { clearTimeout(t); if(formData.errCode) { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+formData.errCode]); } else { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } break; } } } }); } }, '#nat checkbox[id=enableDmz]':{ change: function(el,newValue,oldValue,scope) { if(newValue) { Ext.getCmp('dmzIp').enable(); Ext.getCmp('dmzIp').show(); } else { Ext.getCmp('dmzIp').disable(); Ext.getCmp('dmzIp').hide(); } } }, '#wan [id=pppoeDemandIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('pppoeManualIdleTime').setValue(newValue); } }, '#wan [id=pppoeManualIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('pppoeDemandIdleTime').setValue(newValue); } }, '#wan [id=l2tpDemandIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('l2tpManualIdleTime').setValue(newValue); } }, '#wan [id=l2tpManualIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('l2tpDemandIdleTime').setValue(newValue); } }, '#wan [id=pptpDemandIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('pptpManualIdleTime').setValue(newValue); } }, '#wan [id=pptpManualIdleTime]':{ change:function(field, newValue, oldValue, option) { Ext.getCmp('pptpDemandIdleTime').setValue(newValue); } }, '#wan button[id=wanConn]':{ click:function(button,event,obj) { var form = Ext.getCmp('wan'); var formBasic = form.getForm(); if( formBasic.isValid() ) { button.disable(); formBasic.submit({ // waitTitle: '', // waitMsg: 'Connecting...', timeout: 10, clientValidation:true, url: './data/wan.json?connect=true', success: function(thisForm, action) { smb.user.timeout.call(this, action, action, 0); var formData = Ext.JSON.decode(action.response.responseText); thisForm.loadRecord(formData); button.enable(); var s = setTimeout(resetApplyChanges, 1000); }, failure: function(form, action){ var formData = Ext.JSON.decode(action.response.responseText); switch (action.failureType) { case Ext.form.action.Action.CLIENT_INVALID: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.formInvalid); break; }; case Ext.form.action.Action.CONNECT_FAILURE: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.dataFailure); break; }; case Ext.form.action.Action.SERVER_INVALID: { if(formData.errCode) { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+formData.errCode]); } else { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } break; } } button.enable(); } }); } else { //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); //btn.disabled = true; } } }, '#wan button[id=wanDisconn]':{ click:function(button,event,obj) { var form = Ext.getCmp('wan'); var formBasic = form.getForm(); if( formBasic.isValid() ) { button.disable(); formBasic.submit({ // waitTitle: '', // waitMsg: 'Disconnecting...', timeout: 10, clientValidation:true, url: './data/wan.json?disconnect=true', success: function(thisForm, action) { smb.user.timeout.call(this, action, action, 0); var formData = Ext.JSON.decode(action.response.responseText); thisForm.loadRecord(formData); button.enable(); var s = setTimeout(resetApplyChanges, 1000); }, failure: function(form, action){ var formData = Ext.JSON.decode(action.response.responseText); switch (action.failureType) { case Ext.form.action.Action.CLIENT_INVALID: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.formInvalid); break; }; case Ext.form.action.Action.CONNECT_FAILURE: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.dataFailure); break; }; case Ext.form.action.Action.SERVER_INVALID: { if(formData.errCode) { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+formData.errCode]); } else { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } break; } } button.enable(); } }); } else { //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); //btn.disabled = true; } } }, '#wan [id=dynamicChkDnsServer]': { change: function( scope, newValue, oldValue, eOpts) { if(scope.getValue()) { Ext.getCmp('dynamicDns1').enable(); Ext.getCmp('dynamicDns2').enable(); Ext.getCmp('dynamicDns1').show(); Ext.getCmp('dynamicDns2').show(); } else { Ext.getCmp('dynamicDns1').disable(); Ext.getCmp('dynamicDns2').disable(); Ext.getCmp('dynamicDns1').hide(); Ext.getCmp('dynamicDns2').hide(); } } }, '#wan [id=pppoeUserIspIp]': { change: function( scope, newValue, oldValue, eOpts) { if(scope.getValue()) { Ext.getCmp('pppoeIspIp').enable(); Ext.getCmp('pppoeIspIp').show(); } else { Ext.getCmp('pppoeIspIp').disable(); Ext.getCmp('pppoeIspIp').hide(); } } }, '#wan [id=chkDnsServer]': { change: function( scope, newValue, oldValue, eOpts) { if(scope.getValue()) { Ext.getCmp('pppoeDns1').enable(); Ext.getCmp('pppoeDns2').enable(); Ext.getCmp('pppoeDns1').show(); Ext.getCmp('pppoeDns2').show(); } else { Ext.getCmp('pppoeDns1').disable(); Ext.getCmp('pppoeDns2').disable(); Ext.getCmp('pppoeDns1').hide(); Ext.getCmp('pppoeDns2').hide(); } } }, '#wan [id=scStatic]': { change: function( scope, newValue, oldValue, eOpts) { if(newValue) { Ext.getCmp('scStaticIp').show(); Ext.getCmp('scStaticIp').enable(); Ext.getCmp('scStaticMask').show(); Ext.getCmp('scStaticMask').enable(); } else { Ext.getCmp('scStaticIp').hide(); Ext.getCmp('scStaticIp').disable(); Ext.getCmp('scStaticMask').hide(); Ext.getCmp('scStaticMask').disable(); } } }, '#wan checkbox[id = showL2tpPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('l2tpPwdText').show(); Ext.getCmp('l2tpPwd').hide(); } else { Ext.getCmp('l2tpPwdText').hide(); Ext.getCmp('l2tpPwd').show(); } } }, '#wan checkbox[id = showPptpPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('pptpPwdText').show(); Ext.getCmp('pptpPwd').hide(); } else { Ext.getCmp('pptpPwdText').hide(); Ext.getCmp('pptpPwd').show(); } } }, '#wan checkbox[id = showPppoePwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('pppoePwdText').show(); Ext.getCmp('pppoePwd').hide(); } else { Ext.getCmp('pppoePwdText').hide(); Ext.getCmp('pppoePwd').show(); } } }, '#networkSecurity checkbox[id=icmpFlood]':{ change:function(obj,newValue,oldValue) { if(newValue==true) { Ext.getCmp('icmpFloodValue').enable(); } else { Ext.getCmp('icmpFloodValue').disable(); } } }, '#networkSecurity checkbox[id=udpFlood]':{ change:function(obj,newValue,oldValue) { if(newValue==true) { Ext.getCmp('udpFloodValue').enable(); } else { Ext.getCmp('udpFloodValue').disable(); } } }, '#networkSecurity checkbox[id=tcpSynFlood]':{ change:function(obj,newValue,oldValue) { if(newValue==true) { Ext.getCmp('tcpSynFloodValue').enable(); } else { Ext.getCmp('tcpSynFloodValue').disable(); } } }, '#networkSecurity checkbox[id=dosProtection]':{ change:function(obj, newValue, oldValue, event) { if(newValue) { Ext.getCmp('packetsInterval').enable(); Ext.getCmp('icmpCnt').enable(); Ext.getCmp('udpFloodCnt').enable(); Ext.getCmp('tcpSynCnt').enable(); Ext.getCmp('dosListBtn').enable(); } else { Ext.getCmp('packetsInterval').disable(); Ext.getCmp('icmpCnt').disable(); Ext.getCmp('udpFloodCnt').disable(); Ext.getCmp('tcpSynCnt').disable(); Ext.getCmp('dosListBtn').disable(); } } } }); } });