firewall gui change

This commit is contained in:
Devdatt Bhatt 2026-05-17 16:27:08 +00:00
parent f01c24255d
commit 23a13ccf06
1 changed files with 18 additions and 17 deletions

View File

@ -38,7 +38,8 @@ if (is_file($jsonFile)) {
}
// Function to get UFW status
function getUfwStatus() {
function getUfwStatus()
{
$status = shell_exec("sudo ufw status");
if ($status === null) return 'disabled';
return (strpos($status, 'Status: active') !== false) ? 'enabled' : 'disabled';
@ -132,6 +133,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
window.onload = attachValidation;
</script>
<div class="containerindex">
<div class="grid">
<div class="card wide">
<!-- Firewall Status Toggle (Left Aligned & Modernized) -->
<div style="display: flex; justify-content: flex-start; margin-bottom: 20px;">
<div style="display: flex; align-items: center; gap: 12px; background: rgba(255, 255, 255, 0.05); padding: 6px 14px; border-radius: 50px; border: 1px solid var(--border);">
@ -146,9 +150,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
</form>
</div>
</div>
<div class="grid">
<div class="card wide">
<h2 style="margin: 0 0 20px 0;">Limit Access</h2>
<form method="post">