modified: data/www/index.html
modified: data/www/wifi.html
This commit is contained in:
@@ -62,8 +62,6 @@
|
|||||||
|
|
||||||
<div class="danger-zone">
|
<div class="danger-zone">
|
||||||
<h4>Danger Zone</h4>
|
<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>
|
<button class="danger-btn" onclick="factoryReset()">Factory Reset</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -88,27 +86,9 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
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() {
|
function factoryReset() {
|
||||||
if(confirm('WARNING: This will reset all settings to factory defaults. Are you sure?')) {
|
if(confirm('Are you sure you want to perform a factory reset? This will erase all settings.')) {
|
||||||
fetch('/api/system/reset', { method: 'POST' })
|
fetch('/api/system/factory-reset', { method: 'POST' })
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => alert(data.message))
|
.then(data => alert(data.message))
|
||||||
.catch(error => alert('Error: ' + error));
|
.catch(error => alert('Error: ' + error));
|
||||||
|
|||||||
@@ -20,6 +20,25 @@
|
|||||||
.status-disconnected {
|
.status-disconnected {
|
||||||
color: #c0392b;
|
color: #c0392b;
|
||||||
}
|
}
|
||||||
|
.danger-zone {
|
||||||
|
margin-top: 30px;
|
||||||
|
padding: 20px;
|
||||||
|
border: 2px solid #e74c3c;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
.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>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
@@ -29,6 +48,12 @@
|
|||||||
<h3>Current Status</h3>
|
<h3>Current Status</h3>
|
||||||
<div id="wifiStatus"></div>
|
<div id="wifiStatus"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="danger-zone">
|
||||||
|
<h4>WiFi Controls</h4>
|
||||||
|
<button class="danger-btn" onclick="resetWiFi()">Reset WiFi Settings</button>
|
||||||
|
<button class="danger-btn" onclick="forgetNetwork()">Forget Current Network</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
function updateWiFiStatus() {
|
function updateWiFiStatus() {
|
||||||
@@ -53,6 +78,30 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
updateWiFiStatus();
|
||||||
|
})
|
||||||
|
.catch(error => alert('Error: ' + error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function forgetNetwork() {
|
||||||
|
if(confirm('Are you sure you want to forget the current network?')) {
|
||||||
|
fetch('/api/wifi/forget', { method: 'POST' })
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
alert(data.message);
|
||||||
|
updateWiFiStatus();
|
||||||
|
})
|
||||||
|
.catch(error => alert('Error: ' + error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Update status every 5 seconds
|
// Update status every 5 seconds
|
||||||
updateWiFiStatus();
|
updateWiFiStatus();
|
||||||
setInterval(updateWiFiStatus, 5000);
|
setInterval(updateWiFiStatus, 5000);
|
||||||
|
|||||||
Reference in New Issue
Block a user