Integra la spec di Simon per la pagina Rischi con le correzioni normative (parere nis2-expert + iso-27001-expert) applicate come eccezioni motivate: - 12 colonne: Codice (link → Misure e Requisiti), Descrizione (RISCHIO DEFAULT = cfg_nis2_rischi.risk_descr), VALUTAZIONE RISCHIO INERENTE (P/I/PxI), Alert, Rischio Inerente, VALUTAZIONE RISCHIO RESIDUO (P/I/PxI), Esito residuo, Rischio Residuo. - Editing INLINE di Probabilità/Impatto (1-5), salvataggio automatico. - Alert a bande (15-25 Prioritaria / 9-14 Critica / 3-8 Necessaria / 1-2 Suggerita) → popup azioni + "crea azione" (tabella requisito_actions, seme Modulo Azioni). - Eccezione #1: il rischio RESIDUO NON aggiorna in automatico lo STATO DI CONFORMITÀ del requisito (piani distinti). Col.11 "Esito residuo" = flag Rivalutare/Adeguato; conformità esplicita. - Eccezione #3: banda 13-14 inclusa in "Critica" (9-14). "Danno €" → "Impatto" (1-5). Soglie = metodo interno (ISO 27001 §6.1.2), non obbligo (help/UI lo dichiarano). Backend: mig 067; derivedList (+risk_descr +residuo), setState (+residuo), requisitoActions list/create. help.js + i18n IT/EN. Cache-buster api/i18n/help 20260730a. Prossima mig=068. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
139 lines
6.8 KiB
HTML
139 lines
6.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
<title>Accedi - NIS2 Agile</title>
|
|
<!-- PILOTA Bootstrap Italia v2.18.1 (Opzione B). Self-hostato: asset serviti da /vendor (regola 'MAI CDN'). -->
|
|
<link rel="stylesheet" href="vendor/bootstrap-italia/dist/css/bootstrap-italia.min.css">
|
|
<style>
|
|
/* solo layout di centratura: i colori/font/forme vengono da Bootstrap Italia */
|
|
body { min-height: 100vh; display: flex; align-items: center; background: #f5f6f7; }
|
|
.auth-wrap { width: 100%; max-width: 460px; margin: 0 auto; padding: 24px; }
|
|
.auth-brand { text-align: center; margin-bottom: 24px; }
|
|
.auth-brand .brand-name { font-weight: 700; font-size: 1.5rem; color: #06c; }
|
|
.auth-brand .brand-name span { color: #17324d; }
|
|
.auth-brand .brand-sub { color: #5a6772; font-size: .9rem; margin-top: 4px; }
|
|
.pw-wrap { position: relative; }
|
|
.pw-wrap .form-control { padding-right: 44px; }
|
|
.pw-toggle { position: absolute; right: 8px; top: 8px; background: none; border: none;
|
|
color: #5a6772; cursor: pointer; padding: 6px; }
|
|
</style>
|
|
<!-- PWA:start -->
|
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
<meta name="theme-color" content="#0066CC">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/assets/icons/favicon-32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/assets/icons/favicon-16.png">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/assets/icons/apple-touch-icon.png">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
|
<meta name="apple-mobile-web-app-title" content="NIS2 Agile">
|
|
<meta name="application-name" content="NIS2 Agile">
|
|
<script src="/js/pwa.js?v=20260614" defer></script>
|
|
<!-- PWA:end -->
|
|
</head>
|
|
<body>
|
|
<main class="auth-wrap">
|
|
<div class="auth-brand">
|
|
<div class="brand-name">NIS2 <span>Agile</span></div>
|
|
<div class="brand-sub">Piattaforma di compliance NIS2</div>
|
|
</div>
|
|
|
|
<div class="card card-bg has-bkg-grey shadow">
|
|
<div class="card-body">
|
|
<h1 class="h4 mb-3">Accedi</h1>
|
|
|
|
<div class="alert alert-danger d-none" id="login-error" role="alert"></div>
|
|
|
|
<form id="login-form" novalidate>
|
|
<div class="form-group">
|
|
<label for="email" class="active">Indirizzo Email</label>
|
|
<input type="email" id="email" name="email" class="form-control"
|
|
autocomplete="email" required aria-describedby="login-error">
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="password" class="active">Password</label>
|
|
<div class="pw-wrap">
|
|
<input type="password" id="password" name="password" class="form-control"
|
|
autocomplete="current-password" required>
|
|
<button type="button" class="pw-toggle" id="pw-toggle" tabindex="-1"
|
|
aria-label="Mostra o nascondi la password"
|
|
onclick="(function(){var i=document.getElementById('password');i.type=(i.type==='password')?'text':'password';})()">
|
|
<svg class="icon icon-sm" aria-hidden="true"><use href="vendor/bootstrap-italia/dist/svg/sprites.svg#it-password-visible"></use></svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="submit" class="btn btn-primary w-100 mt-2" id="login-btn">Accedi</button>
|
|
|
|
<p class="text-center mt-3 mb-0">
|
|
<a href="forgot-password.html">Password dimenticata?</a>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<p class="text-center mt-3 small">
|
|
Non hai un account? <a href="register.html">Registrati</a>
|
|
</p>
|
|
<p class="text-center small text-muted">
|
|
Accedendo accetti i
|
|
<a href="https://agentai.agile.software/terms" target="_blank" rel="noopener">Termini di Servizio</a>
|
|
e la <a href="https://agentai.agile.software/privacy" target="_blank" rel="noopener">Privacy Policy</a>.
|
|
</p>
|
|
</main>
|
|
|
|
<script src="vendor/bootstrap-italia/dist/js/bootstrap-italia.bundle.min.js"></script>
|
|
<script>
|
|
// Carica i web font ufficiali (Titillium Web, ecc.) — richiesto da Bootstrap Italia
|
|
if (window.bootstrap && bootstrap.loadFonts) {
|
|
bootstrap.loadFonts('vendor/bootstrap-italia/dist/fonts');
|
|
}
|
|
</script>
|
|
|
|
<!-- Stessa logica della login attuale: ZERO modifiche backend -->
|
|
<script src="js/api.js?v=20260730a"></script>
|
|
<script src="js/common.js?v=20260729b"></script>
|
|
<script>
|
|
if (api.isAuthenticated()) { window.location.href = 'dashboard.html'; }
|
|
|
|
const form = document.getElementById('login-form');
|
|
const errorEl = document.getElementById('login-error');
|
|
const loginBtn = document.getElementById('login-btn');
|
|
|
|
function showError(msg) { errorEl.textContent = msg; errorEl.classList.remove('d-none'); }
|
|
function hideError() { errorEl.classList.add('d-none'); }
|
|
|
|
form.addEventListener('submit', async (e) => {
|
|
e.preventDefault();
|
|
hideError();
|
|
const email = document.getElementById('email').value.trim();
|
|
const password = document.getElementById('password').value;
|
|
if (!email || !password) { showError('Inserisci email e password.'); return; }
|
|
|
|
loginBtn.disabled = true;
|
|
loginBtn.textContent = 'Accesso in corso...';
|
|
try {
|
|
const result = await api.login(email, password);
|
|
if (result.success) {
|
|
const isConsultant = result.data.user && result.data.user.role === 'consultant';
|
|
const hasOrgs = result.data.organizations && result.data.organizations.length > 0;
|
|
if (!hasOrgs) window.location.href = 'onboarding.html';
|
|
else if (isConsultant) window.location.href = 'companies.html';
|
|
else window.location.href = 'dashboard.html';
|
|
} else {
|
|
showError(result.message || 'Credenziali non valide.');
|
|
}
|
|
} catch (err) {
|
|
showError('Errore di connessione al server.');
|
|
} finally {
|
|
loginBtn.disabled = false;
|
|
loginBtn.textContent = 'Accedi';
|
|
}
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|