Automatic detect of clients

This commit is contained in:
2025-07-17 06:31:50 +00:00
parent 1a6faaa104
commit 4e525e4bae
10 changed files with 367 additions and 36 deletions

21
server/routes/setup.py Normal file
View File

@@ -0,0 +1,21 @@
from flask import Blueprint, jsonify
from server.database import get_db
from models.models import Client
bp = Blueprint('setup', __name__, url_prefix='/api/setup')
@bp.route('/clients_without_description', methods=['GET'])
def clients_without_description():
db = get_db()
clients = db.query(Client).filter(Client.description == None).all()
result = []
for c in clients:
result.append({
'uuid': c.uuid,
'hostname': c.hostname,
'ip_address': c.ip_address,
'last_alive': c.last_alive,
'created_at': c.created_at,
'group': c.group_id,
})
return jsonify(result)