feat: 7 Vorbereitungs-Module auf 100% — Frontend, Proxy-Routen, Backend-Fixes
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 35s
CI / test-python-backend-compliance (push) Successful in 30s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 19s
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Successful in 35s
CI / test-python-backend-compliance (push) Successful in 30s
CI / test-python-document-crawler (push) Successful in 22s
CI / test-python-dsms-gateway (push) Successful in 19s
Profil: machineBuilder-Felder im POST-Body, PATCH-Handler Scope: API-Route (GET/POST), ScopeDecisionTab Props + Buttons, Export-Druckansicht HTML Anwendung: PUT-Handler, Bearbeiten-Button, Pagination/Search Import: Verlauf laden, DELETE-Route, Offline-Badge, ObjectURL Memory-Leak fix Screening: Security-Backlog Button verdrahtet, Scan-Verlauf Module: Detail-Seite, GET-Proxy, Konfigurieren-Button, Modul-erstellen-Modal, Error-Toast Quellen: 10 Proxy-Routen, Tab-Komponenten umgestellt, Dashboard-Tab, blocked_today Bug fix, Datum-Filter Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -408,6 +408,8 @@ async def list_blocked_content(
|
||||
limit: int = Query(50, ge=1, le=500),
|
||||
offset: int = Query(0, ge=0),
|
||||
domain: Optional[str] = None,
|
||||
date_from: Optional[str] = Query(None, alias="from"),
|
||||
date_to: Optional[str] = Query(None, alias="to"),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""List blocked content entries."""
|
||||
@@ -416,6 +418,20 @@ async def list_blocked_content(
|
||||
if domain:
|
||||
query = query.filter(BlockedContentDB.domain == domain)
|
||||
|
||||
if date_from:
|
||||
try:
|
||||
from_dt = datetime.fromisoformat(date_from)
|
||||
query = query.filter(BlockedContentDB.created_at >= from_dt)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if date_to:
|
||||
try:
|
||||
to_dt = datetime.fromisoformat(date_to)
|
||||
query = query.filter(BlockedContentDB.created_at <= to_dt)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
total = query.count()
|
||||
entries = query.order_by(BlockedContentDB.created_at.desc()).offset(offset).limit(limit).all()
|
||||
|
||||
@@ -445,6 +461,8 @@ async def get_policy_audit(
|
||||
limit: int = Query(50, ge=1, le=500),
|
||||
offset: int = Query(0, ge=0),
|
||||
entity_type: Optional[str] = None,
|
||||
date_from: Optional[str] = Query(None, alias="from"),
|
||||
date_to: Optional[str] = Query(None, alias="to"),
|
||||
db: Session = Depends(get_db),
|
||||
):
|
||||
"""Get the audit trail for source policy changes."""
|
||||
@@ -452,6 +470,20 @@ async def get_policy_audit(
|
||||
if entity_type:
|
||||
query = query.filter(SourcePolicyAuditDB.entity_type == entity_type)
|
||||
|
||||
if date_from:
|
||||
try:
|
||||
from_dt = datetime.fromisoformat(date_from)
|
||||
query = query.filter(SourcePolicyAuditDB.created_at >= from_dt)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
if date_to:
|
||||
try:
|
||||
to_dt = datetime.fromisoformat(date_to)
|
||||
query = query.filter(SourcePolicyAuditDB.created_at <= to_dt)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
total = query.count()
|
||||
entries = query.order_by(SourcePolicyAuditDB.created_at.desc()).offset(offset).limit(limit).all()
|
||||
|
||||
@@ -486,16 +518,13 @@ async def get_policy_stats(db: Session = Depends(get_db)):
|
||||
active_sources = db.query(AllowedSourceDB).filter(AllowedSourceDB.active == True).count()
|
||||
pii_rules = db.query(PIIRuleDB).filter(PIIRuleDB.active == True).count()
|
||||
|
||||
# Count audit entries from today
|
||||
# Count blocked content entries from today
|
||||
today_start = datetime.utcnow().replace(hour=0, minute=0, second=0, microsecond=0)
|
||||
blocked_today = db.query(SourcePolicyAuditDB).filter(
|
||||
SourcePolicyAuditDB.action == "delete",
|
||||
SourcePolicyAuditDB.created_at >= today_start,
|
||||
blocked_today = db.query(BlockedContentDB).filter(
|
||||
BlockedContentDB.created_at >= today_start,
|
||||
).count()
|
||||
|
||||
blocked_total = db.query(SourcePolicyAuditDB).filter(
|
||||
SourcePolicyAuditDB.action == "delete",
|
||||
).count()
|
||||
blocked_total = db.query(BlockedContentDB).count()
|
||||
|
||||
return {
|
||||
"active_policies": active_sources,
|
||||
|
||||
Reference in New Issue
Block a user