// JavaScript Document
var spectrumRegion = 511;
Ext.define('smb.view.sysStatus',{
extend: 'Ext.container.Container',
alias:'widget.sysStatus',
id: 'sysStatus',
initComponent: function()
{
this.callParent(arguments);
}
});
Ext.define('smb.model.info',{
extend: 'Ext.data.Model',
fields: [
{mapping: 'enableSSID', name: 'enableSSID', type: 'boolean'},
{mapping: 'snrProcess', name: 'snrProcess', type: 'int'},
{mapping: 'snrValue', name: 'snrValue', type: 'string'},
{mapping: 'rssi', name: 'rssi', type: 'int'},
{mapping: 'rssiValue', name: 'rssiValue', type: 'string'},
{mapping: 'noiseStrength', name: 'noiseStrength', type: 'int'},
{mapping: 'noiseValue', name: 'noiseValue', type: 'string'},
{mapping: 'transmitCcq', name: 'transmitCcq', type: 'int'},
{mapping: 'transmitValue', name: 'transmitValue', type: 'string'},
{mapping: 'tdma', name: 'tdma', type: 'string'},
{mapping: 'region', name: 'region', type: 'int', convert:function(value){spectrumRegion = value; return smb.charset.region['c'+value]} },
{mapping: 'channel', name: 'channel', type: 'string'},
{mapping: 'channelWidth', name: 'channelWidth', type: 'string'},
{mapping: 'mode', name: 'mode', type: 'string'},
{mapping: 'txPower', name: 'txPower', type: 'string'},
{mapping: 'ackTimeout', name: 'ackTimeout', type: 'string'},
{mapping: 'apEnable', name: 'apEnable', type: 'int',
convert:function(value)
{
if(value == 1)
{
return smb.charset.label.enabled;
}
else
{
return smb.charset.label.disabled;
}
}
},
{mapping: 'apMacAddr', name: 'apMacAddr', type: 'string'},
{mapping: 'apSsid', name: 'apSsid', type: 'string'},
{mapping: 'apSecurity', name: 'apSecurity', type: 'string'},
// {mapping: 'apMaxTxRate', name: 'apMaxTxRate', type: 'string'},
{mapping: 'apConnectedStations', name: 'apConnectedStations', type: 'string'},
{mapping: 'clientEnable', name: 'clientEnable', type: 'int',
convert:function(value)
{
if(value == 1)
{
return smb.charset.label.enabled;
}
else
{
return smb.charset.label.disabled;
}
}
},
{mapping: 'clientMacAddr', name: 'clientMacAddr', type: 'string'},
// {mapping: 'clientSsid', name: 'clientSsid', type: 'string'},
{mapping: 'clientSecurity', name: 'clientSecurity', type: 'string'},
// {mapping: 'clientMaxTxRate', name: 'clientMaxTxRate', type: 'string'},
{mapping: 'clientWds', name: 'clientWds', type: 'int',
convert:function(value)
{
switch(value)
{
case 0:
return smb.charset.label.auto;
case 1:
return smb.charset.label.enabled;
case 2:
return smb.charset.label.disabled;
case 3:
return smb.charset.label.na;
}
}
},
// {mapping: 'clientRootIp', name: 'clientRootIp', type: 'string'},
{mapping: 'rootApBssid', name: 'rootApBssid', type: 'string'},
{mapping: 'rootApSsid', name: 'rootApSsid', type: 'string'},
{mapping: 'clientTxRate', name: 'clientTxRate', type: 'string'},
{mapping: 'clientRxRate', name: 'clientRxRate', type: 'string'},
{mapping: 'clientConnTime', name: 'clientConnTime', type: 'string'},
{mapping: 'ssEnable', name: 'ssEnable', type: 'int'},
// {mapping: 'ssMacAddr', name: 'ssMacAddr', type: 'string'},
{mapping: 'maxTxRate', name: 'maxTxRate', type: 'string'},
{mapping: 'ssid01', name: 'ssid01', type: 'string'},
{mapping: 'ssSecurity01', name: 'ssSecurity01', type: 'string'},
{mapping: 'vlanId01', name: 'vlanId01', type: 'string'},
{mapping: 'connStation01', name: 'connStation01', type: 'string'},
{mapping: 'ssid02', name: 'ssid02', type: 'string'},
{mapping: 'ssSecurity02', name: 'ssSecurity02', type: 'string'},
{mapping: 'vlanId02', name: 'vlanId02', type: 'string'},
{mapping: 'connStation02', name: 'connStation02', type: 'string'},
{mapping: 'ssid03', name: 'ssid03', type: 'string'},
{mapping: 'ssSecurity03', name: 'ssSecurity03', type: 'string'},
{mapping: 'vlanId03', name: 'vlanId03', type: 'string'},
{mapping: 'connStation03', name: 'connStation03', type: 'string'},
{mapping: 'ssid04', name: 'ssid04', type: 'string'},
{mapping: 'ssSecurity04', name: 'ssSecurity04', type: 'string'},
{mapping: 'vlanId04', name: 'vlanId04', type: 'string'},
{mapping: 'connStation04', name: 'connStation04', type: 'string'},
{mapping: 'deviceName', name: 'deviceName', type: 'string'},
{mapping: 'hardVersion', name: 'hardVersion', type: 'string'},
{mapping: 'firmVersion', name: 'firmVersion', type: 'string'},
{mapping: 'sysTime', name: 'sysTime', type: 'string'},
{mapping: 'sysRunTime', name: 'sysRunTime', type: 'string'},
{mapping: 'cpu', name: 'cpu', type: 'int'},
{mapping: 'cpuValue', name: 'cpuValue', type: 'string'},
{mapping: 'memory', name: 'memory', type: 'int'},
{mapping: 'memoryValue', name: 'memoryValue', type: 'string'},
{mapping: 'wanConnType', name: 'wanConnType', type: 'string'},
{mapping: 'wanPort1', name: 'wanPort1', type: 'string'},
{mapping: 'wanMacAddr', name: 'wanMacAddr', type: 'string'},
{mapping: 'wanIpAddress', name: 'wanIpAddress', type: 'string'},
{mapping: 'wanSubnetMask', name: 'wanSubnetMask', type: 'string'},
{mapping: 'wanDefaultGateway', name: 'wanDefaultGateway', type: 'string'},
{mapping: 'wanDnsServer', name: 'wanDnsServer', type: 'string'},
{mapping: 'lanConnType', name: 'lanConnType', type: 'string'},
{mapping: 'lanMacAddr', name: 'lanMacAddr', type: 'string'},
{mapping: 'lanPort0', name: 'lanPort0', type: 'string'},
{mapping: 'lanPort1', name: 'lanPort1', type: 'string'},
{mapping: 'lanIpAddress', name: 'lanIpAddress', type: 'string'},
{mapping: 'lanSubnetMask', name: 'lanSubnetMask', type: 'string'},
{mapping: 'lanDefaultGateway', name: 'lanDefaultGateway', type: 'string'},
{mapping: 'lanDnsServer', name: 'lanDnsServer', type: 'string'}
],
autoLoad:true,
proxy: {
type: 'ajax',
url: './data/info.json',
reader: {
type: 'json',
root: 'data'
},
listeners:{
metachange: function( scope, meta, eOpts)
{
Etx.getCmp('snrProcess').value = 0.8;
}
}
}
});
Ext.define('smb.view.loadingCnt',{
extend: 'Ext.container.Container',
alias: 'widget.loadingCnt',
layout:
{
type:'hbox',
pack: 'center',
align: 'middle'
},
width:'100%',
//height:'100%',
items:
[
{
xtype:'image',
src: './css/Spinner_55.gif',
width:55,
//align: 'center',
height:55
}
]
//html:"

"
});
Ext.define('smb.view.wirelessInfoContent',{
extend: 'Ext.container.Container',
alias: 'widget.wirelessInfoContent',
id: 'wirelessInfoContent',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'displayfield',
name: 'tdma',
id : 'tdmaLabel',
fieldLabel:smb.charset.label.tdma,
renderer: function(value){
var result;
result = value.replace ("OFF", smb.charset.label.offed);
result = result.replace("ON", smb.charset.label.oned);
return result;
}
},
{
xtype: 'displayfield',
id: 'infoRegion',
name: 'region',
fieldLabel:smb.charset.label.region
},
{
xtype: 'displayfield',
name: 'channel',
id : 'channelLabel',
fieldLabel:smb.charset.label.channelFrequency,
renderer : function(value) {
var result;
result = value.replace ("MHz", smb.charset.units.MHz);
return result;
}
},
{
xtype: 'displayfield',
name: 'channelWidth',
id : 'channelWidthLabel',
fieldLabel:smb.charset.label.channelWidth,
renderer : function(value) {
var result;
result = value.replace ("MHz", smb.charset.units.MHz);
return result;
}
},
{
xtype: 'displayfield',
name: 'mode',
id : 'modeLabel',
fieldLabel:smb.charset.label.modeIeee,
renderer: function(value){
var result;
result = value.replace ("Mixed", smb.charset.label.mode80211Mixed);
result = result.replace("A Only", smb.charset.label.mode80211AOnly);
result = result.replace("B Only", smb.charset.label.mode80211BOnly);
result = result.replace("G Only", smb.charset.label.mode80211GOnly);
result = result.replace("N Only", smb.charset.label.mode80211NOnly);
return result;
}
},
{
xtype: 'displayfield',
name: 'maxTxRate',
id : 'maxTxRateLabel',
fieldLabel:smb.charset.label.maxTxRate,
renderer : function(value) {
var result;
result = value.replace ("Mbps", smb.charset.units.Mbps);
return result;
}
},
{
xtype: 'displayfield',
name: 'txPower',
id : 'txPowerLabel',
fieldLabel:smb.charset.label.transPower,
renderer : function(value) {
var result;
result = value.replace ("dBm", smb.charset.units.dBm);
return result;
}
},
{
xtype: 'displayfield',
name: 'ackTimeout',
id : 'ackTimeoutLabel',
fieldLabel:smb.charset.label.ackTimeout,
renderer : function(value) {
var result;
result = value.replace ("km", smb.charset.units.km);
return result;
}
}
]
});
Ext.define('smb.view.signalInfoContent',{
extend: 'Ext.container.Container',
alias: 'widget.signalInfoContent',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'container',
defaults:{
labelAlign:'right',
labelWidth:160
},
layout:'hbox',
id:'signalCnt',
padding: '0 0 5 0',
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.signalStrength
},
{
xtype: 'progressbar',
//text:'Ready',
id:'rssiProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'rssi',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('rssiProcess').updateProgress(newValue/100);
}
}
},
{
xtype: 'displayfield',
id: 'rssi',
name: 'rssiValue',
width:60,
listeners:{
change:function(item, newValue, oldValue){
if(newValue=='N/A'){
Ext.getCmp('rssiProcess').hide();
}else{
Ext.getCmp('rssiProcess').show();
}
}
},
renderer : function(value){
var result;
result = value.replace ("dBm", smb.charset.units.dBm);
return result;
}
}]
},
{
xtype: 'container',
defaults:{
labelAlign:'right',
labelWidth:160
},
layout:'hbox',
id:'noiseStrengthCnt',
padding: '0 0 5 0',
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.noiseStrength
},
{
xtype: 'progressbar',
//text:'Ready',
id:'noiseStrengthProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'noiseStrength',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('noiseStrengthProcess').updateProgress(newValue/100);
}
}
},
{
xtype: 'displayfield',
id: 'noiseStrength',
name: 'noiseValue',
width:60,
listeners:{
change:function(item, newValue, oldValue){
if(newValue=='N/A'){
Ext.getCmp('noiseStrengthProcess').hide();
}else{
Ext.getCmp('noiseStrengthProcess').show();
}
}
},
renderer : function(value){
var result;
result = value.replace ("dBm", smb.charset.units.dBm);
return result;
}
}]
},
{
xtype: 'container',
defaults:
{
labelAlign:'right',
labelWidth:160
},
id:'snrCnt',
layout:'hbox',
padding: '0 0 5 0',
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.snr
},
{
xtype: 'progressbar',
//text:'Ready',
id:'snrProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'snrProcess',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('snrProcess').updateProgress(newValue/100);
}
}
},
{
id: 'snrDis',
xtype: 'displayfield',
name: 'snrValue',
width:60,
listeners:{
change:function(item, newValue, oldValue){
if(newValue=='N/A'){
Ext.getCmp('snrProcess').hide();
}else{
Ext.getCmp('snrProcess').show();
}
}
},
renderer : function(value){
var result;
result = value.replace ("dB", smb.charset.units.dB);
return result;
}
}]
},
{
xtype: 'container',
id:'transmitCcqCnt',
defaults:{
labelAlign:'right',
labelWidth:160
},
layout:'hbox',
padding: '0 0 5 0',
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.transmitCcq
},
{
xtype: 'progressbar',
//text:'Ready',
id:'transmitCcqProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'transmitCcq',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('transmitCcqProcess').updateProgress(newValue/100);
}
}
},
{
xtype: 'displayfield',
name: 'transmitValue',
id: 'transmitCcq',
width:60,
listeners:{
change:function(item, newValue, oldValue){
if(newValue=='N/A'){
Ext.getCmp('transmitCcqProcess').hide();
}else{
Ext.getCmp('transmitCcqProcess').show();
}
}
}
}]
}
]
});
Ext.define('smb.view.lanInfoContent',{
extend: 'Ext.container.Container',
alias: 'widget.lanInfoContent',
id: 'lanInfoContent',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'displayfield',
name: 'lanMacAddr',
fieldLabel:smb.charset.label.macAddr
},
{
xtype: 'displayfield',
name: 'lanIpAddress',
fieldLabel:smb.charset.label.ipAddress
},
{
xtype: 'displayfield',
name: 'lanSubnetMask',
fieldLabel:smb.charset.label.subnetMask
},
{
xtype: 'displayfield',
id: 'lanPort0',
name: 'lanPort0',
fieldLabel:smb.charset.label.port0,
renderer: function(value){
var result;
result = value.replace ("Unplugged", smb.charset.label.portUnplugged);
result = result.replace("FD", smb.charset.label.portFullDuplex);
result = result.replace("HD", smb.charset.label.portHalfDuplex);
return result;
}
},
{
xtype: 'displayfield',
id: 'lanPort1',
name: 'lanPort1',
fieldLabel:smb.charset.label.port1,
renderer: function(value){
var result;
result = value.replace ("Unplugged", smb.charset.label.portUnplugged);
result = result.replace("FD", smb.charset.label.portFullDuplex);
result = result.replace("HD", smb.charset.label.portHalfDuplex);
result = result.replace("Mbps", smb.charset.units.Mbps)
return result;
}
}
],
initComponent: function()
{
this.callParent(arguments);
if(smb.mode.status == "apRouter" )
{
Ext.getCmp('lanPort0').hide();
// Ext.getCmp('wanPort1').show();
}
else
{
Ext.getCmp('lanPort0').show();
// Ext.getCmp('wanPort1').hide();
}
}
});
Ext.define('smb.view.wanInfoContent',{
extend: 'Ext.container.Container',
alias: 'widget.wanInfoContent',
id: 'wanInfoContent',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'displayfield',
name: 'wanConnType',
id : 'wanConnTypeLabel',
fieldLabel:smb.charset.label.connType,
renderer: function(value){
if(value == 'Static')
return smb.charset.comboBox.staticConn;
else if(value == 'Dynamic')
return smb.charset.comboBox.dynamic;
else if(value == 'PPPoE')
return smb.charset.comboBox.pppoe;
else if(value == 'L2TP')
return smb.charset.comboBox.l2tp;
else if(value == 'PPTP')
return smb.charset.comboBox.pptp;
else
return 'N/A';
}
},
{
xtype: 'displayfield',
name: 'wanMacAddr',
id : 'wanMacAddrLabel',
fieldLabel:smb.charset.label.macAddr
},
{
xtype: 'displayfield',
name: 'wanIpAddress',
id : 'wanIpAddressLabel',
fieldLabel:smb.charset.label.ipAddress
},
{
xtype: 'displayfield',
name: 'wanSubnetMask',
id : 'wanSubnetMaskLabel',
fieldLabel:smb.charset.label.subnetMask
},
{
xtype: 'displayfield',
name: 'wanDefaultGateway',
id : 'wanDefaultGatewayLabel',
fieldLabel:smb.charset.label.defaultGateway
},
{
xtype: 'displayfield',
name: 'wanDnsServer',
id : 'wanDnsServerLabel',
fieldLabel:smb.charset.label.dnsServer
},
{
xtype: 'displayfield',
id: 'wanPort1',
name: 'wanPort1',
fieldLabel:smb.charset.label.port0,
renderer: function(value){
var result;
result = value.replace ("Unplugged", smb.charset.label.portUnplugged);
result = result.replace("FD", smb.charset.label.portFullDuplex);
result = result.replace("HD", smb.charset.label.portHalfDuplex);
return result;
}
}
],
initComponent: function()
{
this.callParent(arguments);
if(smb.mode.status == "apRouter" )
{
// Ext.getCmp('lanPort0').hide();
Ext.getCmp('wanPort1').show();
}
else
{
// Ext.getCmp('lanPort0').show();
Ext.getCmp('wanPort1').hide();
}
}
});
Ext.define('smb.view.radioModeInfoContent',{
extend: 'Ext.container.Container',
alias: 'widget.radioModeInfoContent',
id : 'radioModeInfoContents',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'displayfield',
name: 'apEnable',
id : 'apEnableLabel',
fieldLabel:smb.charset.label.ap
},
{
xtype: 'displayfield',
name: 'apMacAddr',
id : 'apMacAddrLabel',
fieldLabel:smb.charset.label.macAddr
},
{
xtype: 'displayfield',
name: 'apSsid',
id : 'apSsidLabel',
fieldLabel:smb.charset.label.ssid,
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
name: 'apSecurity',
id : 'apSecurityLabel',
fieldLabel:smb.charset.label.securityMode,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
{
xtype: 'displayfield',
id: 'apConnectedStations',
name: 'apConnectedStations',
fieldLabel:smb.charset.label.connectedStations
},
{
xtype: 'displayfield',
name: 'clientEnable',
id : 'clientEnableLabel',
fieldLabel:smb.charset.label.client,
margin: '50 0 5 0'
},
{
xtype: 'displayfield',
name: 'clientMacAddr',
id : 'clientMacAddrLabel',
fieldLabel:smb.charset.label.macAddr
},
{
xtype: 'displayfield',
name: 'clientSecurity',
id : 'clientSecurityLabel',
fieldLabel:smb.charset.label.securityMode,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
/*
{
xtype: 'displayfield',
name: 'clientMaxTxRate',
fieldLabel:smb.charset.label.maxTxRate
},
*/
{
xtype: 'displayfield',
name: 'clientWds',
id : 'clientWdsLabel',
fieldLabel:smb.charset.label.wds
},
/*
{
xtype: 'displayfield',
id: 'clientRootIp',
name: 'clientRootIp',
fieldLabel:smb.charset.label.rootApIp
},
*/
{
xtype: 'displayfield',
id: 'rootApBssid',
name: 'rootApBssid',
fieldLabel:smb.charset.label.rootApBssid
},
{
xtype: 'displayfield',
id: 'rootApSsid',
name: 'rootApSsid',
fieldLabel:smb.charset.label.rootApSsid,
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
id: 'clientTxRate',
name: 'clientTxRate',
fieldLabel:smb.charset.label.txRate,
renderer : function(value) {
var result;
result = value.replace ("Mbps", smb.charset.units.Mbps);
return result;
}
},
{
xtype: 'displayfield',
id: 'clientRxRate',
name: 'clientRxRate',
fieldLabel:smb.charset.label.rxRate,
renderer : function(value) {
var result;
result = value.replace ("Mbps", smb.charset.units.Mbps);
return result;
}
},
{
xtype: 'displayfield',
id: 'clientConnTime',
name: 'clientConnTime',
fieldLabel:smb.charset.label.connectionTime,
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
}
]
});
Ext.define('smb.view.radioSsidContent',{
extend: 'Ext.container.Container',
alias: 'widget.radioSsidContent',
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
xtype: 'displayfield',
name: 'ssEnable',
fieldLabel: smb.charset.label.multiSsid,
renderer: function(value)
{
if(value == 1)
{
return smb.charset.label.enabled;
}
else
{
return smb.charset.label.disabled;
}
}
},
{
xtype: 'displayfield',
name: 'ssid01',
fieldLabel:smb.charset.label.ssid01,
margin: '15 0 5 0',
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
name: 'ssSecurity01',
fieldLabel:smb.charset.label.security,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
{
xtype: 'displayfield',
name: 'vlanId01',
fieldLabel:smb.charset.label.vlanId
},
{
xtype: 'displayfield',
name: 'connStation01',
fieldLabel:smb.charset.label.connectedStations
},
{
xtype: 'displayfield',
name: 'ssid02',
fieldLabel:smb.charset.label.ssid02,
margin: '15 0 5 0',
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
name: 'ssSecurity02',
fieldLabel:smb.charset.label.security,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
{
xtype: 'displayfield',
name: 'vlanId02',
fieldLabel:smb.charset.label.vlanId
},
{
xtype: 'displayfield',
name: 'connStation02',
fieldLabel:smb.charset.label.connectedStations
},
{
xtype: 'displayfield',
name: 'ssid03',
fieldLabel:smb.charset.label.ssid03,
margin: '15 0 5 0',
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
name: 'ssSecurity03',
fieldLabel:smb.charset.label.security,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
{
xtype: 'displayfield',
name: 'vlanId03',
fieldLabel:smb.charset.label.vlanId
},
{
xtype: 'displayfield',
name: 'connStation03',
fieldLabel:smb.charset.label.connectedStations
},
{
xtype: 'displayfield',
name: 'ssid04',
fieldLabel:smb.charset.label.ssid04,
margin: '15 0 5 0',
renderer: function(value){
var encodeValue = Ext.String.htmlEncode(value);
return encodeValue.replace(/ /g, " ");
}
},
{
xtype: 'displayfield',
name: 'ssSecurity04',
fieldLabel:smb.charset.label.security,
renderer: function(value){
return value.replace ("None", smb.charset.comboBox.none);
}
},
{
xtype: 'displayfield',
name: 'vlanId04',
fieldLabel:smb.charset.label.vlanId
},
{
xtype: 'displayfield',
name: 'connStation04',
fieldLabel:smb.charset.label.connectedStations
}
]
});
Ext.define('smb.view.info',{
extend: 'smb.view.module',
id: 'info',
alias: 'widget.info',
model: 'info',
header: false,
collapsible: false,
padding: 0,
margin: 0,
buttons: false,
url: './data/info.json',
items:
[
{
xtype: 'hidden',
id: 'enableSSID',
name: 'enableSSID',
value: false
},
{
xtype: 'container',
id: 'infoCnt',
width:'100%',
height: 730,
layout:
{
type:'table',
columns: 2
},
items:
[
{
xtype: 'fieldcontainer',
width: 450,
margin: 0,
items:[
{
xtype: 'panel',
id:'deviceInfoPanel',
margin: 0,
bodyPadding: 5,
height: 220,
title: smb.charset.label.deviceInfo,
header:
{
padding: '5 0 2 0'
},
defaults:{
labelAlign: 'right',
labelWidth: 160
},
items:
[
{
xtype: 'displayfield',
name: 'deviceName',
fieldLabel:smb.charset.label.deviceName
},
{
xtype: 'displayfield',
name: 'hardVersion',
fieldLabel:smb.charset.label.deviceModel
},
{
xtype: 'displayfield',
name: 'firmVersion',
fieldLabel:smb.charset.label.firmVersion
},
{
xtype: 'displayfield',
id: 'sysTime',
name: 'sysTime',
fieldLabel:smb.charset.label.sysTime
},
{
xtype: 'displayfield',
id: 'sysRunTime',
name: 'sysRunTime',
fieldLabel:smb.charset.label.uptime,
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
},
{
xtype: 'container',
defaults:{
labelAlign:'right',
labelWidth:160
},
id:'cpuCnt',
layout:'hbox',
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.cpu
},
{
//cls:'inlineBlock',
xtype: 'progressbar',
//text:'Ready',
id:'cpuProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'cpu',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('cpuProcess').updateProgress(newValue/100);
}
}
},
{
xtype: 'displayfield',
id:'cpu',
name: 'cpuValue',
width:60
}]
},
{
xtype: 'container',
defaults:{
labelAlign:'right',
labelWidth:160
},
layout:'hbox',
id:'memoryCnt',
bodyPadding: 5,
items:[
{
xtype: 'displayfield',
cls:'inlineBlock',
fieldLabel: smb.charset.label.memory
},
{
xtype: 'progressbar',
//text:'Ready',
id:'memoryProcess',
value:0.3,
width:120,
height: 10,
margin: '6 6 0 0'
},
{
xtype: 'hidden',
name:'memory',
value: 110,
listeners:{
change: function(item, newValue)
{
Ext.getCmp('memoryProcess').updateProgress(newValue/100);
}
}
},
{
id:'memory',
xtype: 'displayfield',
name: 'memoryValue',
width:60
}]
}
]
},
{
xtype: 'panel',
id:'signalInfo',
bodyPadding: 5,
margin: 0,
height: 136,
title: smb.charset.label.signalQuality,
header:
{
padding: '5 0 2 0'
},
items:
[
{
// height: 136-28,
xtype: 'loadingCnt'
}
]
},
{
xtype: 'panel',
//width:'100%',
margin: 0,
bodyPadding: 5,
height: 151,
id:'lanInfo',
title: smb.charset.label.lanInfo,
layout:
{
align: 'center'
},
header:
{
padding: '5 0 2 0'
},
defaults:{
labelAlign:'right',
labelWidth:160
},
items:
[
{
// height: 151-28,
xtype: 'loadingCnt'
}
]
},
{
xtype: 'panel',
//width:'100%',
margin: 0,
bodyPadding: 5,
height: 190,
id:'wanInfo',
title: smb.charset.label.wanInfo,
header:
{
padding: '5 0 2 0'
},
items:
[
{
height: 201-28,
xtype: 'loadingCnt'
}
]
}
]
},
{
xtype: 'fieldcontainer',
width: 450,
margin: '0 0 0 10',
items:[
{
xtype: 'panel',
id:'wirelessInfo',
height: 220,
margin: 0,
bodyPadding: 5,
title: smb.charset.label.wirelessSetting,
header:
{
padding: '5 0 2 0'
},
defaults:{
labelAlign:'right',
labelWidth:180
},
items:
[
{
// height: 200-28,
xtype: 'loadingCnt'
}
]
},
{
xtype: 'panel',
//id:'radioModePanel',
//width:'100%',
rowspan: 3,
height: 477,
header:
{
padding: '5 0 2 0'
},
id:'radioModeInfo',
margin: 0,
bodyPadding: 5,
defaults:{
labelAlign:'right',
labelWidth:180
},
layout:
{
align: 'center'
},
title: smb.charset.label.radioStatus,
items:
[
{
// height: 513-28,
xtype: 'loadingCnt'
}
]
},
{
xtype: 'panel',
id: 'radioSsidInfo',
//width:'100%',
hidden: true,
header:
{
padding: '5 0 2 0'
},
//id:'lanPanel',
rowspan:3,
height: 477,
margin: 0,
bodyPadding: 5,
defaults:{
labelAlign:'right',
labelWidth:180
},
title: smb.charset.label.radioStatus,
items:
[
{
// height: 513-28,
xtype: 'loadingCnt'
}
]
},
{
xtype: 'panel',
id: 'radioSsid',
//width:'100%',
hidden: true,
header:
{
padding: '5 0 2 0'
},
//id:'lanPanel',
rowspan:3,
height: 477,
margin: 0,
bodyPadding: 5,
defaults:{
labelAlign:'right',
labelWidth:180
},
title: smb.charset.label.radioStatus,
items:
[
{
// height: 513-28,
xtype: 'loadingCnt'
}
]
}
]
}
]
}
],
initComponent: function()
{
this.callParent(arguments);
}
});
Ext.define('smb.store.throughputWired', {
extend: 'Ext.data.Store',
storeId: 'lan',
fields:
[
{name:'index', type:'int'},
{name:'deviceRx', type:'float'},
{name:'deviceTx', type:'float'}
],
proxy:{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
url: './data/throughputWired.json'
// url: './data/monitor.json?target=lan'
}
});
Ext.define('smb.store.throughputWireless', {
extend: 'Ext.data.Store',
storeId: 'lan',
fields:
[
{name:'index', type:'int'},
{name:'deviceRx', type:'float'},
{name:'deviceTx', type:'float'}
],
proxy:{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
url: './data/throughputWireless.json'
// url: './data/monitor.json?target=lan'
}
});
Ext.define('smb.store.lan', {
extend: 'Ext.data.Store',
storeId: 'lan',
//autoLoad: true,
fields:
[
{name:'index', type:'int'},
{name:'eth0Rx', type:'int'},
{name:'eth0Tx', type:'int'},
{name:'wlan0Rx', type:'int'},
{name:'wlan0Tx', type:'int'}
],
proxy:{
type: 'ajax',
reader: {
type: 'json',
root: 'lan'
},
url: './data/monitor.json?target=lan'
}
});
Ext.define('smb.model.station', {
extend: 'Ext.data.Model',
fields: [
{name:'mac', type:'string'},
{name:'deviceName', type:'string'},
{name:'ssid', type:'string'},
{name:'sn', type:'auto'},
{name:'ccq', type:'auto'},
{name:'rate', type:'string'},
{name:'txRate', type:'auto'},
{name:'connTime', type:'string'},
{name:'rxRate', type:'auto'}
],
idProperty: 'key'
});
Ext.define('smb.store.station', {
extend: 'Ext.data.Store',
model: 'smb.model.station',
//autoLoad:true,
proxy:
{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : './data/station.json?option=get&mode=' + smb.mode.status
}
}
});
//alert("in index.js lin 3461");
Ext.define('smb.model.interfaces', {
extend: 'Ext.data.Model',
fields: [
{name:'interface', type:'string'},
{name:'mac', type:'string'},
{name:'ip', type:'string'},
{name:'mtu', type:'auto'},
{name:'rxPacket', type:'string'},
{name:'rxBytes', type:'string'},
{name:'txPacket', type:'string'},
{name:'txBytes', type:'string'}
],
idProperty: 'key'
});
Ext.define('smb.store.interfaces', {
extend: 'Ext.data.Store',
model: 'smb.model.interfaces',
//autoLoad:true,
proxy:
{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : './data/interfaces.json?option=get&mode=' + smb.mode.status
}
}
});
Ext.define('smb.model.arpTable', {
extend: 'Ext.data.Model',
fields: [
{name:'ip', type:'string'},
{name:'mac', type:'string'},
{name:'interface', type:'string'}
],
idProperty: 'key'
});
Ext.define('smb.store.arpTable', {
extend: 'Ext.data.Store',
model: 'smb.model.arpTable',
//autoLoad:true,
proxy:
{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : './data/arpTable.json?option=get&mode=' + smb.mode.status
}
}
});
Ext.define('smb.model.route', {
extend: 'Ext.data.Model',
fields: [
{name:'destination', type:'string'},
{name:'gateway', type:'string'},
{name:'subnetMask', type:'string'},
{name:'interface', type:'string'}
],
idProperty: 'key'
});
Ext.define('smb.store.route', {
extend: 'Ext.data.Store',
model: 'smb.model.route',
//autoLoad:true,
proxy:
{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : './data/route.json?option=get&mode=' + smb.mode.status
}
}
});
Ext.define('smb.model.dhcpClients', {
extend: 'Ext.data.Model',
fields: [
{name:'clientName', type:'string'},
{name:'mac', type:'string'},
{name:'assignedIp', type:'string'},
{name:'leaseTime', type:'string'}
],
idProperty: 'key'
});
Ext.define('smb.store.dhcpClients', {
extend: 'Ext.data.Store',
model: 'smb.model.dhcpClients',
//autoLoad:true,
proxy:
{
type: 'ajax',
reader: {
type: 'json',
root: 'data'
},
api: {
read : './data/dhcpClients.json?option=get&mode=' + smb.mode.status
}
}
});
Ext.define('smb.model.dynamicWan',{
extend: 'Ext.data.Model',
fields: [
{mapping: 'dynacimWanType', name: 'dynacimWanType', type: 'int'},
{mapping: 'dhcpStatus', name: 'dhcpStatus', type: 'int'},
{mapping: 'dhcpIp', name: 'dhcpIp', type: 'string'},
{mapping: 'dhcpMask', name: 'dhcpMask', type: 'string'},
{mapping: 'dhcpGateway', name: 'dhcpGateway', type: 'string'},
{mapping: 'dhcpPriDns', name: 'dhcpPriDns', type: 'string'},
{mapping: 'dhcpSecDns', name: 'dhcpSecDns', type: 'string'},
{mapping: 'dhcpConnUptime', name: 'dhcpConnUptime', type: 'string'},
{mapping: 'dhcpObtain', name: 'dhcpObtain', type: 'int'},
{mapping: 'dhcpRelease', name: 'dhcpRelease', type: 'int'},
{mapping: 'l2tpStatus', name: 'l2tpStatus', type: 'int'},
{mapping: 'l2tpLocalIp', name: 'l2tpLocalIp', type: 'string'},
{mapping: 'l2tpRemoteIp', name: 'l2tpRemoteIp', type: 'string'},
{mapping: 'l2tpSubnet', name: 'l2tpSubnet', type: 'string'},
{mapping: 'l2tpPriDns', name: 'l2tpPriDns', type: 'string'},
{mapping: 'l2tpSecDns', name: 'l2tpSecDns', type: 'string'},
{mapping: 'l2tpSecConn', name: 'l2tpSecConn', type: 'string'},
{mapping: 'l2tpConnUptime', name: 'l2tpConnUptime', type: 'string'},
{mapping: 'l2tpSecStatus', name: 'l2tpSecStatus', type: 'string'},
{mapping: 'l2tpIp', name: 'l2tpIp', type: 'string'},
{mapping: 'l2tpMask', name: 'l2tpMask', type: 'string'},
{mapping: 'l2tpGateway', name: 'l2tpGateway', type: 'string'},
{mapping: 'l2tpSecPriDns', name: 'l2tpSecPriDns', type: 'string'},
{mapping: 'l2tpSecSecDns', name: 'l2tpSecSecDns', type: 'string'},
{mapping: 'pptpStatus', name: 'pptpStatus', type: 'int'},
{mapping: 'pptpLocalIp', name: 'pptpLocalIp', type: 'string'},
{mapping: 'pptpRemoteIp', name: 'pptpRemoteIp', type: 'string'},
{mapping: 'pptpSubnet', name: 'pptpSubnet', type: 'string'},
{mapping: 'pptpPriDns', name: 'pptpPriDns', type: 'string'},
{mapping: 'pptpSecDns', name: 'pptpSecDns', type: 'string'},
{mapping: 'pptpSecConn', name: 'pptpSecConn', type: 'string'},
{mapping: 'pptpConnUptime', name: 'pptpConnUptime', type: 'string'},
{mapping: 'pptpSecStatus', name: 'pptpSecStatus', type: 'string'},
{mapping: 'pptpIp', name: 'pptpIp', type: 'string'},
{mapping: 'pptpMask', name: 'pptpMask', type: 'string'},
{mapping: 'pptpGateway', name: 'pptpGateway', type: 'string'},
{mapping: 'pptpSecPriDns', name: 'pptpSecPriDns', type: 'string'},
{mapping: 'pptpSecSecDns', name: 'pptpSecSecDns', type: 'string'},
{mapping: 'pppoeStatus', name: 'pppoeStatus', type: 'int'},
{mapping: 'pppoeLocalIp', name: 'pppoeLocalIp', type: 'string'},
{mapping: 'pppoeRemoteIp', name: 'pppoeRemoteIp', type: 'string'},
{mapping: 'pppoeSubnet', name: 'pppoeSubnet', type: 'string'},
{mapping: 'pppoePriDns', name: 'pppoePriDns', type: 'string'},
{mapping: 'pppoeSecDns', name: 'pppoeSecDns', type: 'string'},
{mapping: 'pppoeConnUptime', name: 'pppoeConnUptime', type: 'string'},
{mapping: 'pppoeSecConn', name: 'pppoeSecConn', type: 'string'},
{mapping: 'pppoeSecStatus', name: 'pppoeSecStatus', type: 'string'},
{mapping: 'pppoeIp', name: 'pppoeIp', type: 'string'},
{mapping: 'pppoeMask', name: 'pppoeMask', type: 'string'},
{mapping: 'wanConnBtn', name: 'wanConnBtn', type: 'int'}
// {mapping: 'region', name: 'region', type: 'int', convert:function(value){return smb.charset.region['c'+value]} },
],
autoLoad:true,
proxy: {
type: 'ajax',
url: './data/dynamicWan.json',
reader: {
type: 'json',
root: 'data'
}
}
});
Ext.define('smb.store.ifListChart',{
extend: 'Ext.data.Store',
fields:
[
{name:'name', type:'int'},
{name:'display', type:'string'}
]
})
Ext.define('smb.view.monitorContent',{
extend: 'Ext.container.Container',
alias: 'widget.monitorContent',
id:'monitorCnt',
frame: true,
bodyStyle:
{
padding: 10
},
items:[
{
xtype:'container',
margin: '0 0 10 0',
html: ''
},
{
xtype:'container',
id:'mainCnt',
height: 400,
/*border: 1,
style: {
borderColor: 'red',
borderStyle: 'solid'
},*/
items:
[
{
xtype: 'fieldcontainer',
id: 'throughput',
margin: '30 0 50 0',
items:
[
{
xtype: 'fieldcontainer',
layout: 'column',
width: 900,
margin: '0 0 20 0',
items:
[
{
xtype: 'combobox',
id: 'chartTitle1',
hideLabel: true,
width: 100,
forceSelection: true,
margin: '0 330 0 200',
store: 'ifListChart',
queryMode: 'local',
editable: false,
displayField: 'display',
valueField: 'name',
listeners:{
change:function( item, newValue, oldValue, scope)
{
if( newValue!=null)
{
Ext.Ajax.request({
url: './data/ifListChart.json',
timeout: 10000,
params: {
ifNameOne: newValue,
ifNameTwo: Ext.getCmp('chartTitle2').getValue()
},
success: function(response)
{
var wdStore = Ext.getCmp('throughputWired').getStore();
wdStore.removeAll();
wdStore.fireEvent("datachanged");
wdStore.fireEvent("refresh");
wdData = [];
var data = Ext.JSON.decode(response.responseText);
if( data.success==false && data.errCode)
{
Ext.Msg.alert(smb.charset.module.failure, smb.charset.errCode['e'+data.errCode]);
}
}
});
}
}
}
},
{
xtype: 'combobox',
id: 'chartTitle2',
hideLabel: true,
width: 100,
forceSelection: true,
store: 'ifListChart',
queryMode: 'local',
editable: false,
displayField: 'display',
valueField: 'name',
listeners:{
change:function( item, newValue, oldValue, scope)
{
if( newValue!=null)
{
Ext.Ajax.request({
url: './data/ifListChart.json',
timeout: 10000,
params: {
ifNameOne: Ext.getCmp('chartTitle1').getValue(),
ifNameTwo: newValue
},
success: function(response)
{
var wlStore = Ext.getCmp('throughputWireless').getStore();
wlStore.removeAll();
wlStore.fireEvent("datachanged");
wlStore.fireEvent("refresh");
wlData = [];
var data = Ext.JSON.decode(response.responseText);
if( data.success==false && data.errCode)
{
Ext.Msg.alert(smb.charset.module.failure, smb.charset.errCode['e'+data.errCode]);
}
}
});
}
}
}
}
]
},
{
xtype: 'chart',
id: 'throughputWired',
store: 'throughputWired',
width: 440,
height: 247,
theme: 'Fancy',
shadow: false,
style:
{
color: '#000'
},
legend:
{
boxStrokeWidth: 0,
// itemSpacing: 20,
// boxZIndex: 10000,
boxFill: '#f0f1f5',
position: 'top',
labelColor: '#000'
},
axes:
[
{
type: 'Numeric',
position: 'left',
fields: ['deviceRx','deviceTx'],
dashSize: 0,
majorTickSteps: 14,
adjustMaximumByMajorUnit: true,
minimum: 0,
// maximum: 100,
decimals: 1,
grid:
{
odd:
{
opacity: 1,
// fill: '#fff',
stroke: '#c8c8c8',
'stroke-width': 0.5
},
even:
{
opacity: 1,
// fill: '#fff',
stroke: '#c8c8c8',
'stroke-width': 0.5
}
}
},
{
type: 'Numeric',
position: 'bottom',
fields: 'index',
majorTickSteps: 18,
dashSize: 0,
minimum: 0,
maximum: 19,
grid: true
}
],
series:
[
{
type: 'line',
xField: 'index',
yField: 'deviceRx',
showMarkers: false,
style: {
// stroke: '#00ff00',
'stroke-width': 2,
// fill: '#80A080',
opacity: 1
},
tips:
{
trackMouse: true,
width: 60,
height: 28,
renderer: function(storeItem, item)
{
this.setTitle(storeItem.get('deviceRx')+','+storeItem.get('index'));
}
}
},
{
type: 'line',
xField: 'index',
yField: 'deviceTx',
showMarkers: false,
style: {
// stroke: '#00ff00',
'stroke-width': 2,
// fill: '#80A080',
opacity: 1
},
tips:
{
trackMouse: true,
width: 60,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('deviceTx')+','+storeItem.get('index'));
}
}
}
]
},
{
xtype: 'chart',
id: 'throughputWireless',
store: 'throughputWireless',
width: 440,
height: 247,
theme: 'Fancy',
shadow: false,
legend:
{
boxStrokeWidth: 0,
boxFill: '#f0f1f5',
labelColor: '#000',
// boxStrokeWidth: 0,
position: 'top' //样图说明
},
axes:
[
{
type: 'Numeric',
position: 'left',
fields: ['deviceRx','deviceTx'],
majorTickSteps: 14,
// minorTickSteps: 15,
adjustMaximumByMajorUnit: true,
dashSize: 0,
minimum: 0,
decimals: 1,
grid:
{
odd:
{
opacity: 1,
// fill: '#fff',
stroke: '#c8c8c8',
'stroke-width': 0.5
},
even:
{
opacity: 1,
// fill: '#fff',
stroke: '#c8c8c8',
'stroke-width': 0.5
}
}
},
{
type: 'Numeric',
position: 'bottom',
fields: 'index',
majorTickSteps: 18,
dashSize: 0,
minimum: 0,
maximum: 19,
grid: true
}
],
series:
[
{
type: 'line',
xField: 'index',
yField: 'deviceRx',
showMarkers:false,
style: {
// stroke: '#00ff00',
'stroke-width': 2,
// fill: '#80A080',
opacity: 1
},
tips:
{
trackMouse: true,
width: 60,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('deviceRx')+','+storeItem.get('index'));
}
}
},
{
type: 'line',
xField: 'index',
yField: 'deviceTx',
showMarkers:false,
style: {
// stroke: '#00ff00',
'stroke-width': 2,
// fill: '#80A080',
opacity: 1
},
tips:
{
trackMouse: true,
width: 60,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(storeItem.get('deviceTx')+','+storeItem.get('index'));
}
}
}
]
}
]
},
{
xtype: 'fieldcontainer',
id:'stations',
hidden: true,
layout: 'vbox',
items:[
{
xtype: 'displayfield',
id: 'noStationsText',
hideLabel: true,
margin: '20 0 0 350',
value: smb.charset.tip.noAssociatedStations
},
{
xtype:'grid',
id: 'stationGrid',
store:'station',
hidden: true,
width: 892,
maxHeight: 325,
columns: [
{
xtype: 'rownumberer',
hideable: false,
width: 40
},
{
text: smb.charset.column.mac,
dataIndex: 'mac',
hideable: false,
width: 140
},
{
text: smb.charset.column.deviceName,
dataIndex: 'deviceName',
hideable: false,
width: 100
},
{
text: smb.charset.column.associatedSsid,
dataIndex: 'ssid',
hideable: false,
width: 140
},
{
text: smb.charset.column.snr,
dataIndex: 'sn',
hideable: false,
width: 70
},
{
text: smb.charset.column.ccq,
dataIndex: 'ccq',
hideable: false,
width: 70
},
{
text: smb.charset.column.rate,
dataIndex: 'rate',
hideable: false,
width: 85
},
{
text: smb.charset.column.txRateKbps,
dataIndex: 'txRate',
hideable: false,
width: 70
},
{
text: smb.charset.column.rxRateKbps,
dataIndex: 'rxRate',
hideable: false,
width: 70
},
{
text: smb.charset.column.connTime,
dataIndex: 'connTime',
hideable: false,
width: 105,
renderer: function(value){
var result;
result = value.replace ("days", smb.charset.label.days);
return result;
}
}
]
},
{
xtype: 'checkbox',
id: 'autoRefreshStation',
margin: '10 0 0 803',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.station = setInterval(getStation, 2000);
}
else
{
clearInterval(smb.user.loop.station);
}
}
}
}
]
},
{
xtype: 'fieldcontainer',
id:'interfaces',
hidden: true,
layout: 'vbox',
items:[
{
xtype:'grid',
id: 'interfaceGrid',
store:'interfaces',
maxHeight: 325,
width: 892,
columns:
[
{
xtype: 'rownumberer',
hideable: false,
flex: 1
},
{
text: smb.charset.column.interface,
hideable: false,
dataIndex: 'interface',
flex: 2
},
{
text: smb.charset.column.mac,
hideable: false,
dataIndex: 'mac',
flex: 3
},
{
text: smb.charset.column.ipAddr,
hideable: false,
dataIndex: 'ip',
flex: 3
},
{
text: smb.charset.column.mtu,
hideable: false,
dataIndex: 'mtu',
flex: 2
},
{
text: smb.charset.column.rxPacket,
hideable: false,
dataIndex: 'rxPacket',
flex: 2
},
{
text: smb.charset.column.rxBytes,
hideable: false,
dataIndex: 'rxBytes',
flex: 2
},
{
text: smb.charset.column.txPacket,
hideable: false,
dataIndex: 'txPacket',
flex: 2
},
{
text: smb.charset.column.txBytes,
hideable: false,
dataIndex: 'txBytes',
flex: 2
}
]
},
{
xtype: 'checkbox',
id: 'autoRefreshInterface',
margin: '10 0 0 803',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.interfaces = setInterval(getInterface, 2000);
}
else
{
clearInterval(smb.user.loop.interfaces);
}
}
}
}
]
},
{
xtype: 'fieldcontainer',
id:'arpTable',
hidden: true,
layout: 'vbox',
items:[
{
xtype:'grid',
id:'arpTableGrid',
store:'arpTable',
maxHeight: 325,
width: 892,
columns:
[
{
xtype: 'rownumberer',
hideable: false,
flex: 1
},
{
text: smb.charset.column.ipAddr,
hideable: false,
dataIndex: 'ip',
flex: 5
},
{
text: smb.charset.column.mac,
hideable: false,
dataIndex: 'mac',
flex: 6
},
{
text: smb.charset.column.interface,
hideable: false,
dataIndex: 'interface',
flex: 5
}
]
},
{
xtype: 'checkbox',
id: 'autoRefreshArptable',
margin: '10 0 0 803',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.arpTable = setInterval(getArpTable, 2000);
}
else
{
clearInterval(smb.user.loop.arpTable);
}
}
}
}
]
},
{
xtype: 'fieldcontainer',
id:'routes',
hidden: true,
layout: 'vbox',
items:[
{
xtype:'grid',
id:'routesGrid',
store:'route',
maxHeight: 325,
width: 892,
columns:
[
{
xtype: 'rownumberer',
hideable: false,
flex: 1
},
{
text: smb.charset.column.destination,
hideable: false,
dataIndex: 'destination',
flex: 5
},
{
text: smb.charset.column.gateway,
hideable: false,
dataIndex: 'gateway',
flex: 5
},
{
text: smb.charset.column.subnetMask,
hideable: false,
dataIndex: 'subnetMask',
flex: 5
},
{
text: smb.charset.column.interface,
hideable: false,
dataIndex: 'interface',
flex: 5
}]
},
{
xtype: 'checkbox',
id: 'autoRefreshRoutes',
margin: '10 0 0 803',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.routes = setInterval(getRoutes, 2000);
}
else
{
clearInterval(smb.user.loop.routes);
}
}
}
}
]
},
{
xtype: 'fieldcontainer',
id: 'dhcpClientsList',
hidden: true,
items:[
{
xtype: 'displayfield',
id: 'noDhcpText',
hideLabel: true,
width: 892,
margin: '20 0 0 350',
value: smb.charset.tip.noDhcpClients
},
{
xtype:'grid',
id:'dhcpClientsGrid',
store:'dhcpClients',
hidden: true,
width: 892,
maxHeight: 325,
columns:
[
{
xtype: 'rownumberer',
hideable: false,
flex: 1
},
{
text: smb.charset.column.clientName,
hideable: false,
dataIndex: 'clientName',
flex: 5,
renderer: function(value){
return Ext.String.htmlEncode(value);
}
},
{
text: smb.charset.column.macAddr,
hideable: false,
dataIndex: 'mac',
flex: 5
},
{
text: smb.charset.column.assignedIp,
hideable: false,
dataIndex: 'assignedIp',
flex: 5
},
{
text: smb.charset.column.leaseTime,
hideable: false,
dataIndex: 'leaseTime',
flex: 5
}
]
},
{
xtype: 'checkbox',
id: 'autoRefreshDhcpClients',
margin: '10 0 0 803',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.dhcpClients = setInterval(getDhcpClients, 2000);
}
else
{
clearInterval(smb.user.loop.dhcpClients);
}
}
}
}
]
},
{
xtype: 'smbModule',
id: 'dynamicWan',
model: 'dynamicWan',
url: './data/dynamicWan.json',
header: false,
buttons: false,
hidden: true,
items:[
{
xtype: 'hidden',
name: 'dynacimWanType',
value: 9,
listeners:{
change: function( item, newValue, oldValue, obj)
{
Ext.getCmp('dynamicDhcpCnt').hide();
Ext.getCmp('dynamicL2tpCnt').hide();
Ext.getCmp('dynamicPptpCnt').hide();
Ext.getCmp('dynamicPppoeCnt').hide();
Ext.getCmp('dynamicStaticCnt').hide();
Ext.getCmp('wanConnBtn').hide();
// Ext.getCmp('wanRefreshBtn').hide();
newValue = parseInt(newValue);
switch(newValue)
{
case 0:
Ext.getCmp('dynamicDhcpCnt').show();
// Ext.getCmp('wanRefreshBtn').show();
break;
case 2:
Ext.getCmp('dynamicL2tpCnt').show();
Ext.getCmp('wanConnBtn').show();
// Ext.getCmp('wanRefreshBtn').show();
break;
case 3:
Ext.getCmp('dynamicPptpCnt').show();
Ext.getCmp('wanConnBtn').show();
// Ext.getCmp('wanRefreshBtn').show();
break;
case 1:
Ext.getCmp('dynamicPppoeCnt').show();
Ext.getCmp('wanConnBtn').show();
// Ext.getCmp('wanRefreshBtn').show();
break;
default:
Ext.getCmp('dynamicStaticCnt').show();
}
}
}
},
{
xtype: 'fieldset',
title: smb.charset.module.dhcpStatus,
id: 'dynamicDhcpCnt',
layout: 'column',
hidden: true,
width: 650,
padding: '10 15',
margin: '10 0 0 100',
items:[
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'dhcpStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.ipAddress,
name: 'dhcpIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'dhcpMask'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.gateway,
name: 'dhcpGateway'
}
]
},
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'dhcpPriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'dhcpSecDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.connUptime,
name: 'dhcpConnUptime',
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
},
{
xtype: 'fieldcontainer',
// id: 'pp',
margin: '5 0 5 118',
items:[
{
xtype: 'button',
id: 'dhcpObtain',
text: smb.charset.button.obtain,
width: 80,
listeners:{
click: function( button, event )
{
button.disable();
getDynamicWan('./data/dynamicWanObtain.json', 'dhcpObtain', 'false');
}
}
},
{
xtype: 'button',
id: 'dhcpRelease',
text: smb.charset.button.release,
width: 80,
margin: '0 0 0 20',
listeners:{
click: function( button, event )
{
button.disable();
getDynamicWan('./data/dynamicWanRelease.json', 'dhcpRelease', 'false');
}
}
}
]
},
{
xtype: 'hidden',
name: 'dhcpObtain',
value: '',
listeners:{
change: function( item, newValue, oldValue, obj )
{
if( newValue==0 )
{
Ext.getCmp('dhcpObtain').disable();
}
else if( newValue==1 )
{
Ext.getCmp('dhcpObtain').enable();
}
}
}
},
{
xtype: 'hidden',
name: 'dhcpRelease',
value: '',
listeners:{
change: function( item, newValue, oldValue, obj )
{
if( newValue==0 )
{
Ext.getCmp('dhcpRelease').disable();
}
else if( newValue==1 )
{
Ext.getCmp('dhcpRelease').enable();
}
}
}
}
]
}
]
},
{
xtype: 'fieldset',
title: smb.charset.module.l2tpStatus,
id: 'dynamicL2tpCnt',
layout: 'column',
hidden: true,
width: 650,
padding: '10 15',
margin: '10 0 0 100',
items:[
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'l2tpStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.localIpAddr,
name: 'l2tpLocalIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.remoteIpAddr,
name: 'l2tpRemoteIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'l2tpSubnet'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'l2tpPriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'l2tpSecDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.connUptime,
name: 'l2tpConnUptime',
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
}
]
},
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondarayConn,
name: 'l2tpSecConn'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'l2tpSecStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.ipAddress,
name: 'l2tpIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'l2tpMask'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.gateway,
name: 'l2tpGateway'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'l2tpSecPriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'l2tpSecSecDns'
}
]
}
]
},
{
xtype: 'fieldset',
title: smb.charset.module.pptpStatus,
id: 'dynamicPptpCnt',
layout: 'column',
hidden: true,
width: 650,
padding: '10 15',
margin: '10 0 0 100',
items:[
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'pptpStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.localIpAddr,
name: 'pptpLocalIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.remoteIpAddr,
name: 'pptpRemoteIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'pptpSubnet'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'pptpPriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'pptpSecDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.connUptime,
name: 'pptpConnUptime',
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
}
]
},
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondarayConn,
name: 'pptpSecConn'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'pptpSecStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.ipAddress,
name: 'pptpIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'pptpMask'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.gateway,
name: 'pptpGateway'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'pptpSecPriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'pptpSecSecDns'
}
]
}
]
},
{
xtype: 'fieldset',
title: smb.charset.module.pppoeStatus,
id: 'dynamicPppoeCnt',
layout: 'column',
hidden: true,
width: 650,
padding: '10 15',
margin: '10 0 0 100',
items:[
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'pppoeStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.localIpAddr,
name: 'pppoeLocalIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.remoteIpAddr,
name: 'pppoeRemoteIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'pppoeSubnet'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.priDns,
name: 'pppoePriDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondaryDns,
name: 'pppoeSecDns'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.connUptime,
name: 'pppoeConnUptime',
renderer: function(value){
return value.replace ("days", smb.charset.label.days);
}
}
]
},
{
xtype: 'fieldcontainer',
layout: 'vbox',
defaults:{
labelAlign: 'right',
labelWidth: 150
},
width: 300,
items:[
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.secondarayConn,
name: 'pppoeSecConn'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.status,
name: 'pppoeSecStatus'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.ipAddress,
name: 'pppoeIp'
},
{
xtype: 'displayfield',
fieldLabel: smb.charset.label.subnetMask,
name: 'pppoeMask'
},
{
xtype: 'fieldcontainer',
id: 'pppoeBtnCnt',
margin: '5 0 5 118',
items:[
{
xtype: 'button',
id: 'pppoeObtain',
text: smb.charset.button.obtain,
width: 80,
listeners:{
click: function( button, event )
{
button.disable();
getDynamicWan('./data/dynamicWanObtain.json', 'pppoeObtain', 'false');
}
}
},
{
xtype: 'button',
text: smb.charset.button.release,
id: 'pppoeRelease',
width: 80,
margin: '0 0 0 20',
listeners:{
click: function( button, event )
{
button.disable();
getDynamicWan('./data/dynamicWanRelease.json', 'pppoeRelease', 'false');
}
}
}
]
},
{
xtype: 'hidden',
name: 'pppoeObtain',
value: '',
listeners:{
change: function( item, newValue, oldValue, obj )
{
if( newValue==0 )
{
Ext.getCmp('pppoeObtain').disable();
}
else if( newValue==1 )
{
Ext.getCmp('pppoeObtain').enable();
}
}
}
},
{
xtype: 'hidden',
name: 'pppoeRelease',
value: '',
listeners:{
change: function( item, newValue, oldValue, obj )
{
if( newValue==0 )
{
Ext.getCmp('pppoeRelease').disable();
}
else if( newValue==1 )
{
Ext.getCmp('pppoeRelease').enable();
}
}
}
}
]
}
]
},
{
xtype: 'displayfield',
hideLabel: true,
hidden: true,
id: 'dynamicStaticCnt',
margin: '10 0 0 300',
value: smb.charset.label.curWanConnStatic
},
{
xtype: 'fieldcontainer',
margin: '20 0 0 670',
id: 'wanButtonCnt',
items:[
{
xtype: 'hidden',
name: 'wanConnBtn',
value: '',
listeners:{
change: function( item, newValue, oldValue, obj )
{
if( newValue==0)
{
Ext.getCmp('wanConnBtn').setText(smb.charset.button.connect);
}
else if( newValue==1)
{
Ext.getCmp('wanConnBtn').setText(smb.charset.button.disconnect);
}
}
}
},
{
xtype: 'button',
id: 'wanConnBtn',
text: smb.charset.button.disconnect,
width: 80,
hidden: true,
// margin: '0 20 0 0',
listeners:{
click: function( button, event )
{
getDynamicWan('./data/dynamicWanConnect.json', 'wanConnBtn', 'false');
}
}
}
]
},
{
xtype: 'fieldcontainer',
margin: '20 0 0 660',
items:[
{
xtype: 'checkbox',
id: 'autoRefreshDynamicWan',
hideLabel: true,
checked: true,
boxLabel: smb.charset.label.autoRefresh,
listeners:{
change: function(item, newValue, oldValue)
{
if( newValue )
{
smb.user.loop.dynamicWan = setInterval(getDynamicWanFn, 2000);
}
else
{
clearInterval(smb.user.loop.dynamicWan);
}
}
}
}
]
}
]
}
]
}
]
});
Ext.define('smb.view.monitor',{
extend: 'smb.view.module',
id: 'monitor',
title: smb.charset.label.monitor,
alias: 'widget.monitor',
height: 460,
collapsible: false,
changeFlag: false,
stationFlag: false,
interfaceFlag: false,
arpTableFlag: false,
routesFlag: false,
dhcpClientFlag: false,
dynamicWanFlag: false,
buttons:[
],
//model: 'monitor',
items:[
{
xtype: 'loadingCnt'
}
]
});
function resetQuick()
{
var panelQuery = Ext.getCmp('wanSetCnt').query('[xtype=textfield]');
Ext.each(panelQuery, function(panel)
{
panel.hide();
});
}
var initClientFlag = true;
var initApFlag = true;
var retFlagAp = false;
var retFlagClient = false;
var lastRawdata = false;
var afterrenderFlag = false;
var modeFlag = 0;
var arrangeFlag = 0;
var initFlag = true; //为防止国家码region选项初始化导致错误而设置
Ext.define('smb.controller.sysStatus', {
extend: 'Ext.app.Controller',
init: function(){
this.control({
'#monitorCnt' : {
afterrender: function(scope, eOpts)
{
if(!afterrenderFlag)
{
afterrenderFlag = true;
// getThroughputChart();
}
smb.user.loop.info = setInterval(refreshInfo,5000);
smb.user.loop.progress = setInterval(getProgressBar,2000);
smb.user.loop.progressCount = 0;
// smb.user.loop.monitor = setInterval(getThroughputChart,4000);
if( smb.mode.status=='apRouter' || smb.mode.status=='apClientRouter' )
{
Ext.fly('dynamicWanTab').show();
// Ext.fly('dynamicWan').show();
}
else
{
Ext.fly('dynamicWanTab').hide();
// Ext.fly('dynamicWan').hide();
}
Ext.Ajax.request({
url: './data/getThroughputIfList.json',
timeout: 10000,
params: {
},
success: function(response)
{
if(!smb.user.timeout.call(this, response, response))
{
var data = Ext.JSON.decode(response.responseText);
var ifList = new Array;
for( var i=0; i