training-academy/data_recovery_check.html

66 lines
2.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>Data Recovery Check</title>
</head>
<body>
<h1>Data Recovery Diagnostic</h1>
<button onclick="checkData()">Check All Data</button>
<pre id="output"></pre>
<script>
function checkData() {
const output = document.getElementById('output');
let report = 'DATA RECOVERY DIAGNOSTIC REPORT\n';
report += '='.repeat(50) + '\n\n';
// Check localStorage keys
report += '1. LOCALSTORAGE KEYS:\n';
for (let i = 0; i < localStorage.length; i++) {
const key = localStorage.key(i);
const value = localStorage.getItem(key);
report += ` ${key}: ${value ? `${value.length} chars` : 'null'}\n`;
// Show preview for important keys
if (key.includes('linked') || key.includes('webGame') || key.includes('player') || key.includes('photo')) {
report += ` Preview: ${value ? value.substring(0, 100) + '...' : 'empty'}\n`;
}
}
report += '\n2. SPECIFIC DATA CHECKS:\n';
// Check for linked directories
const linkedImages = localStorage.getItem('linkedImageDirectories');
const linkedVideos = localStorage.getItem('linkedVideoDirectories');
const webGameData = localStorage.getItem('webGame-data');
report += ` linkedImageDirectories: ${linkedImages ? 'EXISTS' : 'MISSING'}\n`;
report += ` linkedVideoDirectories: ${linkedVideos ? 'EXISTS' : 'MISSING'}\n`;
report += ` webGame-data: ${webGameData ? 'EXISTS' : 'MISSING'}\n`;
if (webGameData) {
try {
const data = JSON.parse(webGameData);
report += ` webGame-data structure: ${Object.keys(data).join(', ')}\n`;
} catch (e) {
report += ` webGame-data parsing error: ${e.message}\n`;
}
}
// Check for photo gallery
const photoGallery = localStorage.getItem('photoGallery');
const capturedPhotos = localStorage.getItem('capturedPhotos');
report += ` photoGallery: ${photoGallery ? 'EXISTS' : 'MISSING'}\n`;
report += ` capturedPhotos: ${capturedPhotos ? 'EXISTS' : 'MISSING'}\n`;
// Check custom tasks
const customMain = localStorage.getItem('customMainTasks');
const customConsequence = localStorage.getItem('customConsequenceTasks');
report += ` customMainTasks: ${customMain ? 'EXISTS' : 'MISSING'}\n`;
report += ` customConsequenceTasks: ${customConsequence ? 'EXISTS' : 'MISSING'}\n`;
output.textContent = report;
}
</script>
</body>
</html>