Added options page
This commit is contained in:
80
src/pages/options.php
Normal file
80
src/pages/options.php
Normal file
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/../includes/config.php';
|
||||
if (empty($_SESSION['is_admin'])) {
|
||||
header('Location: login.php');
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Options Panel</title>
|
||||
<link rel="stylesheet" href="css/options.css">
|
||||
</head>
|
||||
<body>
|
||||
<div class="options-container">
|
||||
|
||||
<h1>System Options</h1>
|
||||
|
||||
<section class="option-card status-widget" id="systemStatus">
|
||||
<h2>System Status</h2>
|
||||
<div class="status-grid">
|
||||
<div><strong>Wi-Fi:</strong> <span id="statusWifi">Loading…</span></div>
|
||||
<div><strong>Uptime:</strong> <span id="statusUptime">–</span></div>
|
||||
<div><strong>Load:</strong> <span id="statusLoad">–</span></div>
|
||||
<div><strong>Memory:</strong> <span id="statusMem">–</span></div>
|
||||
<div><strong>Services:</strong> <span id="statusServices">–</span></div>
|
||||
</div>
|
||||
<br>
|
||||
<button id="btnRefreshStatus" class="btn small">🔄 Refresh</button>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Wi-Fi & Network</h2>
|
||||
<button id="btnWifiToggle">Toggle Wi-Fi</button>
|
||||
<button id="btnLanRestart">Restart LAN</button>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Services</h2>
|
||||
<input type="text" id="serviceName" placeholder="Service name (e.g., uhttpd)">
|
||||
<button id="btnServiceStart">Start</button>
|
||||
<button id="btnServiceStop">Stop</button>
|
||||
<button id="btnServiceRestart">Restart</button>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Configuration File</h2>
|
||||
<textarea id="configEditor" placeholder="Config contents here..."></textarea>
|
||||
<button id="btnLoadConfig">Load</button>
|
||||
<button id="btnSaveConfig">Save</button>
|
||||
<div id="configMessage"></div>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Cache</h2>
|
||||
<button id="btnClearCache">Clear Cache</button>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Logs</h2>
|
||||
<button id="btnViewLogs">View Logs</button>
|
||||
<pre id="logsBox">(none)</pre>
|
||||
</section>
|
||||
|
||||
<section class="option-card">
|
||||
<h2>Admin Password</h2>
|
||||
<input type="password" id="oldPass" placeholder="Old password">
|
||||
<input type="password" id="newPass" placeholder="New password">
|
||||
<input type="password" id="confirmPass" placeholder="Confirm new password">
|
||||
<button id="btnChangePass">Change Password</button>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="js/options.js" defer></script>
|
||||
<link rel="stylesheet" href="css/options.css">
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user