/*************************global varis***************************/ var hostMac = ""; /**************************************************************/ Ext.define('smb.view.management',{ extend: 'smb.view.form', alias: 'widget.management', id: 'management', layout:{ type: 'table', tdAttrs:{ valign:'top' }, columns:2 }, items:[ {xtype:'log'}, {xtype:'miscellaneous'}, {xtype:'ping'}, {xtype:'ddns'}, {xtype:'webserver'}, {xtype:'snmp'}, {xtype:'sshServer'}, {xtype:'rssiLed'}, // {xtype:'userAccount'}, // {xtype:'deviceInfo'}, // {xtype:'time'}, {xtype:'autoMail'}, {xtype:'openLog'} ], initComponent: function(){ this.callParent(arguments); } }); Ext.define('smb.model.webserver',{ extend: 'Ext.data.Model', fields: [ {mapping: 'secureConnEnable', name: 'secureConnEnable', type: 'bool'}, {mapping: 'secureServerPort', name: 'secureServerPort', type: 'int'}, {mapping: 'serverPort', name: 'serverPort', type: 'int'}, {mapping: 'remoteIp', name: 'remoteIp', type: 'string'}, {mapping: 'sessionTimeout', name: 'sessionTimeout', type: 'int'}, {mapping: 'macAuthEnable', name: 'macAuthEnable', type: 'bool'}, {mapping: 'hostMac', name: 'hostMac', type: 'string'}, {mapping: 'mac1', name: 'mac1', type: 'string'}, {mapping: 'mac2', name: 'mac2', type: 'string'}, {mapping: 'mac3', name: 'mac3', type: 'string'}, {mapping: 'mac4', name: 'mac4', type: 'string'} ], proxy: { type: 'ajax', url: './data/webserver.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.webserver',{ extend: 'smb.view.module', id: 'webserver', alias: 'widget.webserver', model: 'webserver', //flex: 1, width: 460, height: 380, collapsible: false, url: './data/webserver.json', title: smb.charset.module.webserver, items: [ { xtype: 'hidden', name: 'hostMac', id: 'hostMac', submitValue: true }, { xtype: 'checkbox', fieldLabel: smb.charset.label.secureConn, labelWidth: 160, boxLabel: smb.charset.label.enable, checked: true, name:'secureConnEnable', id:'secureConnEnable', labelAlign: 'right' }, { xtype: 'numberfield', labelWidth: 160, fieldLabel: smb.charset.label.secureServerPort, vtype:'integer', id:'secureServerPort', cls: 'small', //grow:true, name:'secureServerPort', //minLength: 1, //maxLength:5, minValue: 1, maxValue: 65535 }, { xtype: 'numberfield', labelWidth: 160, vtype:'integer', fieldLabel: smb.charset.label.serverPort, name:'serverPort', id :'webServerPort', //minLength: 1, //maxLength:5, minValue: 1, maxValue: 65535 }, { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'textfield', //labelWidth: 160, vtype:'ip', allowAny: true, allowAllZero: true, //minLength: 1, //maxLength:15, fieldLabel: smb.charset.label.remoteIp, name:'remoteIp', id :'remoteIp', inputWidth: 150 }, { xtype: 'helpIcon', id: 'remoteHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'remoteHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.remoteHelp }); } } } ] }, { xtype: 'fieldcontainer', layout: 'hbox', defaults: { labelWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'numberfield', fieldLabel: smb.charset.label.sessionTimeout, name:'sessionTimeout', id :'sessionTimeout', vtype:'integer', //minLength: 1, //maxLength:4, minValue: 1, maxValue: 1440, inputWidth: 150 }, { xtype: 'displayfield', hideLabel:true, margin: '0 0 0 6', value: smb.charset.label.minutes } ] }, { xtype: 'checkbox', fieldLabel: smb.charset.label.macAuth, boxLabel: smb.charset.label.enable, name:'macAuthEnable', id:'macAuthChkEnable', inputId:'macAuthChkEnablekInput', labelWidth: 160, labelAlign: 'right', checked: true }, { xtype: 'fieldcontainer', id: 'macCt', defaults: { labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'textfield', changeEnable: true, //minLength: 1, //maxLength: 17, fieldLabel: smb.charset.label.mac1, id: 'mac1', name: 'mac1', allowBlank: true, validator: function(value) { if( Ext.isEmpty(Ext.getCmp('mac2').getValue()) && Ext.isEmpty(Ext.getCmp('mac3').getValue()) && Ext.isEmpty(Ext.getCmp('mac4').getValue()) ) { if(Ext.isEmpty(value)) { return smb.charset.validation.fieldRequired; } else { if(smb.verify.mac(value)) { Ext.getCmp('mac2').clearInvalid(); Ext.getCmp('mac3').clearInvalid(); Ext.getCmp('mac4').clearInvalid(); } return smb.verify.mac(value); } } else { if(Ext.isEmpty(value)) { return true; } else { if(smb.verify.mac(value) == true) { if( smb.verify.mac(Ext.getCmp('mac2').getValue()) && value==Ext.getCmp('mac2').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac3').getValue()) && value==Ext.getCmp('mac3').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac4').getValue()) && value==Ext.getCmp('mac4').getValue()) { return smb.charset.validation.macConflict; } return true; } else { return smb.verify.mac(value); } } } } }, { xtype: 'textfield', changeEnable: true, allowBlank: true, //minLength: 1, //maxLength: 17, fieldLabel: smb.charset.label.mac2, id: 'mac2', name: 'mac2', validator:function(value) { if( Ext.isEmpty(Ext.getCmp('mac1').getValue()) && Ext.isEmpty(Ext.getCmp('mac3').getValue()) && Ext.isEmpty(Ext.getCmp('mac4').getValue()) ) { if(Ext.isEmpty(value)) { return smb.charset.validation.fieldRequired; } else { if(smb.verify.mac(value)) { Ext.getCmp('mac1').clearInvalid(); Ext.getCmp('mac3').clearInvalid(); Ext.getCmp('mac4').clearInvalid(); } return smb.verify.mac(value); } } else { if(Ext.isEmpty(value)) { return true; } else { if(smb.verify.mac(value) == true) { if( smb.verify.mac(Ext.getCmp('mac1').getValue()) && value==Ext.getCmp('mac1').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac3').getValue()) && value==Ext.getCmp('mac3').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac4').getValue()) && value==Ext.getCmp('mac4').getValue()) { return smb.charset.validation.macConflict; } return true; } else { return smb.verify.mac(value); } } } } }, { xtype: 'textfield', changeEnable: true, allowBlank: true, //minLength: 1, //maxLength: 17, fieldLabel: smb.charset.label.mac3, id: 'mac3', name: 'mac3', validator:function(value) { if( Ext.isEmpty(Ext.getCmp('mac1').getValue()) && Ext.isEmpty(Ext.getCmp('mac2').getValue()) && Ext.isEmpty(Ext.getCmp('mac4').getValue()) ) { if(Ext.isEmpty(value)) { return smb.charset.validation.fieldRequired; } else { if(smb.verify.mac(value)) { Ext.getCmp('mac1').clearInvalid(); Ext.getCmp('mac2').clearInvalid(); Ext.getCmp('mac4').clearInvalid(); } return smb.verify.mac(value); } } else { if(Ext.isEmpty(value)) { return true; } else { if(smb.verify.mac(value)==true) { if( smb.verify.mac(Ext.getCmp('mac1').getValue()) && value==Ext.getCmp('mac1').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac2').getValue()) && value==Ext.getCmp('mac2').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac4').getValue()) && value==Ext.getCmp('mac4').getValue()) { return smb.charset.validation.macConflict; } return true; } else { return smb.verify.mac(value); } } } } }, { xtype: 'fieldcontainer', layout: 'column', items: [ { xtype: 'textfield', changeEnable: true, allowBlank: true, //minLength: 1, //maxLength: 17, labelWidth: 160, fieldLabel: smb.charset.label.mac4, id: 'mac4', name: 'mac4', validator:function(value) { if( Ext.isEmpty(Ext.getCmp('mac1').getValue()) && Ext.isEmpty(Ext.getCmp('mac2').getValue()) && Ext.isEmpty(Ext.getCmp('mac3').getValue()) ) { if(Ext.isEmpty(value)) { return smb.charset.validation.fieldRequired; } else { if(smb.verify.mac(value)) { Ext.getCmp('mac1').clearInvalid(); Ext.getCmp('mac2').clearInvalid(); Ext.getCmp('mac3').clearInvalid(); } return smb.verify.mac(value); } } else { if(Ext.isEmpty(value)) { return true; } else { if(smb.verify.mac(value)==true) { if( smb.verify.mac(Ext.getCmp('mac1').getValue()) && value==Ext.getCmp('mac1').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac2').getValue()) && value==Ext.getCmp('mac2').getValue()) { return smb.charset.validation.macConflict; } if( smb.verify.mac(Ext.getCmp('mac3').getValue()) && value==Ext.getCmp('mac3').getValue()) { return smb.charset.validation.macConflict; } return true; } else { return smb.verify.mac(value); } } } } }, { xtype: 'button', changeEnable: true, margin: '0 0 0 10', id: 'addPcMac', text: smb.charset.button.addPcMac } ] } ] } ], buttons:[ { text: smb.charset.button.submit, elemType: 'saveBtn', hidden: false, id: 'webserverBtn' } ], initComponent: function(){ this.callParent(arguments); if(smb.user.isRemoteLogin) { Ext.getCmp('addPcMac').hide(); } if( smb.mode.status == 'apRouter' || smb.mode.status == 'apClientRouter' ) { Ext.getCmp('remoteIp').enable(); } else { Ext.getCmp('remoteIp').disable(); } } }); Ext.define('smb.model.snmp',{ extend: 'Ext.data.Model', fields: [ {mapping: 'snmpEnable', name: 'snmpEnable', type: 'bool'}, {mapping: 'sysContact', name: 'sysContact', type: 'string'}, {mapping: 'sysName', name: 'sysName', type: 'string'}, {mapping: 'sysLocation', name: 'sysLocation', type: 'string'}, {mapping: 'getCommunity', name: 'getCommunity', type: 'string'}, {mapping: 'getSource', name: 'getSource', type: 'string'}, {mapping: 'setCommunity', name: 'setCommunity', type: 'string'}, {mapping: 'hiddenfield', name: 'hiddenfield', type: 'string'}, {mapping: 'setSource', name: 'setSource', type: 'string'} // {mapping: 'remoteEnable', name: 'remoteEnable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/snmp.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.snmp',{ extend: 'smb.view.module', id: 'snmp', alias: 'widget.snmp', title: smb.charset.module.snmp, width:460, model:'snmp', height: 380, url: './data/snmp.json', //flex: 1, collapsible: false, items: [ { xtype: 'fieldcontainer', id: 'snmpDetailCt', defaults: { labelWidth: 160, labelAlign: 'right' }, items:[ { xtype: 'checkbox', fieldLabel: smb.charset.label.snmp, boxLabel: smb.charset.label.enable, id: 'snmpChkEnable', name: 'snmpEnable', checked: true }, { xtype: 'textfield', changeEnable: true, // vtype: 'name', minLength: 1, maxLength:64, enforceMaxLength: true, name: 'sysContact', fieldLabel: smb.charset.label.sysContact, validator:function(value){ var pattern = /^\s+/; if( value && pattern.test(value) ){ return smb.charset.validation.startSpaceIsNotAllow; } return true; } }, { xtype: 'textfield', changeEnable: true, minLength: 1, maxLength:64, name: 'sysName', // vtype: 'name', enforceMaxLength: true, fieldLabel: smb.charset.label.sysName, validator:function(value){ var pattern = /^\s+/; if( value && pattern.test(value) ){ return smb.charset.validation.startSpaceIsNotAllow; } return true; } }, { xtype: 'textfield', name: 'sysLocation', minLength: 1, maxLength: 64, enforceMaxLength: true, // vtype: 'name', changeEnable: true, fieldLabel: smb.charset.label.sysLocation, validator:function(value){ var pattern = /^\s+/; if( value && pattern.test(value) ){ return smb.charset.validation.startSpaceIsNotAllow; } return true; } }, { xtype: 'textfield', name: 'getCommunity', minLength: 1, maxLength: 31, enforceMaxLength: true, // vtype: 'name', changeEnable: true, fieldLabel: smb.charset.label.getCommunity, validator:function(value){ var pattern = /[\s\$\`\#\&\(\)\;\"\'\<\>]+/; // var pattern = /^\s[\$\`\#\&\(\)\;\"\<\>]+$/; // var pattern1 = /^[\$\`\#\&\(\)\;\"\<\>]+$/; if( value && pattern.test(value) ){ return smb.charset.validation.startSpaceIsNotAllow; } return true; } }, { xtype: 'textfield', name: 'getSource', minLength: 1, maxLength: 18, vtype: 'ipOrIpMask', allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.getSource }, { xtype: 'textfield', name: 'setCommunity', minLength: 1, maxLength: 31, enforceMaxLength: true, // vtype: 'name', changeEnable: true, fieldLabel: smb.charset.label.setCommunity, validator:function(value){ var pattern = /[\s\$\`\#\&\(\)\;\"\'\<\>]+/; // var pattern = /^\s+/; if( value && pattern.test(value) ){ return smb.charset.validation.startSpaceIsNotAllow; } return true; } }, { xtype: 'textfield', name: 'setSource', minLength: 1, maxLength: 18, vtype: 'ipOrIpMask', allowAllZero: true, changeEnable: true, fieldLabel: smb.charset.label.setSource }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' }] }], initComponent: function(){ this.callParent(arguments); } }); Ext.define('smb.model.sshServer',{ extend: 'Ext.data.Model', fields: [ {mapping: 'sshServerEnable', name: 'sshServerEnable', type: 'bool'}, {mapping: 'remoteEnable', name: 'remoteEnable', type: 'bool'}, {mapping: 'hiddenfield', name: 'hiddenfield', type: 'string'}, {mapping: 'serverPort', name: 'serverPort', type: 'int'} ], proxy: { type: 'ajax', url: './data/sshServer.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.sshServer',{ extend: 'smb.view.module', id: 'sshServer', alias: 'widget.sshServer', title: smb.charset.module.sshServer, width: 460, height: 180, model: 'sshServer', url: './data/sshServer.json', collapsible: false, //flex: 1, defaults: { labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'numberfield', fieldLabel: smb.charset.label.serverPort, vtype:'integer', changeEnable: true, name: 'serverPort', minValue: 1, maxValue: 65535, inputWidth: 60 }, { xtype: 'checkbox', fieldLabel: smb.charset.label.sshLogin, boxLabel: smb.charset.label.enable, // boxLabel: smb.charset.label.enable, name:'sshServerEnable', id:'sshServerChkEnable', inputId:'sshServerChkEnablekInput', checked: true }, { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { fieldLabel: smb.charset.label.remoteMng, xtype: 'checkbox', boxLabel: smb.charset.label.enable, checked: true, changeEnable: true, name:'remoteEnable', // id:'pwdAuthEnable', inputId:'pwdAuthEnablekInput' }, { xtype: 'helpIcon', id: 'remoteMngHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'remoteMngHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.remoteMng }); } } } ] }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' } ] }); Ext.define('smb.model.rssiLed',{ extend: 'Ext.data.Model', fields: [ {mapping:'led1', name:'led1', type:'int'}, {mapping:'led2', name:'led2', type:'int'}, {mapping:'led3', name:'led3', type:'int'}, {mapping:'led4', name:'led4', type:'int'}, {mapping:'hiddenfield', name:'hiddenfield', type:'int'} ], proxy: { type: 'ajax', url: './data/rssiLed.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.rssiLed',{ extend: 'smb.view.module', id: 'rssiLed', alias: 'widget.rssiLed', title: smb.charset.module.rssiLedThresholds, width: 460, height: 180, model: 'rssiLed', url: './data/rssiLed.json', collapsible: false, defaults: { labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'fieldcontainer', margin: '25 0 0 0', layout: { type: 'table', columns: 5 }, items: [ { xtype: 'fieldcontainer', id: 'rssiLed_label_id', width: 160 }, { xtype: 'displayfield', width: 40, padding: '0 10', hideLabel: true, value: smb.charset.label.led1 }, { xtype: 'displayfield', width: 40, padding: '0 10', hideLabel: true, value: smb.charset.label.led2 }, { xtype: 'displayfield', width: 40, padding: '0 10', hideLabel: true, value: smb.charset.label.led3 }, { xtype: 'displayfield', width: 40, padding: '0 10', hideLabel: true, value: smb.charset.label.led4 }, { xtype: 'label', text: smb.charset.label.thresholdDbm, margin: '0 0 0 40' }, { xtype: 'fieldcontainer', width: 60, layout: 'hbox', items: [ { xtype: 'label', text: '-', margin: '5 5 0 0' }, { xtype: 'numberfield', id: 'led1', name: 'led1', hideLabel: true, inputWidth: 30, width: 48, minValue: 1, maxValue: 120, decimalPrecision: 0, validator: function(value) { if( !Ext.isEmpty(Ext.getCmp('led2').getValue()) ) { if( parseInt(value) <= parseInt(Ext.getCmp('led2').getValue() ) ) { return smb.charset.validation.biggerThanNext; } } return true; } } ] }, { xtype: 'fieldcontainer', width: 60, layout: 'hbox', items: [ { xtype: 'label', text: '-', margin: '5 5 0 0' }, { xtype: 'numberfield', id: 'led2', name: 'led2', hideLabel: true, inputWidth: 30, width: 48, minValue: 1, maxValue: 120, decimalPrecision: 0, validator: function(value) { if( !Ext.isEmpty(Ext.getCmp('led3').getValue()) ) { if( parseInt(value) <= parseInt(Ext.getCmp('led3').getValue() ) ) { return smb.charset.validation.biggerThanNext; } } return true; } } ] }, { xtype: 'fieldcontainer', width: 60, layout: 'hbox', items: [ { xtype: 'label', text: '-', margin: '5 5 0 0' }, { xtype: 'numberfield', id: 'led3', name: 'led3', hideLabel: true, inputWidth: 30, width: 48, minValue: 1, maxValue: 120, decimalPrecision: 0, validator: function(value) { if( !Ext.isEmpty(Ext.getCmp('led4').getValue()) ) { if( parseInt(value) <= parseInt(Ext.getCmp('led4').getValue() ) ) { return smb.charset.validation.biggerThanNext; } } return true; } } ] }, { xtype: 'fieldcontainer', width: 60, layout: 'hbox', items: [ { xtype: 'label', text: '-', margin: '5 5 0 0' }, { xtype: 'numberfield', id: 'led4', name: 'led4', hideLabel: true, inputWidth: 30, width: 48, minValue: 1, maxValue: 120, decimalPrecision: 0 } ] } ] }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' } ] }); Ext.define('smb.model.ping',{ extend: 'Ext.data.Model', fields: [ {mapping: 'pingEnable', name: 'pingEnable', type: 'bool'}, {mapping: 'pingIp', name: 'pingIp', type: 'string'}, {mapping: 'pingInterval', name: 'pingInterval', type: 'int'}, {mapping: 'startUpDelay', name: 'startUpDelay', type: 'int'}, {mapping: 'hiddenfield', name: 'hiddenfield', type: 'string'}, {mapping: 'rebootCount', name: 'rebootCount', type: 'int'} ], proxy: { type: 'ajax', url: './data/pwdog.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.ping',{ extend: 'smb.view.module', id: 'ping', alias: 'widget.ping', title: smb.charset.module.ping, width: 460, height: 280, collapsible: false, url: './data/pwdog.json', model: 'ping', //flex: 1, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.pingWatchDog, boxLabel: smb.charset.label.enable, labelWidth: 160, labelAlign: 'right', name:'pingEnable', id:'pingChkEnable', inputId:'pingChkEnablekInput', checked: true }, { xtype: 'textfield', changeEnable: true, name: 'pingIp', id : "pingIpLabel", vtype:'ip', labelWidth: 160, //minLength: 1, //maxLength:15, fieldLabel: smb.charset.label.ipAddrToPing, inputWidth: 150 }, { xtype: 'fieldcontainer', layout:'hbox', defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 150 }, items: [ { xtype: 'numberfield', changeEnable: true, vtype: 'integer', minValue: 10, maxValue: 300, name:'pingInterval', id :'pingInterval', fieldLabel: smb.charset.label.pingInterval }, { xtype: 'label', margin: '5 0 0 6', changeEnable: true, disabledCls: 'disabledLabel', text: smb.charset.label.pingIntervalTip } ] }, { xtype: 'fieldcontainer', layout:'hbox', defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 150 }, items: [ { xtype: 'numberfield', changeEnable: true, vtype: 'integer', minValue: 60, maxValue: 300, name:'startUpDelay', id :'startUpDelay', fieldLabel: smb.charset.label.startUpDelay }, { xtype: 'label', margin: '5 0 0 6', changeEnable: true, disabledCls: 'disabledLabel', text: smb.charset.label.startUpDelayTip } ] }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' }, { xtype: 'fieldcontainer', layout:'hbox', defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 150 }, items: [ { xtype: 'numberfield', changeEnable: true, vtype: 'integer', name: 'rebootCount', id : 'rebootCount', minValue: 1, maxValue: 65535, fieldLabel: smb.charset.label.rebootCount }, { xtype: 'label', margin: '5 0 0 6', changeEnable: true, disabledCls: 'disabledLabel', text: smb.charset.label.rebootCountTip } ] } ] }); Ext.define('smb.model.log',{ extend: 'Ext.data.Model', fields: [ {mapping: 'mailFrom', name: 'mailFrom', type: 'string'}, {mapping: 'mailTo', name: 'mailTo', type: 'string'}, {mapping: 'smtpSvr', name: 'smtpSvr', type: 'string'}, {mapping: 'mailAuth', name: 'mailAuth', type: 'boolean'}, {mapping: 'mailUsername', name: 'mailUsername', type: 'string'}, {mapping: 'mailTime', name: 'mailTime', type: 'string'}, {mapping: 'mailDayHour', name: 'mailDayHour', type: 'string'}, {mapping: 'mailDayMin', name: 'mailDayMin', type: 'string'}, {mapping: 'mailHourHour', name: 'mailHourHour', type: 'string'}, {mapping: 'mailEnable', name: 'mailEnable', type: 'boolean'} // {mapping: 'hiddenfield', name: 'hiddenfield', type: 'string'}, ], proxy: { type: 'ajax', url: './data/log.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.log',{ extend: 'smb.view.module', id: 'log', alias: 'widget.log', title: smb.charset.module.log, width:460, height: 170, collapsible: false, model: 'log', // url: './data/log.json', items: [ { xtype: 'fieldcontainer', items: [ { xtype: 'label', text: smb.charset.label.openSysLog+':', cls: 'inlineBlock', style: 'text-align:right', width: 160, id : 'logOpenLabel' }, { xtype: 'button', text: smb.charset.button.open, name:'logOpen', id:'sysLogOpen', margin: '0 0 0 5', width: 80 } ] }, { xtype: 'fieldcontainer', items: [ { xtype: 'label', text: smb.charset.label.download+':', cls: 'inlineBlock', style: 'text-align:right', width: 160, id : 'logDownloadLabel' }, { xtype: 'button', text: smb.charset.button.download, name:'logDownload', id:'sysLogDownload', margin: '0 0 0 5', width: 80 } ] }, { xtype: 'fieldcontainer', items: [ { xtype: 'label', text: smb.charset.label.autoMailSet+':', cls: 'inlineBlock', style: 'text-align:right', width: 160, id : 'logMailSetLabel' }, { xtype: 'button', text: smb.charset.button.setting, name:'logMailSet', id:'logMailSet', margin: '0 0 0 5', width: 80 } ] }, { xtype: 'displayfield', fieldLabel: smb.charset.label.enableAutoMail, submitValue: false, id: 'mailAuthShow', name: 'mailEnable', labelWidth: 160, labelAlign: 'right', value: smb.charset.label.disable, renderer:function(value) { if(value.toString() == 'true') { return smb.charset.label.enabled; } else { return smb.charset.label.disabled; } } }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' } ], buttons:false }); Ext.define('smb.view.autoMail',{ extend: 'smb.view.popBox', alias: 'widget.autoMail', id: 'autoMail', name: 'autoMail', title: smb.charset.label.mailAccount, width: 600, height: 400, resizable: false, hidden: true, items: [ { xtype: 'smbModule', id: 'autoMailForm', header: false, frame: false, border: 0, model: 'log', url: './data/log.json', defaults:{ labelWidth: 160, inputWidth: 150 }, items: [ { xtype: 'textfield', fieldLabel: smb.charset.label.from, id: 'mailFrom', name: 'mailFrom', maxLength: 63, vtype: 'mail' }, { xtype: 'textfield', fieldLabel: smb.charset.label.to, id: 'mailTo', name: 'mailTo', maxLength: 63, vtype: 'mail' }, { xtype: 'textfield', fieldLabel: smb.charset.label.smtpSvr, id: 'smtpSvr', name: 'smtpSvr', maxLength: 63, validator: function(value) { if ( smb.verify.ip(value)!=true && smb.verify.domain(value)!=true ) { return smb.charset.validation.invalidIpOrDomain; } else { return true; } } }, { xtype: 'checkbox', boxLabel: smb.charset.label.authentication, margin: '5 0 5 165', inputWidth: 13, checked: true, id: 'mailAuth', name: 'mailAuth' }, { xtype: 'textfield', fieldLabel: smb.charset.label.username, id: 'mailUsername', name: 'mailUsername', maxLength: 31, vtype: 'username' }, { xtype: 'fieldcontainer', layout: 'column', id: 'mailPwdCnt', defaults:{ labelWidth: 160, inputWidth: 150 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.password, inputType: 'password', maxLength: 31, id: 'mailPassword', name: 'mailPassword', changeFlag: true, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('mailPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('mailPwdText').setValue(newValue); } Ext.getCmp('mailPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'mailPwdText', submitValue: false, hidden: true, changeFlag: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('mailPassword').changeFlag = false; if(item.changeFlag) { Ext.getCmp('mailPassword').setValue(newValue); } Ext.getCmp('mailPassword').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showMailPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'textfield', fieldLabel: smb.charset.label.confirmPassword, inputType: 'password', id: 'mailCfmPwd', name: 'mailCfmPwd', validator: function(value) { var formPanel = this.ownerCt; var newPwd = Ext.getCmp('mailPassword').getValue(); if(value == newPwd) { // Ext.getCmp('submitNewPwd').setValue( Ext.util.Format.uppercase(md5(value)) ); return true; } else { return smb.charset.validation.pwdNotEqual; } } }, { xtype: 'checkbox', boxLabel: smb.charset.label.enableAutoMail, margin: '0 0 0 165', inputWidth: 13, checked: true, id: 'mailEnable', name: 'mailEnable' }, { xtype: 'fieldcontainer', layout: 'hbox', id: 'mailDayCnt', margin: '10 0 0 165', items: [ { xtype: 'radio', id: 'mailTimeDay', name: 'mailTime', inputValue: 1 }, { xtype: 'displayfield', hideLabel: true, value: smb.charset.tip.everydayMail, id: 'mailTimeLabel', // forId: 'mailTimeDay', // disabledCls: 'disabledLabel', margin: '0 2' }, { xtype: 'numberfield', minValue: 0, maxValue: 23, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailDayHour', name: 'mailDayHour' }, { xtype: 'displayfield', hideLabel: true, value: ':', id: 'timeSep', // disabledCls: 'disabledLabel', margin: '0 2' }, { xtype: 'numberfield', minValue: 0, maxValue: 59, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailDayMin', name: 'mailDayMin' } ] }, { xtype: 'fieldcontainer', margin: '5 0 0 165', layout: 'hbox', id: 'mailHourCnt', items: [ { xtype: 'radio', id: 'mailTimeHour', name: 'mailTime', inputValue: 2 }, { xtype: 'displayfield', hideLabel: true, value: smb.charset.tip.mailTheLog, id: 'mailHourLabel', margin: '0 0 0 5' // forId: 'mailTimeHour', // disabledCls: 'disabledLabel' }, { xtype: 'numberfield', minValue: 1, maxValue: 99, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailHourHour', name: 'mailHourHour' }, { xtype: 'displayfield', hideLabel: true, value: smb.charset.tip.hour, id: 'hourLabel', margin: '0 0 0 5' // disabledCls: 'disabledLabel' } ] }, { xtype: 'button', text: smb.charset.button.save, margin: '20 40 0 450', width: 60, id: 'mailSave' } /* { xtype: 'button', text: smb.charset.button.back, margin: '20 0 0 0', width: 60, id: 'mailBack' } */ ], buttons: false } ] }) Ext.define('smb.view.openLog',{ extend: 'smb.view.popBox', alias: 'widget.openLog', id: 'openLog', name: 'openLog', title: smb.charset.module.systemLog, width: 920, height: 560, resizable: false, bodyStyle: { // background: '#fff', padding: 0 }, hidden: true, closeAction: 'hide', items: [ { xtype: 'grid', store: 'logRecord', maxHeight: 497, columns: [ { xtype: 'rownumberer', text: smb.charset.column.index, // hideable: false, align: 'center', flex: 1 }, { text: smb.charset.column.time, dataIndex: 'time', align: 'center', // hideable: false, flex: 3 }, { text: smb.charset.column.type, dataIndex: 'type', align: 'center', // hideable: false, flex: 2 }, { text: smb.charset.column.level, dataIndex: 'level', align: 'center', // hideable: false, flex: 2 }, { text: smb.charset.column.msg, dataIndex: 'msg', // hideable: false, flex: 10 } ] } ], buttonAlign: 'right', buttons:[ { id: 'updateLogBtn', //height: 26, width: 100, margin: '0 12 0 0', text: smb.charset.button.refresh } ] }) Ext.define('smb.model.ddns',{ extend: 'Ext.data.Model', fields: [ {mapping: 'hiddenfield', name: 'hiddenfield', type: 'string'}, {mapping: 'dUsername', name: 'dUsername', type: 'string'}, {mapping: 'dPassword', name: 'dPassword', type: 'string'}, {mapping: 'dPassword', name: 'dPasswordText', type: 'string'}, {mapping: 'dDomain', name: 'dDomain', type: 'string'}, {mapping: 'dStatus', name: 'dStatus', type: 'int', convert:function(value) { switch(value) { case 0: return smb.charset.tip.ddns0; case 1: return smb.charset.tip.ddns1; case 2: return smb.charset.tip.ddns2; case 3: return smb.charset.tip.ddns3; case 4: return smb.charset.tip.ddns4; case 5: return smb.charset.tip.ddns5 default: return smb.charset.tip.ddns6; } }}, {mapping: 'dIsEnable', name: 'dIsEnable', type: 'boolean'}, {mapping: 'nUsername', name: 'nUsername', type: 'string'}, {mapping: 'nPassword', name: 'nPassword', type: 'string'}, {mapping: 'nPassword', name: 'nPasswordText', type: 'string'}, {mapping: 'nDomain', name: 'nDomain', type: 'string'}, {mapping: 'nStatus', name: 'nStatus', type: 'int', convert:function(value) { switch(value) { case 0: return smb.charset.tip.ddns0; case 1: return smb.charset.tip.ddns1; case 2: return smb.charset.tip.ddns2; case 3: return smb.charset.tip.ddns3; case 4: return smb.charset.tip.ddns4; default: return smb.charset.tip.ddns5; } }}, {mapping: 'nIsEnable', name: 'nIsEnable', type: 'boolean'}, {mapping: 'cUsername', name: 'cUsername', type: 'string'}, {mapping: 'cPassword', name: 'cPassword', type: 'string'}, {mapping: 'cPassword', name: 'cPasswordText', type: 'string'}, {mapping: 'cDomain', name: 'cDomain', type: 'string'}, {mapping: 'cStatus', name: 'cStatus', type: 'int', convert:function(value) { switch(value) { case 0: return smb.charset.tip.ddns0; case 1: return smb.charset.tip.ddns1; case 2: return smb.charset.tip.ddns2; case 3: return smb.charset.tip.ddns3; case 4: return smb.charset.tip.ddns4; default: return smb.charset.tip.ddns5; } }}, {mapping: 'cIsEnable', name: 'cIsEnable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/ddnsSave.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.ddns',{ extend: 'smb.view.module', id: 'ddns', alias: 'widget.ddns', title: smb.charset.module.ddns, width: 460, height: 280, url: './data/ddnsSave.json', model: 'ddns', collapsible: false, defaults: { labelWidth: 160 }, items: [ { xtype: 'combobox', fieldLabel: smb.charset.label.serverProvider, id: 'svrProvider', name: 'svrProvider', editable: false, store: 'svrProv', valueField: 'name', displayField: 'display', inputWidth: 180, value: 1 }, { xtype: 'fieldcontainer', id: 'dynamicCnt', hidden: true, disabled: true, defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 180 }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.ddns, boxLabel: smb.charset.label.enable, inputWidth: 13, id: 'dIsEnable', name: 'dIsEnable', checked: true, listeners:{ change:function(item, newValue, oldValue) { if(newValue){ Ext.getCmp('dUsername').enable(); Ext.getCmp('dPwd').enable(); Ext.getCmp('dDomain').enable(); Ext.getCmp('dStatus').enable(); if(Ext.getCmp('svrProvider').getValue()==0){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } } else{ Ext.getCmp('dUsername').disable(); Ext.getCmp('dPwd').disable(); Ext.getCmp('dDomain').disable(); Ext.getCmp('dStatus').disable(); if(Ext.getCmp('svrProvider').getValue()==0){ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } } } }, { xtype: 'textfield', id: 'dUsername', vtype: 'username', minLength: 1, maxLength: 31, enforceMaxLength: true, name: 'dUsername', fieldLabel: smb.charset.label.username }, { xtype: 'fieldcontainer', id: 'dPwd', layout: 'column', defaults:{ labelWidth: 160, inputWidth: 180 }, items:[ { xtype: 'textfield', inputType: 'password', id: 'dynamicPwd', name: 'dPassword', maxLength: 63, enforceMaxLength: true, changeFlag: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('dynamicPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('dynamicPwdText').setValue(newValue); } Ext.getCmp('dynamicPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'dynamicPwdText', name: 'dPasswordText', submitValue: false, hidden: true, maxLength: 63, enforceMaxLength: true, changeFlag: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('dynamicPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('dynamicPwd').setValue(newValue); } Ext.getCmp('dynamicPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showDynamicPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'textfield', id: 'dDomain', vtype: 'domain', minLength: 1, maxLength: 31, enforceMaxLength: true, name: 'dDomain', fieldLabel: smb.charset.label.domainName }, { xtype: 'displayfield', fieldLabel: smb.charset.label.connStatus, id: 'dStatus', name: 'dStatus', submitValue: false } ] }, { xtype: 'fieldcontainer', id: 'noIpCnt', defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 180 }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.ddns, boxLabel: smb.charset.label.enable, id: 'nIsEnable', name: 'nIsEnable', inputWidth: 13, checked: true, listeners:{ change:function(item, newValue, oldValue) { if(newValue){ Ext.getCmp('nUsername').enable(); Ext.getCmp('nPwd').enable(); Ext.getCmp('nDomain').enable(); Ext.getCmp('nStatus').enable(); if(Ext.getCmp('svrProvider').getValue()==1){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } } else{ Ext.getCmp('nUsername').disable(); Ext.getCmp('nPwd').disable(); Ext.getCmp('nDomain').disable(); Ext.getCmp('nStatus').disable(); if(Ext.getCmp('svrProvider').getValue()==1){ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } } } }, { xtype: 'textfield', id: 'nUsername', name: 'nUsername', vtype: 'username', enforceMaxLength: true, minLength: 1, maxLength: 31, fieldLabel: smb.charset.label.username }, { xtype: 'fieldcontainer', id: 'nPwd', layout: 'column', defaults:{ labelWidth: 160, inputWidth: 180 }, items:[ { xtype: 'textfield', inputType: 'password', id: 'noIpPwd', name: 'nPassword', enforceMaxLength: true, maxLength: 63, fieldLabel: smb.charset.label.password, changeFlag: true, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('noIpPwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('noIpPwdText').setValue(newValue); } Ext.getCmp('noIpPwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'noIpPwdText', name:'nPasswordText', submitValue: false, maxLength: 63, enforceMaxLength: true, hidden: true, changeFlag: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('noIpPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('noIpPwd').setValue(newValue); } Ext.getCmp('noIpPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showNoIpPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'textfield', id: 'nDomain', name: 'nDomain', vtype: 'domain', minLength: 1, maxLength: 31, fieldLabel: smb.charset.label.domainName }, { xtype: 'displayfield', fieldLabel: smb.charset.label.connStatus, id: 'nStatus', name: 'nStatus', submitValue: false } ] }, { xtype: 'fieldcontainer', id: 'comexeCnt', hidden: true, disabled: true, defaults: { labelWidth: 160, labelAlign: 'right', inputWidth: 180 }, items: [ { xtype: 'checkbox', id: 'cIsEnable', name: 'cIsEnable', fieldLabel: smb.charset.label.ddns, boxLabel: smb.charset.label.enable, inputWidth: 13, checked: true, listeners:{ change:function(item, newValue, oldValue) { if(newValue){ Ext.getCmp('cUsername').enable(); Ext.getCmp('cPwd').enable(); Ext.getCmp('cDomain').enable(); Ext.getCmp('cStatus').enable(); if(Ext.getCmp('svrProvider').getValue()==2){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } } else{ Ext.getCmp('cUsername').disable(); Ext.getCmp('cPwd').disable(); Ext.getCmp('cDomain').disable(); Ext.getCmp('cStatus').disable(); if(Ext.getCmp('svrProvider').getValue()==2){ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } } } }, { xtype: 'textfield', id: 'cUsername', name: 'cUsername', vtype: 'username', minLength: 1, maxLength: 31, enforceMaxLength: true, fieldLabel: smb.charset.label.username }, { xtype: 'fieldcontainer', id: 'cPwd', layout: 'column', defaults:{ labelWidth: 160, inputWidth: 180 }, items:[ { xtype: 'textfield', inputType: 'password', maxLength: 63, enforceMaxLength: true, id: 'comextPwd', name: 'cPassword', fieldLabel: smb.charset.label.password, changeFlag: true, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('comexePwdText').changeFlag = false; if(item.changeFlag) { Ext.getCmp('comexePwdText').setValue(newValue); } Ext.getCmp('comexePwdText').changeFlag = true; } } }, { xtype: 'textfield', id: 'comexePwdText', name:'cPasswordText', submitValue: false, hidden: true, maxLength: 63, enforceMaxLength: true, changeFlag: true, fieldLabel: smb.charset.label.password, vtype: 'wanPwd', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('comextPwd').changeFlag = false; if(item.changeFlag) { Ext.getCmp('comextPwd').setValue(newValue); } Ext.getCmp('comextPwd').changeFlag = true; } } }, { xtype: 'checkbox', id: 'showComexePwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'textfield', id: 'cDomain', name: 'cDomain', vtype: 'domain', minLength: 1, maxLength: 31, fieldLabel: smb.charset.label.domainName }, { xtype: 'displayfield', fieldLabel: smb.charset.label.connStatus, id: 'cStatus', name: 'cStatus', submitValue: false } ] }, { xtype: 'hiddenfield', name: 'hiddenfield', value: 'hiddenfield' }, { xtype: 'button', id: 'ddnsLogin', margin: '0 20 0 165', text: smb.charset.button.login, width: 60 }, { xtype: 'button', id: 'ddnsLogout', text: smb.charset.button.logOut, width: 60 } ], initComponent: function(){ this.callParent(arguments); if( smb.mode.status=='apRouter' || smb.mode.status=='apClientRouter' ) { } else { Ext.getCmp('svrProvider').disable(); Ext.getCmp('noIpCnt').disable(); Ext.getCmp('dynamicCnt').disable(); Ext.getCmp('comexeCnt').disable(); Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } }); Ext.define('smb.model.miscellaneous',{ extend: 'Ext.data.Model', fields: [ {mapping: 'discoveryEnable', name: 'discoveryEnable', type: 'boolean'}, {mapping: 'CDP', name: 'CDP', type: 'boolean'}, // {mapping: 'remoteResEnable', name: 'remoteResEnable', type: 'boolean'}, {mapping: 'poeEnable', name: 'poeEnable', type: 'boolean'} ], proxy: { type: 'ajax', url: './data/miscellaneous.json', reader: { type: 'json', root: 'data' } } }); Ext.define('smb.view.miscellaneous',{ extend: 'smb.view.module', id: 'miscellaneous', alias: 'widget.miscellaneous', title: smb.charset.module.miscellaneous, width: 460, height: 170, collapsible: false, model: 'miscellaneous', url: './data/miscellaneous.json', //flex: 1, defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.discovery, boxLabel: smb.charset.label.enable, name: 'discoveryEnable' }, { xtype: 'helpIcon', id: 'discoveryHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'discoveryHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.discovery }); } } } ] }, /* newly added by chenjianfeng, for CDP, 2015/7/16 */ { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.CDP, boxLabel: smb.charset.label.enable, name: 'CDP' }, { xtype: 'helpIcon', id: 'CDPHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'CDPHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.CDP }); } } } ] }, /* { xtype: 'checkbox', fieldLabel: smb.charset.label.remoteReset, boxLabel: smb.charset.label.enable, name: 'remoteResEnable' }, */ { xtype: 'fieldcontainer', layout: 'hbox', defaults:{ labelWidth: 160, labelAlign: 'right' }, items: [ { xtype: 'checkbox', fieldLabel: smb.charset.label.poePassthrough, boxLabel: smb.charset.label.enable, name: 'poeEnable' }, { xtype: 'helpIcon', id: 'poePassThroughHelp', listeners:{ afterrender:function(button, event){ var tip = Ext.create('Ext.tip.ToolTip', { target: 'poePassThroughHelp', maxWidth: 500, dismissDelay: 0, html: smb.charset.help.poePassThrough }); } } } ] }, { xtype: 'hidden', name: 'hidden', value: 'hidden' } ] }); Ext.define('smb.store.timeZone',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name: '0', display: smb.charset.comboBox.gmt0}, {name: '60', display: smb.charset.comboBox.gmt1}, {name: '120', display: smb.charset.comboBox.gmt2}, {name: '180', display: smb.charset.comboBox.gmt3}, {name: '240', display: smb.charset.comboBox.gmt4}, {name: '300', display: smb.charset.comboBox.gmt5}, {name: '360', display: smb.charset.comboBox.gmt6}, {name: '420', display: smb.charset.comboBox.gmt7}, {name: '450', display: smb.charset.comboBox.gmt33}, {name: '480', display: smb.charset.comboBox.gmt8}, {name: '510', display: smb.charset.comboBox.gmt9}, {name: '540', display: smb.charset.comboBox.gmt10}, {name: '600', display: smb.charset.comboBox.gmt11}, {name: '660', display: smb.charset.comboBox.gmt12}, {name: '720', display: smb.charset.comboBox.gmt13}, {name: '780', display: smb.charset.comboBox.gmt14}, {name: '840', display: smb.charset.comboBox.gmt15}, {name: '900', display: smb.charset.comboBox.gmt16}, {name: '930', display: smb.charset.comboBox.gmt17}, {name: '960', display: smb.charset.comboBox.gmt18}, {name: '990', display: smb.charset.comboBox.gmt19}, {name: '1020', display: smb.charset.comboBox.gmt20}, {name: '1050', display: smb.charset.comboBox.gmt21}, {name: '1065', display: smb.charset.comboBox.gmt22}, {name: '1080', display: smb.charset.comboBox.gmt23}, {name: '1110', display: smb.charset.comboBox.gmt24}, {name: '1140', display: smb.charset.comboBox.gmt25}, {name: '1200', display: smb.charset.comboBox.gmt26}, {name: '1260', display: smb.charset.comboBox.gmt27}, {name: '1290', display: smb.charset.comboBox.gmt28}, {name: '1320', display: smb.charset.comboBox.gmt29}, {name: '1380', display: smb.charset.comboBox.gmt30}, {name: '1440', display: smb.charset.comboBox.gmt31}, {name: '1500', display: smb.charset.comboBox.gmt32} ] }) Ext.define('smb.store.svrProv',{ extend: 'Ext.data.Store', fields: [ {name:'name', type:'int'}, {name:'display', type:'string'} ], data: [ {name: 1, display: smb.charset.comboBox.noIp}, {name: 0, display: smb.charset.comboBox.dynDns}, {name: 2, display: smb.charset.comboBox.comexe} ] }) Ext.define('smb.store.logRecord',{ extend: 'Ext.data.Store', fields: [ {name:'time', type:'string'}, {name:'type', type:'string'}, {name:'level', type:'string'}, {name:'msg', type:'string'} ] }); Ext.define('smb.controller.management', { extend: 'Ext.app.Controller', init: function(){ this.control({ '#webserver checkbox[id=macAuthChkEnable]': { change: function(checkbox, newValue, oldValue, Opts){ var tempArr = Ext.getCmp('macCt').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(newValue) { if(item.disabled) { item.enable(true); } } else { if(!item.disabled) { item.disable(true); } } }); } }, '#webserver button[id=addPcMac]': { click: function(button, event) { var hostMac = Ext.getCmp('hostMac').getValue(); if(Ext.getCmp('mac1').getValue()==hostMac || Ext.getCmp('mac2').getValue()==hostMac || Ext.getCmp('mac3').getValue()==hostMac || Ext.getCmp('mac4').getValue()==hostMac) { Ext.Msg.alert( smb.charset.module.failure, smb.charset.validation.hostMacExist ); } else if( Ext.isEmpty(Ext.getCmp('mac1').getValue()) ) { Ext.getCmp('mac1').setValue(hostMac) } else if( Ext.isEmpty(Ext.getCmp('mac2').getValue()) ) { Ext.getCmp('mac2').setValue(hostMac) } else if( Ext.isEmpty(Ext.getCmp('mac3').getValue()) ) { Ext.getCmp('mac3').setValue(hostMac) } else if( Ext.isEmpty(Ext.getCmp('mac4').getValue()) ) { Ext.getCmp('mac4').setValue(hostMac) } else { Ext.Msg.alert( smb.charset.module.failure, smb.charset.validation.macFull ); } } }, '#webserver button[id=webserverBtn]': { click: function(btn, event){ var formBasic = Ext.getCmp('webserver').getForm(); if( formBasic.isValid() ) { formBasic.submit({ // waitTitle: 'Submitting your data', // waitMsg: 'Submitting your data msg', timeout: 15, clientValidation:true, success: function(thisForm, action) { var formData = Ext.JSON.decode(action.response.responseText); smb.user.timeout.call(this, thisForm, action, 0); thisForm.loadRecord(formData); var s = setTimeout(resetApplyChanges, 1000); if(formData.relogin == true) { var pageUrl = top.location.href; var stIindex = pageUrl.indexOf('//'); if(formData.https_enable){ top.location.href = /*pageUrl.slice(0, stIindex+2)*/'https://' + pageUrl.slice(stIindex+2).split('/')[0].split(':')[0] + ':' +formData.newport; }else{ top.location.href = 'http://' + pageUrl.slice(stIindex+2).split('/')[0].split(':')[0] + ':' +formData.newport; } } }, failure: function(form, action) { var formData = Ext.JSON.decode(action.response.responseText); switch (action.failureType) { case Ext.form.action.Action.CLIENT_INVALID: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.formInvalid); break; }; case Ext.form.action.Action.CONNECT_FAILURE: { Ext.Msg.alert(smb.charset.module.failure, smb.charset.tip.dataFailure); break; }; case Ext.form.action.Action.SERVER_INVALID: { if(formData.errCode) { Ext.Msg.alert(smb.charset.module.failure, smb.charset.errCode['e'+formData.errCode]); } else { Ext.Msg.alert(smb.charset.module.failure, smb.charset.errCode.eDefault); } break; } } } }); } else { //如果有高级选项,则展开高级选项 var advPanel = form.query('[expandItem=advancedSettings]'); Ext.each(advPanel, function(panel){ panel.expand(); }); //btn.disabled = true; } } }, '#snmp checkbox[id=snmpChkEnable]': { change: function(checkbox, newValue, oldValue, Opts){ var tempArr = Ext.getCmp('snmp').query('[changeEnable=true]'); Ext.each(tempArr, function(item){ if(newValue) { if(item.isDisabled()) { item.enable(); } } else { if(!item.isDisabled()) { item.disable(); } } }); } }, '#ping checkbox[id=pingChkEnable]': { change: function(checkbox, newValue, oldValue, Opts){ var tempArr = Ext.getCmp('ping').query('[changeEnable=true]'); Ext.each(tempArr, function(item) { if(newValue) { if(item.disabled) { item.enable(true); } } else { if(!item.disabled) { item.disable(true); } } }); } }, '#webserver checkbox[id=secureConnEnable]': { change: function(checkbox, newValue, oldValue, Opts){ if(newValue) { Ext.getCmp('secureServerPort').enable(true); } else { Ext.getCmp('secureServerPort').disable(true); } } }, '#log button[id=logMailSet]': { click: function(button, newValue, oldValue, Opts) { smb.user.bodyMask.show(); smb.user.bodyMask2.show(); /* if(Ext.getCmp('autoMail')) { Ext.getCmp('autoMail').show(); } else { Ext.create('smb.view.popBox',{ id: 'autoMail', name: 'autoMail', title: smb.charset.label.mailAccount, width: 600, height: 424, // hidden: true, renderTo: 'management', items: [ { xtype: 'smbModule', header: false, frame: false, border: 0, model: 'log', url: './data/log.json', defaults:{ labelWidth: 120, inputWidth: 150 }, items: [ { xtype: 'textfield', fieldLabel: smb.charset.label.from, id: 'mailFrom', name: 'mailFrom' }, { xtype: 'textfield', fieldLabel: smb.charset.label.to, id: 'mailTo', name: 'mailTo' }, { xtype: 'textfield', fieldLabel: smb.charset.label.smtpSvr, id: 'smtpSvr', name: 'smtpSvr', vtype: 'ip' }, { xtype: 'checkbox', boxLabel: smb.charset.label.authentication, margin: '5 0 5 105', inputWidth: 13, checked: true, id: 'mailAuth', name: 'mailAuth' }, { xtype: 'textfield', fieldLabel: smb.charset.label.username, id: 'mailUsername', name: 'mailUsername', maxLength: 31, vtype: 'username' }, { xtype: 'fieldcontainer', layout: 'column', defaults:{ labelWidth: 120, inputWidth: 150 }, items:[ { xtype: 'textfield', fieldLabel: smb.charset.label.password, inputType: 'password', maxLength: 31, id: 'mailPassword', name: 'mailPassword', listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('mailPwdText').setValue(newValue); } } }, { xtype: 'textfield', id: 'mailPwdText', submitValue: false, hidden: true, fieldLabel: smb.charset.label.password, listeners:{ change: function( item, newValue, oldValue, scope) { Ext.getCmp('mailPassword').setValue(newValue); } } }, { xtype: 'checkbox', id: 'showMailPwd', margin: '0 0 0 5', inputWidth: 13, boxLabel: smb.charset.label.show, hideLabel: true } ] }, { xtype: 'textfield', fieldLabel: smb.charset.label.confirmPassword, inputType: 'password', id: 'mailCfmPwd', name: 'mailCfmPwd', validator: function(value) { var formPanel = this.ownerCt; var newPwd = formPanel.getComponent('mailPassword').getValue(); if(value == newPwd) { // Ext.getCmp('submitNewPwd').setValue( Ext.util.Format.uppercase(md5(value)) ); return true; } else { return smb.charset.validation.pwdNotEqual; } } }, { xtype: 'checkbox', boxLabel: smb.charset.label.enableAutoMail, margin: '0 0 0 105', inputWidth: 13, checked: true, id: 'mailEnable', name: 'mailEnable' }, { xtype: 'fieldcontainer', layout: 'hbox', id: 'mailDayCnt', margin: '10 0 0 85', items: [ { xtype: 'radio', id: 'mailTimeDay', name: 'mailTime', inputValue: 1 }, { xtype: 'label', text: 'Everyday, mail the log at', id: 'mailTimeLabel', forId: 'mailTimeDay', disabledCls: 'disabledLabel', margin: '5 2 0 2' }, { xtype: 'numberfield', minValue: 0, maxValue: 23, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailDayHour', name: 'mailDayHour' }, { xtype: 'label', text: ':', id: 'timeSep', disabledCls: 'disabledLabel', margin: '5 2 0 2' }, { xtype: 'numberfield', minValue: 0, maxValue: 59, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailDayMin', name: 'mailDayMin' }, ] }, { xtype: 'fieldcontainer', margin: '5 0 0 85', layout: 'hbox', id: 'mailHourCnt', items: [ { xtype: 'radio', id: 'mailTimeHour', name: 'mailTime', inputValue: 2 }, { xtype: 'label', text: 'Mail the log every', id: 'mailHourLabel', margin: '5 0 0 5', forId: 'mailTimeHour', disabledCls: 'disabledLabel' }, { xtype: 'numberfield', minValue: 1, maxValue: 99, inputWidth: 30, margin: '0 5 0 5', hideLabel: true, id: 'mailHourHour', name: 'mailHourHour' }, { xtype: 'label', text: 'hour', id: 'hourLabel', margin: '5 0 0 5', disabledCls: 'disabledLabel' }, ] }, { xtype: 'button', text: smb.charset.button.save, margin: '20 40 0 105', width: 50, id: 'mailSave' }, { xtype: 'button', text: smb.charset.button.back, margin: '20 0 0 0', width: 50, id: 'mailBack' }, ], buttons: false } ] }) } */ Ext.getCmp('autoMailForm').load({method:'GET'}); Ext.getCmp('autoMail').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+Ext.getBody().dom.scrollTop-424+150; temp = (h-400)/2+Ext.getBody().dom.scrollTop-150; Ext.getCmp('autoMail').setPosition((960-600)/2, temp); } }, '#log button[id=sysLogDownload]': { click: function(button, event) { if(Ext.isIE){ var referLink = document.createElement('a'); referLink.href = 'file/SystemLog.txt'; document.body.appendChild(referLink); referLink.click(); } else{ window.location.href = 'file/SystemLog.txt'; } } }, '#log button[id=sysLogOpen]': { click: function(button, event) { Ext.getCmp('openLog').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('openLog').setPosition((960-920)/2, temp); Ext.Ajax.request({ url: './data/syslogShow.json', success: function(response) { smb.user.timeout.call(this, response, response); var data = Ext.JSON.decode(response.responseText).data; Ext.getStore('logRecord').loadData(data); } }) } }, '#openLog button[id=updateLogBtn]': { click: function(button, event) { Ext.Ajax.request({ url: './data/syslogShow.json', success: function(response) { smb.user.timeout.call(this, response, response); var data = Ext.JSON.decode(response.responseText).data; Ext.getStore('logRecord').loadData(data); } }) } }, /* '#openLog button[id=exitLogBtn]': { click: function(button, event) { Ext.getCmp('openLog').hide(); } }, */ /* '#webserver': { afterrender: function(){ var webserver = Ext.getCmp('webserver'); smb.model.webserver.load(10,{ scope: this, failure: function(record, operation) { }, callback: function(record, operation) { }, success: function(record, operation) { webserver.getForm().setValues(record.data); hostMac = record.data.hostMac; } }); } }, */ '#ddns combobox[id=svrProvider]': { change: function(checkbox, newValue, oldValue, Opts){ if(newValue == 0) { Ext.getCmp('dynamicCnt').show(); Ext.getCmp('dynamicCnt').enable(); if( Ext.getCmp('dIsEnable').getValue() ) { Ext.getCmp('dPwd').enable(); } else { Ext.getCmp('dPwd').disable(); } Ext.getCmp('noIpCnt').hide(); Ext.getCmp('noIpCnt').disable(); Ext.getCmp('comexeCnt').hide(); Ext.getCmp('comexeCnt').disable(); if(Ext.getCmp('dIsEnable').getValue()){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } else{ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } else if(newValue == 1) { Ext.getCmp('noIpCnt').show(); Ext.getCmp('noIpCnt').enable(); if( Ext.getCmp('nIsEnable').getValue() ) { Ext.getCmp('nPwd').enable(); } else { Ext.getCmp('nPwd').disable(); } Ext.getCmp('dynamicCnt').hide(); Ext.getCmp('dynamicCnt').disable(); Ext.getCmp('comexeCnt').hide(); Ext.getCmp('comexeCnt').disable(); if(Ext.getCmp('nIsEnable').getValue()){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } else{ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } else if(newValue == 2) { Ext.getCmp('comexeCnt').show(); Ext.getCmp('comexeCnt').enable(); if( Ext.getCmp('cIsEnable').getValue() ) { Ext.getCmp('cPwd').enable(); } else { Ext.getCmp('cPwd').disable(); } Ext.getCmp('noIpCnt').hide(); Ext.getCmp('noIpCnt').disable(); Ext.getCmp('dynamicCnt').hide(); Ext.getCmp('dynamicCnt').disable(); if(Ext.getCmp('cIsEnable').getValue()){ Ext.getCmp('ddnsLogin').enable(); Ext.getCmp('ddnsLogout').enable(); } else{ Ext.getCmp('ddnsLogin').disable(); Ext.getCmp('ddnsLogout').disable(); } } } }, '#ddns button[id=ddnsLogin]': { click: function(btn, newValue, oldValue, Opts){ var form = btn.findParentByType('smbModule'); var formBasic = form.getForm(); if( formBasic.isValid() ) { formBasic.submit({ // waitTitle: 'Submitting your data', // waitMsg: 'Submitting your data msg', timeout: 3, clientValidation:true, url: './data/ddnsLogin.json', success: function(thisForm, action) { smb.user.timeout.call(this, action, action, 0); var s = setTimeout(resetApplyChanges, 1000); var formData = Ext.JSON.decode(action.response.responseText); Ext.getCmp('ddns').loadRecord(formData); /*switch(formData.data.dStatus) { case 0: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns5); } switch(formData.data.nStatus) { case 0: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns5); } switch(formData.data.cStatus) { case 0: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns5); }*/ }, failure: function(form, action){ 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); } } } }); } function setData() { Ext.Ajax.request({ url: './data/ddnsLogin.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var formData = Ext.JSON.decode(response.responseText); /*switch(formData.data.dStatus) { case 0: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns5); } switch(formData.data.nStatus) { case 0: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('nStatus').setValue(smb.charset.tip.ddns5); } switch(formData.data.cStatus) { case 0: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('cStatus').setValue(smb.charset.tip.ddns5); }*/ }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, smb.charset.alert.failGetData); } }); } var o = setTimeout(setData,4000) } }, '#ddns button[id=ddnsLogout]': { click: function(btn, newValue, oldValue, Opts) { Ext.Ajax.request({ url: './data/ddnsLogout.json', params: { svrProvider: Ext.getCmp('svrProvider').getValue() }, success: function(response) { smb.user.timeout.call(this, response, response); var s = setTimeout(resetApplyChanges, 1000); var formData = Ext.JSON.decode(response.responseText); Ext.getCmp('ddns').loadRecord(formData); /*switch(formData.data.dStatus) { case 0: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns5); }*/ }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, smb.charset.alert.failGetData); } }); function setData() { Ext.Ajax.request({ url: './data/ddnsLogin.json', params: { }, success: function(response) { smb.user.timeout.call(this, response, response); var formData = Ext.JSON.decode(response.responseText); /*switch(formData.data.dStatus) { case 0: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns0); break; case 1: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns1); break; case 2: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns2); break; case 3: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns3); break; case 4: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns4); break; default: Ext.getCmp('dStatus').setValue(smb.charset.tip.ddns5); }*/ }, failure: function() { Ext.Msg.alert(smb.charset.module.failure, smb.charset.alert.failGetData); } }); var o = setTimeout(setData,2000) } } }, '#ddns checkbox[id = showDynamicPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('dynamicPwdText').show(); Ext.getCmp('dynamicPwd').hide(); } else { Ext.getCmp('dynamicPwdText').hide(); Ext.getCmp('dynamicPwd').show(); } } }, '#ddns checkbox[id = showNoIpPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('noIpPwdText').show(); Ext.getCmp('noIpPwd').hide(); } else { Ext.getCmp('noIpPwdText').hide(); Ext.getCmp('noIpPwd').show(); } } }, '#ddns checkbox[id = showComexePwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('comexePwdText').show(); Ext.getCmp('comextPwd').hide(); } else { Ext.getCmp('comexePwdText').hide(); Ext.getCmp('comextPwd').show(); } } }, '#autoMail': { close: function(){ smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); } }, '#autoMail checkbox[id=mailEnable]':{ change: function(obj, newValue, oldValue, event) { Ext.getCmp('mailDayCnt').disable(); Ext.getCmp('mailHourCnt').disable(); if(newValue) { Ext.getCmp('mailAuthShow').setValue(true); Ext.getCmp('mailDayCnt').enable(); Ext.getCmp('mailHourCnt').enable(); /* Ext.getCmp('mailTimeDay').enable(); Ext.getCmp('mailTimeHour').enable(); if(Ext.getCmp('mailTimeDay').getValue()) { Ext.getCmp('mailDayCnt').enable(); // Ext.getCmp('mailTimeLabel').enable(); // Ext.getCmp('mailDayHour').enable(); // Ext.getCmp('mailDayMin').enable(); // Ext.getCmp('timeSep').enable(); } else { Ext.getCmp('mailHourCnt').enable(); // Ext.getCmp('mailHourLabel').enable(); // Ext.getCmp('mailHourHour').enable(); // Ext.getCmp('hourLabel').enable(); } */ } else { Ext.getCmp('mailAuthShow').setValue(false); Ext.getCmp('mailDayCnt').disable(); Ext.getCmp('mailHourCnt').disable(); /* Ext.getCmp('mailTimeDay').disable(); Ext.getCmp('mailTimeHour').disable(); if(Ext.getCmp('mailTimeDay').getValue()) { Ext.getCmp('mailTimeLabel').disable(); Ext.getCmp('mailDayHour').disable(); Ext.getCmp('mailDayMin').disable(); Ext.getCmp('timeSep').disable(); } else { Ext.getCmp('mailHourLabel').disable(); Ext.getCmp('mailHourHour').disable(); Ext.getCmp('hourLabel').disable(); } */ } } }, '#autoMail checkbox[id=mailAuth]':{ change: function(obj, newValue, oldValue, event) { if(newValue) { // Ext.getCmp('mailUsername').show(); // Ext.getCmp('mailPwdCnt').show(); // Ext.getCmp('mailCfmPwd').show(); Ext.getCmp('mailUsername').enable(); Ext.getCmp('mailPwdCnt').enable(); Ext.getCmp('mailCfmPwd').enable(); } else { // Ext.getCmp('mailUsername').hide(); // Ext.getCmp('mailPwdCnt').hide(); // Ext.getCmp('mailCfmPwd').hide(); Ext.getCmp('mailUsername').disable(); Ext.getCmp('mailPwdCnt').disable(); Ext.getCmp('mailCfmPwd').disable(); } } }, '#autoMail radio[id=mailTimeDay]':{ change: function(obj, newValue, oldValue, event) { if(newValue) { Ext.getCmp('mailTimeLabel').enable(); Ext.getCmp('mailDayHour').enable(); Ext.getCmp('mailDayMin').enable(); Ext.getCmp('timeSep').enable(); Ext.getCmp('mailHourLabel').disable(); Ext.getCmp('mailHourHour').disable(); Ext.getCmp('hourLabel').disable(); } } }, '#autoMail radio[id=mailTimeHour]':{ change: function(obj, newValue, oldValue, event) { if(newValue) { Ext.getCmp('mailTimeLabel').disable(); Ext.getCmp('mailDayHour').disable(); Ext.getCmp('mailDayMin').disable(); Ext.getCmp('timeSep').disable(); Ext.getCmp('mailHourLabel').enable(); Ext.getCmp('mailHourHour').enable(); Ext.getCmp('hourLabel').enable(); } } }, /* '#autoMail button[id=mailBack]':{ click: function() { Ext.getCmp('autoMail').hide(); smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); } }, */ '#autoMail button[id=mailSave]':{ click: function(btn,event) { var form = btn.findParentByType('smbModule'); var formBasic = form.getForm(); if( formBasic.isValid() ) { formBasic.submit({ // waitTitle: 'Submitting your data', // waitMsg: 'Submitting your data msg', timeout: 3, clientValidation:true, success: function(thisForm, action) { smb.user.timeout.call(this, action, action, 0); var formData = Ext.JSON.decode(action.response.responseText); thisForm.loadRecord(formData); /////////// var s = setTimeout(resetApplyChanges, 1000); Ext.getCmp('autoMail').hide(); smb.user.bodyMask.hide(); smb.user.bodyMask2.hide(); }, failure: function(form, action){ 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); } } } }); } } }, '#autoMail checkbox[id = showMailPwd]': { change: function( scope, newValue, oldValue, eOpts) { if( newValue ) { Ext.getCmp('mailPwdText').show(); Ext.getCmp('mailPassword').hide(); } else { Ext.getCmp('mailPwdText').hide(); Ext.getCmp('mailPassword').show(); } } } }) } });