Completata la rifinitura help: i 4 moduli che avevano contenuto (commit c1d3328)
ma non il pulsante '?' ora chiamano HelpSystem.init().
- whistleblowing/normative: aggiunto HelpSystem.init() (help.js gia' incluso).
- companies: aggiunti include i18n.js + help.js + HelpSystem.init().
- kb: aggiunto include help.js + HelpSystem.init().
Ora ogni modulo della piattaforma ha aiuto contestuale. version 1.11.0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
147 lines
8.1 KiB
HTML
147 lines
8.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Knowledge Base - NIS2 Agile</title>
|
|
<link rel="stylesheet" href="css/style.css">
|
|
<style>
|
|
.kb-scope-radios { display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; }
|
|
.kb-scope-radios label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
|
|
.kb-share-block { margin-top: 12px; }
|
|
.kb-doc-list { margin-top: 24px; }
|
|
.kb-doc-row { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; }
|
|
.kb-scope-badge { font-size: .72rem; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
|
|
.kb-scope-badge.SYSTEM { background: #DBEAFE; color: #1E40AF; }
|
|
.kb-scope-badge.FIRM { background: #FEF3C7; color: #92400E; }
|
|
.kb-scope-badge.ORG { background: #DCFCE7; color: #166534; }
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="app-layout">
|
|
<aside class="sidebar" id="sidebar"></aside>
|
|
|
|
<main class="main-content">
|
|
<header class="content-header">
|
|
<h2>Knowledge Base</h2>
|
|
<div class="content-header-actions">
|
|
<button class="btn btn-primary" id="btn-kb-upload">
|
|
<svg viewBox="0 0 20 20" fill="currentColor" style="width:18px;height:18px;vertical-align:middle;"><path d="M5.5 13a3.5 3.5 0 01-.369-6.98 4 4 0 117.753-1.977A4.5 4.5 0 1113.5 13H11V9.413l1.293 1.293a1 1 0 001.414-1.414l-3-3a1 1 0 00-1.414 0l-3 3a1 1 0 001.414 1.414L9 9.414V13H5.5z"/><path d="M9 13h2v5a1 1 0 11-2 0v-5z"/></svg>
|
|
Carica documento
|
|
</button>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="content-body">
|
|
<p class="text-muted" style="margin-top:0;">
|
|
Carica documenti (procedure, policy, normative, training material) che l'AI usera' per
|
|
rispondere alle domande con citazioni precise. La visibilita' segue il modello a 3 livelli:
|
|
<strong>SYSTEM</strong> (vendor), <strong>FIRM</strong> (studio + condivisioni esplicite),
|
|
<strong>ORG</strong> (singola organizzazione cliente).
|
|
</p>
|
|
|
|
<!-- Form upload (hidden by default) -->
|
|
<div class="card" id="kb-form-card" style="display:none;margin-top:16px;">
|
|
<div class="card-body">
|
|
<div class="form-grid" style="display:grid;grid-template-columns:1fr 1fr;gap:12px;">
|
|
<div class="form-group">
|
|
<label for="kb-title">Titolo</label>
|
|
<input type="text" id="kb-title" class="form-control" placeholder="Es: Procedura interna gestione incidenti NIS2">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="kb-entity-type">Tipo</label>
|
|
<select id="kb-entity-type" class="form-control">
|
|
<option value="custom">Procedura interna</option>
|
|
<option value="platform_guide">Linea guida</option>
|
|
<option value="csrd">Normativa</option>
|
|
<option value="training">Training</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group" style="margin-top:12px;">
|
|
<label for="kb-text">Contenuto (testo libero, 50–50.000 caratteri)</label>
|
|
<textarea id="kb-text" rows="8" class="form-control"
|
|
placeholder="Incolla qui il testo della procedura, della checklist o del template..."></textarea>
|
|
</div>
|
|
|
|
<div style="margin-top:12px;border-top:1px solid var(--gray-100);padding-top:12px;">
|
|
<label style="font-weight:600;font-size:.85rem;">Visibilita'</label>
|
|
<div class="kb-scope-radios" style="margin-top:6px;">
|
|
<label data-scope-opt="SYSTEM" style="display:none;">
|
|
<input type="radio" name="kb-scope" value="SYSTEM"> Sistema (super_admin)
|
|
</label>
|
|
<label data-scope-opt="FIRM" style="display:none;">
|
|
<input type="radio" name="kb-scope" value="FIRM"> Studio + condivisioni
|
|
</label>
|
|
<label data-scope-opt="ORG">
|
|
<input type="radio" name="kb-scope" value="ORG" checked> Solo organizzazione corrente
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="kb-share-block" class="kb-share-block" style="display:none;">
|
|
<label style="font-size:.78rem;color:var(--gray-600);">
|
|
Organizzazioni clienti destinatarie (Ctrl/Cmd per selezione multipla, opzionale):
|
|
</label>
|
|
<select id="kb-shared-with" multiple size="5" class="form-control">
|
|
<option value="">Caricamento organizzazioni del firm...</option>
|
|
</select>
|
|
<div style="font-size:.72rem;color:var(--gray-500);margin-top:4px;">
|
|
Lascia vuoto per condividere solo con i collaboratori dello studio.
|
|
</div>
|
|
</div>
|
|
|
|
<div style="margin-top:16px;display:flex;gap:8px;align-items:center;">
|
|
<button class="btn btn-primary" id="btn-kb-submit">Indicizza documento</button>
|
|
<button class="btn btn-secondary" id="btn-kb-cancel">Annulla</button>
|
|
<span id="kb-status" style="margin-left:8px;font-size:.85rem;"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Lista documenti -->
|
|
<div class="card kb-doc-list">
|
|
<div class="card-header">
|
|
<h3>Documenti caricati visibili</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
<div id="kb-doc-list">
|
|
<div class="text-muted">Caricamento...</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Search preview -->
|
|
<div class="card" style="margin-top:24px;">
|
|
<div class="card-header"><h3>Test search semantica</h3></div>
|
|
<div class="card-body">
|
|
<div style="display:flex;gap:8px;">
|
|
<input type="text" id="kb-search-query" class="form-control" placeholder="Es: come gestire un incidente NIS2?">
|
|
<button class="btn btn-secondary" id="btn-kb-search">Cerca</button>
|
|
</div>
|
|
<div id="kb-search-results" style="margin-top:12px;"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
</div>
|
|
|
|
<script src="js/common.js"></script>
|
|
<script src="js/api.js"></script>
|
|
<script src="js/i18n.js"></script>
|
|
<script src="js/help.js"></script>
|
|
<script src="js/kb.js"></script>
|
|
<script>
|
|
// Gate auth + chrome come le altre pagine (kb.html ne era priva).
|
|
if (typeof checkAuth === 'function' && !checkAuth()) {
|
|
// checkAuth reindirizza a login se non autenticato
|
|
} else {
|
|
if (typeof loadSidebar === 'function') loadSidebar();
|
|
if (typeof I18n !== 'undefined' && I18n.init) I18n.init();
|
|
if (typeof HelpSystem !== 'undefined') HelpSystem.init();
|
|
}
|
|
</script>
|
|
</body>
|
|
</html>
|