Compare commits
2 Commits
82d7160e5e
...
4a61bd195f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a61bd195f | ||
|
|
fbd0e65019 |
@@ -33,7 +33,7 @@ class SystemDbController():
|
||||
try:
|
||||
# Check if the data to be inserted has an ID
|
||||
if not system_data.get("_id"):
|
||||
system_data['_id'] = uuid4()
|
||||
system_data['_id'] = str(uuid4())
|
||||
|
||||
inserted_result = None
|
||||
inserted_id = None
|
||||
|
||||
@@ -113,3 +113,12 @@ async def leave():
|
||||
|
||||
except Exception as e:
|
||||
return jsonify({"error": f"Failed to send command: {e}"}), 500
|
||||
|
||||
|
||||
@nodes_bp.route("/get_online_bots", methods=['GET'])
|
||||
async def get_online_bots():
|
||||
active_bots = []
|
||||
for client in current_app.active_clients:
|
||||
active_bots.append(client.active_token.to_dict())
|
||||
|
||||
return jsonify(active_bots)
|
||||
@@ -38,7 +38,7 @@ async def create_system_route():
|
||||
|
||||
if created_system:
|
||||
print("Created new system:", created_system)
|
||||
return jsonify(created_system), 201
|
||||
return jsonify(created_system.to_dict()), 201
|
||||
else:
|
||||
abort(500, "Failed to create system in the database.")
|
||||
except HTTPException:
|
||||
|
||||
Reference in New Issue
Block a user