Files
audio2midi/data/www/index.html

123 lines
3.9 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html>
<head>
<title>Audio2MIDI</title>
<style>
body {
margin: 0;
padding: 0;
display: flex;
height: 100vh;
font-family: Arial, sans-serif;
}
.sidemenu {
width: 250px;
background: #2c3e50;
color: white;
padding: 20px 0;
}
.menu-item {
padding: 15px 25px;
cursor: pointer;
transition: background 0.3s;
}
.menu-item:hover {
background: #34495e;
}
.menu-item.active {
background: #3498db;
}
.content {
flex: 1;
padding: 20px;
background: #f8f9fa;
overflow-y: auto;
}
.danger-zone {
margin-top: auto;
padding: 20px;
border-top: 1px solid #34495e;
}
.danger-btn {
background: #e74c3c;
color: white;
border: none;
padding: 10px 15px;
border-radius: 4px;
cursor: pointer;
width: 100%;
margin: 5px 0;
}
.danger-btn:hover {
background: #c0392b;
}
</style>
</head>
<body>
<div class="sidemenu">
<div class="menu-item active" data-page="dashboard">Dashboard</div>
<div class="menu-item" data-page="wifi">WiFi Settings</div>
<div class="menu-item" data-page="midi">MIDI Config</div>
<div class="menu-item" data-page="system">System</div>
<div class="danger-zone">
<h4>Danger Zone</h4>
<button class="danger-btn" onclick="resetWiFi()">Reset WiFi Settings</button>
<button class="danger-btn" onclick="forgetNetwork()">Forget Current Network</button>
<button class="danger-btn" onclick="factoryReset()">Factory Reset</button>
</div>
</div>
<div class="content" id="mainContent">
<iframe id="contentFrame" style="width:100%;height:100%;border:none;"></iframe>
</div>
<script>
const pages = {
dashboard: '/dashboard.html',
wifi: '/wifi.html',
midi: '/midi.html',
system: '/system.html'
};
document.querySelectorAll('.menu-item').forEach(item => {
item.addEventListener('click', () => {
document.querySelectorAll('.menu-item').forEach(i => i.classList.remove('active'));
item.classList.add('active');
const page = item.dataset.page;
document.getElementById('contentFrame').src = pages[page];
});
});
function resetWiFi() {
if(confirm('Are you sure you want to reset all WiFi settings?')) {
fetch('/api/wifi/reset', { method: 'POST' })
.then(response => response.json())
.then(data => alert(data.message))
.catch(error => alert('Error: ' + error));
}
}
function forgetNetwork() {
if(confirm('Are you sure you want to forget the current WiFi network?')) {
fetch('/api/wifi/forget', { method: 'POST' })
.then(response => response.json())
.then(data => alert(data.message))
.catch(error => alert('Error: ' + error));
}
}
function factoryReset() {
if(confirm('WARNING: This will reset all settings to factory defaults. Are you sure?')) {
fetch('/api/system/reset', { method: 'POST' })
.then(response => response.json())
.then(data => alert(data.message))
.catch(error => alert('Error: ' + error));
}
}
// Load dashboard by default
document.getElementById('contentFrame').src = pages.dashboard;
</script>
</body>
</html>