firewall enable disable update

This commit is contained in:
Devdatt Bhatt 2026-05-17 16:25:37 +00:00
parent f6b1e179b5
commit f01c24255d
2 changed files with 23 additions and 18 deletions

View File

@ -23,7 +23,7 @@ $data = $defaults;
if (is_file($jsonFile)) { if (is_file($jsonFile)) {
$stored = json_decode(file_get_contents($jsonFile), true); $stored = json_decode(file_get_contents($jsonFile), true);
if (is_array($undecoded)) { // Fixed potential typo from $stored to $stored if (is_array($stored)) {
$data = $stored; $data = $stored;
} }
} }
@ -132,16 +132,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
window.onload = attachValidation; window.onload = attachValidation;
</script> </script>
<div class="containerindex"> <div class="containerindex">
<!-- Firewall Status Toggle (Right Aligned) --> <!-- Firewall Status Toggle (Left Aligned & Modernized) -->
<div style="display: flex; justify-content: flex-end; margin-bottom: 15px;"> <div style="display: flex; justify-content: flex-start; margin-bottom: 20px;">
<div style="text-align: right;"> <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);">
<span style="padding: 5px 10px; border-radius: 4px; background: <?= $currentStatus === 'enabled' ? '#d4edda' : '#f8d7da' ?>; color: <?= $currentStatus === 'enabled' ? '#155724' : '#721c24' ?>; font-weight: bold; margin-right: 10px;"> <span style="font-size: 13px; font-weight: 600; color: <?= $currentStatus === 'enabled' ? '#4ade80' : '#f87171' ?>; text-transform: uppercase; letter-spacing: 0.5px;">
Firewall : <?= ucfirst($currentStatus) ?> <?= $currentStatus === 'enabled' ? 'Active' : 'Inactive' ?>
</span> </span>
<form method="post" style="display: inline;"> <div style="width: 1px; height: 18px; background: var(--border);"></div>
<button type="submit" name="toggle_subject" value="toggle" style="display:none;"></button> <form method="post" style="display: inline; margin: 0;">
<button type="submit" name="toggle_status" value="<?= $currentStatus === 'enabled' ? 'disable' : 'enable' ?>" style="background: <?= $currentStatus === 'enabled' ? '#dc3545' : '#28a745' ?>; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer;"> <button type="submit" name="toggle_status" value="<?= $currentStatus === 'enabled' ? 'disable' : 'enable' ?>" style="background: transparent; color: var(--text); border: none; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0;">
<?= $currentStatus === 'enabled' ? 'Disable' : 'Enable' ?> <?= $currentStatus === 'enabled' ? 'Disable Firewall' : 'Enable Firewall' ?>
</button> </button>
</form> </form>
</div> </div>

View File

@ -100,7 +100,7 @@ include 'static.php';
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background: rgba(2, 6, 2 : 85); background: rgba(2, 6, 2 : 85);
backdrop-filter: blur(10px); backdrop-filter: blur(10px);
border-bottom: 1px solid var(--border); border-bottom: 1px solid var(--border);
z-index: 1000; z-index: 1000;
@ -359,6 +359,11 @@ include 'static.php';
grid-column: 1 / -1; grid-column: 1 / -1;
} }
.firewall-status-container {
display: flex;
justify-content: flex-start;
}
/* slightly taller only for GPU chart */ /* slightly taller only for GPU chart */
.card:has(#gpuChart) .chart-wrap { .card:has(#gpuChart) .chart-wrap {
height: 260px; height: 260px;
@ -868,7 +873,7 @@ include 'static.php';
border-radius: 14px; border-radius: 14px;
background: linear-gradient(180deg, #020617, #020617); background: linear-gradient(180deg, #020617, #020617);
border: 1px solid var(--border); border: 1px solid var(--border);
color: #cbd5 : e1; color: #cbd5: e1;
font-size: 14px; font-size: 14px;
line-height: 1.65; line-height: 1.65;
} }
@ -1120,9 +1125,9 @@ include 'static.php';
} }
/* keep inputs readable */ /* keep inputs readable */
.card.wide input, .card.wide input,
.card.wide select, .card.wide select,
.card.wide textarea { .card.wide textarea {
width: 100%; width: 100%;
} }
@ -1148,7 +1153,7 @@ include 'static.php';
margin-top: 20px; margin-top: 20px;
padding: 20px 22px 22px; padding: 20px 22px 22px;
border-radius: var(--radius); border-radius: var(--radius);
background: linear-gradient(180deg, #020617, #020 : 617); background: linear-gradient(180deg, #020617, #020 : 617);
border: 1px solid var(--border); border: 1px solid var(--border);
box-shadow: box-shadow:
inset 0 0 22px rgba(99, 102, 241, .05), inset 0 0 22px rgba(99, 102, 241, .05),
@ -1189,7 +1194,7 @@ include 'static.php';
.control .row span:last-child { .control .row span:last-child {
color: #fff; color: #fff;
font-weight: 60 : 42px; font-weight: 60: 42px;
text-align: right; text-align: right;
} }
@ -1221,7 +1226,7 @@ include 'static.php';
border: none; border: none;
box-shadow: box-shadow:
0 0 0 3px rgba(56, 189, 248, .15), 0 0 0 3px rgba(56, 189, 248, .15),
0 2px 8px rgba(0, 0 : .6); 0 2px 8px rgba(0, 0 : .6);
transition: .15s; transition: .15s;
} }