style: simplify firewall view in Proxmox by removing unused sidebar navigation styles and optimizing layout for better performance
This commit is contained in:
@@ -443,23 +443,23 @@
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
min-width: 180px;
|
||||
background: var(--color-background-secondary);
|
||||
background: color-mix(in srgb, var(--color-background-secondary) 95%, transparent);
|
||||
backdrop-filter: blur(16px);
|
||||
border: 1px solid color-mix(in srgb, var(--color-neutral) 50%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--color-neutral) 35%, transparent);
|
||||
border-radius: 12px;
|
||||
box-shadow:
|
||||
0 4px 16px rgba(0, 0, 0, 0.15),
|
||||
0 0 0 1px rgba(0, 0, 0, 0.05);
|
||||
0 4px 16px rgba(0, 0, 0, 0.12),
|
||||
0 0 0 1px rgba(0, 0, 0, 0.03);
|
||||
z-index: 50;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.dark .dropdown-menu {
|
||||
background: var(--color-background-secondary);
|
||||
border-color: color-mix(in srgb, var(--color-neutral) 60%, transparent);
|
||||
background: color-mix(in srgb, var(--color-background-secondary) 95%, transparent);
|
||||
border-color: color-mix(in srgb, var(--color-neutral) 45%, transparent);
|
||||
box-shadow:
|
||||
0 4px 20px rgba(0, 0, 0, 0.5),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.1);
|
||||
0 4px 20px rgba(0, 0, 0, 0.4),
|
||||
0 0 0 1px rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
@@ -469,7 +469,7 @@
|
||||
font-weight: 600;
|
||||
transition: all 0.2s ease;
|
||||
border-left: 3px solid transparent;
|
||||
color: color-mix(in srgb, var(--color-base) 85%, transparent);
|
||||
color: color-mix(in srgb, var(--color-base) 70%, transparent);
|
||||
}
|
||||
|
||||
.dropdown-item:hover {
|
||||
@@ -477,7 +477,7 @@
|
||||
rgba(37, 99, 235, 0.08),
|
||||
rgba(59, 130, 246, 0.05));
|
||||
border-left-color: rgba(37, 99, 235, 0.3);
|
||||
color: var(--color-base);
|
||||
color: color-mix(in srgb, var(--color-base) 90%, transparent);
|
||||
}
|
||||
|
||||
.dropdown-item.active {
|
||||
|
||||
@@ -1,84 +1,6 @@
|
||||
<x-proxmox::layout :server="$server" view="firewall" :status="$status" :status-polling="true" :status-polling-interval="'2s'">
|
||||
|
||||
<style>
|
||||
/* Sidebar Navigation Styles */
|
||||
.firewall-sidebar {
|
||||
position: sticky;
|
||||
top: 1rem;
|
||||
max-height: calc(100vh - 2rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.firewall-nav-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
width: 100%;
|
||||
text-align: left;
|
||||
padding: 0.625rem 0.875rem;
|
||||
border-radius: 0.5rem;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
transition: all 0.15s ease;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
|
||||
.firewall-nav-item:hover {
|
||||
background-color: rgba(var(--color-background), 1);
|
||||
}
|
||||
|
||||
.firewall-nav-item.active {
|
||||
background-color: rgba(var(--color-primary), 0.1);
|
||||
border-color: rgba(var(--color-primary), 0.2);
|
||||
color: rgba(var(--color-primary), 1);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.firewall-nav-item:not(.active) {
|
||||
color: rgba(var(--color-base), 0.7);
|
||||
}
|
||||
|
||||
.firewall-nav-icon {
|
||||
width: 1.125rem;
|
||||
height: 1.125rem;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.firewall-nav-badge {
|
||||
margin-left: auto;
|
||||
padding: 0.125rem 0.5rem;
|
||||
border-radius: 9999px;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.firewall-nav-badge-success {
|
||||
background-color: rgba(var(--color-success), 0.15);
|
||||
color: rgba(var(--color-success), 1);
|
||||
}
|
||||
|
||||
.firewall-nav-badge-neutral {
|
||||
background-color: rgba(var(--color-base), 0.1);
|
||||
color: rgba(var(--color-base), 0.6);
|
||||
}
|
||||
|
||||
.firewall-nav-badge-warning {
|
||||
background-color: rgba(var(--color-warning), 0.15);
|
||||
color: rgba(var(--color-warning), 1);
|
||||
}
|
||||
|
||||
.firewall-section-card {
|
||||
scroll-margin-top: 1.5rem;
|
||||
}
|
||||
|
||||
@media (max-width: 1023px) {
|
||||
.firewall-sidebar {
|
||||
position: relative;
|
||||
top: 0;
|
||||
max-height: none;
|
||||
}
|
||||
}
|
||||
|
||||
.firewall-toggle-switch {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
@@ -449,132 +371,9 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div x-data="{
|
||||
activeSection: 'status',
|
||||
scrollToSection(sectionId) {
|
||||
this.activeSection = sectionId;
|
||||
const element = document.getElementById(sectionId);
|
||||
if (element) {
|
||||
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}
|
||||
},
|
||||
init() {
|
||||
// Set up intersection observer to update active section on scroll
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(entry => {
|
||||
if (entry.isIntersecting && entry.intersectionRatio > 0.2) {
|
||||
this.activeSection = entry.target.id;
|
||||
}
|
||||
});
|
||||
}, { threshold: 0.2, rootMargin: '-10% 0px -70% 0px' });
|
||||
|
||||
// Observe all sections
|
||||
document.querySelectorAll('.firewall-section-card').forEach(section => {
|
||||
observer.observe(section);
|
||||
});
|
||||
}
|
||||
}" class="lg:grid lg:grid-cols-5 gap-6">
|
||||
|
||||
<!-- Sidebar Navigation -->
|
||||
<div class="lg:col-span-1 mb-6 lg:mb-0">
|
||||
<div class="firewall-sidebar bg-background-secondary border border-neutral rounded-lg p-4">
|
||||
<div class="flex items-center gap-2 mb-4 pb-3 border-b border-neutral/30">
|
||||
<x-ri-shield-line class="size-5 text-primary" />
|
||||
<h3 class="text-base font-semibold">Firewall</h3>
|
||||
</div>
|
||||
|
||||
<nav class="space-y-1">
|
||||
<!-- Status Section -->
|
||||
<button
|
||||
@click="scrollToSection('status')"
|
||||
:class="activeSection === 'status' ? 'active' : ''"
|
||||
class="firewall-nav-item">
|
||||
<x-ri-toggle-line class="firewall-nav-icon" />
|
||||
<span>Status</span>
|
||||
@if($firewallEnabled)
|
||||
<span class="firewall-nav-badge firewall-nav-badge-success">ON</span>
|
||||
@else
|
||||
<span class="firewall-nav-badge firewall-nav-badge-neutral">OFF</span>
|
||||
@endif
|
||||
</button>
|
||||
|
||||
<!-- Network Adapters Section -->
|
||||
<button
|
||||
@click="scrollToSection('adapters')"
|
||||
:class="activeSection === 'adapters' ? 'active' : ''"
|
||||
class="firewall-nav-item">
|
||||
<x-ri-wifi-line class="firewall-nav-icon" />
|
||||
<span>Adapters</span>
|
||||
<span class="firewall-nav-badge firewall-nav-badge-neutral">{{ count($networkAdapters) }}</span>
|
||||
</button>
|
||||
|
||||
@if($firewallEnabled)
|
||||
<!-- Firewall Rules Section -->
|
||||
<button
|
||||
@click="scrollToSection('rules')"
|
||||
:class="activeSection === 'rules' ? 'active' : ''"
|
||||
class="firewall-nav-item">
|
||||
<x-ri-list-check class="firewall-nav-icon" />
|
||||
<span>Rules</span>
|
||||
<span class="firewall-nav-badge firewall-nav-badge-neutral">{{ count($rules) }}</span>
|
||||
</button>
|
||||
|
||||
<!-- Firewall Logs Section -->
|
||||
<button
|
||||
@click="scrollToSection('logs')"
|
||||
:class="activeSection === 'logs' ? 'active' : ''"
|
||||
class="firewall-nav-item">
|
||||
<x-ri-file-list-3-line class="firewall-nav-icon" />
|
||||
<span>Logs</span>
|
||||
@if(count($firewallLogs) > 0)
|
||||
<span class="firewall-nav-badge firewall-nav-badge-warning">{{ count($firewallLogs) }}</span>
|
||||
@else
|
||||
<span class="firewall-nav-badge firewall-nav-badge-neutral">0</span>
|
||||
@endif
|
||||
</button>
|
||||
@endif
|
||||
</nav>
|
||||
|
||||
<!-- Quick Actions -->
|
||||
<div class="mt-4 pt-4 border-t border-neutral/30">
|
||||
<p class="text-xs font-semibold text-base/50 uppercase tracking-wide mb-2">Quick Actions</p>
|
||||
<div class="space-y-1">
|
||||
<button
|
||||
wire:click="toggleFirewall"
|
||||
wire:loading.attr="disabled"
|
||||
class="firewall-nav-item text-sm {{ $firewallEnabled ? 'text-error/80 hover:text-error' : 'text-success/80 hover:text-success' }}">
|
||||
@if($firewallEnabled)
|
||||
<x-ri-shield-cross-line class="firewall-nav-icon" />
|
||||
<span>Disable Firewall</span>
|
||||
@else
|
||||
<x-ri-shield-check-line class="firewall-nav-icon" />
|
||||
<span>Enable Firewall</span>
|
||||
@endif
|
||||
</button>
|
||||
@if($firewallEnabled)
|
||||
<button
|
||||
wire:click="startCreateRule"
|
||||
class="firewall-nav-item text-sm text-primary/80 hover:text-primary">
|
||||
<x-ri-add-line class="firewall-nav-icon" />
|
||||
<span>Add Rule</span>
|
||||
</button>
|
||||
<button
|
||||
wire:click="loadFirewallLogs"
|
||||
wire:loading.attr="disabled"
|
||||
class="firewall-nav-item text-sm">
|
||||
<x-ri-refresh-line class="firewall-nav-icon" />
|
||||
<span>Refresh Logs</span>
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Content -->
|
||||
<div class="lg:col-span-4 space-y-6">
|
||||
<!-- Error Message - Centered Modal -->
|
||||
@if($error && $showErrorModal)
|
||||
<div class="space-y-6">
|
||||
<!-- Error Message - Centered Modal -->
|
||||
@if($error && $showErrorModal)
|
||||
<div class="fixed inset-0 flex items-center justify-center z-50 bg-black/50 backdrop-blur-sm"
|
||||
wire:click="$set('error', ''); $set('showErrorModal', false)">
|
||||
<div class="bg-error/20 border-2 border-error rounded-lg p-6 shadow-lg max-w-3xl w-full mx-4 max-h-[80vh] overflow-y-auto" wire:click.stop>
|
||||
|
||||
Reference in New Issue
Block a user