diff --git a/js/main.js b/js/main.js index c15ceac..40354d2 100644 --- a/js/main.js +++ b/js/main.js @@ -22,8 +22,8 @@ $(document).ready( function() { \

\
\ - '); - $('#switches-set').collapsibleset().trigger( 'create' ); + ') + .collapsibleset().trigger( 'create' ); all_switches[new_id] = obj; all_switches[new_id].id = new_id; @@ -71,17 +71,17 @@ function UpdateSwitchData( id ) { }); //show network info - $('#infotbl-' + id).empty(); - $('#infotbl-' + id).append( 'Uptime:' + all_switches[id].info.uptime + '' ); - $('#infotbl-' + id).append( 'IP:' + all_switches[id].ip + '' ); - $('#infotbl-' + id).append( 'MAC:' + all_switches[id].info.macaddr + '' ); - $('#infotbl-' + id).append( 'BSID:' + all_switches[id].info.ssid + '' ); - $('#infotbl-' + id).append( 'Channel:' + all_switches[id].info.channel + '' ); - $('#infotbl-' + id).append( 'Signal:' + all_switches[id].info.signal + ' dBm' ); + $('#infotbl-' + id).empty() + .append('Uptime:' + all_switches[id].info.uptime + '') + .append('IP:' + all_switches[id].ip + '') + .append('MAC:' + all_switches[id].info.macaddr + '') + .append('BSID:' + all_switches[id].info.ssid + '') + .append('Channel:' + all_switches[id].info.channel + '') + .append('Signal:' + all_switches[id].info.signal + ' dBm'); // show wifi info - $('#right-' + id + ' span').append( '' + all_switches[id].info.ssid + '
' ); - $('#right-' + id + ' span').append( 'ch ' + all_switches[id].info.channel + '' ); + $('#right-' + id + ' span').append( '' + all_switches[id].info.ssid + '
' ) + .append( 'ch ' + all_switches[id].info.channel + '' ); //update switch based on actual reported state $.getJSON( all_switches[id].links.meta.state + '&callback=?', function( result ) {