Files
infoscreen/server/routes/setup.py
2025-10-10 15:20:14 +00:00

22 lines
667 B
Python

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)