Skip to content

Merge Prasoon updates into main - #2

Merged
pathakpk7 merged 1 commit into
mainfrom
prasoon
Sep 8, 2026
Merged

pathakpk7 merged 1 commit into
mainfrom
prasoon

Conversation

@pathakpk7

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 8, 2026 19:08
@pathakpk7
pathakpk7 merged commit dd9cb69 into main Sep 8, 2026
2 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The new archive/reset feature is currently unauthenticated and destructive, and some UI actions (e.g., “Block IP”) are non-functional without backend integration.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR merges a large set of UI updates that shift multiple SecureNet UI pages from mock/static data to backend-driven “realtime” data (REST + WebSocket), and adds an admin “archive/reset” capability backed by a new FastAPI endpoint.

Changes:

  • Replace mock data across alerts/logs/reports/dashboards with fetches to localhost:8000 endpoints and periodic refresh intervals.
  • Add realtime monitoring UX (WebSocket packet stream, live protocol breakdowns, dynamic status/health panels).
  • Introduce an admin archive/reset flow in the UI and backend (POST /api/v1/admin/archive) to clear active tables and log an audit event.
File summaries
File Description
securenet-ui/src/styles/global.css Adds global top margin override for multiple header variants.
securenet-ui/src/pages/SIEMExport.jsx Fetches SIEM connectors from backend instead of mock data.
securenet-ui/src/pages/Reports.jsx Removes mock report history and adds weekly archive/reset action.
securenet-ui/src/pages/EnterpriseDashboard.jsx Fetches /health and renders component-by-component system status.
securenet-ui/src/pages/EnhancedAdminPanel.jsx Removes fallback demo org/users; uses empty lists on failure.
securenet-ui/src/pages/Dashboard.jsx Computes health percentage from /health and adds telemetry polling for admin stats/activity.
securenet-ui/src/pages/AuditLogs.jsx Removes mock fallback audit logs and uses empty state on failure.
securenet-ui/src/pages/Alerts.jsx Switches to backend alerts, adds threat-type filtering, loading/empty states, confidence display.
securenet-ui/src/layouts/DashboardLayout.css Adjusts layout padding to increase top spacing.
securenet-ui/src/hooks/useRealtimeAlerts.js Loosens empty-list handling so hook can represent “no alerts” correctly.
securenet-ui/src/components/simulation/AdminSimulation.jsx Major UI refresh for simulation center (KPIs, templates, config modal, charts).
securenet-ui/src/components/settings/UserView.jsx Major UX overhaul: sidebar sections + reusable toggle/select rows.
securenet-ui/src/components/security/ThreatIntelligence.jsx Redesigns threat intelligence card with risk-based styling and “AI insight”.
securenet-ui/src/components/profile/UserOnlyProfile.jsx Switches profile data to localStorage/backend stats/logs and refreshes UI.
securenet-ui/src/components/profile/AdminProfile.jsx Makes profile/metrics more dynamic (auth context/local users/Supabase profiles), refreshes UI.
securenet-ui/src/components/network/UserView.jsx Adds WebSocket live packet feed + periodic status polling, replaces mock traffic.
securenet-ui/src/components/network/AdminView.jsx Adds WebSocket live packet feed + monitoring start/stop calls, derives IP/protocol data from realtime alerts.
securenet-ui/src/components/integrations/AdminIntegrations.jsx UI refresh and derives integration KPIs from state via useMemo.
securenet-ui/src/components/dashboard/Topbar.jsx Uses demo-user fallback for menu label, updates displayed role formatting.
securenet-ui/src/components/common/AdminBanner.jsx Removes the admin banner entirely.
securenet-ui/src/components/analysis/UserView.jsx Replaces simulated analysis with backend stats + realtime alerts aggregation.
securenet-ui/src/components/analysis/UserAIInsights.jsx Replaces simulated AI insights with backend stats + realtime alert trends and recommendations.
securenet-ui/src/components/analysis/AdminView.jsx Replaces simulated admin attack analysis with realtime aggregations from alerts + stats polling.
securenet-ui/src/components/analysis/AdminAIInsights.jsx Replaces simulated admin AI insights with backend stats + realtime trends/recommendations.
backend/main.py Adds POST /api/v1/admin/archive endpoint to delete active tables and append an audit log entry.
Review details

Suppressed comments (1)

securenet-ui/src/pages/Alerts.jsx:302

  • The AI confidence rendering uses a truthy check (alert.confidence ? ... : ...), so a legitimate 0 confidence will display as N/A. Use a null/undefined check instead.
                        <span>AI Confidence:</span>
                        <strong style={{ color: '#34d399' }}>
                          {alert.confidence ? `${(alert.confidence * 100).toFixed(1)}%` : 'N/A'}
                        </strong>
  • Files reviewed: 27/30 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread backend/main.py
Comment on lines +513 to +515
async def archive_and_clear_data(request: Request) -> JSONResponse:
"""Archive current data (simulate weekly report generation) and clear active dashboards."""
try:
Comment on lines +160 to 163
<div className="user-name">{user?.name || user?.user_metadata?.name || 'Authorized User'}</div>
<div className={`user-role ${user?.role || user?.user_metadata?.role || 'user'}`}>
{(user?.role || user?.user_metadata?.role || 'USER').toUpperCase()}
</div>
Comment on lines 103 to 105
const handleBlockIP = (ip) => {
setAllIPs(prev =>
prev.map(item =>
item.ip === ip ? { ...item, status: 'blocked', monitoring: false } : item
)
);
toast.success(`IP ${ip} blocked`);
};
destinationIP: item.destination_ip || item.destinationIP || 'Unknown',
protocol: item.protocol || 'TCP',
description: item.description || 'Flow anomaly intercepted by SecureNet engine',
confidence: item.confidence || null,
Comment on lines +111 to +112
const response = await fetch('http://localhost:8000/api/v1/admin/archive', { method: 'POST' });
const data = await response.json();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants