Dashboard Masticationpedia: differenze tra le versioni
Nessun oggetto della modifica |
Nessun oggetto della modifica |
||
(3 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 30: | Riga 30: | ||
<pre id="api-result" style="background:#f0f0f0; padding:1rem; border:1px solid #ccc; margin-top:1rem; white-space:pre-wrap;"></pre> | <pre id="api-result" style="background:#f0f0f0; padding:1rem; border:1px solid #ccc; margin-top:1rem; white-space:pre-wrap;"></pre> | ||
</div> | </div> | ||
<!-- 📦 Box: Accesso File Server --> | <!-- 📦 Box: Accesso File Server --> | ||
<div | <div style="margin-top: 2rem; padding: 1rem; border: 1px solid #ccc; background: #f9f9f9; border-radius: 8px;"> | ||
< | <h3 style="margin-top: 0;">📂 Accesso File Server</h3> | ||
< | <p>Inserisci il nome completo del file MediaWiki che desideri leggere, ad esempio: <code>MediaWiki:Common.css</code></p> | ||
<input id="readFileName" type="text" style="width: 100%; padding: 8px; font-family: monospace; font-size: 14px;" placeholder="MediaWiki:CommonDashboard.js"> | |||
<button id="readFileBtn" class="mw-ui-button" style="margin-top: 10px;">📂 Leggi file</button> | |||
< | |||
<div id="readFileResult" style="margin-top: 1rem; border: 1px solid #ddd; padding: 1rem; background: #fff; font-family: monospace; font-size: 14px; white-space: pre-wrap; max-height: 400px; overflow: auto;"> | |||
<em>📄 Il contenuto del file verrà mostrato qui...</em> | |||
</div> | |||
</div> | </div> | ||
<script> | |||
document.querySelector('#readFileBtn')?.addEventListener('click', async () => { | |||
const filenameInput = document.querySelector('#readFileName'); | |||
const fileContentDiv = document.querySelector('#readFileResult'); | |||
const filename = filenameInput.value.trim(); | |||
if (!filename) { | |||
fileContentDiv.innerHTML = '<span style="color:red;">⚠️ Inserisci un nome di file.</span>'; | |||
return; | |||
} | |||
try { | |||
const response = await fetch('/wiki/dashboard/api/read_file.php?filename=' + encodeURIComponent(filename)); | |||
const data = await response.json(); | |||
if (data.status === 'success') { | |||
fileContentDiv.innerHTML = `<pre style="background:#f4f4f4;border:1px solid #ccc;padding:8px;max-height:400px;overflow:auto;font-size:14px;">${data.content}</pre>`; | |||
} else { | |||
fileContentDiv.innerHTML = `<span style="color:red;">❌ Errore: ${data.message}</span>`; | |||
} | |||
} catch (error) { | |||
fileContentDiv.innerHTML = `<span style="color:red;">❌ Errore di connessione.</span>`; | |||
console.error('Errore JS:', error); | |||
} | |||
}); | |||
</script> | |||
<!-- 📦 Box: Stato Progetti --> | <!-- 📦 Box: Stato Progetti --> |
Versione delle 18:51, 31 lug 2025
🔧 Dashboard Operativa – Masticationpedia
Centro di comando per progetti, API, file e backup
📂 Accesso File Server
Inserisci il nome completo del file MediaWiki che desideri leggere, ad esempio: MediaWiki:Common.css
📄 Il contenuto del file verrà mostrato qui...
📜 Registro attività:
Registro avviato...