// JavaScript Document Ext.define('smb.model.wirelessClientSettings',{ extend: 'Ext.data.Model', fields: [ {mapping: 'ssid', name:'ssid', type: 'auto'}, {mapping: 'macAp', name:'macAp', type: 'string'}, {mapping: 'lockToAp', name:'lockToAp', type: 'boolean'}, {mapping: 'wds', name:'wds', type: 'auto'}, {mapping: 'ScanRangeEnable', name:'ScanRangeEnable', type: 'boolean'}, {mapping: 'ScanRangeMin', name:'ScanRangeMin', type: 'int'}, {mapping: 'ScanRangeMax', name:'ScanRangeMax', type: 'int'}, {mapping: 'txRate', name:'txRate', type: 'auto'}, {mapping: 'pskVersion', name:'pskVersion', type: 'int'}, {mapping: 'pskEncryption', name:'pskEncryption', type: 'int'}, {mapping: 'pskPassword', name:'pskPassword', type: 'auto'}, {mapping: 'pskGroupKeyUpdatePeriod', name:'pskGroupKeyUpdatePeriod', type: 'int'}, {mapping: 'wpaVersion', name:'wpaVersion', type: 'int'}, {mapping: 'wpaEncryption', name:'wpaEncryption', type: 'int'}, {mapping: 'wpaAuth', name:'wpaAuth', type: 'int'}, {mapping: 'wpaAuth2', name:'wpaAuth2', type: 'int'}, {mapping: 'wpaUserName', name:'wpaUserName', type: 'string'}, {mapping: 'wpaUserPwd', name:'wpaUserPwd', type: 'string'}, {mapping: 'wepAuthType', name:'wepAuthType', type: 'int'}, {mapping: 'wepKeyFormat', name:'wepKeyFormat', type: 'int'}, {mapping: 'wepKeySlt', name:'wepKeySlt', type: 'string'}, {mapping: 'wepKeyText1', name:'wepKeyText1', type: 'string'}, {mapping: 'wepType1', name:'wepType1', type: 'int'}, {mapping: 'wepKeyText2', name:'wepKeyText2', type: 'string'}, {mapping: 'wepType2', name:'wepType2', type: 'int'}, {mapping: 'wepKeyText3', name:'wepKeyText3', type: 'string'}, {mapping: 'wepType3', name:'wepType3', type: 'int'}, {mapping: 'wepKeyText4', name:'wepKeyText4', type: 'string'}, {mapping: 'wepType4', name:'wepType4', type: 'int'}, {mapping: 'securityMode', name:'securityMode', type: 'int'}, {mapping: 'wirelessEnable', name:'wirelessEnable', type: 'boolean'} // {mapping: 'enableSecurity', name:'enableSecurity', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/wirelessClient.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.channel',{ extend: 'Ext.data.Model', fields: [ {name:'name', type: 'string', convert:function(value) { var result; switch(value) { case "Auto": return smb.charset.label.auto; default: result = value.replace("MHz", smb.charset.units.MHz); return result; } } }, {name:'txPower', type: 'auto'}, {name:'value', type: 'auto'}, {name:'key', type: 'string'} ] }); Ext.define('smb.model.txRates',{ extend: 'Ext.data.Model', fields: [ {name:'name', type: 'string', convert:function(value) { var result; result = value.replace("Mbps", smb.charset.units.Mbps); return result; } }, {name:'value', type: 'auto'}, {name:'key', type: 'string'} ] }); Ext.define('smb.model.channelWidth',{ extend: 'Ext.data.Model', fields: [ {name:'name', type: 'string', convert:function(value) { var result; result = value.replace("MHz", smb.charset.units.MHz); return result; } }, {name:'value', type: 'auto'}, {name:'key', type: 'string'} ], hasMany: {model: 'channel', name: 'channel'} }); Ext.define('smb.model.mode',{ extend: 'Ext.data.Model', fields: [ {name:'name', type: 'string'}, {name:'value', type: 'auto'}, {name:'key', type: 'string'} ]/*, hasMany: [ {model: 'channelWidth', name: 'channelWidth'}, {model: 'txRate', name: 'txRate'} ]*/ }); Ext.define('smb.view.wirelessClientSettingsContent',{ extend: 'Ext.container.Container', id:'wirelessClientSettingsContent', alias:'widget.wirelessClientSettingsContent', items:[ { xtype: 'hiddenfield', name: 'text', value: 11111 }, { xtype: 'checkbox', fieldLabel: smb.charset.label.wirelessRadio, boxLabel: smb.charset.label.enable, // hideLabel: true, labelWidth: 275, labelAlign: 'right', name:'wirelessEnable', hidden: true, checked: true, id:'clientWirelessEnable' }, { xtype: 'fieldcontainer', id:'clientWirelessCnt', defaultType: 'textfield', defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ { xtype: 'fieldcontainer', // layout: 'hbox', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', vtype:'name', id:'ssidOfAp', minLength: 1, maxLength: 32, enforceMaxLength: true, fieldLabel: smb.charset.label.ssidOfAp, margin: '0 12 6 0', cls:'inlineBlock', name:'ssid', allowBlank: false /* 与mac有一个不能为空的检查 validator: function(value) { if( value=='' && Ext.getCmp('macOfAp').getValue()=='' ) { return smb.charset.validation.oneIsRequired; } else if( Ext.getCmp('macOfAp').getValue()!='' ) { return true; } return true; } */ }, { xtype: 'button', id:'searchBtn', text: smb.charset.button.survey, name:'survey' } ] }, { xtype: 'fieldcontainer', id:'clientWirelessScan', // layout: 'hbox', defaults:{ labelWidth: 275, //inputWidth: 80 }, cls:'inlineBlock', items:[ { xtype: 'checkbox', fieldLabel: "Scan Range", boxLabel: smb.charset.label.enable, id: 'FreqScanRangeEnable', name: 'ScanRangeEnable', labelWidth: 275, labelAlign: 'right', checked: true, margin: '0 12 8 0', cls:'inlineBlock', listeners:{ change:function(item, newValue, oldValue, scope){ if(newValue){ Ext.getCmp('FreqScanRangeMin').show(); Ext.getCmp('FreqScanRangeLable').show(); Ext.getCmp('FreqScanRangeMax').show(); Ext.getCmp('FreqScanRangeUnit').show(); }else{ Ext.getCmp('FreqScanRangeMin').hide(); Ext.getCmp('FreqScanRangeLable').hide(); Ext.getCmp('FreqScanRangeMax').hide(); Ext.getCmp('FreqScanRangeUnit').hide(); } } } }, { xtype: 'numberfield', id: 'FreqScanRangeMin', name: 'ScanRangeMin', inputWidth: 50, cls: 'inlineBlock', decimalPrecision: 0, minValue: 2300, maxValue: 6100 }, { xtype: 'label', id: 'FreqScanRangeLable', text: ' - ', cls: 'inlineBlock', margin: '5 0 0 5' }, { xtype: 'numberfield', id: 'FreqScanRangeMax', name: 'ScanRangeMax', inputWidth: 50, cls: 'inlineBlock', decimalPrecision: 0, minValue: 2300, maxValue: 6100 }, { xtype: 'label', id: 'FreqScanRangeUnit', text: 'MHz', cls: 'inlineBlock', margin: '5 0 0 5' } ] }, { xtype: 'fieldcontainer', // layout: 'hbox', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.macAp, id:'macOfAp', name:'macAp', allowBlank: false, margin: '0 12 6 0', cls:'inlineBlock', vtype: 'mac' }, { xtype: 'checkbox', boxLabel: smb.charset.label.lockToAp, id: 'lockToAp', name: 'lockToAp', checked: true, cls:'inlineBlock', inputWidth: 13, listeners:{ change:function(item, newValue, oldValue, scope){ if(newValue){ Ext.getCmp('macOfAp').enable(); }else{ Ext.getCmp('macOfAp').disable(); } } } } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.wds, store: Ext.create('Ext.data.Store',{ data:[ {name:smb.charset.label.auto, value:0}, {name:smb.charset.label.enable, value:1}, {name:smb.charset.label.disable, value:2} ], fields: ['name', 'value'] }), editable: false, autoSelect:true, queryMode: 'local', displayField: 'name', id:'wds', //labelWidth: 160, valueField: 'value', queryDelay: 600, //disabled:true, name:'wds' } /* { xtype: 'combobox', queryMode: 'local', store: Ext.create('Ext.data.Store',{ fields: ['name', 'value'] }), fieldLabel: smb.charset.label.maxTxRate, hidden:true, id:'txRateClient', editable: false, autoSelect:true, displayField: 'name', valueField: 'value', name:'txRate' }, */ /* { xtype: 'checkbox', labelAlign: 'right', fieldLabel: smb.charset.label.security, boxLabel: smb.charset.label.enable, inputWidth: 13, name:'enableSecurity', id:'clientEnableSecurity', checked: true } */ ] }, { xtype: 'fieldcontainer', id:'clientSecurityCnt', defaultType: 'textfield', // title: smb.charset.label.securitySetting, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ { xtype: 'combobox', id:'clientSecurityMode', name:'securityMode', queryMode: 'local', editable:false, store:'wlSecurityMode', displayField:'display', valueField:'name', value: 0, labelWidth: 275, inputWidth: 160, fieldLabel: smb.charset.label.securityMode }, { xtype: 'fieldcontainer', id: 'wpaPskClient', type: 'securityModule', hidden: true, disabled: true, defaults: { labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'pskVersion', store:'version', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.version, changeEnable:true}, {xtype: 'combobox', name:'pskEncryption', id:'clientWpEn', qType:'encryption', store:'encryption', queryMode:'local', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.encryption, changeEnable:true}, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id: 'clientPskPwd', name:'pskPassword', fieldLabel: smb.charset.label.pskPassword, inputType: 'password', vtype:'securityPwd', minLength: 8, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { if(item.changeFlag) { Ext.getCmp('clientPskPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('clientPskPwdText').setValue(newValue); } Ext.getCmp('clientPskPwdText').changeFlag = true; } } } }, { xtype: 'textfield', id: 'clientPskPwdText', hidden: true, fieldLabel: smb.charset.label.pskPassword, vtype:'securityPwd', minLength: 8, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, submitValue: false, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('clientPskPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('clientPskPwd').setValue(newValue); } Ext.getCmp('clientPskPwd').changeFlag = true; } } }, { xtype: 'checkbox', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true, listeners:{ change: function(item, newValue, oldValue, obj) { if( newValue ) { Ext.getCmp('clientPskPwdText').show(); Ext.getCmp('clientPskPwd').hide(); } else { Ext.getCmp('clientPskPwdText').hide(); Ext.getCmp('clientPskPwd').show(); } } } } ] } ] }, { xtype: 'fieldcontainer', id: 'wpaClient', type: 'securityModule', hidden: true, disabled: true, defaults: { labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'wpaVersion', store:'version', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.version, changeEnable:true}, {xtype: 'combobox', name:'wpaEncryption', id:'clientWpaEn', qType:'encryption', store:'encryption', queryMode:'local', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.encryption, changeEnable:true}, {xtype: 'combobox', name:'wpaAuth', store:'wpaAuthentication', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.authentication, changeEnable:true}, {xtype: 'combobox', name:'wpaAuth2', store:'wpaAuthentication2', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.authentication2, changeEnable:true}, {xtype: 'textfield', name:'wpaUserName', fieldLabel: smb.charset.label.wpaUserName, vtype:'name', minLength: 1, maxLength: 64, enforceMaxLength: true, changeEnable:true}, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id: 'clientWpaPwd', fieldLabel: smb.charset.label.wpaUserPwd, submitValue: false, inputType: 'password', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, vtype:'securityPwd', changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('clientWpaPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('clientWpaPwdText').setValue(newValue); } Ext.getCmp('clientWpaPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'clientWpaPwdText', name:'wpaUserPwd', fieldLabel: smb.charset.label.wpaUserPwd, hidden: true, vtype:'securityPwd', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('clientWpaPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('clientWpaPwd').setValue(newValue); } Ext.getCmp('clientWpaPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showClientWpaPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true, listeners:{ change: function(item, newValue, oldValue, obj) { if( newValue ) { Ext.getCmp('clientWpaPwdText').show(); Ext.getCmp('clientWpaPwd').hide(); } else { Ext.getCmp('clientWpaPwdText').hide(); Ext.getCmp('clientWpaPwd').show(); } } } } ] }, ] }, { xtype: 'fieldcontainer', id: 'wepClient', type: 'securityModule', hidden: true, disabled: true, defaults: { labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'wepAuthType', store:'wepAuthType', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.authType, changeEnable:true}, {xtype: 'combobox', id:'wepKeyClient', name:'wepKeyFormat', store:'wepKeyFormat', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.keyFormat, changeEnable:true}, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', items: [ {xtype: 'displayfield', name:'wepKeySelected', columnWidth: 0.3, fieldLabel: smb.charset.label.keySelected, cls:'inlineBlock', changeEnable:true}, {xtype: 'displayfield', name:'wepKey', columnWidth: 0.35, fieldLabel: smb.charset.label.wepKey, cls:'inlineBlock', changeEnable:true}, {xtype: 'displayfield', name:'wepKeyType', columnWidth: 0.3, fieldLabel: smb.charset.label.keyType, cls:'inlineBlock', changeEnable:true} ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt1Client', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'1', fieldLabel: smb.charset.label.keyOne, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText1Client', name:'wepKeyText1', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType1Client').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType1Client').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 5); // elDom; break; case 2: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText1Client-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType1Client', name:'wepType1', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Client').getValue()==0 && Ext.getCmp('wepType2Client').getValue()==0 && Ext.getCmp('wepType3Client').getValue()==0 && Ext.getCmp('wepType4Client').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType2Client').validate(); Ext.getCmp('wepType3Client').validate(); Ext.getCmp('wepType4Client').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt2Client', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'2', fieldLabel: smb.charset.label.keyTwo, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText2Client', name:'wepKeyText2', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType2Client').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType2Client').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 5); // elDom; break; case 2: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText2Client-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType2Client', name:'wepType2', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Client').getValue()==0 && Ext.getCmp('wepType2Client').getValue()==0 && Ext.getCmp('wepType3Client').getValue()==0 && Ext.getCmp('wepType4Client').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Client').validate(); Ext.getCmp('wepType3Client').validate(); Ext.getCmp('wepType4Client').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt3Client', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'3', fieldLabel: smb.charset.label.keyThree, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText3Client', name:'wepKeyText3', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType3Client').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType3Client').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText3Client-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType3Client', name:'wepType3', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', margin:'0 0 0 10', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Client').getValue()==0 && Ext.getCmp('wepType2Client').getValue()==0 && Ext.getCmp('wepType3Client').getValue()==0 && Ext.getCmp('wepType4Client').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Client').validate(); Ext.getCmp('wepType2Client').validate(); Ext.getCmp('wepType4Client').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt4Client', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'4', fieldLabel: smb.charset.label.keyFour, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText4Client', name:'wepKeyText4', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType4Client').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyClient').getValue(); var keyType = Ext.getCmp('wepType4Client').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText4Client-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType4Client', name:'wepType4', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Client').getValue()==0 && Ext.getCmp('wepType2Client').getValue()==0 && Ext.getCmp('wepType3Client').getValue()==0 && Ext.getCmp('wepType4Client').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Client').validate(); Ext.getCmp('wepType2Client').validate(); Ext.getCmp('wepType3Client').validate(); } } } ] } ] } ] } ], initComponent: function(){ this.callParent(arguments); initClientFlag = false; if (smb.user.is2G == true ) { Ext.getCmp('FreqScanRangeMin').minValue = 2312; Ext.getCmp('FreqScanRangeMin').maxValue = 2572; Ext.getCmp('FreqScanRangeMax').minValue = 2312; Ext.getCmp('FreqScanRangeMax').maxValue = 2572; } else { Ext.getCmp('FreqScanRangeMin').minValue = 4920; Ext.getCmp('FreqScanRangeMin').maxValue = 6100; Ext.getCmp('FreqScanRangeMax').minValue = 4920; Ext.getCmp('FreqScanRangeMax').maxValue = 6100; } if(smb.mode.status == "apRouter" || smb.mode.status == "client") { Ext.getCmp('clientWirelessEnable').show(); Ext.getCmp('clientWirelessEnable').enable(); } else { Ext.getCmp('clientWirelessEnable').hide(); Ext.getCmp('clientWirelessEnable').disable(); } } }); Ext.define('smb.view.wirelessClientSettings',{ extend: 'smb.view.module', id: 'wirelessClientSettings', alias: 'widget.wirelessClientSettings', model: 'wirelessClientSettings', title: smb.charset.module.wirelessClientSettings, url: './data/wirelessClient.json', relayFlag: true, relayTime: 500, items: [ { xtype:'loadingCnt' } ], buttons:[ { text: smb.charset.button.submit, //type: 'btnSubmit', listeners:{ click:function( button, event ) { if( smb.mode.status == 'wdsRepeater' ) { var form = button.findParentByType('smbModule'); var formBasic = form.getForm(); if( formBasic.isValid() ) { changeSubmitWaitStatus(true); formBasic.submit({ //waitTitle: smb.charset.tip.submitWaitTitle, //waitMsg: smb.charset.tip.submitWaitMsg, timeout: 25, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); var s = setTimeout(resetApplyChanges, 1000); smb.app.getController('wireless').getStoreDataForApAndClient(thisForm.owner.model); }, failure: function(form, action) { changeSubmitWaitStatus(false); 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; } } } }); } } else { var form = button.findParentByType('smbModule'); var formBasic = form.getForm(); if( formBasic.isValid() ) { changeSubmitWaitStatus(true); formBasic.submit({ //waitTitle: smb.charset.tip.submitWaitTitle, //waitMsg: smb.charset.tip.submitWaitMsg, timeout: 15, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); 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) { changeSubmitWaitStatus(false); 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; } } } }); } } } } } ], initComponent: function(){ this.callParent(arguments); if(smb.user.wirelessFirstLoadFlag) { this.removeAll(true); var xtypeId = this.id+"Content"; //console.log(xtypeId); this.add({xtype:xtypeId}); } } }); Ext.define('smb.model.wirelessApSettings',{ extend: 'Ext.data.Model', fields: [ {mapping: 'ssidEnable', name:'ssidEnable', type: 'boolean'}, {mapping: 'ssid', name:'ssid', type: 'auto'}, // {mapping: 'dfsEnable', name:'dfsEnable', type: 'auto'}, {mapping: 'txRate', name:'txRate', type: 'auto'}, {mapping: 'pskVersion', name:'pskVersion', type: 'int'}, {mapping: 'pskEncryption', name:'pskEncryption', type: 'int'}, {mapping: 'pskPassword', name:'pskPassword', type: 'auto'}, {mapping: 'pskGroupKeyUpdatePeriod', name:'pskGroupKeyUpdatePeriod', type: 'int'}, {mapping: 'wpaVersion', name:'wpaVersion', type: 'int'}, {mapping: 'wpaEncryption', name:'wpaEncryption', type: 'int'}, {mapping: 'radiusServerIp', name:'radiusServerIp', type: 'string'}, {mapping: 'radiusPort', name:'radiusPort', type: 'int'}, {mapping: 'radiusPassword', name:'radiusPassword', type: 'string'}, {mapping: 'wpaGroupKeyUpdatePeriod', name:'wpaGroupKeyUpdatePeriod', type: 'string'}, {mapping: 'acctServer', name:'acctServer', type: 'boolean'}, {mapping: 'acctServerIp', name:'acctServerIp', type: 'string'}, {mapping: 'acctServerPort', name:'acctServerPort', type: 'int'}, {mapping: 'acctServerPwd', name:'acctServerPwd', type: 'string'}, {mapping: 'radiusMacAuth', name:'radiusMacAuth', type: 'boolean'}, {mapping: 'wepAuthType', name:'wepAuthType', type: 'int'}, {mapping: 'wepKeyFormat', name:'wepKeyFormat', type: 'int'}, // {mapping: 'wepKeySelected', name:'wepKeySelected', type: 'string'}, // {mapping: 'wepKey', name:'wepKey', type: 'string'}, // {mapping: 'wepKeyType', name:'wepKeyType', type: 'string'}, {mapping: 'wepKeySlt', name:'wepKeySlt', type: 'string'}, {mapping: 'wepKeyText1', name:'wepKeyText1', type: 'string'}, {mapping: 'wepType1', name:'wepType1', type: 'int'}, {mapping: 'wepKeyText2', name:'wepKeyText2', type: 'string'}, {mapping: 'wepType2', name:'wepType2', type: 'int'}, {mapping: 'wepKeyText3', name:'wepKeyText3', type: 'string'}, {mapping: 'wepType3', name:'wepType3', type: 'int'}, {mapping: 'wepKeyText4', name:'wepKeyText4', type: 'string'}, {mapping: 'wepType4', name:'wepType4', type: 'int'}, {mapping: 'securityMode', name:'securityMode', type: 'int'}, {mapping: 'wirelessEnable', name:'wirelessEnable', type: 'boolean'} // {mapping: 'enableSecurity', name:'enableSecurity', type: 'auto'} ], proxy: { type: 'ajax', url: './data/wirelessAp.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.wirelessApSettingsContent',{ extend: 'Ext.container.Container', id:'wirelessApSettingsContent', alias:'widget.wirelessApSettingsContent', defaults:{ labelWidth: 275, labelAlign: 'right' }, items:[ { xtype: 'hiddenfield', name: 'text', value: 'apEmpty' }, { xtype: 'checkbox', fieldLabel: smb.charset.label.wirelessRadio, boxLabel: smb.charset.label.enable, // hideLabel: true, checked: true, name:'wirelessEnable', id:'apWirelessEnable' }, { xtype: 'fieldcontainer', id:'apWirelessCnt', defaultType: 'textfield', margin: 0, // disabled: true, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ { xtype: 'textfield', id:'ssid', vtype:'name', minLength: 1, maxLength: 32, enforceMaxLength: true, fieldLabel: smb.charset.label.ssid, margin: '0 12 6 0', cls:'inlineBlock', name:'ssid' }, { xtype: 'checkbox', fieldLabel: smb.charset.label.enableSSID, boxLabel: smb.charset.label.enableSSID, hideLabel: true, inputWidth: 13, name:'ssidEnable', cls:'inlineBlock', id:'ssidEnable' } /* { xtype: 'checkbox', labelAlign: 'right', inputWidth: 13, fieldLabel: smb.charset.label.security, boxLabel: smb.charset.label.enable, name:'enableSecurity', id:'apEnableSecurity', checked: false } */ ] }, { xtype: 'fieldcontainer', id:'apSecurityCnt', // disabled: true, defaultType: 'textfield', // title: smb.charset.label.securitySetting, items: [ { xtype: 'combobox', id:'apSecurityMode', name:'securityMode', editable:false, store:'securityMode', displayField:'display', valueField:'name', queryMode: 'local', labelWidth: 275, inputWidth: 160, value: 0, fieldLabel: smb.charset.label.securityMode }, { xtype: 'fieldcontainer', id: 'noneAp', type: 'securityModule', layout: 'column', disabled: false, hidden: false, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.radiusMacAuth, boxLabel: smb.charset.label.enable, // hideLabel: true, checked: false, inputWidth: 13, labelAlign:'right', name:'radiusMacAuth', id:'radiusMacAuth', listeners:{ change: function( scope, newValue, oldValue, eOpts) { if ( Ext.getCmp('apSecurityMode').getValue() == 0 ) { if( newValue ) { Ext.getCmp('wpaAp').enable(); Ext.getCmp('wpaAp').show(); Ext.getCmp('apWpaVersion').disable(); Ext.getCmp('apWpaEn').disable(); Ext.getCmp('wpaGroupKeyUpdatePeriod').disable(); Ext.getCmp('wpaGroupKeyText').disable(); Ext.getCmp('apWpaVersion').hide(); Ext.getCmp('apWpaEn').hide(); Ext.getCmp('wpaGroupKeyUpdatePeriod').hide(); Ext.getCmp('wpaGroupKeyText').hide(); if (Ext.getCmp('acctServer').getValue()) { Ext.getCmp('acctServerIp').enable(); Ext.getCmp('acctServerPort').enable(); Ext.getCmp('acctServerPwdCon').enable(); }else { Ext.getCmp('acctServerIp').disable(); Ext.getCmp('acctServerPort').disable(); Ext.getCmp('acctServerPwdCon').disable(); } //Ext.getCmp('radiusMacConfig').enable(); //Ext.getCmp('radiusMacConfig').show(); } else { Ext.getCmp('wpaAp').disable(); Ext.getCmp('wpaAp').hide(); //Ext.getCmp('radiusMacConfig').disable(); //Ext.getCmp('radiusMacConfig').hide(); } } } } }, { xtype: 'helpIcon', id: 'radiusMacAuthHelp', // cls:'inlineBlock', // margin: '3 0 0 15', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'radiusMacAuthHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.radiusMacAuth }); } } } ] }, { xtype: 'fieldcontainer', id: 'wpaPskAp', type: 'securityModule', disabled: true, hidden: true, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'pskVersion', store:'version', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.version, changeEnable:true}, {xtype: 'combobox', name:'pskEncryption', id:'apPskEn', qType:'encryption', store:'encryption', queryMode:'local', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.encryption, changeEnable:true}, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id: 'apWpaPwd', fieldLabel: smb.charset.label.pskPassword, inputType: 'password', vtype:'securityPwd', minLengthText: smb.charset.validation.tooShortPwd, minLength: 8, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, submitValue: false, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('apWpaPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('apWpaPwdText').setValue(newValue); } Ext.getCmp('apWpaPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'apWpaPwdText', hidden: true, name:'pskPassword', fieldLabel: smb.charset.label.pskPassword, vtype:'securityPwd', minLength: 8, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('apWpaPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('apWpaPwd').setValue(newValue); } Ext.getCmp('apWpaPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showApWpaPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, {xtype: 'numberfield', name:'pskGroupKeyUpdatePeriod', decimalPrecision:0, vtype:'groupKey', fieldLabel: smb.charset.label.groupKeyUpdatePeriod, changeEnable:true, cls:'inlineBlock'}, {xtype: 'displayfield', value:smb.charset.label.seconds0, cls:'inlineBlock', disabledCls:'disabledLabel', margin: '3 0 0 5', inputWidth:200 } ] }, { xtype: 'fieldcontainer', id: 'wpaAp', type: 'securityModule', disabled: true, hidden: true, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'wpaVersion', id:'apWpaVersion',store:'version', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.version, changeEnable:true}, {xtype: 'combobox', name:'wpaEncryption', id:'apWpaEn', qType:'encryption', store:'encryption', queryMode:'local', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.encryption, changeEnable:true}, {xtype: 'textfield', name:'radiusServerIp', fieldLabel: smb.charset.label.radiusServerIp, vtype:'ip', changeEnable:true}, {xtype: 'numberfield', name:'radiusPort', decimalPrecision:0, minValue:1, maxValue:65535, fieldLabel: smb.charset.label.radiusPort, changeEnable:true}, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id: 'apApRadiusPwd', fieldLabel: smb.charset.label.radiusPassword, submitValue: false, inputType: 'password', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, vtype:'securityPwd', changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('apApRadiusPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('apApRadiusPwdText').setValue(newValue); } Ext.getCmp('apApRadiusPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'apApRadiusPwdText', name:'radiusPassword', fieldLabel: smb.charset.label.radiusPassword, hidden: true, vtype:'securityPwd', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('apApRadiusPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('apApRadiusPwd').setValue(newValue); } Ext.getCmp('apApRadiusPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showApApRadiusPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, {xtype: 'numberfield', name:'wpaGroupKeyUpdatePeriod', id:'wpaGroupKeyUpdatePeriod',decimalPrecision:0, vtype:'groupKey', fieldLabel: smb.charset.label.groupKeyUpdatePeriod, changeEnable:true, cls:'inlineBlock'}, {xtype: 'displayfield', id:'wpaGroupKeyText', value:smb.charset.label.seconds0, cls:'inlineBlock', disabledCls:'disabledLabel', margin: '3 0 0 5', inputWidth:200 }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.acctServer, boxLabel: smb.charset.label.enable, // hideLabel: true, checked: true, inputWidth: 13, labelAlign:'right', name:'acctServer', id:'acctServer', listeners:{ change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('acctServerIp').enable(); Ext.getCmp('acctServerPort').enable(); Ext.getCmp('acctServerPwdCon').enable(); Ext.getCmp('acctServerIp').show(); Ext.getCmp('acctServerPort').show(); Ext.getCmp('acctServerPwdCon').show(); } else { Ext.getCmp('acctServerIp').disable(); Ext.getCmp('acctServerPort').disable(); Ext.getCmp('acctServerPwdCon').disable(); Ext.getCmp('acctServerIp').hide(); Ext.getCmp('acctServerPort').hide(); Ext.getCmp('acctServerPwdCon').hide(); } } } }, { xtype: 'helpIcon', id: 'acctServerHelp', // cls:'inlineBlock', // margin: '3 0 0 15', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'acctServerHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.acctServer }); } } } ] }, {xtype: 'textfield', id:'acctServerIp', name:'acctServerIp', fieldLabel: smb.charset.label.acctServerIp, vtype:'ip', changeEnable:true}, {xtype: 'numberfield', id:'acctServerPort', name:'acctServerPort', decimalPrecision:0, minValue:1, maxValue:65535, fieldLabel: smb.charset.label.acctServerPort, changeEnable:true}, { xtype: 'fieldcontainer', id: 'acctServerPwdCon', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id: 'acctServerPwd', fieldLabel: smb.charset.label.acctServerPwd, submitValue: false, inputType: 'password', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, vtype:'securityPwd', changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('acctServerPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('acctServerPwdText').setValue(newValue); } Ext.getCmp('acctServerPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'acctServerPwdText', name:'acctServerPwd', fieldLabel: smb.charset.label.acctServerPwd, hidden: true, vtype:'securityPwd', minLength: 1, minLengthText: smb.charset.validation.tooShortPwd, maxLength: 64, maxLengthText: smb.charset.validation.tooLongPwd, enforceMaxLength: true, changeEnable:true, changeFlag: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('acctServerPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('acctServerPwd').setValue(newValue); } Ext.getCmp('acctServerPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showAcctServerPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true, listeners:{ change: function(item, newValue, oldValue, obj) { if( newValue ) { Ext.getCmp('acctServerPwdText').show(); Ext.getCmp('acctServerPwd').hide(); } else { Ext.getCmp('acctServerPwdText').hide(); Ext.getCmp('acctServerPwd').show(); } } } } ] } ] }, { xtype: 'fieldcontainer', id: 'wepAp', type: 'securityModule', disabled: true, hidden: true, defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', name:'wepAuthType', store:'wepAuthType', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.authType, changeEnable:true}, {xtype: 'combobox', id:'wepKeyAp', name:'wepKeyFormat', store:'wepKeyFormat', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.keyFormat, changeEnable:true}, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', items: [ {xtype: 'displayfield', name:'wepKeySelected', columnWidth: 0.3, fieldLabel: smb.charset.label.keySelected, cls:'inlineBlock', changeEnable:true}, {xtype: 'displayfield', name:'wepKey', columnWidth: 0.35, fieldLabel: smb.charset.label.wepKey, cls:'inlineBlock', changeEnable:true}, {xtype: 'displayfield', name:'wepKeyType', columnWidth: 0.3, fieldLabel: smb.charset.label.keyType, cls:'inlineBlock', changeEnable:true} ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt1Ap', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'1', fieldLabel: smb.charset.label.keyOne, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText1Ap', name:'wepKeyText1', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType1Ap').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType1Ap').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText1Ap-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType1Ap', name:'wepType1', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Ap').getValue()==0 && Ext.getCmp('wepType2Ap').getValue()==0 && Ext.getCmp('wepType3Ap').getValue()==0 && Ext.getCmp('wepType4Ap').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType2Ap').validate(); Ext.getCmp('wepType3Ap').validate(); Ext.getCmp('wepType4Ap').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt2Ap', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'2', fieldLabel: smb.charset.label.keyTwo, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText2Ap', name:'wepKeyText2', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType2Ap').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType2Ap').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText2Ap-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType2Ap', name:'wepType2', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Ap').getValue()==0 && Ext.getCmp('wepType2Ap').getValue()==0 && Ext.getCmp('wepType3Ap').getValue()==0 && Ext.getCmp('wepType4Ap').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Ap').validate(); Ext.getCmp('wepType3Ap').validate(); Ext.getCmp('wepType4Ap').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt3Ap', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'3', fieldLabel: smb.charset.label.keyThree, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText3Ap', name:'wepKeyText3', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType3Ap').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType3Ap').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText3Ap-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType3Ap', name:'wepType3', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Ap').getValue()==0 && Ext.getCmp('wepType2Ap').getValue()==0 && Ext.getCmp('wepType3Ap').getValue()==0 && Ext.getCmp('wepType4Ap').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Ap').validate(); Ext.getCmp('wepType2Ap').validate(); Ext.getCmp('wepType4Ap').validate(); } } } ] }, { xtype:'fieldcontainer', layout:'column', width: 520, margin: '0 0 5 205', defaults: { labelAlign: 'right' }, items: [ {xtype: 'radio', id:'wepKeySlt4Ap', name:'wepKeySlt', columnWidth: 0.3, labelWidth: 60, inputValue:'4', fieldLabel: smb.charset.label.keyFour, cls:'inlineBlock', changeEnable:true}, {xtype: 'textfield', id:'wepKeyText4Ap', name:'wepKeyText4', enforceMaxLength: true, enableKeyEvents:true, width:150, inputWidth:140, margin:'0 40 0 40', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function(value) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType4Ap').getValue(); var pattern = /^[A-Fa-f0-9]+$/; var pattern_ascii = /^[A-Za-z0-9\`\~\!\@\#\$\%\^\&\*\(\)\-\=\_\+\[\]\{\}\;\:\'\"\\\|\/\?\.\,\<\>\s]+$/; if(keyValue == 1) //hex { switch(keyType) { case 1: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 10 ) { return smb.charset.validation.theMaxLength10; } break; case 2: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 26 ) { return smb.charset.validation.theMaxLength26; } break; case 3: if( !pattern.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 32 ) { return smb.charset.validation.theMaxLength32; } break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 5 ) { return smb.charset.validation.theMaxLength5; } break; case 2: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 13 ) { return smb.charset.validation.theMaxLength13; } break; case 3: if( !pattern_ascii.test(value) ) { return smb.charset.validation.invalidChar; } if( value.length != 16 ) { return smb.charset.validation.theMaxLength16; } break; } } return true; }, listeners:{ keydown:function( item, event, scope ) { var keyValue = Ext.getCmp('wepKeyAp').getValue(); var keyType = Ext.getCmp('wepType4Ap').getValue(); if(keyValue == 1) //hex { switch(keyType) { case 1: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 10); break; case 2: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 26); break; case 3: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 32); break; } } else if(keyValue == 2) //ascii { switch(keyType) { case 1: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 5); break; case 2: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 13); break; case 3: Ext.getDom('wepKeyText4Ap-inputEl').setAttribute("maxLength", 16); break; } } } } }, {xtype: 'combobox', id:'wepType4Ap', name:'wepType4', margin:'0 0 0 10', columnWidth: 0.3, inputWidth:80, editable:false, store:'wepKey', displayField:'display', valueField:'name', hideLabel:true, cls:'inlineBlock', changeEnable:true, validator:function( value ) { if( Ext.getCmp('wepType1Ap').getValue()==0 && Ext.getCmp('wepType2Ap').getValue()==0 && Ext.getCmp('wepType3Ap').getValue()==0 && Ext.getCmp('wepType4Ap').getValue()==0 ) { return smb.charset.validation.enableOneKey; } return true; }, listeners:{ change:function() { Ext.getCmp('wepType1Ap').validate(); Ext.getCmp('wepType2Ap').validate(); Ext.getCmp('wepType3Ap').validate(); } } } ] } ] } ] } ] }); Ext.define('smb.view.wirelessApSettings',{ extend: 'smb.view.module', id: 'wirelessApSettings', alias: 'widget.wirelessApSettings', model: 'wirelessApSettings', relayFlag: true, relayTime: 500, title: smb.charset.module.wirelessApSettings, url: './data/wirelessAp.json', items: [ { xtype:'loadingCnt' } ], buttons:[ {text:smb.charset.button.submit, hidden:false, elemType:'saveBtn', id:'wlApSubmit'} ], initComponent: function(){ this.callParent(arguments); //console.log(smb.user.wirelessFirstLoadFlag); if(smb.user.wirelessFirstLoadFlag) { this.removeAll(true); var xtypeId = this.id+"Content"; //console.log(xtypeId); this.add({xtype:xtypeId}); } } }); Ext.define('smb.view.security',{ extend: 'smb.view.module', id: 'security', alias: 'widget.security', title: smb.charset.module.security, items: [ {xtype: 'combobox', fieldLabel: smb.charset.label.securityMode}, {xtype: 'combobox', fieldLabel: smb.charset.label.version}, {xtype: 'textfield', fieldLabel: smb.charset.label.encryption}, {xtype: 'textfield', fieldLabel: smb.charset.label.pskPassword, inputType: 'password', vtype:'securityPwd'}, { xtype: 'smbAdvancedSettings', title: smb.charset.label.advancedSettings, id: 'wirelessSecurity', width: 'auto', items: [ {xtype: 'textfield', fieldLabel: smb.charset.label.groupKeyUpdatePeriod} ] } ], initComponent: function(){ this.callParent(arguments); } }); /* Ext.define('smb.view.surveyContent',{ extend: 'Ext.container.Container', id:'surveyContent', alias:'widget.surveyContent', items:[ { xtype: 'smbForm', items: [ { xtype: 'displayfield', fieldLabel: smb.charset.label.apCount, id: 'searchApCount', name: 'apCount' }, { xtype: 'gridpanel', id: 'searchGrid', store: 'searchGrid', selType:'checkboxmodel', margin: '10 0', width: 800, columns: [ {text: smb.charset.column.bssid, hideable: false, dataIndex:'bssid', flex:3}, {text: smb.charset.column.ssid, hideable: false, dataIndex:'ssid', flex:2}, {text: smb.charset.column.tdma, hideable: false, dataIndex:'tdma', flex:1}, {text: smb.charset.column.deviceName, hideable: false, dataIndex:'deviceName', flex:3}, {text: smb.charset.column.snr, hideable: false, dataIndex:'snr', flex:1}, {text: smb.charset.column.signalNoise, hideable: false, dataIndex:'signal', flex:3, renderer:function(value, metaData, record, colIndex, store, view) { return value + '/' + record.data.noise; } }, {text: smb.charset.column.frequencyChannel, hideable: false, dataIndex:'channel', flex:2}, {text: smb.charset.column.security, hideable: false, dataIndex:'security', flex:2} ], listeners: { viewready:function() { // console.log(this) var me = this; me.getEl().mask(); me.getStore().load(function(records, operation, success){ me.getEl().unmask(); }); } } }, { xtype: 'button', width: 100, id: 'securityRefresh', margin: '0 12 0 0', text: smb.charset.button.refresh }, { xtype: 'button', id: 'securityConnect', width: 100, margin: '0 12 0 0', text: smb.charset.button.connect }, { xtype: 'button', id: 'securityLock', width: 100, margin: '0 12 0 0', text: smb.charset.button.lockToAp } ] } ] }); */ /* Ext.define('smb.model.survey',{ extend: 'Ext.data.Model', fields: [ {mapping: 'apCount', name: 'apCount', type: 'int'} ], proxy: { type: 'ajax', url: './data/search.json', reader: { type: 'json', root: 'data' } } }); */ Ext.define('smb.model.searchGrid', { extend: 'Ext.data.Model', fields: [ {name:'bssid', type:'string'}, {name:'ssid', type:'string'}, {name:'tdma', type:'string'}, {name:'deviceName', type:'string'}, {name:'snr', type:'int'}, {name:'signal', type:'string'}, {name:'noise', type:'string'}, {name:'channel', type:'string'}, {name:'security', type:'string'}, {name:'key', type:'string'} ], idProperty: 'key' }); Ext.define('smb.store.searchGrid', { extend: 'Ext.data.Store', model: 'smb.model.searchGrid', proxy: { type: 'ajax', reader: { type: 'json', root: 'data.searchGrid' }, writer: { type: 'json', writeAllFields: false }, api: { create: './data/search.json?option=add&mode=' + smb.mode.status, read : './data/search.json?option=get&mode=' + smb.mode.status, update: './data/search.json?option=edit&mode=' + smb.mode.status, destroy: './data/search.json?option=delete&mode=' + smb.mode.status } } }); ////////////////// combobox的store Ext.define('smb.store.securityMode',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:0, display:smb.charset.comboBox.none}, {name:3, display:smb.charset.comboBox.wpaPsk}, {name:2, display:smb.charset.comboBox.wpa}, {name:1, display:smb.charset.comboBox.wep} ] }) Ext.define('smb.store.wlSecurityMode',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:0, display:smb.charset.comboBox.none}, {name:3, display:smb.charset.comboBox.wpaPsk}, {name:2, display:smb.charset.comboBox.wpa}, {name:1, display:smb.charset.comboBox.wep} ] }) Ext.define('smb.store.ssidSecurityMode',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:0, display:smb.charset.comboBox.none}, {name:3, display:smb.charset.comboBox.wpaPsk} ] }) Ext.define('smb.store.version',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:3, display:smb.charset.comboBox.auto}, {name:1, display:smb.charset.comboBox.wpa}, {name:2, display:smb.charset.comboBox.wpa2} ] }) Ext.define('smb.store.encryption',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:1, display:smb.charset.comboBox.auto}, {name:2, display:smb.charset.comboBox.tkip}, {name:3, display:smb.charset.comboBox.aes} ] }) Ext.define('smb.store.wpaAuthentication',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:1, display:smb.charset.comboBox.ttls}, {name:2, display:smb.charset.comboBox.peap} ] }) Ext.define('smb.store.wpaAuthentication2',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:1, display:smb.charset.comboBox.mschapv2} ] }) Ext.define('smb.store.wepAuthType',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:3, display:smb.charset.comboBox.auto}, {name:1, display:smb.charset.comboBox.openSys}, {name:2, display:smb.charset.comboBox.sharedKey} ] }) Ext.define('smb.store.wepKeyFormat',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:1, display:smb.charset.comboBox.hex}, {name:2, display:smb.charset.comboBox.ascii} ] }) Ext.define('smb.store.wepKey',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:0, display:smb.charset.comboBox.disabled}, {name:1, display:smb.charset.comboBox.bit64}, {name:2, display:smb.charset.comboBox.bit128}, {name:3, display:smb.charset.comboBox.bit152} ] }) Ext.define('smb.store.trueFalse',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'string'}, {name:'display', type:'string'} ], data: [ {name:'1', display:smb.charset.comboBox["true"]}, {name:'0', display:smb.charset.comboBox["false"]} ] }) Ext.define('smb.store.enable',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name:1, display:smb.charset.comboBox.enable}, {name:0, display:smb.charset.comboBox.disable} ] }) Ext.define('smb.model.tdma',{ extend: 'Ext.data.Model', fields: [ {mapping: 'tdmaEnable', name:'tdmaEnable', type: 'auto'}, {mapping: 'region', name:'region', type: 'auto'}, {mapping: 'mode', name:'mode', type: 'auto'}, {mapping: 'channelWidth', name:'channelWidth', type: 'auto'}, {mapping: 'txRate', name:'txRate', type: 'auto'}, {mapping: 'channel', name:'channel', type: 'auto'}, {mapping: 'extensionChan', name:'extensionChan', type: 'auto'}, {mapping: 'transPowerValue', name:'transPower', type: 'auto'}, {mapping: 'dfsEnable', name:'dfsEnable', type: 'boolean'}, {mapping: 'transPowerValue', name:'transPowerValue', type: 'auto'}, {mapping: 'tdmaPriority', name:'tdmaPriority', type: 'int'}, {mapping: 'antennaGain', name:'antennaGain', type: 'int'} ], proxy: { id: 'tdmaProxy', type: 'ajax', url: './data/tdma.json', reader: { id:'tdmaReader', type: 'json', root: 'data' } } }); Ext.define('smb.view.tdma',{ extend: 'smb.view.module', id: 'tdma', alias: 'widget.tdma', model: 'tdma', autoDestroy: true, title: smb.charset.module.tdma, url: './data/tdma.json', defaults:{ labelWidth: 275, inputWidth: 200 }, items: [ { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 275, inputWidth: 200 }, items: [ { xtype: 'combobox', fieldLabel: smb.charset.label.region, id:'apRegion', editable:false, forceSelection:true, typeAhead:false, autoSelect:true, store: 'apRegion', displayField:'name', valueField: 'value', triggerAction:'all', queryMode: 'local', name:'region' }, { xtype: 'helpIcon', id: 'regionHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'regionHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.region }); } } } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.mode, store: Ext.create('Ext.data.Store',{ model: 'smb.model.mode', proxy: { url:'./data/mode.json', type: 'ajax', reader: { type: 'json', root: 'data' } } }), editable: false, autoSelect:true, queryMode: 'local', displayField: 'name', id:'apMode', valueField: 'value', name:'mode' }, { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 275, inputWidth: 200 }, items: [ { xtype: 'combobox', fieldLabel: smb.charset.label.channelWidth, store: Ext.create('Ext.data.Store',{ model: 'smb.model.channelWidth', proxy: { url:'./data/channelWidth.json', type: 'ajax', reader: { type: 'json', root: 'data' } } }), editable: false, autoSelect:true, queryMode: 'local', labelAlign:'right', displayField: 'name', id:'apChannelWidth', //labelWidth: 160, //disabled:true, valueField: 'value', name:'channelWidth' }, { xtype: 'helpIcon', id: 'channelWidthHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'channelWidthHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.channelWidth }); } } } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.maxTxRate, id:'txRateAp', editable: false, store: Ext.create('Ext.data.Store',{ model: 'smb.model.txRates', proxy: { url:'./data/txRate.json', type: 'ajax', reader: { type: 'json', root: 'data' } } }), autoSelect:true, queryMode: 'local', displayField: 'name', valueField: 'value', name:'txRate' }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 200 }, items: [ { xtype: 'combobox', fieldLabel: smb.charset.label.channelFrequency, width: 480, store: Ext.create('Ext.data.Store',{ model: 'smb.model.channel', proxy: { url:'./data/channel.json', type: 'ajax', reader: { type: 'json', root: 'data' } } }), editable: false, autoSelect:true, queryMode: 'local', displayField: 'name', id:'apChannel', //labelWidth: 160, //disabled:true, valueField: 'value', name:'channel' }, { xtype: 'helpIcon', id: 'channelHelp', listeners:{ afterrender:function(button, event){ var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } if (localProductInfo == "UN") { var tip = Ext.create('Ext.tip.ToolTip', { target: 'channelHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.channel }); } else { var tip = Ext.create('Ext.tip.ToolTip', { target: 'channelHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.channelFixed }); } } } }, { xtype: 'button', width: 150, margin: '0 0 0 5', text: smb.charset.button.spectrumAnalysis, id: 'spectrumAnalysisBtn' } ] }, { xtype: 'combobox', fieldLabel: smb.charset.label.extensionChan, store: Ext.create('Ext.data.Store',{ data:[ {name: smb.charset.comboBox.extensionUpper, value: 1}, {name: smb.charset.comboBox.extensionLower, value: 2} ], fields: ['name', 'value'] }), editable: false, autoSelect:true, queryMode: 'local', displayField: 'name', id:'extensionChan', valueField: 'value', queryDelay: 600, name:'extensionChan' }, { fieldLabel: smb.charset.label.dfs, xtype: 'checkbox', boxLabel: smb.charset.label.enable, inputWidth: 13, checked: true, //labelWidth: 160, labelAlign:'right', name:'dfsEnable', id:'dfsEnable' }, { xtype: 'fieldcontainer', id:'basicAntennaGainCnt', margin: '0 0', items: [ { xtype: 'numberfield', id:'basicAntennaGain', fieldLabel: smb.charset.label.antennaGain, labelWidth: 275, inputWidth: 200, cls:'inlineBlock', minValue: 0, maxValue: 30, decimalPrecision:0, name:'antennaGain', // Remove spinner buttons, and arrow key and mouse wheel listeners hideTrigger: true, keyNavEnabled: false, mouseWheelEnabled: false }, { xtype: 'label', cls:'inlineBlock', text: smb.charset.label.antennaGainDbm, width: 90, margin: '0 0 4 5' } ] }, { xtype: 'sliderfield', tipText: function(thumb){ return String(thumb.value) + smb.charset.label.dbm; }, //value: 8, increment: 1, minValue: 0, maxValue: 12, width: 475, id:'transPowerAp', zeroBasedSnapping: true, margin: '0 16 6 0', cls:'inlineBlock', fieldLabel: smb.charset.label.transPower, labelAlign: 'right', name:'transPower' }, { xtype: 'numberfield', id:'transPowerValueAp', hideLabel :true, inputWidth:50, cls:'inlineBlock', minValue: 0, maxValue: 12, decimalPrecision:0, name:'transPowerValue' }, { xtype: 'label', id:'txPowerUnit', cls:'inlineBlock', text: smb.charset.label.dbm, width: 25, margin: '0 0 4 5' }, { xtype: 'helpIcon', id: 'transmitPowerHelp', // cls:'inlineBlock', listeners:{ afterrender:function(button, event){ var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } if (localProductInfo == "UN") { var tip = Ext.create('Ext.tip.ToolTip', { target: 'transmitPowerHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.transmitPower }); } else { var tip = Ext.create('Ext.tip.ToolTip', { target: 'transmitPowerHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.transmitPowerFixed }); } } } }, { xtype: 'fieldcontainer', //title: smb.charset.label.tdma, id:'tdmaEnableTotalCnt', layout: 'hbox', items:[ { xtype: 'fieldcontainer', layout: 'hbox', id:'tdmaEnableCnt', items: [ { xtype: 'checkbox', id: 'tdmaEnable', name: 'tdmaEnable', fieldLabel: smb.charset.label.enableTdma, boxLabel: smb.charset.label.enable, labelWidth: 275, inputWidth: 13, labelAlign: 'right' }, { xtype: 'helpIcon', id: 'tdmaEnableHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'tdmaEnableHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.tdmaEnable }); } } } ] }, { xtype: 'fieldcontainer', layout: 'hbox', id:'tdmaPriorityCnt', items:[ { xtype: 'combobox', id: 'tdmaPriority', name: 'tdmaPriority', fieldLabel: smb.charset.label.tdmaPriority, editable: false, labelWidth: 275, inputWidth: 200, // labelAlign: 'right', queryMode: 'local', store: Ext.create('Ext.data.Store',{ fields: ['name', 'value'], data: [ {value: 0, name: smb.charset.comboBox.autoAdjust}, {value: 1, name: smb.charset.comboBox.lowLatency}, {value: 2, name: smb.charset.comboBox.highPerformance} ] }), displayField: 'name', valueField: 'value', value: 0 }, { xtype: 'helpIcon', id: 'tdmaPriorityHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'tdmaPriorityHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.tdmaEnable }); } } } ] } ] } ], buttons:[ { text: smb.charset.button.submit, id:'tdmaSubmit', hidden:false, elemType:'saveBtn',formBind:false } ], initComponent: function(){ this.callParent(arguments); if(smb.mode.status == "wdsRepeater") { Ext.getCmp('tdmaEnableTotalCnt').hide(); /* Ext.getCmp('tdmaEnable').enable(); Ext.getCmp('tdmaPriority').show(); Ext.getCmp('tdmaPriority').enable();*/ } else if(smb.mode.status == "accessPoint" || smb.mode.status == "apRouter")//只有开关,没有模式选择。 { Ext.getCmp('tdmaEnableTotalCnt').show(); Ext.getCmp('tdmaEnableCnt').show(); Ext.getCmp('tdmaEnable').enable(); Ext.getCmp('tdmaPriorityCnt').hide(); Ext.getCmp('tdmaPriority').disable(); } else { Ext.getCmp('tdmaEnableTotalCnt').show(); Ext.getCmp('tdmaEnableCnt').hide(); Ext.getCmp('tdmaEnable').disable(); Ext.getCmp('tdmaPriorityCnt').show(); Ext.getCmp('tdmaPriority').enable(); } refreshChannel(); var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } if(smb.user.is2G == true) { Ext.getCmp('dfsEnable').hide(); Ext.getStore('apRegion').loadData(dataFor2G); Ext.getStore('clientRegion').loadData(dataFor2G); } else { Ext.getStore('apRegion').loadData(dataFor5G); Ext.getStore('clientRegion').loadData(dataFor5G); } if(localProductInfo == "EU") { Ext.getCmp('dfsEnable').hide(); } if (smb.user.isSetAntGain) { Ext.getCmp('basicAntennaGainCnt').enable(); Ext.getCmp('basicAntennaGainCnt').show(); } else { Ext.getCmp('basicAntennaGainCnt').disable(); Ext.getCmp('basicAntennaGainCnt').hide(); } if (smb.user.isLockCountryID == true) { Ext.getCmp('apRegion').disable(); } } }); Ext.define('smb.view.wireless',{ extend: 'Ext.container.Container', id: 'wireless', alias: 'widget.wireless', //title: smb.charset.tabs.wireless, initComponent: function(){ this.callParent(arguments); /*var wirelessItem = smb.mode.subItems["wireless"][smb.mode.status]; this.insert(0,wirelessItem); len = wirelessItem.length; for(var i = 0; i < len; i++) { //console.log(wirelessItem[i]["xtype"]); smb.modules["wireless"][wirelessItem[i]["xtype"]].status = "on"; }*/ var mode = smb.mode.status; for (var name in smb.mode[mode].wireless){ if(name) { var index = smb.mode[mode].wireless[name]; this.insert(index, { xtype: name }); smb.modules["wireless"][name].status = "on"; } } } }); Ext.define('smb.view.wirelessAdvContent',{ extend: 'Ext.container.Container', id:'wirelessAdvContent', alias:'widget.wirelessAdvContent', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', fieldLabel: smb.charset.label.distanceSetting, id: 'ackNumber', name: 'ackNumber', // inputWidth: 50, // cls: 'inlineBlock', decimalPrecision: 1, minValue: 0, maxValue: 200 }, { xtype: 'label', forId: 'ackNumber', id: 'ackNumLabel', text: smb.charset.label.ackRange, // cls: 'inlineBlock', // style: 'display: inline-block', width: 100, margin: '3 0 0 5', listeners:{ beforerender: function(){ var ackNumCmp = Ext.getCmp('ackNumber'); /*switch(Ext.getCmp('apChannelWidth').getValue()) { case 0: ackNumCmp.setMaxValue(24 * 8); break; case 1: ackNumCmp.setMaxValue(24 * 4); break; case 2: ackNumCmp.setMaxValue(24 * 2); break; default: break; }*/ ackNumCmp.setMaxValue(200); this.setText('(0-'+ackNumCmp.maxValue+')' + smb.charset.units.km); } } }, { xtype: 'checkbox', boxLabel: smb.charset.label.auto, id: 'autoDistance', name: 'autoDistance', //checked: true, //cls:'inlineBlock', inputWidth: 13, listeners:{ change:function(item, newValue, oldValue, scope){ if(newValue){ Ext.getCmp('ackNumber').disable(); } else{ Ext.getCmp('ackNumber').enable(); } } } }, { xtype: 'label', forId: 'autoDistance', id: 'autoDistanceLabel', text: smb.charset.label.autoNote + smb.charset.label.autoRange, // cls: 'inlineBlock', // style: 'display: inline-block', width: 170, margin: '3 0 0 5', listeners:{ beforerender: function(){ var autoDistanceCmp = 27.9; switch(Ext.getCmp('apChannelWidth').getValue()) { case 0: autoDistanceCmp = (27.9 * 8); break; case 1: autoDistanceCmp = (27.9 * 4); break; case 2: autoDistanceCmp = (27.9 * 2); break; default: break; } this.setText(smb.charset.label.autoNote+'0-'+autoDistanceCmp+ smb.charset.units.km + ')'); } } }, { xtype: 'helpIcon', id: 'distanceSetHelp', // cls: 'inlineBlock', margin: '3 0 0 15', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'distanceSetHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.distanceSetting }); } } } ] }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', id: 'beaconInterval', name: 'beaconInterval', fieldLabel: smb.charset.label.beaconInterval, decimalPrecision:0, minValue: 40, maxValue: 1000 }, { xtype: 'label', text: '(40-1000)', margin: '3 0 0 5' } ] }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', name: 'rtsThreshold', fieldLabel: smb.charset.label.rtsThreshold, decimalPrecision:0, minValue: 1, maxValue: 2346 }, { xtype: 'label', text: '(1-2346)', margin: '3 0 0 5' } ] }, { xtype: 'fieldcontainer', layout: 'column', id: 'fragmentCnt', width: 860, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', name: 'fragmentationThreshold', fieldLabel: smb.charset.label.fragmentationThreshold, decimalPrecision:0, minValue: 256, maxValue: 2346 }, { xtype: 'label', id: 'fragmentUnit', text: '(256-2346)', margin: '3 0 0 5', disabledCls: 'disabledLabel' } ] }, { xtype: 'fieldcontainer', layout: 'column', width: 860, defaults:{ labelWidth: 275, inputWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', id: 'dtimInterval', name: 'dtimInterval', fieldLabel: smb.charset.label.dtimInterval, decimalPrecision:0, minValue: 1, maxValue: 255 }, { xtype: 'label', text: '(1-255)', margin: '3 0 0 5' } ] }, { fieldLabel: smb.charset.label.apIsolation, xtype: 'checkbox', boxLabel: smb.charset.label.enable, checked: true, inputWidth: 13, labelAlign:'right', name:'apIsolationEnable', id:'apIsolationEnable' }, { xtype: 'checkbox', name: 'enableShortGi', id: 'enableShortGi', inputWidth: 13, fieldLabel: smb.charset.label.enableShortGi, boxLabel: smb.charset.label.enable, labelAlign: 'right' }, { xtype: 'checkbox', name: 'enableWmm', id: 'enableWmm', fieldLabel: smb.charset.label.enableWmm, boxLabel: smb.charset.label.enable, inputWidth: 13, labelAlign: 'right' }, { xtype: 'checkbox', name: 'enableaQos', id: 'enableaQos', fieldLabel: smb.charset.label.enableAQos, boxLabel: smb.charset.label.enable, inputWidth: 13, labelAlign: 'right' }/*, { xtype: 'checkbox', name: 'enableTxbf', fieldLabel: smb.charset.label.enableTxbf, boxLabel: smb.charset.label.enable, inputWidth: 13, labelAlign: 'right' }*/ ], initComponent: function(){ this.callParent(arguments); if( smb.mode.status == 'client' ) { Ext.getCmp('beaconInterval').disable(); Ext.getCmp('dtimInterval').disable(); Ext.getCmp('apIsolationEnable').disable(); } else { Ext.getCmp('beaconInterval').enable(); Ext.getCmp('dtimInterval').enable(); Ext.getCmp('apIsolationEnable').enable(); } } }); Ext.define('smb.view.wirelessAdv',{ extend: 'smb.view.module', alias: 'widget.wirelessAdv', id: 'wirelessAdv', type: 'advancedSettings', model: 'wirelessAdv', title: smb.charset.module.wirelessAdv, url: './data/wirelessAdv.json', defaults: { labelWidth: 150 }, items: [ { xtype:'loadingCnt' } ], buttons:[ { text: smb.charset.button.submit, id:'wirelessAdvSubmit', hidden:false, elemType:'saveBtn',formBind:false } ], initComponent: function(){ this.callParent(arguments); if(smb.user.wirelessFirstLoadFlag) { this.removeAll(true); var xtypeId = this.id+"Content"; this.add({xtype:xtypeId}); } } }); Ext.define('smb.view.wireMacFilter',{ extend: 'smb.view.module', alias: 'widget.wireMacFilter', id: 'wireMacFilter', type: 'advancedSettings', model: 'wireMacFilter', title: smb.charset.module.wireMacFilter, url: './data/wireMacFilter.json', collapsed: true, // buttons: false, grid: { 'macFilterGrid': 'macFilterGrid' }, items: [ { xtype:'checkbox', id:'wireMacFilter_enable_id', name:'enable', labelWidth: 130, labelAlign: 'left', labelPad: 9, fieldLabel: smb.charset.label.wirelessMacFiltering, boxLabel:smb.charset.label.enable, checked: false, listeners:{ change: function( item, newValue, oldValue) { if(newValue){ Ext.getCmp('wanFilteringGrid').show(); } else{ Ext.getCmp('wanFilteringGrid').hide(); } } } }, { xtype: 'radiogroup', id:'wireMacFilter_rules_id', fieldLabel: smb.charset.label.filteringRules, columns: 1, labelWidth: 130, labelAlign: 'left', items: [ {boxLabel:smb.charset.label.denyMacFiltering, name:'filteringRules', inputValue:0, checked:true}, {boxLabel:smb.charset.label.allowMacFiltering, name:'filteringRules', inputValue:1} ] }, { xtype: 'hidden', id: 'ssidName1', name: 'ssidName1', submitValue: false, value: '' }, { xtype: 'hidden', id: 'ssidName2', name: 'ssidName2', submitValue: false, value: '' }, { xtype: 'hidden', id: 'ssidName3', name: 'ssidName3', submitValue: false, value: '' }, { xtype: 'hidden', id: 'ssidName4', name: 'ssidName4', submitValue: false, value: '' }, { xtype: 'hidden', id: 'ssidName5', name: 'ssidName5', submitValue: false, value: '' }, /* { xtype: 'button', type: 'btnSubmit', text: smb.charset.button.submit, margin: '0 0 10 159' }, */ { xtype: 'smbGrid', id: 'wanFilteringGrid', store: 'macFilterGrid', hidden: true, 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.ssid, hideable: false, dataIndex: 'ssidName', flex:1, editor: { xtype: 'combobox', editable: false, store: 'mfSsidName', queryMode: 'local', displayField: 'display', valueField: 'name', tpl: '
' }, renderer: function(value){ return Ext.String.htmlEncode(value); } }, { text: smb.charset.column.mac, hideable: false, dataIndex:'mac', flex:1, editor: { xtype: 'textfield', allowBlank: false, vtype: 'mac' } }, { text: smb.charset.column.comment, hideable: false, dataIndex:'comment', flex:1, editor: { xtype: 'textfield', allowBlank: true, maxLength: 63, enforceMaxLength: true }, renderer: function(value){ return Ext.String.htmlEncode(value); } } ] } ], listeners: { collapse: function(panel, obj) { Ext.getCmp('ssidName1').setValue(''); Ext.getCmp('ssidName2').setValue(''); Ext.getCmp('ssidName3').setValue(''); Ext.getCmp('ssidName4').setValue(''); Ext.getCmp('ssidName5').setValue(''); } } }); Ext.define('smb.model.wirelessAdv',{ extend: 'Ext.data.Model', fields: [ // {mapping: 'distanceSetting', name: 'distanceSetting', type: 'int'}, {mapping: 'ackNumber', name: 'ackNumber', type: 'number'}, {mapping: 'autoDistance', name: 'autoDistance', type: 'boolean'}, {mapping: 'beaconInterval', name: 'beaconInterval', type: 'int'}, {mapping: 'rtsThreshold', name: 'rtsThreshold', type: 'int'}, {mapping: 'fragmentationThreshold', name: 'fragmentationThreshold', type: 'int'}, {mapping: 'dtimInterval', name: 'dtimInterval', type: 'int'}, {mapping: 'enableWmm', name: 'enableWmm', type: 'boolean'}, {mapping: 'enableaQos', name: 'enableaQos', type: 'boolean'}, {mapping: 'enableShortGi', name: 'enableShortGi', type: 'boolean'}, {mapping: 'apIsolationEnable', name:'apIsolationEnable', type: 'auto'}/*, {mapping: 'enableTxbf', name: 'enableTxbf', type: 'boolean'}*/ ], proxy: { type: 'ajax', url: './data/wirelessAdv.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.wireMacFilter',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'}, {mapping: 'filteringRules', name: 'filteringRules', type: 'int'}, {mapping: 'ssidName1', name: 'ssidName1', type: 'string'}, {mapping: 'ssidName2', name: 'ssidName2', type: 'string'}, {mapping: 'ssidName3', name: 'ssidName3', type: 'string'}, {mapping: 'ssidName4', name: 'ssidName4', type: 'string'}, {mapping: 'ssidName5', name: 'ssidName5', type: 'string'} ], proxy: { type: 'ajax', url: './data/wireMacFilter.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.multiSsid',{ extend: 'smb.view.module', alias: 'widget.multiSsid', id: 'multiSsid', type: 'advancedSettings', model: 'multiSsid', title: smb.charset.module.multiSsid, url: './data/multiSsid.json', collapsed: true, grid: { 'multiSsidGrid': 'multiSsidGrid' }, items: [ { xtype:'checkbox', id:'multiSsidEnable', name:'enable', labelWidth: 70, labelAlign: 'left', fieldLabel: smb.charset.label.multiSsid, boxLabel:smb.charset.label.enable, checked: false, listeners:{ change: function( item, newValue, oldValue) { if(newValue){ Ext.getCmp('ssidGrid').show(); Ext.getCmp('ssidSecuritySet').enable(); Ext.getCmp('ssidSecuritySet').show(); var store = Ext.getStore('multiSsidGrid'); var ssidName = Ext.getCmp('ssidName'); var nameStore = Ext.getStore('ssidNameStore'); var mfNameStore = Ext.getStore('mfSsidName'); ssidName.setValue(0); Ext.getCmp('ssidSecurityMode').setValue(1); mfNameStore.removeAll(); if(mfNameStore.addFlag == true) { mfNameStore.add({name:Ext.getCmp('ssidName1').getValue(), display:Ext.getCmp('ssidName1').getValue()}); } if( Ext.getCmp('multiSsidEnable').getValue() ){ nameStore.removeAll(); store.each(function(record) { if(record.data.key != 2147483647){ nameStore.add({name:record.data.ssid, display:record.data.ssid}); } mfNameStore.add({name:record.data.ssid, display:record.data.ssid}); },this); if(store.data.items.length>1) { for(var i=0; i'; } else if(value == false) { return ''; } } }, { text: smb.charset.column.ssid, hideable: false, dataIndex:'ssid', flex:1, editor: { xtype: 'textfield', id: 'ssidNameEdit', minLength: 1, maxLength: 32, enforceMaxLength: true, allowBlank: false }, renderer: function(value){ return Ext.String.htmlEncode(value); } }, { text: smb.charset.column.wirelessVlan, hideable: false, dataIndex:'wirelessVlan', flex:1, defaultValue: 1, editor: { xtype: 'numberfield', id: 'wlVlanEdit', decimalPrecision:0, minValue: 1, maxValue: 4094, allowBlank: false } }, { text: smb.charset.column.ssidBroadcast, hideable: false, dataIndex:'ssidBroadcast', flex:1, defaultValue: 1, editor: { xtype: 'combobox', id: 'ssidBcEdit', editable: false, store: 'enable', displayField: 'display', valueField: 'name' }, renderer: function(value) { switch(value) { case 0: return smb.charset.comboBox.disable; case 1: return smb.charset.comboBox.enable; } } }, { text: smb.charset.column.apIsolation, hideable: false, dataIndex:'apIsolation', flex:1, editor: { xtype: 'combobox', id: 'ssidApIsoEdit', editable: false, store: 'enable', displayField: 'display', valueField: 'name' }, renderer: function(value) { switch(value) { case 0: return smb.charset.comboBox.disable; case 1: return smb.charset.comboBox.enable; } } } ] }, { xtype: 'fieldset', id: 'ssidSecuritySet', title: smb.charset.label.securitySetting, defaults:{ labelWidth: 275, inputWidth: 160 }, hidden: true, items: [ { xtype: 'combobox', id:'ssidName', name:'ssidName', editable:false, store:'ssidNameStore', displayField:'display', valueField:'name', queryMode:'local', allowBlank: true, fieldLabel: smb.charset.label.ssid, tpl: '
  • {[Ext.util.Format.htmlEncode(values.name)]}
' }, { xtype: 'combobox', id:'ssidSecurityMode', name:'securityMode', editable:false, store:'ssidSecurityMode', displayField:'display', valueField:'name', fieldLabel: smb.charset.label.securityMode, queryMode: 'local', value: 1 }, { xtype: 'fieldcontainer', id: 'wpaPskSsid', hidden: true, disabled: true, type: 'securityModule', defaults:{ labelWidth: 275, inputWidth: 160 }, items: [ {xtype: 'combobox', id:'pskVersionSsid', name:'pskVersion', store:'version', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.version, value:1}, {xtype: 'combobox', id:'pskEncryptionSsid', name:'pskEncryption', qType:'encryption', store:'encryption', queryMode:'local', displayField:'display', valueField:'name', editable:false, fieldLabel: smb.charset.label.encryption, value:1}, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 275, inputWidth: 160 }, items:[ { xtype: 'textfield', id:'pskPasswordSsid', name:'pskPassword', fieldLabel: smb.charset.label.pskPassword, inputType: 'password', vtype:'securityPwd', changeFlag: true, minLength: 8, maxLength: 64, enforceMaxLength: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pskPwdSsidText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pskPwdSsidText').setValue(newValue); } Ext.getCmp('pskPwdSsidText').changeFlag = true; } } }, { xtype: 'textfield', id: 'pskPwdSsidText', hidden: true, fieldLabel: smb.charset.label.pskPassword, vtype:'securityPwd', changeEnable:true, submitValue: false, changeFlag: true, minLength: 8, maxLength: 64, enforceMaxLength: true, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('pskPasswordSsid').changeFlag = false; if(item.changeFlag) { Ext.getCmp('pskPasswordSsid').setValue(newValue); } Ext.getCmp('pskPasswordSsid').changeFlag = true; } } }, { xtype: 'checkbox', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true, listeners:{ change: function(item, newValue, oldValue, obj) { if( newValue ) { Ext.getCmp('pskPwdSsidText').show(); Ext.getCmp('pskPasswordSsid').hide(); } else { Ext.getCmp('pskPwdSsidText').hide(); Ext.getCmp('pskPasswordSsid').show(); } } } } ] }, // {xtype: 'textfield', id:'pskPasswordSsid', name:'pskPassword', fieldLabel: smb.charset.label.pskPassword, inputType: 'password', vtype:'securityPwd'}, {xtype: 'numberfield', id:'pskGroupKeyUpdatePeriodSsid', name:'pskGroupKeyUpdatePeriod', decimalPrecision:0, vtype:'groupKey', fieldLabel: smb.charset.label.groupKeyUpdatePeriod, cls:'inlineBlock'}, {xtype: 'label', text:smb.charset.label.seconds0, cls:'inlineBlock', margin: '3 0 0 5', inputWidth:200 } ] }, { xtype: 'hiddenfield', id: 'ssidKey', submitValue: true, name: 'key' } ] } ], buttons:[ { text: smb.charset.button.submit, modeChangeCallback:function(itemId, value, cfg) { var form = Ext.getCmp('multiSsid'); var formBasic = form.getForm(); if(itemId == "yes") { /*var loadObj = Ext.create('smb.view.loadingCnt',{ //renderTo:'loadingBarContainer', height:200, width:200 }); console.dir(loadObj); console.log(Ext.getBody().getWidth()/2, Ext.getBody().getHeight()/2); loadObj.setPagePosition(Ext.getBody().getWidth()/2,Ext.getBody().getHeight()/2); loadObj.setPosition(Ext.getBody().getWidth()/2,Ext.getBody().getHeight()/2); loadObj.show(); console.dir(loadObj); console.log(loadObj.getWidth()); console.log(loadObj.getHeight()); */ changeSubmitWaitStatus(true); formBasic.submit({ //waitTitle: 'Submitting your data', //waitMsg: 'Submitting your data msg', timeout: 15, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); Ext.getStore('multiSsidGrid').loadData(formData.data.multiSsidGrid); var s = setTimeout(resetApplyChanges, 1000); if( (thisForm.owner.model == "wirelessAdv") || (thisForm.owner.model == "wirelessClientSettings")) { smb.app.getController("wireless").getStoreDataForApAndClient(thisForm.owner.model); } }, failure: function(form, action) { changeSubmitWaitStatus(false); 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; } } } }); } else { } }, //type: 'btnSubmit', listeners:{ click:function( btn, event ) { var form = btn.findParentByType('smbModule'); var formBasic = form.getForm(); if( formBasic.isValid() ) { var newValue = Ext.getCmp('multiSsidEnable').getValue(); //var oldValue = Ext.getCmp('multiSsidEnable').originalValue; var record = getRecordOrModelData('multiSsid'); var oldValue = record.enable; if( (oldValue==false) && (newValue==true)) { Ext.MessageBox.confirm( smb.charset.tip.multiSsidConfirmTitle, smb.charset.tip.multiSsidConfirm, this.modeChangeCallback, this); } else { changeSubmitWaitStatus(true); formBasic.submit({ //waitTitle: 'Submitting your data', //waitMsg: 'Submitting your data msg', timeout: 15, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); Ext.getStore('multiSsidGrid').loadData(formData.data.multiSsidGrid); var s = setTimeout(resetApplyChanges, 1000); if( (thisForm.owner.model == "wirelessAdv") || (thisForm.owner.model == "wirelessClientSettings")) { smb.app.getController("wireless").getStoreDataForApAndClient(thisForm.owner.model); } }, failure: function(form, action) { changeSubmitWaitStatus(false); 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; } } } }); } return; } else { //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); //btn.disabled = true; } } } } ] }); Ext.define('smb.model.multiSsid',{ extend: 'Ext.data.Model', fields: [ {mapping: 'enable', name: 'enable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/multiSsid.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.model.multiSsidGrid', { extend: 'Ext.data.Model', fields: [ {name:'enable', type:'boolean'}, {name:'ssid', type:'string'}, {name:'wirelessVlan', type:'int'}, {name:'apIsolation', type:'int'}, {name:'ssidBroadcast', type:'int'}, {name:'key', type:'string'}, {name:'securityMode', type:'int'}, {name:'pskVersion', type:'int'}, {name:'pskEncryption', type:'int'}, {name:'pskPassword', type:'string'}, {name:'pskGroupKeyUpdatePeriod', type:'int'}, {name:'key', type: 'int'} ], idProperty: 'key' }); Ext.define('smb.store.multiSsidGrid', { extend: 'Ext.data.Store', model: 'smb.model.multiSsidGrid', proxy: { type: 'ajax', reader: { type: 'json', root: 'data.multiSsidGrid' }, writer: { type: 'json', writeAllFields: false }, api: { create: './data/multiSsid.json?option=add&mode=' + smb.mode.status, read : './data/multiSsid.json?option=get&mode=' + smb.mode.status, update: './data/multiSsid.json?option=edit&mode=' + smb.mode.status, destroy: './data/multiSsid.json?option=delete&mode=' + smb.mode.status } }, listeners: { datachanged : function(store, options) { var ssidName = Ext.getCmp('ssidName'); var nameStore = Ext.getStore('ssidNameStore'); var mfNameStore = Ext.getStore('mfSsidName'); mfNameStore.removeAll(); if(mfNameStore.addFlag == true) { mfNameStore.add({name:Ext.getCmp('ssidName1').getValue(), display:Ext.getCmp('ssidName1').getValue()}); } // if( Ext.getCmp('multiSsidEnable').getValue() ){ nameStore.removeAll(); store.each(function(record) { if(record.data.key != 2147483647){ nameStore.add({name:record.data.ssid, display:record.data.ssid}); } mfNameStore.add({name:record.data.ssid, display:record.data.ssid}); },this); if(store.data.items.length>1) { for(var i=0; i ackThreshNum && !wmmValue) { Ext.getCmp('enableWmm').setValue(true); //ackNumLabelCmp.setText('(0-'+ackNumberCmp.maxValue+')km'); /* send request to get distance for wireless adv model */ Ext.Ajax.request({ url: './data/wirelessAdv.json', // method: 'GET', success: function(response) { smb.user.timeout.call(this, response, response); var data = Ext.JSON.decode(response.responseText); if(data.success){ //ackNumberCmp.setValue(data.data.ackNumber); } else{ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+data.errCode]); } }, failure: function(){ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } }) } } else { //ackNumberCmp.maxValue = 24; ackNumberCmp.maxValue = 200; ackNumLabelCmp.setText('(0-'+ackNumberCmp.maxValue+')' + smb.charset.units.km); } var autoDistanceCmp = 27.9; var autoDistanceLabelCmp = Ext.getCmp('autoDistanceLabel'); if( (typeof autoDistanceLabelCmp != "undefined") ) { switch(Ext.getCmp('apChannelWidth').getValue()) { case 0: autoDistanceCmp = (27.9 * 8); break; case 1: autoDistanceCmp = (27.9 * 4); break; case 2: autoDistanceCmp = (27.9 * 2); break; default: autoDistanceCmp = (27.9); break; } { autoDistanceLabelCmp.setText(smb.charset.label.autoNote+'0-'+autoDistanceCmp+smb.charset.units.km+')'); } } else { autoDistanceCmp = (27.9); autoDistanceLabelCmp.setText(smb.charset.label.autoNote+'0-'+autoDistanceCmp+smb.charset.units.km+')'); } }, failure: function(form, action){ changeSubmitWaitStatus(false); 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: { alert(action); Ext.Msg.alert(smb.charset.module.failure, action.result.msg); } } } }); } else { // console.log('error') //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); //btn.disabled = true; } } } }, '#tdma [id=basicAntennaGain]': { change: function(scope, newValue, oldValue, Opts) { if (scope.disabled) return; if (newValue == null) return; if (newValue > scope.maxValue) return; if (newValue < scope.minValue) return; Ext.Ajax.request({ url: './data/antennaGainTmp.json', method: 'POST', params: {antennaGain: newValue}, success: function(response) { var data = Ext.JSON.decode(response.responseText); if (data.success == true) { smb.user.timeout.call(this, response, response); var me = smb.app.getController('wireless'); Ext.getCmp('apChannel').store.load({params:{channelWidth:Ext.getCmp('apChannelWidth').getValue()}, scope: me, callback:me.setTransPower}); } } }); } }, '#tdma [id=transPowerAp]': { change: function(slider, newValue, thumb, eOpts){ //console.log("slider change"); //console.log(newValue); //console.dir(arguments); if(newValue > slider.maxValue) { slider.setMaxValue(newValue); Ext.getCmp('transPowerValueAp').maxValue = newValue; slider.setValue(newValue); //console.log("Ext.getCmp('transPowerValueAp').maxValue"); //console.log(newValue); } /*if(slider.hasFocus)//如果不是手动选择的,两者一起调整*/ if(1) { Ext.getCmp('transPowerValueAp').setValue(newValue); } } }, '#tdma [id=transPowerValueAp]': { change: function(scope, newValue, oldValue, Opts){ //console.log("value change"); //console.log(newValue+":"+oldValue); if(newValue > scope.maxValue) { if(!scope.hasFocus) { scope.setMaxValue(newValue); Ext.getCmp('transPowerAp').setMaxValue(newValue); } scope.setValue(newValue); } /*if(scope.hasFocus)*/ if(1) { Ext.getCmp('transPowerAp').setValue(newValue); } } }, '#wirelessApSettings': { actioncomplete: function(scope, action, eOpts ) { var formData = Ext.JSON.decode(action.response.responseText); this.tdmaChangeStatus(formData.data.tdmaOn); } }, '#tdma combobox[id = apRegion]':{ change: function( scope, newValue, oldValue, eOpts){ //console.log("apRegion change"); //console.dir(arguments); if(typeof oldValue == "undefined" && newValue == 840) { Ext.getCmp('apRegion').disable(); } smb.user.regionPage = 0; var apModeObj = Ext.getCmp('apMode'); if( !scope.hasFocus)//如果没有选中,则只加载下一级的store { //console.log(smb.user.regionChangeAvalid); if(!smb.user.regionChangeAvalid) { apModeObj.store.load({params:{region:newValue},callback:this.refreshChannelStore}); } else { apModeObj.store.load({params:{region:newValue},callback:this.setDefaultValByRegion}); } } else { if(scope.oldset) { delete scope.oldset; return true; } else { if(!smb.user.regionChangeAvalid) { //console.log(smb.user.regionChangeAvalid); scope.oldset = true; scope.setValue(oldValue); smb.user.newRegion = newValue; smb.user.regionConfirm.show(); return false; } } } if(Ext.getCmp('txRateAp')) { this.setTxRateValue(2); } return -1; } }, '#tdma combobox[id = apMode]':{ change: function( scope, newValue, oldValue, eOpts){ //Ext.getCmp('apChannelWidth').store.load({params:{mode:newValue},callback:this.setApChannelWidthDefaultVal}); //console.log(newValue); //var advRoot = smb.model['tdma'].getProxy().getReader().rawData.data; //如果返回数据的根节点名称发生变化,wirelessApSetting需要相应变化 var record = scope.findRecord("value", newValue,0,false,true,true); var TKIP_WEP; //console.log(Ext.getCmp('txRateAp')); if(scope.hasFocus) { TKIP_WEP = this.getTKIP_WEPFlag(); if( (record.data.name == "802.11n") && (TKIP_WEP) ) { Ext.Msg.alert(smb.charset.tip.error, smb.charset.tip.noSetAtSameTime1); scope.setValue(oldValue); return; } Ext.getCmp('apChannelWidth').store.load({params:{mode:newValue},scope: me,callback:this.setDefaultValByMode}); } if(typeof oldValue != "undefined") { //console.log("apMode change"); //console.log(newValue); Ext.getCmp('apChannelWidth').store.load({params:{mode:newValue},scope: me,callback:this.setApChannelWidthDefaultVal}); } else { Ext.getCmp('apChannelWidth').store.load({params:{mode:newValue},callback:this.isTimeout}); } //console.log(Ext.getCmp('txRateAp')); if(Ext.getCmp('txRateAp')) { this.setTxRateValue(2); } /* if(scope.hasFocus) { //Ext.getCmp('apChannel').store.load({params:{channelWidth:newValue}, callback:this.setTransPowerMax}); var apChannelObj = Ext.getCmp('apChannel'); //apChannelObj.setValue(0); apChannelObj.store.load({params:{channelWidth:newValue}, scope: me,callback:this.setTransPower}); } */ /* tempLine */ } }, '#tdma combobox[id = apChannelWidth]':{ change: function( scope, newValue, oldValue, eOpts){ if(typeof oldValue != "undefined") { //console.log("apChannelWidth changed"); var store = scope.store; //console.dir(store); if(store) { var record = store.findRecord("value", newValue,0,false,true,true); if(!record) { store.load({params:{mode:Ext.getCmp('apMode').value},scope: me,callback:this.setApChannelWidthDefaultVal}); } } var apChannelObj = Ext.getCmp('apChannel'); apChannelObj.store.load({params:{channelWidth:newValue}, scope: me, callback:this.setTransPower}); } else { //console.log("apChannelWidth changed"); Ext.getCmp('apChannel').store.load({ scope: me, params:{channelWidth:newValue}, callback:this.setTransPower}); } //console.log(Ext.getCmp('txRateAp')); if(Ext.getCmp('txRateAp')) { this.setTxRateValue(2); } return -1; } }, '#tdma combobox[id = apChannel]':{ change: function( scope, newValue, oldValue, eOpts){ if(typeof oldValue != "undefined") { //console.log("apChannel changed"); this.setTransPower(); } else { //console.log("apChannel changed"); this.setTransPower(newValue); } return -1; } }, //子项的change事件只处理下一级的联动 '#wirelessApSettings combobox[id = txRateAp]':{ afterrender:function() { this.setTxRateValue(1); } }, '#wirelessApSettings checkbox[id = apWirelessEnable]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) // && Ext.getCmp('apEnableSecurity').getValue() ) { Ext.getCmp('apWirelessCnt').enable(); // Ext.getCmp('apSecurityCnt').enable(); Ext.getCmp('apSecurityMode').enable(); switch(Ext.getCmp('apSecurityMode').getValue()) { case 0: Ext.getCmp('noneAp').enable(); if (Ext.getCmp('radiusMacAuth').getValue()) { Ext.getCmp('wpaAp').enable(); Ext.getCmp('apWpaVersion').disable(); Ext.getCmp('apWpaEn').disable(); Ext.getCmp('wpaGroupKeyUpdatePeriod').disable(); Ext.getCmp('wpaGroupKeyText').disable(); if (Ext.getCmp('acctServer').getValue()) { Ext.getCmp('acctServerIp').enable(); Ext.getCmp('acctServerPort').enable(); Ext.getCmp('acctServerPwdCon').enable(); }else { Ext.getCmp('acctServerIp').disable(); Ext.getCmp('acctServerPort').disable(); Ext.getCmp('acctServerPwdCon').disable(); } } break; case 1: Ext.getCmp('wepAp').enable(); // Ext.getCmp('wpaAp').disable(); // Ext.getCmp('wpaPskAp').disable(); break; case 2: Ext.getCmp('wpaAp').enable(); // Ext.getCmp('wepAp').disable(); // Ext.getCmp('wpaPskAp').disable(); break; case 3: Ext.getCmp('wpaPskAp').enable(); // Ext.getCmp('wpaAp').disable(); // Ext.getCmp('wepAp').disable(); break; } } else { Ext.getCmp('apWirelessCnt').disable(); Ext.getCmp('apSecurityMode').disable(); switch(Ext.getCmp('apSecurityMode').getValue()) { case 0: Ext.getCmp('noneAp').disable(); Ext.getCmp('wpaAp').disable(); break; case 1: Ext.getCmp('wepAp').disable(); break; case 2: Ext.getCmp('wpaAp').disable(); break; case 3: Ext.getCmp('wpaPskAp').disable(); break; } } /* else if( newValue && !Ext.getCmp('apEnableSecurity').getValue() ) { Ext.getCmp('apWirelessCnt').enable(); Ext.getCmp('apSecurityCnt').disable(); } else if( !newValue && !Ext.getCmp('apEnableSecurity').getValue() ) { Ext.getCmp('apWirelessCnt').disable(); Ext.getCmp('apSecurityCnt').disable(); } else if(!newValue && Ext.getCmp('apEnableSecurity').getValue()) { Ext.getCmp('apWirelessCnt').disable(); Ext.getCmp('apSecurityCnt').disable(); } */ } }, /* '#wirelessApSettings checkbox[id=apEnableSecurity]': { change: function( scope, newValue, oldValue, eOpts) { if(newValue==true && Ext.getCmp('apWirelessEnable').getValue()) { Ext.getCmp('apSecurityCnt').enable(); switch(Ext.getCmp('apSecurityMode').getValue()) { case 1: Ext.getCmp('wepAp').enable(); Ext.getCmp('wpaAp').disable(); Ext.getCmp('wpaPskAp').disable(); break; case 2: Ext.getCmp('wpaAp').enable(); Ext.getCmp('wepAp').disable(); Ext.getCmp('wpaPskAp').disable(); break; case 3: Ext.getCmp('wpaPskAp').enable(); Ext.getCmp('wpaAp').disable(); Ext.getCmp('wepAp').disable(); break; } } else { Ext.getCmp('apSecurityCnt').disable(); } } }, */ '#wirelessApSettings [id=apSecurityMode]': { enable: function(checkbox, eOpts) { var mode_11n_flag = this.getModeFlag("wirelessApSettings"); if( (checkbox.value == 1) && (mode_11n_flag) ) { Ext.Msg.alert(smb.charset.tip.error, smb.charset.tip.noSetAtSameTime2); checkbox.setValue(2); return; } }, change: function(checkbox, newValue, oldValue, Opts) { if(checkbox.hasFocus) { var mode_11n_flag = this.getModeFlag("wirelessApSettings"); if( (newValue == 1) && (mode_11n_flag) ) { Ext.Msg.alert(smb.charset.tip.error, smb.charset.tip.noSetAtSameTime2); checkbox.setValue(oldValue); return; } } Ext.getCmp('wpaPskAp').disable(); Ext.getCmp('wpaPskAp').hide(); Ext.getCmp('wpaAp').disable(); Ext.getCmp('wpaAp').hide(); Ext.getCmp('wepAp').disable(); Ext.getCmp('wepAp').hide(); Ext.getCmp('noneAp').disable(); Ext.getCmp('noneAp').hide(); switch(newValue) { case 0: Ext.getCmp('noneAp').show(); if (Ext.getCmp('radiusMacAuth').getValue()) { Ext.getCmp('wpaAp').show(); Ext.getCmp('apWpaVersion').hide(); Ext.getCmp('apWpaEn').hide(); Ext.getCmp('wpaGroupKeyUpdatePeriod').hide(); Ext.getCmp('wpaGroupKeyText').hide(); } break; case 1: Ext.getCmp('wepAp').show(); break; case 2: Ext.getCmp('wpaAp').show(); Ext.getCmp('apWpaVersion').show(); Ext.getCmp('apWpaEn').show(); Ext.getCmp('wpaGroupKeyUpdatePeriod').show(); Ext.getCmp('wpaGroupKeyText').show(); break; case 3: Ext.getCmp('wpaPskAp').show(); break; } // if(Ext.getCmp('apWirelessEnable').getValue()) // { switch(newValue) { case 0: Ext.getCmp('noneAp').enable(); if (Ext.getCmp('radiusMacAuth').getValue()) { Ext.getCmp('wpaAp').enable(); Ext.getCmp('apWpaVersion').disable(); Ext.getCmp('apWpaEn').disable(); Ext.getCmp('wpaGroupKeyUpdatePeriod').disable(); Ext.getCmp('wpaGroupKeyText').disable(); } if (Ext.getCmp('acctServer').getValue()) { Ext.getCmp('acctServerIp').enable(); Ext.getCmp('acctServerPort').enable(); Ext.getCmp('acctServerPwdCon').enable(); }else { Ext.getCmp('acctServerIp').disable(); Ext.getCmp('acctServerPort').disable(); Ext.getCmp('acctServerPwdCon').disable(); } break; case 1: Ext.getCmp('wepAp').enable(); break; case 2: Ext.getCmp('wpaAp').enable(); Ext.getCmp('apWpaVersion').enable(); Ext.getCmp('apWpaEn').enable(); Ext.getCmp('wpaGroupKeyUpdatePeriod').enable(); Ext.getCmp('wpaGroupKeyText').enable(); if (Ext.getCmp('acctServer').getValue()) { Ext.getCmp('acctServerIp').enable(); Ext.getCmp('acctServerPort').enable(); Ext.getCmp('acctServerPwdCon').enable(); }else { Ext.getCmp('acctServerIp').disable(); Ext.getCmp('acctServerPort').disable(); Ext.getCmp('acctServerPwdCon').disable(); } break; case 3: Ext.getCmp('wpaPskAp').enable(); break; } // } } }, '#wirelessApSettings [id=wepType1Ap]': { change: function( scope, newValue, oldValue, eOpts) { if( scope.getValue() == '0') { setWepClient('wepKeySlt1Ap',['wepKeySlt2Ap','wepKeySlt3Ap','wepKeySlt4Ap']); Ext.getCmp('wepKeySlt1Ap').disable(); Ext.getCmp('wepKeyText1Ap').disable(); } else { Ext.getCmp('wepKeySlt1Ap').enable(); Ext.getCmp('wepKeyText1Ap').enable(); } } }, '#wirelessApSettings [id=wepType2Ap]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue() == '0') { setWepClient('wepKeySlt2Ap',['wepKeySlt3Ap','wepKeySlt4Ap','wepKeySlt1Ap']); Ext.getCmp('wepKeySlt2Ap').disable(); Ext.getCmp('wepKeyText2Ap').disable(); } else { Ext.getCmp('wepKeySlt2Ap').enable(); Ext.getCmp('wepKeyText2Ap').enable(); } } }, '#wirelessApSettings [id=wepType3Ap]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue() == '0') { setWepClient('wepKeySlt3Ap',['wepKeySlt4Ap','wepKeySlt1Ap','wepKeySlt2Ap']); Ext.getCmp('wepKeySlt3Ap').disable(); Ext.getCmp('wepKeyText3Ap').disable(); } else { Ext.getCmp('wepKeySlt3Ap').enable(); Ext.getCmp('wepKeyText3Ap').enable(); } } }, '#wirelessApSettings [id=wepType4Ap]': { change: function( scope, newValue, oldValue, eOpts){ if(scope.getValue() == '0') { setWepClient('wepKeySlt4Ap',['wepKeySlt1Ap','wepKeySlt2Ap','wepKeySlt3Ap']); Ext.getCmp('wepKeySlt4Ap').disable(); Ext.getCmp('wepKeyText4Ap').disable(); } else { Ext.getCmp('wepKeySlt4Ap').enable(); Ext.getCmp('wepKeyText4Ap').enable(); } } }, '#wirelessApSettings button[id = wlApSubmit]': { click: function( button, event ) { // console.log("11111"); var form = Ext.getCmp('wirelessApSettings'); var formBasic = form.getForm(); if( formBasic.isValid() ) { changeSubmitWaitStatus(true); formBasic.submit({ //waitTitle: smb.charset.tip.submitWaitTitle, //waitMsg: smb.charset.tip.submitWaitMsg, timeout: 15, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); if( Ext.getCmp('multiSsid') ) { Ext.getStore('multiSsidGrid').load(); } else if( Ext.getCmp('wireMacFilter') ) { Ext.getCmp('ssidName1').setValue(''); Ext.getCmp('ssidName2').setValue(''); Ext.getCmp('ssidName3').setValue(''); Ext.getCmp('ssidName4').setValue(''); Ext.getCmp('ssidName5').setValue(''); // Ext.getStore('macFilterGrid').load(); Ext.Ajax.request({ url: './data/wireMacFilter.json', // method: 'GET', success: function(response) { smb.user.timeout.call(this, response, response); var data = Ext.JSON.decode(response.responseText); if(data.success){ Ext.getCmp('wireMacFilter').getForm().setValues({ ssidName1: data.data.ssidName1, ssidName2: data.data.ssidName2, ssidName3: data.data.ssidName3, ssidName4: data.data.ssidName4, ssidName5: data.data.ssidName5 }) Ext.getStore('macFilterGrid').loadData(data.data.macFilterGrid); } else{ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+data.errCode]); } }, failure: function(){ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } }) } var s = setTimeout(resetApplyChanges, 1000); me.getStoreDataForApAndClient(thisForm.owner.id); me.refreshTxRateValue(formData.data.TKIP_WEP, formData.data.txRateAp); Ext.getCmp('tdma').TKIP_WEPFlag = true; Ext.getCmp('tdma').TKIP_WEPValue = formData.data.TKIP_WEP; //smb.app.getController("wireless").getStoreDataForApAndClient(thisForm.owner.id); }, failure: function(form, action) { changeSubmitWaitStatus(false); 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; } } } }); } else { //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); } } }, '#wirelessApSettings checkbox[id = showApWpaPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('apWpaPwdText').show(); Ext.getCmp('apWpaPwd').hide(); } else { Ext.getCmp('apWpaPwdText').hide(); Ext.getCmp('apWpaPwd').show(); } } }, '#wirelessApSettings checkbox[id = showApApRadiusPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('apApRadiusPwdText').show(); Ext.getCmp('apApRadiusPwd').hide(); } else { Ext.getCmp('apApRadiusPwdText').hide(); Ext.getCmp('apApRadiusPwd').show(); } } }, '#wirelessClientSettings button[id=searchBtn]': { click: function(button) { smb.user.bodyMask.show(); smb.user.bodyMask2.show(); if(Ext.getCmp('survey')) { Ext.getStore('searchGrid').removeAll(); Ext.getCmp('searchGrid').hide(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('surveyLoading').show(); Ext.getCmp('survey').show(); } else { Ext.create('smb.view.popBox', { id: 'survey', name: 'survey', title: smb.charset.button.survey, width: 920, height: 560, resizable: false, renderTo: 'wireless', bodyStyle:{ //background: '#fff' }, items: [ { xtype:'loadingCnt', id: 'surveyLoading', margin: 0, height: 497 }, { xtype: 'grid', id: 'searchGrid', store: 'searchGrid', selType:'checkboxmodel', scrollPositionPre:0, maxHeight: 497, margin: 0, columns: [ {text: smb.charset.column.bssid, hideable: false, dataIndex:'bssid', flex:3.5}, {text: smb.charset.column.ssid, hideable: false, dataIndex:'ssid', flex:4.5, renderer: function(value){ return Ext.String.htmlEncode(value); } }, {text: smb.charset.column.tdma, hideable: false, dataIndex:'tdma', flex:1.7, renderer : function(value, metaData, record, colIndex, store, view) { if (value === 'Yes'){ return smb.charset.status.yes; } else if (value === 'No'){ return smb.charset.status.no; } else { return value; } } }, {text: smb.charset.column.deviceName, hideable: false, dataIndex:'deviceName', flex:3}, {text: smb.charset.column.snr, hideable: false, dataIndex:'snr', flex:1.5}, {text: smb.charset.column.signalNoise, hideable: false, dataIndex:'signal', flex:3, renderer:function(value, metaData, record, colIndex, store, view) { return value + '/' + record.data.noise; } }, {text: smb.charset.column.frequencyChannel, hideable: false, dataIndex:'channel', flex:2}, {text: smb.charset.column.security, hideable: false, dataIndex:'security', flex:3.5} ], listeners: { /*viewready:function() { // console.log(this) var me = this; me.getEl().mask(); me.getStore().load(function(records, operation, success){ me.getEl().unmask(); }); },*/ selectionchange:function( sltMode, selected, eOpts) { if(selected.length!=0){ Ext.getCmp('securityConnect').enable(); Ext.getCmp('securityLock').enable(); } else{ Ext.getCmp('securityConnect').disable(); Ext.getCmp('securityLock').disable(); } } } } ], buttonAlign: 'right', buttons:[ { xtype: 'displayfield', fieldLabel: smb.charset.label.apCount, labelWidth: 60, width: 120, id: 'searchApCount', name: 'apCount', margin: '0 450 0 0' }, { xtype: 'button', width: 100, id: 'securityRefresh', margin: '0 12 0 0', text: smb.charset.button.refresh }, { xtype: 'button', id: 'securityConnect', disabled: true, width: 100, margin: '0 12 0 0', text: smb.charset.button.connect }, { xtype: 'button', id: 'securityLock', disabled: true, width: 100, margin: '0 12 0 0', text: smb.charset.button.lockToAp } ] }) } var survey = Ext.getCmp('survey'); Ext.getStore('searchGrid').removeAll(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('searchGrid').hide(); Ext.getCmp('surveyLoading').show(); var position = button.getPosition(); var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight; var temp = 0; temp = (h-520)/2+Ext.getBody().dom.scrollTop-150; survey.setPosition(10, temp); survey.show(); var searchGrid = Ext.getCmp('searchGrid'); Ext.getCmp('securityRefresh').setText(smb.charset.button.scanning); Ext.getCmp('securityRefresh').disable(); Ext.Ajax.request({ url: './data/search.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var respObj = Ext.JSON.decode(response.responseText); var reqCount = 0; if(respObj.success) { searchGrid.intr = setInterval(function() { if(smb.user.loginFlag) { Ext.Ajax.request({ url: './data/getSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var responseData = Ext.JSON.decode(response.responseText); reqCount = reqCount + 1; if(responseData.success == false) { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } else if( responseData.success ) { if (responseData.data.searchDone == '2' || reqCount > 35) { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); return; } Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); var gridStore = responseData.data.searchGrid; Ext.getStore('searchGrid').loadData(gridStore); Ext.getCmp('searchApCount').setValue(responseData.data.apCount); if (responseData.data.searchDone == '1') { Ext.Ajax.request({ url: './data/stopSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var rspData = Ext.JSON.decode(response.responseText); if(rspData.success == false) { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } else if( rspData.success ) { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); return; } }, failure: function() { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); } } }, failure: function() { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); } }, 4000); } else { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); } }, failure: function(response) { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); return; } }); } }, '#survey button[id=securityRefresh]': { click: function(button) { Ext.getStore('searchGrid').removeAll(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('searchGrid').hide(); Ext.getCmp('surveyLoading').show(); Ext.getCmp('securityRefresh').setText(smb.charset.button.scanning); Ext.getCmp('securityRefresh').disable(); var survey = Ext.getCmp('survey'); var searchGrid = Ext.getCmp('searchGrid'); Ext.Ajax.request({ url: './data/search.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var respObj = Ext.JSON.decode(response.responseText); var reqCountRe = 0; if(respObj.success) { searchGrid.intr = setInterval(function() { if(smb.user.loginFlag) { Ext.Ajax.request({ url: './data/getSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var responseData = Ext.JSON.decode(response.responseText); reqCountRe = reqCountRe + 1; if(responseData.success == false) { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); clearInterval(Ext.getCmp('searchGrid').intr); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } else if( responseData.success ) { if (responseData.data.searchDone == '2' || reqCountRe > 35) { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); return; } Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); var gridStore = responseData.data.searchGrid; Ext.getStore('searchGrid').loadData(gridStore); Ext.getCmp('searchApCount').setValue(responseData.data.apCount); if (responseData.data.searchDone == '1') { Ext.Ajax.request({ url: './data/stopSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var rspData = Ext.JSON.decode(response.responseText); if(rspData.success == false) { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } else if( rspData.success ) { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); return; } }, failure: function() { Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); } } }, failure: function() { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); clearInterval(Ext.getCmp('searchGrid').intr); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); } }, 4000); } else { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('searchGrid').show(); Ext.getCmp('searchApCount').setValue(0); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); } }, failure: function(response) { Ext.getCmp('surveyLoading').hide(); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); return; } }); } }, '#survey button[id=securityConnect]': { click: function(button){ var searchGrid = Ext.getCmp('searchGrid'); var list = searchGrid.getSelectionModel().getSelection(); if(list.length!=0) { Ext.getCmp('ssidOfAp').setValue(list[0].data.ssid); Ext.getCmp('macOfAp').setValue(list[0].data.bssid); if( list[0].data.security.toUpperCase() == 'NONE' ) { Ext.getCmp('clientSecurityMode').setValue(0); } else if( list[0].data.security.toUpperCase() == 'WEP' ) { Ext.getCmp('clientSecurityMode').setValue(1); } else if( list[0].data.security.toUpperCase() == 'WPA/WPA2' ) { Ext.getCmp('clientSecurityMode').setValue(2); } else { Ext.getCmp('clientSecurityMode').setValue(3); } } if(Ext.getCmp('securityRefresh').isDisabled() == true) { clearInterval(Ext.getCmp('searchGrid').intr); Ext.Ajax.request({ url: './data/stopSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var rspData = Ext.JSON.decode(response.responseText); if(rspData.success == false) { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); } Ext.getCmp('survey').hide(); smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); Ext.getCmp('lockToAp').setValue(false); } }, '#survey button[id=securityLock]': { click: function(button){ var searchGrid = Ext.getCmp('searchGrid'); var list = searchGrid.getSelectionModel().getSelection(); if(list.length!=0) { Ext.getCmp('ssidOfAp').setValue(list[0].data.ssid); Ext.getCmp('macOfAp').setValue(list[0].data.bssid); // if( list[0].data.security.toUpperCase() != 'NONE' ) // { // Ext.getCmp('clientEnableSecurity').setValue(true); if( list[0].data.security.toUpperCase() == 'NONE' ){ Ext.getCmp('clientSecurityMode').setValue(0); } else if( list[0].data.security.toUpperCase() == 'WEP' ) { Ext.getCmp('clientSecurityMode').setValue(1); } else if( list[0].data.security.toUpperCase() == 'WPA/WPA2' ) { Ext.getCmp('clientSecurityMode').setValue(2); } else { Ext.getCmp('clientSecurityMode').setValue(3); } // } // else // { // Ext.getCmp('clientEnableSecurity').setValue(false); // } } if(Ext.getCmp('securityRefresh').isDisabled() == true) { clearInterval(Ext.getCmp('searchGrid').intr); Ext.Ajax.request({ url: './data/stopSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var rspData = Ext.JSON.decode(response.responseText); if(rspData.success == false) { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); } Ext.getCmp('survey').hide(); smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); Ext.getCmp('lockToAp').setValue(true); } }, '#survey': { close: function() { if(Ext.getCmp('securityRefresh').isDisabled() == true) { clearInterval(Ext.getCmp('searchGrid').intr); Ext.Ajax.request({ url: './data/stopSearch.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var rspData = Ext.JSON.decode(response.responseText); if(rspData.success == false) { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, 'fail to get data'); return; } }); Ext.getCmp('securityRefresh').setText(smb.charset.button.refresh); Ext.getCmp('securityRefresh').enable(); } smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); } }, 'wirelessAdv button[id = wirelessAdvSubmit]':{ click: function(button){ var wmmValue = false; var ackNumCmp = 27.9; var ackNumValue = Ext.getCmp('ackNumber').getValue(); switch(Ext.getCmp('apChannelWidth').getValue()) { case 0: ackNumCmp = (27.9 * 8); break; case 1: ackNumCmp = (27.9 * 4); break; case 2: ackNumCmp = (27.9 * 2); break; default: break; } Ext.Ajax.request({ url: './data/wirelessAdv.json', // method: 'GET', async: false, success: function(response) { smb.user.timeout.call(this, response, response); var data = Ext.JSON.decode(response.responseText); if(data.success){ wmmValue = data.data.enableWmm; if (ackNumValue > ackNumCmp && Ext.getCmp('enableWmm').getValue() == false && wmmValue == false) { Ext.getCmp('enableWmm').setValue(true); } var form = Ext.getCmp('wirelessAdv'); var formBasic = form.getForm(); if( formBasic.isValid() ) { changeSubmitWaitStatus(true); //globalMask.show(); formBasic.submit({ //waitTitle: smb.charset.tip.submitWaitTitle, //waitMsg: smb.charset.tip.submitWaitMsg, scope:me, timeout: 15, clientValidation:true, success: function(thisForm, action) { changeSubmitWaitStatus(false); var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); /* console.log("111"); console.dir(thisForm.owner); console.dir(thisForm.owner.model); //this.getModel().getProxy().getReader().readRecords('formData'); smb.app.getController('wireless').getModel('wirelessAdv').getProxy().getReader().readRecords(formData); console.dir(smb.app.getController('wireless').getModel('wirelessAdv').getProxy().getReader().rawData); */ var s = setTimeout(resetApplyChanges, 1000); var root = getRecordOrModelData('wirelessAdv'); var TKIP_WEP = root.TKIP_WEP; var enableShortGi = root.enableShortGi; var retObj = getCurTxRateModel(Ext.getCmp('apMode').getRawValue(), Ext.getCmp('apChannelWidth').getRawValue(), TKIP_WEP); Ext.getCmp('txRateAp').getStore().loadData( retObj ); //如果返回数据的根节点名称发生变化,wirelessApSetting需要相应变化 var txRateAp = root.txRateAp; //console.log("txRateAp"+":"+txRateAp); Ext.getCmp('txRateAp').setValue(txRateAp); //smb.app.getController("wireless").getStoreDataForApAndClient(thisForm.owner.id); }, failure: function(form, action) { changeSubmitWaitStatus(false); 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; } } } }); } } else{ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+data.errCode]); } }, failure: function(){ Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.eDefault); } }) } }, /* 'wirelessAdv checkbox[id = enableShortGi]':{ change: function( scope, newValue, oldValue, eOpts) { if(this.getModel('wirelessAdv').getProxy().getReader().rawData.data.enableShortGi!=lastRawdata) { if(Ext.get("wirelessApSettings")) { if(Ext.getCmp('txRateAp').getStore().data.length != 0) //store还没有加载,证明是第一次加载 { //console.dir("need to update txRate model"); var TKIP_WEP = this.getModel('wirelessAdv').getProxy().getReader().rawData.data.TKIP_WEP; var retObj = getCurTxRateModel(Ext.getCmp('apMode').getRawValue(), Ext.getCmp('apChannelWidth').getRawValue(), enableShortGi, TKIP_WEP); Ext.getCmp('txRateAp').getStore().loadData( retObj ); var root = this.getModel('wirelessAdv').getProxy().getReader().rawData.data;//如果返回数据的根节点名称发生变化,wirelessApSetting需要相应变化 var txRateAp = root.txRate; console.log(txRateAp); Ext.getCmp('txRateAp').setValue(txRateAp); lastRawdata = this.getModel('wirelessAdv').getProxy().getReader().rawData.data.enableShortGi; } else { lastRawdata = this.getModel('wirelessAdv').getProxy().getReader().rawData.data.enableShortGi; } } if(Ext.get("wirelessClientSettings")) { lastRawdata = this.getModel('wirelessAdv').getProxy().getReader().rawData.data.enableShortGi; } } } }, */ /*'#wirelessClientSettingsContent': { change: function(item, newValue, oldValue, scope){ if (Ext.getCmp('apRegion').getValue() != 511) { Ext.getCmp('clientWirelessScan').hide(); } else { Ext.getCmp('clientWirelessScan').show(); } } },*/ '#tdma button[id=spectrumAnalysisBtn]': { click: function(button) { if( smb.user.isWirelessAccess == true ) { Ext.Msg.alert( smb.charset.tip.error, smb.charset.tip.spectrumInWireless); } else if( smb.user.isWirelessAccess == false ) { Ext.Msg.confirm( '', smb.charset.tip.spectrumNotInWireless, showSpectrum); } var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } function showSpectrum(result) { if( result == 'cancel' || result == 'no' ) { smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); return ; } else if( result == 'yes' ) { smb.user.bodyMask.show(); smb.user.bodyMask2.show(); Ext.getStore('spectrumChart').removeAll(); if( Ext.getCmp('spectrumAnalysis') ) { Ext.getCmp('spectrumAnalysis').show(); } else { if (Ext.getCmp('apRegion').getValue() == 840) { Ext.create('smb.view.popBox', { // alias: 'widget.spectrumAnalysis', id: 'spectrumAnalysis', name: 'spectrumAnalysis', title: smb.charset.button.spectrumAnalysis, width: 960, height: 560, closeAction: 'destroy', resizable: false, hidden: true, renderTo: 'wireless', bodyStyle: { background: '#fff', padding: '10px' }, items: [ { xtype: 'smbForm', header: false, buttonAlign: 'right', items: [ { xtype: 'combobox', id: 'frequencyRangeSlt', align: 'right', store: 'frequencyRangeUS', fieldLabel: smb.charset.label.frequencyRange, inputWidth: 150, editable: false, displayField: 'display', valueField: 'name', value: '5180-5240', listeners:{ change: function(item, newValue, oldValue, scope) { switch(newValue) { case '5180-5240': Ext.getCmp('spectrumChart').axes.items[1].minimum = 5180; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5240; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 2; Ext.getStore('spectrumChart').loadData([ {frequency:5180, peak:-10, current:-20, average:0}, {frequency:5200, peak:-10, current:-20, average:0}, {frequency:5220, peak:-10, current:-20, average:0}, {frequency:5240, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true); break; case '5745-5825': Ext.getCmp('spectrumChart').axes.items[1].minimum = 5745; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5825; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 3; Ext.getStore('spectrumChart').loadData([ {frequency:5745, peak:-10, current:-20, average:0}, {frequency:5765, peak:-10, current:-20, average:0}, {frequency:5785, peak:-10, current:-20, average:0}, {frequency:5805, peak:-10, current:-20, average:0}, {frequency:5825, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true); break; } } } }, { xtype: 'hiddenfield', submitValue: true, id: 'frequencyRangeHidden', value: '2412-2462' }, { xtype: 'chart', id: 'spectrumChart', store: 'spectrumChart', width: 850, height: 430, theme: 'Fancy', shadow: false, background: { fill: '#fff' }, legend: { boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 9, minimum: -110, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 2, position: 'bottom', fields: 'frequency', grid: true, minimum: 5180, maximum: 5240 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] }, { id: 'spectrumChartDefault', xtype: 'chart', store: 'spectrumChartDefault', width: 850, height: 430, theme: 'Fancy', shadow: false, margin: '10 0 10 20', background: { fill: '#fff' }, legend: { // position: 'right', // boxFill: '#4c4c4e' boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 7, minimum: -130, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 9, position: 'bottom', fields: 'frequency', grid: true, minimum: 2412, maximum: 2462 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { 'stroke-width': 2, opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { 'stroke-width': 2, opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] } ], buttons: [ { id: 'startSpectrum', text: smb.charset.button.start, status: 'start', width: 50 } ] } ] }) } else if (localProductInfo == "EU") { Ext.create('smb.view.popBox', { // alias: 'widget.spectrumAnalysis', id: 'spectrumAnalysis', name: 'spectrumAnalysis', title: smb.charset.button.spectrumAnalysis, width: 960, height: 560, closeAction: 'destroy', resizable: false, hidden: true, renderTo: 'wireless', bodyStyle: { background: '#fff', padding: '10px' }, items: [ { xtype: 'smbForm', header: false, buttonAlign: 'right', items: [ { xtype: 'combobox', id: 'frequencyRangeSlt', align: 'right', store: 'frequencyRangeEU', fieldLabel: smb.charset.label.frequencyRange, inputWidth: 150, editable: false, displayField: 'display', valueField: 'name', value: '5500-5700', listeners:{ change: function(item, newValue, oldValue, scope) { switch(newValue) { case '5500-5700': Ext.getCmp('spectrumChart').axes.items[1].minimum = 5500; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5700; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 9; Ext.getStore('spectrumChart').loadData([ {frequency:5500, peak:-10, current:-20, average:0}, {frequency:5520, peak:-10, current:-20, average:0}, {frequency:5540, peak:-10, current:-20, average:0}, {frequency:5560, peak:-10, current:-20, average:0}, {frequency:5580, peak:-10, current:-20, average:0}, {frequency:5600, peak:-10, current:-20, average:0}, {frequency:5620, peak:-10, current:-20, average:0}, {frequency:5640, peak:-10, current:-20, average:0}, {frequency:5660, peak:-10, current:-20, average:0}, {frequency:5680, peak:-10, current:-20, average:0}, {frequency:5700, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true); break; } } } }, { xtype: 'hiddenfield', submitValue: true, id: 'frequencyRangeHidden', value: '2412-2472' }, { xtype: 'chart', id: 'spectrumChart', store: 'spectrumChart', width: 850, height: 430, theme: 'Fancy', shadow: false, background: { fill: '#fff' }, legend: { boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 9, minimum: -110, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 9, position: 'bottom', fields: 'frequency', grid: true, minimum: 5500, maximum: 5700 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] }, { id: 'spectrumChartDefault', xtype: 'chart', store: 'spectrumChartDefault', width: 850, height: 430, theme: 'Fancy', shadow: false, margin: '10 0 10 20', background: { fill: '#fff' }, legend: { // position: 'right', // boxFill: '#4c4c4e' boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 7, minimum: -130, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 9, position: 'bottom', fields: 'frequency', grid: true, minimum: 2412, maximum: 2472 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { 'stroke-width': 2, opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { 'stroke-width': 2, opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] } ], buttons: [ { id: 'startSpectrum', text: smb.charset.button.start, status: 'start', width: 50 } ] } ] }) } else{ Ext.create('smb.view.popBox', { // alias: 'widget.spectrumAnalysis', id: 'spectrumAnalysis', name: 'spectrumAnalysis', title: smb.charset.button.spectrumAnalysis, width: 960, height: 560, resizable: false, closeAction: 'destroy', hidden: true, renderTo: 'wireless', bodyStyle: { background: '#fff', padding: '10px' }, items: [ { xtype: 'smbForm', header: false, buttonAlign: 'right', items: [ { xtype: 'combobox', id: 'frequencyRangeSlt', align: 'right', store: 'frequencyRange', fieldLabel: smb.charset.label.frequencyRange, inputWidth: 150, editable: false, displayField: 'display', valueField: 'name', value: '4920-5300', listeners:{ change: function(item, newValue, oldValue, scope) { switch(newValue) { case '4920-5300': Ext.getCmp('spectrumChart').axes.items[1].minimum = 4920; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5300; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 18; Ext.getStore('spectrumChart').loadData([ {frequency:4920, peak:-10, current:-20, average:0}, {frequency:4940, peak:-10, current:-20, average:0}, {frequency:4980, peak:-10, current:-20, average:0}, {frequency:5020, peak:-10, current:-20, average:0}, {frequency:5060, peak:-10, current:-20, average:0}, {frequency:5100, peak:-10, current:-20, average:0}, {frequency:5140, peak:-10, current:-20, average:0}, {frequency:5180, peak:-10, current:-20, average:0}, {frequency:5220, peak:-10, current:-20, average:0}, {frequency:5260, peak:-10, current:-20, average:0}, {frequency:5300, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true); break; case '5300-5700': Ext.getCmp('spectrumChart').axes.items[1].minimum = 5300; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5700; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 19; Ext.getStore('spectrumChart').loadData([ {frequency:5300, peak:-10, current:-20, average:0}, {frequency:5340, peak:-10, current:-20, average:0}, {frequency:5380, peak:-10, current:-20, average:0}, {frequency:5420, peak:-10, current:-20, average:0}, {frequency:5460, peak:-10, current:-20, average:0}, {frequency:5500, peak:-10, current:-20, average:0}, {frequency:5540, peak:-10, current:-20, average:0}, {frequency:5580, peak:-10, current:-20, average:0}, {frequency:5620, peak:-10, current:-20, average:0}, {frequency:5660, peak:-10, current:-20, average:0}, {frequency:5700, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true); break; case '5700-6080': Ext.getCmp('spectrumChart').axes.items[1].minimum = 5700; Ext.getCmp('spectrumChart').axes.items[1].maximum = 6080; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 18; Ext.getStore('spectrumChart').loadData([ {frequency:5700, peak:-10, current:-20, average:0}, {frequency:5740, peak:-10, current:-20, average:0}, {frequency:5780, peak:-10, current:-20, average:0}, {frequency:5820, peak:-10, current:-20, average:0}, {frequency:5860, peak:-10, current:-20, average:0}, {frequency:5900, peak:-10, current:-20, average:0}, {frequency:5940, peak:-10, current:-20, average:0}, {frequency:5980, peak:-10, current:-20, average:0}, {frequency:6020, peak:-10, current:-20, average:0}, {frequency:6060, peak:-10, current:-20, average:0}, {frequency:6080, peak:-10, current:-20, average:0}]); Ext.getStore('spectrumChart').removeAll(true) break; } } } }, { xtype: 'hiddenfield', submitValue: true, id: 'frequencyRangeHidden', value: '2312-2712' }, { xtype: 'chart', id: 'spectrumChart', store: 'spectrumChart', width: 850, height: 430, theme: 'Fancy', shadow: false, background: { fill: '#fff' }, legend: { boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 9, minimum: -110, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 18, position: 'bottom', fields: 'frequency', grid: true, minimum: 4920, maximum: 5300 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { // stroke: '#00ff00', 'stroke-width': 2, // fill: '#80A080', opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] }, { id: 'spectrumChartDefault', xtype: 'chart', store: 'spectrumChartDefault', width: 850, height: 430, theme: 'Fancy', shadow: false, margin: '10 0 10 20', background: { fill: '#fff' }, legend: { // position: 'right', // boxFill: '#4c4c4e' boxStrokeWidth: 0, boxFill: '#fff', position: 'top', labelColor: '#000' }, axes: [ { title: smb.charset.label.powerTitle, type: 'Numeric', position: 'left', fields: ['peak','current','average'], minorTickSteps: 1, majorTickSteps: 7, minimum: -130, maximum: -10, grid: { odd: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 }, even: { opacity: 1, // fill: '#4c4c4e', stroke: '#c8c8c8', 'stroke-width': 0.5 } } }, { title: smb.charset.label.frequencyTitle, type: 'Numeric', minorTickSteps: 1, majorTickSteps: 9, position: 'bottom', fields: 'frequency', grid: true, minimum: 2312, maximum: 2712 } ], series: [ { type: 'line', title: smb.charset.label.peak, xField: 'frequency', yField: 'peak', highlight: { size: 3, radius: 3 }, style: { 'stroke-width': 2, opacity: 1 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.current, xField: 'frequency', yField: 'current', highlight: { size: 3, radius: 3 }, showMarkers: false, style: { 'stroke-width': 2, opacity: 1 }, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('peak')); } } }, { type: 'line', title: smb.charset.label.average, xField: 'frequency', yField: 'average', fill: true, highlight: { size: 3, radius: 3 }, markerConfig: { type: 'circle', size: 1, radius: 1, 'stroke-width': 0 }, showMarkers: false, tips: { trackMouse: true, width: 50, height: 28, renderer: function(storeItem, item) { this.setTitle(storeItem.get('average')); } } } ] } ], buttons: [ { id: 'startSpectrum', text: smb.charset.button.start, status: 'start', width: 50 } /* { id: 'stopSpectrum', disabled: true, text: smb.charset.button.stop, width: 50 } { text: smb.charset.button.clear, width: 50 } */ ] } ] /* initComponent: function() { this.callParent(arguments); if(smb.user.is2G == true) { Ext.getCmp('frequencyRangeSlt').disable(); Ext.getCmp('frequencyRangeSlt').hide(); Ext.getCmp('spectrumChart').hide(); Ext.getCmp('spectrumChartDefault').show(); Ext.getCmp('frequencyRangeHidden').enable(); } else { Ext.getCmp('frequencyRangeSlt').enable(); Ext.getCmp('frequencyRangeSlt').show(); Ext.getCmp('spectrumChart').show(); Ext.getCmp('spectrumChartDefault').hide(); Ext.getCmp('frequencyRangeHidden').disable(); } } */ })} } } if (Ext.getCmp('apRegion').getValue() == 840) { Ext.getCmp('frequencyRangeSlt').setValue('5180-5240'); } else if (localProductInfo == "EU") { Ext.getCmp('frequencyRangeSlt').setValue('5500-5700'); } else { Ext.getCmp('frequencyRangeSlt').setValue('4920-5300'); } if(smb.user.is2G == true) { Ext.getCmp('frequencyRangeSlt').disable(); Ext.getCmp('frequencyRangeSlt').hide(); Ext.getCmp('spectrumChart').hide(); Ext.getCmp('spectrumChartDefault').show(); Ext.getCmp('frequencyRangeHidden').enable(); } else { Ext.getCmp('frequencyRangeSlt').enable(); Ext.getCmp('frequencyRangeSlt').show(); Ext.getCmp('spectrumChart').show(); Ext.getCmp('spectrumChartDefault').hide(); Ext.getCmp('frequencyRangeHidden').disable(); } if (localProductInfo == "EU") { Ext.getCmp('frequencyRangeSlt').disable(); } var spectrumAnalysis = Ext.getCmp('spectrumAnalysis'); spectrumAnalysis.show(); var position = button.getPosition(); var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.clientHeight; var temp = 0; temp = (h-560)/2+Ext.getBody().dom.scrollTop-150; Ext.getCmp('spectrumAnalysis').setPosition((960-960)/2, temp); } } }, '#spectrumAnalysis button[id=startSpectrum]': { click: function( button, event, obj) { var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } if(button.status == 'start') { button.disable(); Ext.getCmp('frequencyRangeSlt').setDisabled(true); var spectrumStore = Ext.getStore('spectrumChart'); var spectrumChart = Ext.getCmp('spectrumChart'); var spectrumStoreDefault = Ext.getStore('spectrumChartDefault'); var spectrumChartDefault = Ext.getCmp('spectrumChartDefault'); var range = ''; if(smb.user.is2G == true) { range = Ext.getCmp('frequencyRangeHidden').getValue(); } else { range = Ext.getCmp('frequencyRangeSlt').getValue(); } Ext.Ajax.request({ url: './data/spectrumAnalysisStart.json', params: { range: range }, success: function(startResponse) { button.enable(); smb.user.timeout.call(this, startResponse, startResponse); var startData = Ext.JSON.decode(startResponse.responseText); var data = new Array(); var dataused = 4; if(startData.success == true) { button.status = 'stop'; button.setText(smb.charset.button.stop); spectrumChart.intr = setInterval(function() { if(smb.user.loginFlag) { Ext.Ajax.request({ url: './data/spectrumAnalysisGet.json', params: { range: range }, success: function(response) { smb.user.timeout.call(this, response, response); var responseData = Ext.JSON.decode(response.responseText); var spectrum = responseData.data; data.length = 0; if(responseData.success == false) { button.status = 'start'; button.setText(smb.charset.button.start); Ext.getCmp('frequencyRangeSlt').enable(true); clearInterval(Ext.getCmp('spectrumChart').intr); Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+responseData.errCode]); } else if( responseData.success ) { if (Ext.getCmp('apRegion').getValue() == 840) { if(smb.user.is2G == true) { for(var i=0; i<160/dataused; i++) { var obj = { frequency: 2412+i*0.3206*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); } spectrumStoreDefault.removeAll(true); spectrumStoreDefault.loadData(data); } else { switch(Ext.getCmp('frequencyRangeSlt').getValue()) { case '5180-5240': for(var i=0; i<192/dataused; i++) { var obj = { frequency: 5180+i*0.32*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 5180; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5240; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 2; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; case '5745-5825': for(var i=0; i<256/dataused; i++) { var obj = { frequency: 5745+i*0.32*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 5745; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5825; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 3; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; } } } else if (localProductInfo == "EU") { if(smb.user.is2G == true) { for(var i=0; i<192/dataused; i++) { var obj = { frequency: 2412+i*0.32*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); } spectrumStoreDefault.removeAll(true); spectrumStoreDefault.loadData(data); } else { switch(Ext.getCmp('frequencyRangeSlt').getValue()) { case '5500-5700': for(var i=0; i<640/dataused; i++) { var obj = { frequency: 5500+i*0.3145*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 5500; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5700; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 9; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; } } } else{ if(smb.user.is2G == true) { for(var i=0; i<1280/dataused; i++) { var obj = { frequency: 2312+i*0.3125*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); } spectrumStoreDefault.removeAll(true); spectrumStoreDefault.loadData(data); } else { switch(Ext.getCmp('frequencyRangeSlt').getValue()) { case '4920-5300': for(var i=0; i<1216/dataused; i++) { var obj = { frequency: 4920+i*0.3125*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 4920; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5300; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 18; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; case '5300-5700': for(var i=0; i<1280/dataused; i++) { var obj = { frequency: 5300+i*0.3125*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 5300; Ext.getCmp('spectrumChart').axes.items[1].maximum = 5700; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 19; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; case '5700-6080': for(var i=0; i<1216/dataused; i++) { var obj = { frequency: 5700+i*0.3125*dataused, current: spectrum.current[i], average: spectrum.average[i], peak: spectrum.peak[i] } data.push(obj); Ext.getCmp('spectrumChart').axes.items[1].minimum = 5700; Ext.getCmp('spectrumChart').axes.items[1].maximum = 6080; Ext.getCmp('spectrumChart').axes.items[1].majorTickSteps = 18; } spectrumStore.removeAll(true); spectrumStore.loadData(data); break; } } } } }, failure: function() { button.status = 'start'; button.setText(smb.charset.button.start); Ext.getCmp('frequencyRangeSlt').enable(true); clearInterval(Ext.getCmp('spectrumChart').intr); Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.e404); return; } }); } }, 1000); } else if(startData.success == false) { Ext.getCmp('frequencyRangeSlt').enable(true); Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+startData.errCode]); } }, failure: function() { button.enable(); Ext.getCmp('frequencyRangeSlt').enable(true); Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.e404); return; } }); } else if(button.status == 'stop') { button.disable(); clearInterval(Ext.getCmp('spectrumChart').intr); Ext.Ajax.request({ url: './data/spectrumAnalysisStop.json', params: { range: Ext.getCmp('frequencyRangeSlt').getValue() }, success: function(response) { button.enable(); smb.user.timeout.call(this, response, response); button.status = 'start'; button.setText(smb.charset.button.start); Ext.getCmp('frequencyRangeSlt').enable(true); var stopData = Ext.JSON.decode(response.responseText); if( stopData.success==false) { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+stopData.errCode]); } }, failure: function() { button.enable(); button.status = 'start'; button.setText(smb.charset.button.start); Ext.getCmp('frequencyRangeSlt').enable(true); Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.e404); return false; } }); } } }, '#spectrumAnalysis': { close: function() { if(Ext.getCmp('startSpectrum').status == 'stop' || Ext.getCmp('startSpectrum').isDisabled() == true) { clearInterval(Ext.getCmp('spectrumChart').intr); Ext.Ajax.request({ url: './data/spectrumAnalysisStop.json', params: { range: Ext.getCmp('frequencyRangeSlt').getValue() }, success: function(response) { smb.user.timeout.call(this, response, response); var stopData = Ext.JSON.decode(response.responseText); if( stopData.success==false) { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode['e'+stopData.errCode]); } }, failure: function() { Ext.Msg.alert(smb.charset.label.failure, smb.charset.errCode.e404); return false; } }); } Ext.getStore('spectrumChart').removeAll(); Ext.getCmp('startSpectrum').setText(smb.charset.button.start); Ext.getCmp('startSpectrum').status = 'start'; smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); Ext.getCmp('frequencyRangeSlt').enable(true); //clearInterval(Ext.getCmp('spectrumChart').intr); } }, '#wireMacFilter [id=ssidName1]': { change: function(obj, newValue, oldValue, event) { Ext.getStore('mfSsidName').addFlag = true; Ext.getStore('mfSsidName').removeAll(); Ext.getStore('mfSsidName').add({name:newValue, display:newValue}); } }, '#wireMacFilter [id=ssidName2]': { change: function(obj, newValue, oldValue, event) { Ext.getStore('mfSsidName').add({name:newValue, display:newValue}) } }, '#wireMacFilter [id=ssidName3]': { change: function(obj, newValue, oldValue, event) { Ext.getStore('mfSsidName').add({name:newValue, display:newValue}) } }, '#wireMacFilter [id=ssidName4]': { change: function(obj, newValue, oldValue, event) { Ext.getStore('mfSsidName').add({name:newValue, display:newValue}) } }, '#wireMacFilter [id=ssidName5]': { change: function(obj, newValue, oldValue, event) { Ext.getStore('mfSsidName').add({name:newValue, display:newValue}) } }, '#wireless [qType=encryption]':{ enable:function(combo) { //var advRoot = smb.model['tdma'].getProxy().getReader().rawData.data;//获取最新的mode的值 var id = combo.ownerCt.ownerCt.ownerCt.ownerCt.id; //console.log(id); var mode_11n_flag = this.getModeFlag(id); //console.log(mode_11n_flag); if( (combo.value == 2) && (mode_11n_flag) ) { Ext.Msg.alert(smb.charset.tip.error, smb.charset.tip.noSetAtSameTime3); combo.setValue(1); return; } }, change: function(combo, newValue, oldValue) { //var advRoot = smb.model[combo.ownerCt.ownerCt.ownerCt.ownerCt.model].getProxy().getReader().rawData.data; //console.log(newValue); //console.dir(combo.ownerCt.ownerCt.ownerCt.ownerCt.model); var id = combo.ownerCt.ownerCt.ownerCt.ownerCt.id; var mode_11n_flag = this.getModeFlag(id); if(combo.hasFocus) { if( (newValue == 2) && (mode_11n_flag) ) { Ext.Msg.alert(smb.charset.tip.error, smb.charset.tip.noSetAtSameTime3); combo.setValue(oldValue); return; } } } }, '#multiSsid [id=ssidGrid]': { beforeedit: function( editor, object, eOpts ) { if(object.record.data.key == 2147483647) { Ext.getCmp('ssidEnableEdit').disable(); Ext.getCmp('ssidNameEdit').disable(); Ext.getCmp('ssidBcEdit').disable(); Ext.getCmp('ssidApIsoEdit').disable(); // return false; } else{ Ext.getCmp('ssidEnableEdit').enable(); Ext.getCmp('ssidNameEdit').enable(); Ext.getCmp('ssidBcEdit').enable(); Ext.getCmp('ssidApIsoEdit').enable(); } }, actioncomplete: function(scope, action, eOpts ) { //console.log("1111"); var formData = Ext.JSON.decode(action.response.responseText); this.refreshTxRateValue(formData.data.TKIP_WEP, formData.data.txRateAp); Ext.getCmp('tdma').TKIP_WEPFlag = true; Ext.getCmp('tdma').TKIP_WEPValue = formData.data.TKIP_WEP; } } }); }, setTransPowerMax:function(records, operation, success){ // console.log("setTransPowerMax"); Ext.getCmp('transPowerAp').maxValue = Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower+0.1; Ext.getCmp('transPowerAp').maxValue -= 0.1; Ext.getCmp('transPowerValueAp').maxValue = Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower+0.1; Ext.getCmp('transPowerValueAp').maxValue -= 0.1; }, setTransPower:function(records, operation, success){ //console.log("setTransPower"); //console.dir(arguments); if(arguments.length == 3) { var ret = this.isTimeout(records, operation, success); if(ret) { return; } var value = Ext.getCmp('apChannel').value; //console.log(value); var rawValue = Ext.getCmp('apChannel').getRawValue(); //console.log(rawValue); var length = records.length; for(var i = 0; i < length; i++) { //console.log(i+":"+records[i].data.value); if(records[i].data.value == value) { break; } if(i == length-1) { Ext.getCmp('apChannel').setValue(0); } } if(smb.user.is2G != true) { var dfsFlag = 0; var localProductInfo = "UN"; if ("undefined" != typeof(productInfo)) { localProductInfo = productInfo[0]; } for (var i = 0; i < length; i++) { if (records[i].data.name && records[i].data.name.indexOf('DFS') >= 0){ dfsFlag = 1; break; } } if (dfsFlag && localProductInfo != "EU"){ Ext.getCmp('dfsEnable').show(); } else{ Ext.getCmp('dfsEnable').hide(); Ext.getCmp('dfsEnable').setValue(0); } } if (Ext.getCmp('apRegion').getValue() != 511) { if (Ext.getCmp('clientWirelessScan')) { Ext.getCmp('clientWirelessScan').hide(); } } else { if (Ext.getCmp('clientWirelessScan')) { Ext.getCmp('clientWirelessScan').show(); } } } if(typeof Ext.getCmp('apChannel').getStore().totalCount == "undefined")//防止在较慢的机器上此时store还没有解析完 { return -1; } Ext.getCmp('transPowerAp').maxValue = Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower+0.1; Ext.getCmp('transPowerAp').maxValue -= 0.1; Ext.getCmp('transPowerValueAp').maxValue = Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower+0.1; Ext.getCmp('transPowerValueAp').maxValue -= 0.1; //Ext.getCmp('transPowerAp').setMaxValue(Ext.getCmp('apChannel').getStore().findRecord('value', apChannelValue).raw.txPower+0.1);//最大值加上0.1,否则设置成最大值时会失败 if(Ext.getCmp('transPowerValueAp').getValue() > Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower) { // console.log(Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue()).raw.txPower); //console.log("set new maxValue"); Ext.getCmp('transPowerAp').setValue(Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower); } else if(Ext.getCmp('transPowerValueAp').getValue() < Ext.getCmp('apChannel').getStore().findRecord('value', Ext.getCmp('apChannel').getValue(),0,false,true,true).raw.txPower) { // console.log(Ext.getCmp('transPowerValueAp').getValue()); //console.log("set new maxValue"); //console.log(Ext.getCmp('transPowerValueAp').getValue()); Ext.getCmp('transPowerAp').setValue(Ext.getCmp('transPowerValueAp').getValue()+1); Ext.getCmp('transPowerAp').setValue(Ext.getCmp('transPowerValueAp').getValue()-1); } else { //console.log("set new maxValue"); //console.log(Ext.getCmp('transPowerValueAp').getValue()); Ext.getCmp('transPowerAp').setValue(Ext.getCmp('transPowerValueAp').getValue()-1); Ext.getCmp('transPowerAp').setValue(Ext.getCmp('transPowerValueAp').getValue()+1); } if ((smb.mode.status == "accessPoint" || smb.mode.status == "apRouter") && (Ext.getCmp('apRegion').getValue() == 511)) { if (Ext.getCmp('apChannelWidth').getValue() == 3 && Ext.getCmp('apChannel').getValue() != 0) { if (Ext.getCmp('extensionChan').getValue() != 1 && Ext.getCmp('extensionChan').getValue() != 2) { Ext.getCmp('extensionChan').setValue(1); } Ext.getCmp('extensionChan').enable(); Ext.getCmp('extensionChan').show(); } else { Ext.getCmp('extensionChan').setValue(smb.charset.comboBox.extensionNone); Ext.getCmp('extensionChan').disable(); Ext.getCmp('extensionChan').show(); } } else { Ext.getCmp('extensionChan').disable(); Ext.getCmp('extensionChan').hide(); } }, setApChannelWidthDefaultVal:function(records, operation, success){//if not found with value, set default 2(20MHz) //console.dir(arguments); var me = smb.app.getController('wireless'); if(arguments.length == 3) { var ret = this.isTimeout(records, operation, success); if(ret) { return; } } var len = records.length; //var setFlag = false; var apChannelWidthObj = Ext.getCmp('apChannelWidth'); var value = apChannelWidthObj.value; for(var i = 0; i < len; i++) { if(records[i].data.value == value) { //apChannelWidthObj.setValue(3); // 40MHz return; } } apChannelWidthObj.setValue(2);//if not found with value, set default 2(20MHz) }, setApChannelWidthDefaultValByRegion:function(){//if there is 3, set its value with 3;otherwise 2 var store = Ext.getCmp('apChannelWidth').store; var me = smb.app.getController('wireless'); //console.dir(store); var record = store.findRecord("value", 3, 0,false,true,true); var channelWidthNew = Ext.getCmp('apChannelWidth').value; //console.dir(record); if(record) { Ext.getCmp('apChannelWidth').setValue(3);//set, immedicate return Ext.getCmp('apChannel').store.load({params:{channelWidth:3}, scope: me, callback:me.setTransPower}); smb.user.regionChangeAvalid = false; if (Ext.getCmp('txRateAp')) { smb.app.getController('wireless').setTxRateValue(0); } return; } record = store.findRecord("value", 2, 0,false,true,true); if(record) { Ext.getCmp('apChannelWidth').setValue(2); Ext.getCmp('apChannel').store.load({params:{channelWidth:2}, scope: me, callback:me.setTransPower}); smb.user.regionChangeAvalid = false; if (Ext.getCmp('txRateAp')) { smb.app.getController('wireless').setTxRateValue(0); } return; } else { //console.log("the store of apChannelWidth is wrong"); } Ext.getCmp('apChannel').store.load({params:{channelWidth:channelWidthNew}, scope: me, callback:this.setTransPower}); smb.user.regionChangeAvalid = false; return ; }, getModeFlag:function(modelName){ var mode_11n_flag; //var advRoot = smb.model['tdma'].getProxy().getReader().rawData.data;//如果返回数据的根节点名称发生变化,wirelessApSetting需要相应变化 //var tdmaData = Ext.getCmp('tdma').getRecord().data; var tdmaData = getRecordOrModelData('tdma'); if(tdmaData) { //console.log(tdmaData.mode+":"+smb.user.mode_11n_value); if(tdmaData.mode == smb.user.mode_11n_value) { mode_11n_flag = true; } else { mode_11n_flag = false; } } else { //mode_11n_flag = smb.model[modelName].getProxy().getReader().rawData.data["11nMode"]; //mode_11n_flag = Ext.getCmp(modelName).getRecord().data["11nMode"]; mode_11n_flag = getRecordOrModelData('modelName')["11nMode"]; } //console.log(mode_11n_flag); return mode_11n_flag; }, getTKIP_WEPFlag:function(){ var TKIP_WEP_flag = false; var root; if(smb.modules["wireless"]["wirelessApSettings"].status == "on") { //if(!Ext.getCmp('apSecurityCnt').isDisabled( )) { //root = smb.model['wirelessApSettings'].getProxy().getReader().rawData.data; //root = Ext.getCmp('wirelessApSettings').getRecord().data; root = getRecordOrModelData('wirelessApSettings'); if(root) { //直接根据总的TKIP_WEP判断 //console.log(root.TKIP_WEP); if(root.TKIP_WEP) { /*TKIP_WEP_flag = true; return TKIP_WEP_flag;*/ return root.TKIP_WEP//统一的值,ap、client、ssid的值是一样的 } } } } if(smb.modules["wireless"]["wirelessClientSettings"].status == "on") { //if(!Ext.getCmp('clientSecurityCnt').isDisabled( )) { //root = smb.model['wirelessClientSettings'].getProxy().getReader().rawData.data; //root = Ext.getCmp('wirelessClientSettings').getRecord().data; root = getRecordOrModelData('wirelessClientSettings'); if(root) { // console.log(root.TKIP_WEP); if(root.TKIP_WEP) { /*TKIP_WEP_flag = true; return TKIP_WEP_flag;*/ return root.TKIP_WEP//统一的值,ap、client、ssid的值是一样的 } } } } if(!root)//ap和client面板store取不到值 { //TKIP_WEP_flag = smb.model['tdma'].getProxy().getReader().rawData.data.TKIP_WEP; //TKIP_WEP_flag = Ext.getCmp('tdma').getRecord().data.TKIP_WEP; TKIP_WEP_flag = getRecordOrModelData('tdma').TKIP_WEP; // console.log(TKIP_WEP_flag); } return TKIP_WEP_flag; }, getStoreDataForApAndClient:function(moduleName){ // console.log("getStoreDataForApAndClient"); var enableShortGi; var TKIP_WEP; //var advRoot = smb.model[moduleName].getProxy().getReader().rawData.data; //var advRoot1 = smb.model['wirelessAdv'].getProxy().getReader().rawData.data; //var advRoot = Ext.getCmp(moduleName).getRecord().data.data; //var advRoot1 = Ext.getCmp('wirelessAdv').getRecord().data.data; var advRoot = getRecordOrModelData(moduleName); var advRoot1 = getRecordOrModelData('wirelessAdv'); if(advRoot) { TKIP_WEP = advRoot.TKIP_WEP; } if(advRoot1) { enableShortGi = advRoot1.enableShortGi; } var retObj = getCurTxRateModel(Ext.getCmp('apMode').getRawValue(), Ext.getCmp('apChannelWidth').getRawValue(), TKIP_WEP); if(Ext.getCmp('txRateAp')) { //console.log('txRateAp'); Ext.getCmp('txRateAp').getStore().loadData( retObj ); Ext.getCmp('txRateAp').setValue(advRoot.txRate); } /* if(Ext.getCmp('txRateClient')) { Ext.getCmp('txRateClient').getStore().loadData( retObj ); //Ext.getCmp('txRateClient').setValue(Ext.getCmp('txRateClient').getStore().first().get('value'));//设置store中的第一条为初始值 } */ }, setDefaultValByMode:function(records, operation, success) { var me = smb.app.getController('wireless'); me.isTimeout(records, operation, success); var apModeObj = Ext.getCmp('apMode'); var apChannelWidthObj = Ext.getCmp('apChannelWidth'); var apChannelObj = Ext.getCmp('apChannel'); apChannelObj.setValue(0); var modeNew = apModeObj.getValue(); apChannelWidthObj.store.load({params:{mode:modeNew},scope: me,callback:me.setApChannelWidthDefaultValByRegion}); }, setDefaultValByRegion:function(records, operation, success) { var me = smb.app.getController('wireless'); me.isTimeout(records, operation, success); var apModeObj = Ext.getCmp('apMode'); var apChannelWidthObj = Ext.getCmp('apChannelWidth'); var apChannelObj = Ext.getCmp('apChannel'); apChannelObj.setValue(0); if(smb.user.is2G == true) { apModeObj.setValue(4);//default:802.11a/n } else { apModeObj.setValue(7);//default:802.11a/n if(Ext.getCmp('apRegion').getValue() == 511) { Ext.getCmp('dfsEnable').setValue(0); } else { Ext.getCmp('dfsEnable').setValue(1); } } var modeNew = apModeObj.value; apChannelWidthObj.store.load({params:{mode:modeNew},scope: me,callback:me.setApChannelWidthDefaultValByRegion}); }, isTimeout:function(records, operation, success){ return smb.user.timeout.call(this, operation, operation, 0); }, tdmaChangeStatus:function(tdmaOn) { if(tdmaOn) { //Ext.getCmp('tdmaEnableCnt').show(); if(smb.mode.status == "accessPoint" || smb.mode.status == "apRouter")//只有开关,没有模式选择。 { Ext.getCmp('tdmaEnableTotalCnt').show(); Ext.getCmp('tdmaEnableCnt').show(); Ext.getCmp('tdmaEnable').enable(); Ext.getCmp('tdmaPriority').hide(); Ext.getCmp('tdmaPriority').disable(); } else { Ext.getCmp('tdmaEnableTotalCnt').show(); Ext.getCmp('tdmaEnableCnt').hide(); Ext.getCmp('tdmaEnable').disable(); Ext.getCmp('tdmaPriority').show(); Ext.getCmp('tdmaPriority').enable(); } } else { Ext.getCmp('tdmaEnableTotalCnt').hide(); } }, shortGiChangeStatus:function(mode) { // console.log(mode); if( (mode == "802.11n") || (mode == "802.11a/n") || (mode == "802.11b/g/n")) { if(Ext.getCmp('enableShortGi')) { Ext.getCmp('enableShortGi').enable(); } } else { if(Ext.getCmp('enableShortGi')) { Ext.getCmp('enableShortGi').disable(); } } }, setTxRateValue:function(type){ // 0 - default, 1 - raw configuration, 2 - web value var enableShortGi; var TKIP_WEP; var advRoot = getRecordOrModelData('tdma'); if(advRoot) { enableShortGi = advRoot.enableShortGi; if(Ext.getCmp('tdma').TKIP_WEPFlag) { TKIP_WEP = Ext.getCmp('tdma').TKIP_WEPValue; } else { TKIP_WEP = advRoot.TKIP_WEP; } } var retObj = getCurTxRateModel(Ext.getCmp('apMode').getRawValue(), Ext.getCmp('apChannelWidth').getRawValue(), TKIP_WEP); if (retObj) { Ext.getCmp('txRateAp').getStore().loadData( retObj ); } var storeList = Ext.getCmp('txRateAp').getStore().data.items; if (type == 0) { Ext.getCmp('txRateAp').setValue(storeList[storeList.length-1].data.value); } else if(type == 1) { var find = Ext.getCmp('txRateAp').getStore().findRecord("value", advRoot.txRateAp,0,false,true,true); if(find) { Ext.getCmp('txRateAp').setValue(advRoot.txRateAp); } else { Ext.getCmp('txRateAp').setValue(storeList[storeList.length-1].data.value); } } else if (type == 2) { var find = Ext.getCmp('txRateAp').getStore().findRecord("value", Ext.getCmp('txRateAp').getValue(),0,false,true,true); if(find) { Ext.getCmp('txRateAp').setValue(Ext.getCmp('txRateAp').getValue()); } else { Ext.getCmp('txRateAp').setValue(storeList[storeList.length-1].data.value); } } }, refreshTxRateValue:function(TKIP_WEP, txRateValue){ var retObj = getCurTxRateModel(Ext.getCmp('apMode').getRawValue(), Ext.getCmp('apChannelWidth').getRawValue(), TKIP_WEP); Ext.getCmp('txRateAp').getStore().loadData( retObj ); var storeList = Ext.getCmp('txRateAp').getStore().data.items; var find = Ext.getCmp('txRateAp').getStore().findRecord('value', txRateValue,0,false,true,true); if(find) { Ext.getCmp('txRateAp').setValue(txRateValue); } else { Ext.getCmp('txRateAp').setValue(storeList[storeList.length-1].data.value); } }, refreshChannelStore:function(records, operation, success) { var me = smb.app.getController('wireless'); me.isTimeout(records, operation, success); Ext.getCmp('apChannelWidth').store.load({params:{mode:Ext.getCmp('apMode').getValue()},callback:this.isTimeout}); Ext.getCmp('apChannel').store.load({params:{channelWidth:Ext.getCmp('apChannelWidth').getValue()}, scope: me, callback:me.setTransPower}); } });