patchcenter/app/templates/partials/campaign_preview.html
Khalid MOUTAOUAKIL 8277653c43 PatchCenter v2.0 — Initial commit
Modules: Dashboard, Serveurs, Campagnes, Planning, Specifiques, Settings, Users
Stack: FastAPI + Jinja2 + HTMX + Alpine.js + TailwindCSS + PostgreSQL
Features: Qualys sync, prereqs auto, planning annuel, server specifics, role-based access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 03:00:12 +02:00

50 lines
3.0 KiB
HTML

<div class="mt-4">
<div class="flex justify-between items-center mb-3">
<div>
<span class="text-sm font-bold text-cyber-accent">{{ count }} serveurs proposes</span>
<span class="text-xs text-gray-500 ml-2">Scope: {{ scope }}</span>
</div>
</div>
<form method="POST" action="/campaigns/create" class="space-y-3">
<input type="hidden" name="year" value="{{ year }}">
<input type="hidden" name="week_number" value="{{ week }}">
<div>
<label class="text-xs text-gray-500">Label campagne</label>
<input type="text" name="label" value="Patch S{{ '%02d' % week }} {{ year }} — {{ scope }}" class="w-full">
</div>
<div class="overflow-x-auto" style="max-height:400px; overflow-y:auto">
<table class="w-full table-cyber text-xs">
<thead><tr>
<th class="p-1 w-8"><input type="checkbox" checked onclick="this.closest('table').querySelectorAll('input[type=checkbox]').forEach(c => c.checked = this.checked)"></th>
<th class="text-left p-1">Hostname</th>
<th class="p-1">Domaine</th>
<th class="p-1">Env</th>
<th class="p-1">OS</th>
<th class="p-1">Tier</th>
<th class="p-1">Connexion</th>
<th class="p-1">Licence</th>
</tr></thead>
<tbody>
{% for s in servers %}
<tr class="{% if s.licence_support == 'eol' %}bg-red-900/10{% elif s.licence_support == 'els' %}bg-yellow-900/10{% endif %}">
<td class="p-1 text-center"><input type="checkbox" name="include_{{ s.id }}" checked></td>
<td class="p-1 font-mono text-cyber-accent">{{ s.hostname }}</td>
<td class="p-1 text-center">{{ s.domaine or '-' }}</td>
<td class="p-1 text-center"><span class="badge {% if s.environnement == 'Production' %}badge-green{% else %}badge-yellow{% endif %}">{{ (s.environnement or '-')[:6] }}</span></td>
<td class="p-1 text-center">{{ s.os_family or '-' }}</td>
<td class="p-1 text-center"><span class="badge {% if s.tier == 'tier0' %}badge-red{% elif s.tier == 'tier1' %}badge-yellow{% else %}badge-blue{% endif %}">{{ s.tier }}</span></td>
<td class="p-1 text-center">{{ s.ssh_method or '-' }}</td>
<td class="p-1 text-center"><span class="badge {% if s.licence_support == 'active' %}badge-green{% elif s.licence_support == 'eol' %}badge-red{% else %}badge-yellow{% endif %}">{{ s.licence_support }}</span></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<p class="text-xs text-gray-600">Decochez les serveurs a exclure. Vous pourrez aussi exclure/reporter individuellement apres creation.</p>
<button type="submit" class="btn-primary px-6 py-2 text-sm">Creer la campagne ({{ count }} serveurs)</button>
</form>
</div>