mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Bugfix - correct power timeline query
This commit is contained in:
		
							parent
							
								
									51a0b3c137
								
							
						
					
					
						commit
						47a050fb0d
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		
							
								
								
									
										2
									
								
								db.js
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								db.js
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -1064,7 +1064,7 @@ module.exports.CreateDB = function (parent, func) {
 | 
			
		|||
            // Database actions on the power collection
 | 
			
		||||
            obj.getAllPower = function (func) { sqlDbQuery('SELECT doc FROM power', null, func); };
 | 
			
		||||
            obj.storePowerEvent = function (event, multiServer, func) { obj.dbCounters.powerSet++; if (multiServer != null) { event.server = multiServer.serverid; } sqlDbQuery('INSERT INTO power VALUE (?, ?, ?, ?)', [null, event.time, event.nodeid ? event.nodeid : null, JSON.stringify(event)], func); };
 | 
			
		||||
            obj.getPowerTimeline = function (nodeid, func) { sqlDbQuery('SELECT doc FROM power WHERE ((nodeid = ?) OR (nodeid = "*")) ORDER BY time DESC', [nodeid], func); };
 | 
			
		||||
            obj.getPowerTimeline = function (nodeid, func) { sqlDbQuery('SELECT doc FROM power WHERE ((nodeid = ?) OR (nodeid = "*")) ORDER BY time ASC', [nodeid], func); };
 | 
			
		||||
            obj.removeAllPowerEvents = function () { sqlDbQuery('DELETE FROM power', null, function (err, docs) { }); };
 | 
			
		||||
            obj.removeAllPowerEventsForNode = function (nodeid) { sqlDbQuery('DELETE FROM power WHERE nodeid = ?', [nodeid], function (err, docs) { }); };
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue