ui(qualys/agents): highlight rouge >=90% / orange >=75% sur lignes df dans bloc disque
This commit is contained in:
parent
a877589cf3
commit
71a2927e15
@ -99,8 +99,29 @@
|
||||
<!-- Espace disque -->
|
||||
<div class="card p-4 mb-4">
|
||||
<h3 class="text-sm font-bold text-cyber-accent mb-2">Espace disque</h3>
|
||||
<pre style="background:#0b0f1a;color:#e5e7eb;padding:10px;border-radius:4px;font-size:11px;overflow-x:auto;white-space:pre-wrap">{{ audit.disk_space or '(vide)' }}</pre>
|
||||
<pre id="disk-pre" style="background:#0b0f1a;color:#e5e7eb;padding:10px;border-radius:4px;font-size:11px;overflow-x:auto;white-space:pre-wrap">{{ audit.disk_space or '(vide)' }}</pre>
|
||||
</div>
|
||||
<script>
|
||||
(function(){
|
||||
var pre = document.getElementById('disk-pre');
|
||||
if(!pre) return;
|
||||
var lines = pre.textContent.split('\n');
|
||||
var html = lines.map(function(l){
|
||||
var m = l.match(/\s(\d{2,3})%\s/);
|
||||
if(m){
|
||||
var pct = parseInt(m[1]);
|
||||
var esc = l.replace(/[&<>]/g, function(c){return {'&':'&','<':'<','>':'>'}[c];});
|
||||
if(pct >= 90){
|
||||
return '<span style="color:#ef4444;font-weight:bold">' + esc + '</span>';
|
||||
} else if(pct >= 75){
|
||||
return '<span style="color:#f59e0b">' + esc + '</span>';
|
||||
}
|
||||
}
|
||||
return l.replace(/[&<>]/g, function(c){return {'&':'&','<':'<','>':'>'}[c];});
|
||||
}).join('\n');
|
||||
pre.innerHTML = html;
|
||||
})();
|
||||
</script>
|
||||
|
||||
<!-- Connectivité console Qualys -->
|
||||
<div class="card p-4 mb-4">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user