feat(patching/import): retire colonnes Coupure/Pb disque/Lien serveur/Mode op de l affichage, link sur Asset, raccourci OS version (RedHat 8, Win 2022, ...)
This commit is contained in:
parent
630297f98e
commit
f70f5c3704
@ -146,16 +146,12 @@
|
||||
<th class="text-left p-1">Valideur RA</th>
|
||||
<th class="text-left p-1">Resp. Domaine DTS</th>
|
||||
<th class="text-left p-1">Référent tech.</th>
|
||||
<th class="text-left p-1">Mode op.</th>
|
||||
<th class="text-left p-1">Impacts</th>
|
||||
<th class="text-left p-1">BDD</th>
|
||||
<th class="text-left p-1 cursor-pointer select-none hover:text-cyber-accent" id="th-date" title="Cliquer pour trier par date+heure">
|
||||
Date <span id="th-date-arrow" class="text-[10px] opacity-50">↕</span>
|
||||
</th>
|
||||
<th class="text-left p-1">Heure</th>
|
||||
<th class="text-left p-1">Coupure</th>
|
||||
<th class="text-left p-1">Pb disque</th>
|
||||
<th class="text-left p-1">Lien serveur</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="sheet-table-body"></tbody>
|
||||
@ -196,6 +192,27 @@
|
||||
return String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
|
||||
}
|
||||
|
||||
function shortOSVersion(v){
|
||||
if (!v) return '';
|
||||
const s = String(v);
|
||||
let m = s.match(/red\s*hat[^0-9]+(\d+)/i);
|
||||
if (m) return 'RedHat ' + m[1];
|
||||
m = s.match(/centos[^0-9]+(\d+)/i);
|
||||
if (m) return 'CentOS ' + m[1];
|
||||
m = s.match(/oracle\s*linux[^0-9]+(\d+)/i);
|
||||
if (m) return 'Oracle ' + m[1];
|
||||
m = s.match(/ubuntu[^0-9]+(\d+(?:\.\d+)?)/i);
|
||||
if (m) return 'Ubuntu ' + m[1];
|
||||
m = s.match(/debian[^0-9]+(\d+)/i);
|
||||
if (m) return 'Debian ' + m[1];
|
||||
m = s.match(/windows\s*server\s*(\d{4})/i);
|
||||
if (m) return 'Win ' + m[1];
|
||||
m = s.match(/windows\s*(\d+)/i);
|
||||
if (m) return 'Win ' + m[1];
|
||||
// Fallback : 30 premiers chars
|
||||
return s.length > 30 ? s.slice(0, 30) + '…' : s;
|
||||
}
|
||||
|
||||
function refreshSelection(){
|
||||
const visible = tbody.querySelectorAll('tr:not(.row-hidden)');
|
||||
const visibleCb = tbody.querySelectorAll('tr:not(.row-hidden) input.row-cb');
|
||||
@ -289,33 +306,29 @@
|
||||
});
|
||||
}
|
||||
tbody.innerHTML = rows.map(r => {
|
||||
const linkSrv = r.server_id
|
||||
? '<a href="/qualys/search?field=hostname&q=' + encodeURIComponent(r.resolved_hostname || r.asset_name) + '" class="text-cyber-blue hover:underline">' + escapeHTML(r.resolved_hostname || r.asset_name) + '</a>'
|
||||
const display = escapeHTML(r.resolved_hostname || r.asset_name || '');
|
||||
const assetCell = r.server_id
|
||||
? '<a href="/qualys/search?field=hostname&q=' + encodeURIComponent(r.resolved_hostname || r.asset_name) + '" class="text-cyber-blue hover:underline">' + display + '</a>'
|
||||
: '<span class="text-cyber-yellow" title="Pas matché en base PatchCenter">' + escapeHTML(r.asset_name || '') + ' ⚠</span>';
|
||||
const pb = r.pb_espace_disque === true ? '<span class="text-cyber-red">⚠ Oui</span>' : (r.pb_espace_disque === false ? 'Non' : '');
|
||||
return '<tr class="border-b border-cyber-border/20 hover:bg-cyber-border/10"'
|
||||
+ ' data-asset="' + escapeHTML(r.asset_name||'') + '"'
|
||||
+ ' data-intervenant="' + escapeHTML(r.intervenant||'') + '"'
|
||||
+ ' data-env="' + escapeHTML(r.environnement||'') + '">'
|
||||
+ '<td class="p-1"><input type="checkbox" class="row-cb" data-id="' + r.id + '" data-asset="' + escapeHTML(r.asset_name||'') + '" data-server-id="' + (r.server_id||'') + '"></td>'
|
||||
+ '<td class="p-1 font-mono">' + escapeHTML(r.asset_name||'') + '</td>'
|
||||
+ '<td class="p-1 font-mono">' + assetCell + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.environnement||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.domaine||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.os||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.os_version||'') + '</td>'
|
||||
+ '<td class="p-1" title="' + escapeHTML(r.os_version||'') + '">' + escapeHTML(shortOSVersion(r.os_version)) + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.application_name||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.intervenant||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.valideur_ra||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.responsable_domaine_dts||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.referent_technique||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.mode_operatoire||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.impacts||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.base_de_donnees||'') + '</td>'
|
||||
+ '<td class="p-1">' + (r.jour ? escapeHTML(r.jour) : (r.jour_text ? '<span class="text-cyber-yellow" title="Texte libre">' + escapeHTML(r.jour_text) + '</span>' : '')) + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.heure||'') + '</td>'
|
||||
+ '<td class="p-1">' + escapeHTML(r.duree_coupure||'') + '</td>'
|
||||
+ '<td class="p-1">' + pb + '</td>'
|
||||
+ '<td class="p-1">' + linkSrv + '</td>'
|
||||
+ '</tr>';
|
||||
}).join('');
|
||||
tbody.querySelectorAll('input.row-cb').forEach(cb => cb.addEventListener('change', refreshSelection));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user