Add /qualys/tagsv3/catalog: page de reference nom/type/QQL/couleur par categorie
- Template catalog.html affiche les 6 categories + prefixes - Tags avec QQL en font mono user-select:all pour copy-paste facile - Export JSON dispo via /qualys/tagsv3/catalog.json - Navigation croisee entre Vue/Catalog/Gap
This commit is contained in:
parent
ec7712f0c9
commit
d508072969
@ -97,7 +97,23 @@ def tags_create_all_static(request: Request, db=Depends(get_db)):
|
||||
)
|
||||
|
||||
|
||||
@router.get("/qualys/tagsv3/catalog", response_class=JSONResponse)
|
||||
@router.get("/qualys/tagsv3/catalog", response_class=HTMLResponse)
|
||||
def tags_catalog_page(request: Request, db=Depends(get_db)):
|
||||
"""Page de reference : nom tag / QQL / couleur pour toute la nomenclature V3."""
|
||||
user = get_current_user(request)
|
||||
if not user:
|
||||
return RedirectResponse(url="/login")
|
||||
perms = get_user_perms(db, user)
|
||||
if not can_view(perms, "qualys"):
|
||||
return RedirectResponse(url="/dashboard")
|
||||
catalog = load_catalog() or {}
|
||||
return templates.TemplateResponse("qualys_tagsv3_catalog.html", {
|
||||
"request": request, "user": user, "app_name": APP_NAME,
|
||||
"catalog": catalog,
|
||||
})
|
||||
|
||||
|
||||
@router.get("/qualys/tagsv3/catalog.json", response_class=JSONResponse)
|
||||
def tags_catalog_json(request: Request, db=Depends(get_db)):
|
||||
user = get_current_user(request)
|
||||
if not user:
|
||||
|
||||
@ -4,8 +4,9 @@
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h2 class="text-xl font-bold text-cyber-accent">Qualys Tags V3 — Vue actuelle</h2>
|
||||
<div class="flex gap-2">
|
||||
<a href="/qualys/tagsv3/gap" class="btn-sm bg-cyber-accent text-black">Analyse gap vs nomenclature V3</a>
|
||||
<a href="/qualys/tags" class="btn-sm bg-cyber-border text-cyber-accent">Tags (vue legacy)</a>
|
||||
<a href="/qualys/tagsv3/catalog" class="btn-sm bg-cyber-green text-black">Catalogue V3</a>
|
||||
<a href="/qualys/tagsv3/gap" class="btn-sm bg-cyber-accent text-black">Analyse gap vs V3</a>
|
||||
<a href="/qualys/tags" class="btn-sm bg-cyber-border text-cyber-accent">Tags (legacy)</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
63
app/templates/qualys_tagsv3_catalog.html
Normal file
63
app/templates/qualys_tagsv3_catalog.html
Normal file
@ -0,0 +1,63 @@
|
||||
{% extends 'base.html' %}
|
||||
{% block title %}Tags V3 - Catalogue{% endblock %}
|
||||
{% block content %}
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h2 class="text-xl font-bold text-cyber-accent">Catalogue nomenclature Qualys V3</h2>
|
||||
<div class="flex gap-2">
|
||||
<a href="/qualys/tagsv3" class="btn-sm bg-cyber-border text-cyber-accent">Vue Qualys</a>
|
||||
<a href="/qualys/tagsv3/gap" class="btn-sm bg-cyber-accent text-black">Gap vs V3</a>
|
||||
<a href="/qualys/tagsv3/catalog.json" class="btn-sm bg-cyber-green text-black">Export JSON</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card p-3 mb-4">
|
||||
<p class="text-sm text-gray-400">Référence complète des tags Qualys SANEF V3 : nom, type, règle QQL, couleur. Les tags <span class="badge badge-blue">DYN</span> se créent dans la console Qualys (API non supportée). Les <span class="badge badge-yellow">STAT</span> se créent via la page Gap.</p>
|
||||
</div>
|
||||
|
||||
{% for cat_code, cat in catalog.categories.items() %}
|
||||
<div class="card p-4 mb-4">
|
||||
<h3 class="text-lg font-bold text-cyber-accent mb-2">{{ cat_code }}</h3>
|
||||
<p class="text-xs text-gray-400 mb-3">{{ cat.description }}</p>
|
||||
|
||||
{% if cat.tags %}
|
||||
<table class="w-full table-cyber">
|
||||
<thead><tr>
|
||||
<th class="p-2" style="width:30px"></th>
|
||||
<th class="p-2 text-left">Tag</th>
|
||||
<th class="p-2">Type</th>
|
||||
<th class="p-2">Auto</th>
|
||||
<th class="p-2 text-left">QQL / Description</th>
|
||||
<th class="p-2">Couleur</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
{% for t in cat.tags %}
|
||||
<tr>
|
||||
<td class="p-2 text-center"><span style="display:inline-block;width:16px;height:16px;background:{{ t.color }};border-radius:3px"></span></td>
|
||||
<td class="p-2 font-mono text-sm" style="color:{{ t.color }};font-weight:bold">{{ t.name }}</td>
|
||||
<td class="p-2 text-center"><span class="badge {% if t.type == 'DYN' %}badge-blue{% else %}badge-yellow{% endif %}">{{ t.type }}</span></td>
|
||||
<td class="p-2 text-center">{% if t.auto %}<span class="text-cyber-green">✓</span>{% else %}<span class="text-cyber-red">✗</span>{% endif %}</td>
|
||||
<td class="p-2 font-mono text-xs text-cyber-accent" style="user-select:all">{{ t.qql or t.description or '-' }}</td>
|
||||
<td class="p-2 text-center"><span class="text-xs text-gray-400 font-mono">{{ t.color }}</span></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% if cat.prefixes %}
|
||||
<table class="w-full table-cyber">
|
||||
<thead><tr><th class="p-2 text-left">Préfixe</th><th class="p-2 text-left">Description</th></tr></thead>
|
||||
<tbody>
|
||||
{% for p in cat.prefixes %}
|
||||
<tr>
|
||||
<td class="p-2 font-mono text-cyber-accent">{{ p.prefix }}xxx</td>
|
||||
<td class="p-2 text-xs">{{ p.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
@ -3,8 +3,11 @@
|
||||
{% block content %}
|
||||
<div class="flex justify-between items-center mb-4">
|
||||
<h2 class="text-xl font-bold text-cyber-accent">Gap nomenclature V3 ↔ Qualys</h2>
|
||||
<div class="flex gap-2">
|
||||
<a href="/qualys/tagsv3/catalog" class="btn-sm bg-cyber-green text-black">Catalogue V3</a>
|
||||
<a href="/qualys/tagsv3" class="btn-sm bg-cyber-border text-cyber-accent">← Vue Qualys</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if not gap.ok %}
|
||||
<div class="card p-4 border border-red-700 text-red-400">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user