mirror of
https://github.com/JMP-MS/ASPIC.git
synced 2026-10-27 17:17:08 +00:00
79 lines
3.0 KiB
HTML
79 lines
3.0 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>ASPIC — BackOffice — Espaces disque</title>
|
|
<link rel="icon" href="mevelia-icone.png">
|
|
<link rel="stylesheet" href="backoffice.css">
|
|
<style>
|
|
section{background:#111;border:1px solid #262626;border-radius:6px;padding:16px 18px;max-width:820px;}
|
|
.ligne{padding:9px 0;border-bottom:1px solid #1e1e1e;font-size:13px;display:flex;justify-content:space-between;align-items:center;gap:10px;}
|
|
.chemin{font-family:"Courier New",Consolas,monospace;color:#8ab;font-size:12px;}
|
|
.badge{font-size:11px;padding:2px 7px;border-radius:10px;}
|
|
.badge.oui{background:#2a4d2a;color:#bdf7bd;}
|
|
.badge.non{background:#4d3a2a;color:#f7d7bd;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="bo-cadre">
|
|
<div id="bo-corps">
|
|
<nav id="bo-menu"></nav>
|
|
<main id="bo-contenu">
|
|
<h1>Espaces disque</h1>
|
|
<p class="sous-titre">Chaque utilisateur MIRADOR a un dossier privé, jamais atteignable par une URL. Cette page ne sert qu'à vérifier — l'opacité du nom protège d'un visiteur extérieur, jamais de toi.</p>
|
|
<section>
|
|
<div id="listeEspaces">Chargement…</div>
|
|
</section>
|
|
</main>
|
|
</div>
|
|
<footer id="bo-pied"></footer>
|
|
</div>
|
|
<script src="backoffice.js"></script>
|
|
<script>
|
|
initBackoffice({ cibleEchap: 'backoffice.html' });
|
|
|
|
function formaterTaille(octets) {
|
|
if (octets < 1024) return octets + ' o';
|
|
if (octets < 1024*1024) return (octets/1024).toFixed(1) + ' Ko';
|
|
return (octets/1024/1024).toFixed(2) + ' Mo';
|
|
}
|
|
|
|
async function charger() {
|
|
const r = await fetch('espaces.php');
|
|
const data = await r.json();
|
|
const conteneur = document.getElementById('listeEspaces');
|
|
conteneur.innerHTML = '';
|
|
(data.espaces || []).forEach(function (e) {
|
|
const div = document.createElement('div');
|
|
div.className = 'ligne';
|
|
div.innerHTML =
|
|
'<div><strong>' + e.MIR_Email + '</strong> (' + e.MIR_BaseNom + ')<br>' +
|
|
'<span class="chemin">' + e.dossier_relatif + '</span></div>' +
|
|
'<div style="text-align:right;">' +
|
|
'<span class="badge ' + (e.existe ? 'oui' : 'non') + '">' + (e.existe ? 'créé — ' + formaterTaille(e.taille_octets) : 'pas encore créé') + '</span>' +
|
|
'</div>';
|
|
if (!e.existe) {
|
|
const btn = document.createElement('button');
|
|
btn.className = 'principal';
|
|
btn.textContent = 'Provisionner';
|
|
btn.style.marginLeft = '10px';
|
|
btn.addEventListener('click', async function () {
|
|
btn.disabled = true;
|
|
await fetch('espaces.php', {
|
|
method: 'POST', headers: {'Content-Type':'application/json'},
|
|
body: JSON.stringify({ action: 'provisionner', MIR_Email: e.MIR_Email })
|
|
});
|
|
charger();
|
|
});
|
|
div.querySelector('div:last-child').appendChild(btn);
|
|
}
|
|
conteneur.appendChild(div);
|
|
});
|
|
if (!(data.espaces || []).length) conteneur.textContent = 'Aucun utilisateur dans MIRADOR.';
|
|
}
|
|
charger();
|
|
</script>
|
|
</body>
|
|
</html>
|