This commit is contained in:
2025-12-08 12:11:20 +00:00
parent 85b1562a75
commit ada27e496d
3 changed files with 40 additions and 4 deletions

View File

@@ -49,18 +49,22 @@
<div class="container">
<div class="card" style="margin-top: 20px; text-align: center; color: #888;">
<small>System IP: <span id="system-ip">Loading...</span></small>
<small>System IP: <span id="system-ip">Loading...</span>
<button onclick="checkIp()" style="background: #444; color: white; border: none; padding: 2px 8px; border-radius: 4px; font-size: 0.8em; margin-left: 10px; cursor: pointer;">Check Again</button>
</small>
</div>
</div>
<script>
async function checkIp() {
const el = document.getElementById('system-ip');
el.textContent = 'Loading...';
try {
const response = await fetch('/system/ip');
const data = await response.json();
document.getElementById('system-ip').textContent = data.ip;
el.textContent = data.ip;
} catch (e) {
document.getElementById('system-ip').textContent = 'Error';
el.textContent = 'Error';
}
}
checkIp();