mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-10-27 23:28:03 +09:00
Comments, docstrings and a few strings cited plan numbers ("plan 29
#9", "plan 86 §B2") from a git-ignored folder, so they pointed at
nothing; one reached users in a bottleneck hint. Code and frontend
strings are unchanged apart from those citations (checked by AST and
token comparison). A vhost still carrying the old asset comment reads
as undrifted, and a guard test keeps new citations out.
33 lines
1.0 KiB
Python
33 lines
1.0 KiB
Python
# Bucket: PER-APP read. The single-app status read gates on app
|
|
# visibility via require_app_member (viewer+); the all-apps roll-up is a
|
|
# panel-wide authed read.
|
|
"""REST surface for the centralized container status aggregator.
|
|
|
|
Mounted at /api/v1/status (registered in app/__init__.py).
|
|
"""
|
|
|
|
from flask import Blueprint, jsonify
|
|
from flask_jwt_extended import jwt_required
|
|
|
|
from app.middleware.rbac import require_app_member
|
|
from app.services import container_status_service as css
|
|
|
|
container_status_bp = Blueprint('container_status', __name__)
|
|
|
|
|
|
@container_status_bp.route('/app/<int:app_id>', methods=['GET'])
|
|
@require_app_member()
|
|
def app_status(app_id):
|
|
"""Aggregated container status for a single application."""
|
|
return jsonify(css.get_app_status(app_id))
|
|
|
|
|
|
@container_status_bp.route('/apps', methods=['GET'])
|
|
@jwt_required()
|
|
def apps_status():
|
|
"""Lightweight aggregated status for every application.
|
|
|
|
Returns {'statuses': [{app_id, status, total, healthy}, ...]}.
|
|
"""
|
|
return jsonify({'statuses': css.list_app_statuses()})
|