Aligne la colonne servers.etat sur les valeurs iTop exactes au lieu des codes lowercase internes. Impact: - servers.etat stocke: Production, Implémentation, Stock, Obsolète, EOL, prêt, tests, Nouveau, A récupérer, Cassé, Cédé, En panne, Perdu, Recyclé, Occasion, A détruire, Volé - Remplace tous les 'production'/'obsolete'/'stock'/'eol'/'implementation' en WHERE/comparisons par les labels iTop verbatim (~10 fichiers) - Templates badges/filtres: valeurs + labels iTop - itop_service: maintient mapping iTop API internal code <-> DB label - import_sanef_*: norm_etat retourne la valeur iTop verbatim ou None (plus de fallback silencieux sur 'production') Ajoute: - tools/import_etat_itop.py : migration lowercase -> iTop + re-import CSV - tools/import_environnement.py : fix dry-run pour ADD COLUMN idempotent Supprime: - tools/fix_etat_extend.py (obsolete par import_etat_itop.py)
112 lines
6.1 KiB
HTML
112 lines
6.1 KiB
HTML
<div class="p-4">
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 class="text-lg font-bold text-cyber-accent">Editer {{ s.hostname }}</h3>
|
|
<button onclick="closePanel()" class="text-gray-500 hover:text-white text-xl">×</button>
|
|
</div>
|
|
|
|
<form hx-put="/servers/{{ s.id }}" hx-target="#detail-panel" hx-swap="innerHTML" class="space-y-3">
|
|
|
|
<!-- IPs + mode connexion -->
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<div>
|
|
<label class="text-xs text-gray-500">IP reelle</label>
|
|
<input type="text" name="ip_reelle" value="{{ ips.ip_reelle or '' }}" placeholder="ex: 10.1.2.30" class="w-full font-mono">
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">IP de connexion</label>
|
|
<input type="text" name="ip_connexion" value="{{ ips.ip_connexion or '' }}" placeholder="ex: 10.1.2.30" class="w-full font-mono">
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Mode de connexion</label>
|
|
<select name="ssh_method" class="w-full">
|
|
{% for m in ['ssh_key','ssh_pwd','ssh_psmp','rdp_psm','rdp_pwd'] %}<option value="{{ m }}" {% if m == s.ssh_method %}selected{% endif %}>{{ m }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="text-xs text-gray-500">Domaine</label>
|
|
<select name="domain_code" class="w-full">
|
|
{% for d in domains %}<option value="{{ d.code }}" {% if d.name == s.domaine %}selected{% endif %}>{{ d.name }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Environnement</label>
|
|
<select name="env_code" class="w-full">
|
|
{% for e in envs %}<option value="{{ e.code }}" {% if e.name == s.environnement %}selected{% endif %}>{{ e.name }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Domaine DNS (domain_ltd)</label>
|
|
<select name="domain_ltd" class="w-full">
|
|
<option value="">-- Aucun --</option>
|
|
{% for d in dns_list %}<option value="{{ d }}" {% if d == s.domain_ltd %}selected{% endif %}>{{ d }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Zone</label>
|
|
<select name="zone" class="w-full">
|
|
{% for z in zones_list %}<option value="{{ z }}" {% if z == s.zone %}selected{% endif %}>{{ z }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Tier</label>
|
|
<select name="tier" class="w-full">
|
|
{% for t in ['tier0','tier1','tier2','tier3'] %}<option value="{{ t }}" {% if t == s.tier %}selected{% endif %}>{{ t }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Etat</label>
|
|
<select name="etat" class="w-full">
|
|
{% for e in ['Production','Implémentation','Stock','Obsolète','EOL','prêt','tests','Nouveau','En panne','Cassé','Cédé','A récupérer','Perdu','Recyclé','Occasion','A détruire','Volé'] %}<option value="{{ e }}" {% if e == s.etat %}selected{% endif %}>{{ e }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Owner OS</label>
|
|
<select name="patch_os_owner" class="w-full">
|
|
{% for o in ['secops','ipop','editeur','tiers','na','a_definir'] %}<option value="{{ o }}" {% if o == s.patch_os_owner %}selected{% endif %}>{{ o }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Solution applicative (iTop) <span class="text-gray-600">— modifie aussi iTop</span></label>
|
|
<select name="application_id" class="w-full">
|
|
<option value="">-- Aucune --</option>
|
|
{% for a in applications %}<option value="{{ a.id }}" {% if a.id == s.application_id %}selected{% endif %}>{{ a.nom_court }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Responsable</label>
|
|
<input type="text" name="responsable_nom" value="{{ s.responsable_nom or '' }}" class="w-full">
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Referent technique</label>
|
|
<input type="text" name="referent_nom" value="{{ s.referent_nom or '' }}" class="w-full">
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<div>
|
|
<label class="text-xs text-gray-500">Jour préféré patching</label>
|
|
<select name="pref_patch_jour" class="w-full">
|
|
{% for j in ['indifferent','lundi','mardi','mercredi','jeudi'] %}<option value="{{ j }}" {% if j == s.pref_patch_jour %}selected{% endif %}>{{ j }}</option>{% endfor %}
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Heure préférée</label>
|
|
<input type="text" name="pref_patch_heure" value="{{ s.pref_patch_heure or '' }}" placeholder="ex: 14h00, tôt le matin" class="w-full">
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Mode opératoire</label>
|
|
<textarea name="mode_operatoire" rows="3" class="w-full">{{ s.mode_operatoire or '' }}</textarea>
|
|
</div>
|
|
<div>
|
|
<label class="text-xs text-gray-500">Commentaire</label>
|
|
<textarea name="commentaire" rows="2" class="w-full">{{ s.commentaire or '' }}</textarea>
|
|
</div>
|
|
|
|
<div class="flex gap-2 pt-2">
|
|
<button type="submit" class="btn-primary px-4 py-2 text-sm flex-1">Sauvegarder</button>
|
|
<button type="button" class="btn-sm bg-cyber-border text-gray-300 px-4 py-2" hx-get="/servers/{{ s.id }}/detail" hx-target="#detail-panel" hx-swap="innerHTML">Annuler</button>
|
|
</div>
|
|
</form>
|
|
</div>
|