mirror of
				https://github.com/beestat/app.git
				synced 2025-10-31 10:07:01 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			60 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			60 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| /**
 | |
|  * Sensors layer.
 | |
|  */
 | |
| beestat.layer.sensors = function() {
 | |
|   beestat.layer.apply(this, arguments);
 | |
| };
 | |
| beestat.extend(beestat.layer.sensors, beestat.layer);
 | |
| 
 | |
| beestat.layer.sensors.prototype.decorate_ = function(parent) {
 | |
|   /*
 | |
|    * Set the overflow on the body so the scrollbar is always present so
 | |
|    * highcharts graphs render properly.
 | |
|    */
 | |
|   $('body').style({
 | |
|     'overflow-y': 'scroll',
 | |
|     'background': beestat.style.color.bluegray.light,
 | |
|     'padding': '0 ' + beestat.style.size.gutter + 'px'
 | |
|   });
 | |
| 
 | |
|   (new beestat.component.header('sensors')).render(parent);
 | |
| 
 | |
|   // All the cards
 | |
|   var cards = [];
 | |
| 
 | |
|   if (window.is_demo === true) {
 | |
|     cards.push([
 | |
|       {
 | |
|         'card': new beestat.component.card.demo(),
 | |
|         'size': 12
 | |
|       }
 | |
|     ]);
 | |
|   }
 | |
| 
 | |
|   cards.push([
 | |
|     {
 | |
|       'card': new beestat.component.card.sensors(),
 | |
|       'size': 12
 | |
|     }
 | |
|   ]);
 | |
| 
 | |
|   cards.push([
 | |
|     {
 | |
|       'card': new beestat.component.card.runtime_sensor_detail(
 | |
|         beestat.setting('thermostat_id')
 | |
|       ),
 | |
|       'size': 12
 | |
|     }
 | |
|   ]);
 | |
| 
 | |
|   // Footer
 | |
|   cards.push([
 | |
|     {
 | |
|       'card': new beestat.component.card.footer(),
 | |
|       'size': 12
 | |
|     }
 | |
|   ]);
 | |
| 
 | |
|   (new beestat.component.layout(cards)).render(parent);
 | |
| };
 |