Skip to content

Commit 99c85b1

Browse files
vsilentCopilot
andcommitted
web: add left sidebar navigation to dashboard layout
- Introduce Sidebar component with Overview/Threats/Alerts/Containers links - Update App layout to include sidebar + main dashboard content - Add section anchors in Dashboard for sidebar navigation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 9366741 commit 99c85b1

File tree

5 files changed

+85
-6
lines changed

5 files changed

+85
-6
lines changed

web/src/App.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.app-layout {
2+
display: flex;
3+
align-items: flex-start;
4+
}
5+
6+
.app-layout .dashboard {
7+
flex: 1;
8+
}

web/src/App.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
import React from 'react';
22
import Dashboard from './components/Dashboard';
3+
import Sidebar from './components/Sidebar';
34
import 'bootstrap/dist/css/bootstrap.min.css';
5+
import './App.css';
46

57
const App: React.FC = () => {
68
return (
7-
<div className="App">
9+
<div className="App app-layout">
10+
<Sidebar />
811
<Dashboard />
912
</div>
1013
);

web/src/components/Dashboard.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import ContainerList from './ContainerList';
99
import ThreatMap from './ThreatMap';
1010
import './Dashboard.css';
1111

12+
const DASHBOARD_LOGO_URL = 'https://github.com/user-attachments/assets/0c8a9216-8315-4ef7-9b73-d96c40521ed1';
13+
1214
const Dashboard: React.FC = () => {
1315
const [securityStatus, setSecurityStatus] = useState<SecurityStatus | null>(null);
1416
const [loading, setLoading] = useState(true);
@@ -79,15 +81,24 @@ const Dashboard: React.FC = () => {
7981
<Container fluid className="dashboard">
8082
<Row className="mb-4">
8183
<Col>
82-
<h1 className="dashboard-title">🐕 Stackdog Security Dashboard</h1>
84+
<h1 className="dashboard-title">
85+
<img
86+
src={DASHBOARD_LOGO_URL}
87+
alt="Stackdog logo"
88+
className="dashboard-logo"
89+
width={30}
90+
height={30}
91+
/>
92+
Stackdog Security Dashboard
93+
</h1>
8394
<p className="dashboard-subtitle">
8495
Real-time security monitoring for containers and Linux servers
8596
</p>
8697
</Col>
8798
</Row>
8899

89100
{/* Security Score Card */}
90-
<Row className="mb-4">
101+
<Row id="overview" className="mb-4">
91102
<Col md={6} lg={3}>
92103
<SecurityScore score={securityStatus?.overallScore || 0} />
93104
</Col>
@@ -124,18 +135,18 @@ const Dashboard: React.FC = () => {
124135
</Row>
125136

126137
{/* Threat Map */}
127-
<Row className="mb-4">
138+
<Row id="threats" className="mb-4">
128139
<Col>
129140
<ThreatMap />
130141
</Col>
131142
</Row>
132143

133144
{/* Alerts and Containers */}
134145
<Row>
135-
<Col lg={8}>
146+
<Col id="alerts" lg={8}>
136147
<AlertPanel />
137148
</Col>
138-
<Col lg={4}>
149+
<Col id="containers" lg={4}>
139150
<ContainerList />
140151
</Col>
141152
</Row>

web/src/components/Sidebar.css

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
.sidebar {
2+
width: 220px;
3+
min-height: 100vh;
4+
background: #1f2937;
5+
color: #f9fafb;
6+
padding: 20px 16px;
7+
position: sticky;
8+
top: 0;
9+
}
10+
11+
.sidebar-brand {
12+
font-size: 1.1rem;
13+
font-weight: 700;
14+
margin-bottom: 20px;
15+
}
16+
17+
.sidebar-nav {
18+
display: flex;
19+
flex-direction: column;
20+
gap: 10px;
21+
}
22+
23+
.sidebar-nav a {
24+
color: #d1d5db;
25+
text-decoration: none;
26+
padding: 8px 10px;
27+
border-radius: 6px;
28+
}
29+
30+
.sidebar-nav a:hover {
31+
background: #374151;
32+
color: #fff;
33+
}
34+
35+
@media (max-width: 992px) {
36+
.sidebar {
37+
display: none;
38+
}
39+
}

web/src/components/Sidebar.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React from 'react';
2+
import './Sidebar.css';
3+
4+
const Sidebar: React.FC = () => {
5+
return (
6+
<aside className="sidebar">
7+
<div className="sidebar-brand">Stackdog</div>
8+
<nav className="sidebar-nav">
9+
<a href="#overview">Overview</a>
10+
<a href="#threats">Threat Map</a>
11+
<a href="#alerts">Alerts</a>
12+
<a href="#containers">Containers</a>
13+
</nav>
14+
</aside>
15+
);
16+
};
17+
18+
export default Sidebar;

0 commit comments

Comments
 (0)