consumer and log views
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -1,7 +1,11 @@
 | 
			
		||||
import json
 | 
			
		||||
from flask import request, current_app, jsonify
 | 
			
		||||
from db import redis_client
 | 
			
		||||
from flask_classful import FlaskView
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ConsumersView(FlaskView):
 | 
			
		||||
 | 
			
		||||
    def get(self):
 | 
			
		||||
        return "ConsumersView"
 | 
			
		||||
        consumer_list = json.loads((redis_client.get("consumer_list") or b"{}").decode('utf-8'))
 | 
			
		||||
        return [v['ip'] for k, v in consumer_list.items()]
 | 
			
		||||
 
 | 
			
		||||
@@ -1,7 +1,9 @@
 | 
			
		||||
from flask_classful import FlaskView
 | 
			
		||||
 | 
			
		||||
from flask import request, current_app, jsonify
 | 
			
		||||
 | 
			
		||||
class LogView(FlaskView):
 | 
			
		||||
 | 
			
		||||
    def get(self):
 | 
			
		||||
        return "LogView"
 | 
			
		||||
        remote_uuid = request.json['uuid']
 | 
			
		||||
        current_app.logger.info(f"New message from {remote_uuid}: {request.message}")
 | 
			
		||||
        return jsonify(success = True)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user