mirror of
				https://github.com/craigerl/aprsd.git
				synced 2025-10-25 10:00:25 -04:00 
			
		
		
		
	Admin interface catch empty stats
This patch adds checks in the admin js to ensure that the specific stats aren't empty before trying to dereference.
This commit is contained in:
		
							parent
							
								
									80705cb341
								
							
						
					
					
						commit
						2c5bc6c1f7
					
				| @ -26,6 +26,9 @@ function ord(str){return str.charCodeAt(0);} | |||||||
| function update_watchlist( data ) { | function update_watchlist( data ) { | ||||||
|     // Update the watch list
 |     // Update the watch list
 | ||||||
|     stats = data["stats"]; |     stats = data["stats"]; | ||||||
|  |     if (stats.hasOwnProperty("WatchList") == false) { | ||||||
|  |         return | ||||||
|  |     } | ||||||
|     var watchdiv = $("#watchDiv"); |     var watchdiv = $("#watchDiv"); | ||||||
|     var html_str = '<table class="ui celled striped table"><thead><tr><th>HAM Callsign</th><th>Age since last seen by APRSD</th></tr></thead><tbody>' |     var html_str = '<table class="ui celled striped table"><thead><tr><th>HAM Callsign</th><th>Age since last seen by APRSD</th></tr></thead><tbody>' | ||||||
|     watchdiv.html('') |     watchdiv.html('') | ||||||
| @ -62,6 +65,9 @@ function update_watchlist_from_packet(callsign, val) { | |||||||
| 
 | 
 | ||||||
| function update_seenlist( data ) { | function update_seenlist( data ) { | ||||||
|     stats = data["stats"]; |     stats = data["stats"]; | ||||||
|  |     if (stats.hasOwnProperty("SeenList") == false) { | ||||||
|  |         return | ||||||
|  |     } | ||||||
|     var seendiv = $("#seenDiv"); |     var seendiv = $("#seenDiv"); | ||||||
|     var html_str = '<table class="ui celled striped table">' |     var html_str = '<table class="ui celled striped table">' | ||||||
|     html_str    += '<thead><tr><th>HAM Callsign</th><th>Age since last seen by APRSD</th>' |     html_str    += '<thead><tr><th>HAM Callsign</th><th>Age since last seen by APRSD</th>' | ||||||
| @ -82,6 +88,9 @@ function update_seenlist( data ) { | |||||||
| 
 | 
 | ||||||
| function update_plugins( data ) { | function update_plugins( data ) { | ||||||
|     stats = data["stats"]; |     stats = data["stats"]; | ||||||
|  |     if (stats.hasOwnProperty("PluginManager") == false) { | ||||||
|  |         return | ||||||
|  |     } | ||||||
|     var plugindiv = $("#pluginDiv"); |     var plugindiv = $("#pluginDiv"); | ||||||
|     var html_str = '<table class="ui celled striped table"><thead><tr>' |     var html_str = '<table class="ui celled striped table"><thead><tr>' | ||||||
|     html_str +=      '<th>Plugin Name</th><th>Plugin Enabled?</th>' |     html_str +=      '<th>Plugin Name</th><th>Plugin Enabled?</th>' | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user