workflow-automation/public/index.html
2025-07-20 22:53:40 +05:30

1248 lines
46 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IoT Industrial Dashboard</title>
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;900&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #181c24 0%, #232837 100%);
color: #f3f6fa;
overflow-x: hidden;
}
.dashboard-container {
display: grid;
grid-template-areas:
"sidebar header"
"sidebar main";
grid-template-columns: 300px 1fr;
grid-template-rows: 70px 1fr;
height: 100vh;
animation: fadeIn 0.8s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(20px); }
to { opacity: 1; transform: translateY(0); }
}
/* Header */
.header {
grid-area: header;
position: fixed;
top: 0;
left: 0;
width: 100vw;
z-index: 1100;
background: #181c24;
backdrop-filter: blur(12px);
border-bottom: 1.5px solid #232837;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0 40px;
height: 72px;
box-shadow: 0 4px 24px 0 rgba(0, 234, 255, 0.07), 0 1.5px 0 0 #00eaff33;
}
@keyframes slideDown {
from { transform: translateY(-100%); }
to { transform: translateY(0); }
}
.logo {
font-size: 32px;
font-weight: 900;
color: #00eaff;
letter-spacing: 2px;
text-shadow: 0 2px 16px rgba(0, 234, 255, 0.18);
display: flex;
align-items: center;
gap: 16px;
}
.header-right {
display: flex;
align-items: center;
gap: 28px;
margin-right: 4px;
}
.notification-bell {
position: relative;
cursor: pointer;
font-size: 22px;
color: #fff;
transition: all 0.3s ease;
margin-right: 8px;
}
.notification-bell:hover {
color: #00d4ff;
transform: scale(1.1);
}
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
background: #ff4757;
color: white;
border-radius: 50%;
width: 18px;
height: 18px;
font-size: 10px;
display: flex;
align-items: center;
justify-content: center;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { transform: scale(1); }
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
.user-profile {
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
padding: 8px 18px;
border-radius: 22px;
background: rgba(0, 234, 255, 0.10);
transition: all 0.3s ease;
font-size: 1.05rem;
}
.user-profile:hover {
background: rgba(0, 234, 255, 0.18);
transform: translateY(-2px) scale(1.03);
}
.avatar {
width: 34px;
height: 34px;
border-radius: 50%;
background: linear-gradient(45deg, #00eaff, #0078ff);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
font-size: 16px;
}
/* Sidebar - Always Visible */
.sidebar {
grid-area: sidebar;
background: #15171e;
backdrop-filter: blur(10px);
border-right: 1.5px solid #232837;
padding: 30px 0;
animation: slideRight 0.6s ease-out;
position: fixed;
left: 0;
top: 0;
width: 300px;
height: 100vh;
z-index: 1000;
box-shadow: 4px 0 24px 0 rgba(0, 0, 0, 0.12);
overflow: hidden;
}
@keyframes slideRight {
from { transform: translateX(-100%); }
to { transform: translateX(0); }
}
.nav-menu {
list-style: none;
margin-top: 80px;
}
.nav-item {
margin: 5px 0;
}
.nav-link {
display: flex;
align-items: center;
padding: 15px 25px;
color: #b0bec5;
text-decoration: none;
transition: all 0.2s cubic-bezier(.4,0,.2,1);
border-left: 3px solid transparent;
cursor: pointer;
font-size: 1.08rem;
letter-spacing: 0.02em;
position: relative;
}
.nav-link.active, .nav-link:hover {
color: #00eaff;
background: rgba(0, 234, 255, 0.08);
border-left-color: #00eaff;
box-shadow: 0 2px 12px 0 rgba(0,234,255,0.04);
}
.nav-link i {
margin-right: 15px;
font-size: 18px;
width: 20px;
filter: drop-shadow(0 1px 2px #00eaff22);
}
/* Main Content */
.main-content {
grid-area: main;
margin-left: 100px;
padding: 30px;
overflow-y: auto;
animation: slideUp 0.8s ease-out;
min-height: calc(100vh - 70px);
margin-top: 70px; /* push content below fixed header */
}
@keyframes slideUp {
from { transform: translateY(50px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.page-title {
font-size: 2rem;
font-weight: 700;
color: #f3f6fa;
letter-spacing: 0.04em;
margin-bottom: 30px;
margin-top: 0;
}
/* Page Content */
.page-content {
display: none;
animation: fadeInUp 0.5s ease-out;
}
.page-content.active {
display: block;
}
@keyframes fadeInUp {
from { transform: translateY(30px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
/* Dashboard Grid */
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 25px;
margin-bottom: 30px;
margin-top: 48px;
}
.card {
background: #232837;
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 28px 24px;
border: 1px solid #232837;
box-shadow: 0 8px 32px rgba(0, 234, 255, 0.07);
transition: box-shadow 0.2s cubic-bezier(.4,0,.2,1);
animation: cardFloat 0.6s ease-out;
}
@keyframes cardFloat {
from { transform: translateY(30px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.card:hover {
box-shadow: 0 16px 40px rgba(0, 234, 255, 0.13);
}
.card-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 18px;
}
.card-title {
font-size: 1.18rem;
font-weight: 700;
letter-spacing: 0.03em;
color: #e3f6fa;
}
.card-icon {
width: 45px;
height: 45px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
box-shadow: 0 2px 8px 0 #00eaff22;
}
.card-icon.alerts {
background: linear-gradient(45deg, #ff4757, #ff3838);
color: white;
}
.card-icon.suggestions {
background: linear-gradient(45deg, #ffa502, #ff6348);
color: white;
}
.card-icon.healing {
background: linear-gradient(45deg, #2ed573, #1e90ff);
color: white;
}
.card-icon.devices {
background: linear-gradient(45deg, #5352ed, #3742fa);
color: white;
}
.card-icon.analytics {
background: linear-gradient(45deg, #a55eea, #26de81);
color: white;
}
/* Alert Items */
.alert-item {
display: flex;
align-items: center;
padding: 12px;
margin: 8px 0;
border-radius: 8px;
background: rgba(255, 255, 255, 0.05);
border-left: 4px solid #ff4757;
animation: slideInLeft 0.5s ease-out;
}
.alert-item.warning {
border-left-color: #ffa502;
}
.alert-item.critical {
border-left-color: #ff4757;
background: rgba(255, 71, 87, 0.1);
}
.alert-item.info {
border-left-color: #00d4ff;
}
@keyframes slideInLeft {
from { transform: translateX(-20px); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
.alert-icon {
width: 35px;
height: 35px;
border-radius: 50%;
background: #ff4757;
color: white;
display: flex;
align-items: center;
justify-content: center;
margin-right: 15px;
animation: pulse 2s infinite;
}
.alert-content {
flex: 1;
}
.alert-title {
font-weight: 600;
color: #fff;
margin-bottom: 3px;
}
.alert-time {
font-size: 12px;
color: #888;
}
/* Device Items */
.device-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px;
margin: 10px 0;
border-radius: 10px;
background: rgba(255, 255, 255, 0.05);
border: 1px solid rgba(83, 82, 237, 0.3);
transition: all 0.3s ease;
}
.device-item:hover {
background: rgba(255, 255, 255, 0.08);
transform: translateX(5px);
}
.device-info {
display: flex;
align-items: center;
}
.device-status {
width: 12px;
height: 12px;
border-radius: 50%;
margin-right: 15px;
animation: pulse 2s infinite;
}
.device-status.online {
background: #2ed573;
}
.device-status.offline {
background: #ff4757;
}
.device-status.maintenance {
background: #ffa502;
}
.device-name {
font-weight: 600;
color: #fff;
}
.device-type {
color: #888;
font-size: 12px;
}
.config-btn, .action-btn {
padding: 8px 15px;
border: none;
border-radius: 6px;
background: linear-gradient(45deg, #5352ed, #3742fa);
color: white;
cursor: pointer;
font-size: 12px;
transition: all 0.3s ease;
margin: 0 5px;
margin-top: 2px;
margin-bottom: 2px;
}
.config-btn:hover, .action-btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(83, 82, 237, 0.4);
}
.action-btn.danger {
background: linear-gradient(45deg, #ff4757, #ff3838);
}
.action-btn.success {
background: linear-gradient(45deg, #2ed573, #1e90ff);
}
/* Large Cards for Full Page Content */
.large-card {
grid-column: 1 / -1;
min-height: 400px;
}
.metric-value {
font-size: 24px;
font-weight: bold;
color: #00d4ff;
text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}
.metric-label {
font-size: 12px;
color: #888;
text-transform: uppercase;
letter-spacing: 1px;
}
/* Settings Panel */
.settings-panel {
display: none;
position: fixed;
top: 0;
right: 0;
width: 400px;
height: 100vh;
background: rgba(15, 15, 15, 0.95);
backdrop-filter: blur(15px);
border-left: 1px solid #333;
padding: 30px;
z-index: 1001;
animation: slideInRight 0.3s ease-out;
}
@keyframes slideInRight {
from { transform: translateX(100%); }
to { transform: translateX(0); }
}
.settings-panel.active {
display: block;
}
.settings-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding-bottom: 15px;
border-bottom: 1px solid #333;
}
.close-settings {
background: none;
border: none;
color: #fff;
font-size: 20px;
cursor: pointer;
}
.settings-section {
margin-bottom: 25px;
}
.settings-section h3 {
color: #00d4ff;
margin-bottom: 15px;
}
.setting-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.toggle-switch {
position: relative;
width: 50px;
height: 24px;
background: #333;
border-radius: 12px;
cursor: pointer;
transition: all 0.3s ease;
}
.toggle-switch.active {
background: #00d4ff;
}
.toggle-slider {
position: absolute;
top: 2px;
left: 2px;
width: 20px;
height: 20px;
background: white;
border-radius: 50%;
transition: all 0.3s ease;
}
.toggle-switch.active .toggle-slider {
transform: translateX(26px);
}
/* Form Elements */
.form-group {
margin-bottom: 20px;
}
.form-label {
display: block;
color: #ccc;
margin-bottom: 8px;
font-weight: 500;
}
.form-input {
width: 100%;
padding: 12px;
background: rgba(255, 255, 255, 0.1);
border: 1px solid #333;
border-radius: 8px;
color: #fff;
font-size: 14px;
transition: all 0.3s ease;
}
.form-input:focus {
border-color: #00d4ff;
box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
outline: none;
}
.btn-primary {
background: linear-gradient(45deg, #00d4ff, #0078ff);
color: white;
border: none;
padding: 12px 24px;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}
/* Responsive */
@media (max-width: 768px) {
.dashboard-container {
grid-template-columns: 1fr;
grid-template-areas:
"header"
"main";
}
.sidebar {
width: 100px;
transform: translateX(-100%);
transition: transform 0.3s ease;
}
.sidebar.active {
transform: translateX(0);
}
.main-content {
margin-left: 0;
margin-top: 70px;
}
.dashboard-grid {
grid-template-columns: 1fr;
}
.header {
width: 100vw;
}
}
#dashboard {
margin-top: 15px;
}
/* Table polish */
table {
border-radius: 10px;
overflow: hidden;
background: #20222b;
box-shadow: 0 2px 12px 0 #00eaff11;
}
thead tr {
background: #1a1c24;
}
td, th {
border-bottom: 1px solid #232837;
}
tbody tr:hover {
background: #232837cc;
transition: background 0.2s;
}
/* Buttons */
.action-btn, .btn-primary {
border: none;
border-radius: 6px;
font-weight: 600;
font-size: 13px;
padding: 8px 18px;
margin: 2px 4px;
transition: background 0.18s, box-shadow 0.18s, color 0.18s;
box-shadow: 0 2px 8px 0 #00eaff22;
outline: none;
}
.action-btn {
background: #3742fa;
color: #fff;
}
.action-btn.success {
background: #2ed573;
color: #fff;
}
.action-btn.danger {
background: #ff4757;
color: #fff;
}
.action-btn:hover, .btn-primary:hover {
background: #00eaff;
color: #181c24;
box-shadow: 0 4px 16px 0 #00eaff44;
}
.btn-primary {
background: #00eaff;
color: #181c24;
}
.btn-primary:focus, .action-btn:focus {
box-shadow: 0 0 0 2px #00eaff99;
}
/* Accessibility */
.nav-link[aria-label], .action-btn[aria-label], .btn-primary[aria-label] {
outline: 2px solid #00eaff;
outline-offset: 2px;
}
/* Smooth transitions for all interactive elements */
.nav-link, .action-btn, .btn-primary, .user-profile, .card {
transition: all 0.18s cubic-bezier(.4,0,.2,1);
}
/* Chart.js legend and axes */
.chartjs-render-monitor + .chartjs-legend {
color: #fff;
font-family: 'Inter', sans-serif;
font-size: 14px;
}
/* Misc */
::-webkit-scrollbar {
width: 8px;
background: #232837;
}
::-webkit-scrollbar-thumb {
background: #181c24;
border-radius: 8px;
}
</style>
<script>
// SPA-style navigation
function showPage(pageId) {
const pages = document.querySelectorAll('.page-content');
pages.forEach(page => page.classList.remove('active'));
const page = document.getElementById(pageId);
if (page) page.classList.add('active');
// Update active nav link
document.querySelectorAll('.nav-link').forEach(link => link.classList.remove('active'));
const navLinks = document.querySelectorAll('.nav-link');
navLinks.forEach(link => {
if (link.getAttribute('onclick') && link.getAttribute('onclick').includes(pageId)) {
link.classList.add('active');
}
});
// Update URL hash for routing
window.location.hash = pageId;
}
// On load, show page based on hash
window.addEventListener('DOMContentLoaded', () => {
const hash = window.location.hash.replace('#', '');
if (hash) showPage(hash);
});
// Listen for hash changes (browser navigation)
window.addEventListener('hashchange', () => {
const hash = window.location.hash.replace('#', '');
if (hash) showPage(hash);
});
</script>
</head>
<body>
<div class="dashboard-container">
<!-- Header -->
<header class="header">
<div class="logo">
<i class="fas fa-microchip"></i> IoT Control Hub
</div>
<div class="header-right">
<div class="notification-bell" onclick="toggleNotifications()">
<i class="fas fa-bell"></i>
<span class="notification-badge" id="notificationBadge">3</span>
</div>
<div class="user-profile" onclick="toggleSettings()">
<div class="avatar">AG</div>
<span>Admin Giri</span>
<i class="fas fa-chevron-down"></i>
</div>
</div>
</header>
<!-- Sidebar - Always Open -->
<nav class="sidebar">
<ul class="nav-menu">
<li class="nav-item">
<div class="nav-link active" onclick="showPage('dashboard')">
<i class="fas fa-tachometer-alt"></i>
Dashboard
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('alerts')">
<i class="fas fa-exclamation-triangle"></i>
Real-time Alerts
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('suggestions')">
<i class="fas fa-lightbulb"></i>
AI Suggestions
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('healing')">
<i class="fas fa-magic"></i>
Self Healing
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('devices')">
<i class="fas fa-cogs"></i>
Device Config
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('analytics')">
<i class="fas fa-chart-bar"></i>
Analytics
</div>
</li>
<li class="nav-item">
<div class="nav-link" onclick="showPage('profile')">
<i class="fas fa-user-cog"></i>
Profile Settings
</div>
</li>
</ul>
</nav>
<!-- Main Content -->
<main class="main-content">
<!-- Dashboard Page -->
<div id="dashboard" class="page-content active">
<h1 class="page-title">Industrial IoT Dashboard</h1>
<div class="dashboard-grid">
<!-- System Overview Card -->
<div class="card">
<div class="card-header">
<h3 class="card-title">System Overview</h3>
<div class="card-icon" style="background: linear-gradient(45deg, #00d4ff, #0078ff);">
<i class="fas fa-chart-line"></i>
</div>
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px;">
<div style="text-align: center; padding: 15px; background: rgba(255,255,255,0.05); border-radius: 10px;">
<div class="metric-value" id="systemUptime">98.7%</div>
<div class="metric-label">System Uptime</div>
</div>
<div style="text-align: center; padding: 15px; background: rgba(255,255,255,0.05); border-radius: 10px;">
<div class="metric-value" id="activeDevices">156</div>
<div class="metric-label">Active Devices</div>
</div>
</div>
</div>
<!-- Recent Alerts Preview -->
<div class="card">
<div class="card-header">
<h3 class="card-title">Recent Alerts</h3>
<div class="card-icon alerts">
<i class="fas fa-bell"></i>
</div>
</div>
<div id="recentAlerts">
<div class="alert-item critical">
<div class="alert-icon">
<i class="fas fa-thermometer-three-quarters"></i>
</div>
<div class="alert-content">
<div class="alert-title">Critical Temperature</div>
<div class="alert-time">Boiler Unit #3 - 2 min ago</div>
</div>
</div>
</div>
</div>
<!-- Real-time Performance Chart Card -->
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Real-time Performance Chart</h3>
<div class="card-icon" style="background: linear-gradient(45deg, #2ed573, #1e90ff);">
<i class="fas fa-chart-area"></i>
</div>
</div>
<div style="height: 300px; background: rgba(255,255,255,0.03); border-radius: 10px; margin-top: 20px; display: flex; align-items: center;">
<canvas id="performanceChart" width="600" height="220"></canvas>
</div>
</div>
</div>
</div>
<!-- Real-time Alerts Page -->
<div id="alerts" class="page-content">
<h1 class="page-title">Real-time Alerts Management</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Active Alerts</h3>
<div class="card-icon alerts">
<i class="fas fa-exclamation-triangle"></i>
</div>
</div>
<div id="allAlerts">
<div class="alert-item critical">
<div class="alert-icon">
<i class="fas fa-thermometer-three-quarters"></i>
</div>
<div class="alert-content">
<div class="alert-title">Critical Temperature Alert</div>
<div class="alert-time">Boiler Unit #3 - Temperature: 85°C (Threshold: 75°C) - 2 min ago</div>
</div>
<button class="action-btn danger">Acknowledge</button>
</div>
<div class="alert-item warning">
<div class="alert-icon" style="background: #ffa502;">
<i class="fas fa-bolt"></i>
</div>
<div class="alert-content">
<div class="alert-title">Power Fluctuation Warning</div>
<div class="alert-time">Generator A - Voltage: 215V (Normal: 220V±5V) - 5 min ago</div>
</div>
<button class="action-btn">Investigate</button>
</div>
<div class="alert-item info">
<div class="alert-icon" style="background: #00d4ff;">
<i class="fas fa-wifi"></i>
</div>
<div class="alert-content">
<div class="alert-title">Connection Restored</div>
<div class="alert-time">Sensor Array B - Connection re-established - 8 min ago</div>
</div>
<button class="action-btn success">Clear</button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3 class="card-title">Alert Statistics</h3>
<div class="card-icon" style="background: linear-gradient(45deg, #a55eea, #26de81);">
<i class="fas fa-chart-pie"></i>
</div>
</div>
<div style="margin-top: 20px;">
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<span>Critical</span>
<span style="color: #ff4757;">12</span>
</div>
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<span>Warning</span>
<span style="color: #ffa502;">28</span>
</div>
<div style="display: flex; justify-content: space-between; margin-bottom: 10px;">
<span>Info</span>
<span style="color: #00d4ff;">45</span>
</div>
</div>
</div>
</div>
</div>
<!-- AI Suggestions Page -->
<div id="suggestions" class="page-content">
<h1 class="page-title">AI-Powered Suggestions</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Optimization Recommendations</h3>
<div class="card-icon suggestions">
<i class="fas fa-lightbulb"></i>
</div>
</div>
<div style="margin-top: 20px;">
<div style="padding: 20px; margin: 15px 0; border-radius: 10px; background: linear-gradient(45deg, rgba(255, 165, 2, 0.1), rgba(255, 99, 72, 0.1)); border: 1px solid rgba(255, 165, 2, 0.3);">
<h4 style="color: #ffa502; margin-bottom: 10px;">🔥 High Priority: Energy Optimization</h4>
<p style="color: #ccc; margin-bottom: 15px;">Based on usage patterns, you can reduce energy consumption by 23% by implementing smart scheduling during off-peak hours (2 AM - 6 AM).</p>
<div style="display: flex; gap: 10px;">
<button class="btn-primary">Implement</button>
<button class="action-btn">Schedule Later</button>
</div>
</div>
<div style="padding: 20px; margin: 15px 0; border-radius: 10px; background: linear-gradient(45deg, rgba(46, 213, 115, 0.1), rgba(30, 144, 255, 0.1)); border: 1px solid rgba(46, 213, 115, 0.3);">
<h4 style="color: #2ed573; margin-bottom: 10px;">⚙️ Predictive Maintenance Alert</h4>
<p style="color: #ccc; margin-bottom: 15px;">Motor Unit #7 showing abnormal vibration patterns. Schedule maintenance within 72 hours to prevent failure.</p>
<div style="display: flex; gap: 10px;">
<button class="btn-primary">Schedule Maintenance</button>
<button class="action-btn">View Details</button>
</div>
</div>
<div style="padding: 20px; margin: 15px 0; border-radius: 10px; background: linear-gradient(45deg, rgba(0, 212, 255, 0.1), rgba(0, 120, 255, 0.1)); border: 1px solid rgba(0, 212, 255, 0.3);">
<h4 style="color: #00d4ff; margin-bottom: 10px;">📊 Performance Enhancement</h4>
<p style="color: #ccc; margin-bottom: 15px;">Adjust pressure settings in Hydraulic System C to improve efficiency by 15%. Optimal pressure: 1.8 bar (current: 2.2 bar).</p>
<div style="display: flex; gap: 10px;">
<button class="btn-primary">Adjust Now</button>
<button class="action-btn">View Details</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- End AI Suggestions Page -->
<!-- Self Healing Page -->
<div id="healing" class="page-content">
<h1 class="page-title">Self Healing System</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Self Healing Status</h3>
<div class="card-icon healing">
<i class="fas fa-magic"></i>
</div>
</div>
<ul style="margin-top: 20px; color: #fff;">
<li>Auto-Recovery Enabled: <span style="color:#2ed573;">Yes</span></li>
<li>Last Self-Heal Event: <span style="color:#ffa502;">3 hours ago</span></li>
<li>Issues Resolved Automatically: <span style="color:#00d4ff;">12</span></li>
<li>Pending Manual Intervention: <span style="color:#ff4757;">1</span></li>
</ul>
<div style="margin-top: 20px;">
<button class="btn-primary">Trigger Self-Heal</button>
</div>
</div>
</div>
</div>
<!-- Device Config Page -->
<div id="devices" class="page-content">
<h1 class="page-title">Device Configuration</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Device List & Status</h3>
<div class="card-icon devices">
<i class="fas fa-cogs"></i>
</div>
</div>
<table style="width:100%; color:#fff; margin-top:20px; border-collapse:collapse;">
<thead>
<tr style="background:rgba(0,212,255,0.08);">
<th style="padding:10px; text-align:left;">Device Name</th>
<th style="padding:10px; text-align:left;">Type</th>
<th style="padding:10px; text-align:left;">Status</th>
<th style="padding:10px; text-align:left;">Last Seen</th>
<th style="padding:10px; text-align:left;">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sensor A1</td>
<td>Temperature</td>
<td><span style="color:#2ed573;">Online</span></td>
<td>2 min ago</td>
<td style="display:flex; gap:4px;">
<button class="action-btn">Config</button>
<button class="action-btn success">Restart</button>
</td>
</tr>
<tr>
<td>Monitor B2</td>
<td>Humidity</td>
<td><span style="color:#ffa502;">Maintenance</span></td>
<td>10 min ago</td>
<td style="display:flex; gap:4px;">
<button class="action-btn">Config</button>
<button class="action-btn danger">Remove</button>
</td>
</tr>
<tr>
<td>Gauge C3</td>
<td>Pressure</td>
<td><span style="color:#ff4757;">Offline</span></td>
<td>1 hour ago</td>
<td style="display:flex; gap:4px;">
<button class="action-btn">Config</button>
<button class="action-btn danger">Remove</button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- Analytics Page -->
<div id="analytics" class="page-content">
<h1 class="page-title">Device Analytics</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">Device Data Analysis</h3>
<div class="card-icon analytics">
<i class="fas fa-chart-bar"></i>
</div>
</div>
<ul style="margin-top: 20px; color: #fff;">
<li>Most Active Device: <span style="color:#00d4ff;">Sensor A1</span></li>
<li>Peak Load Time: <span style="color:#ffa502;">14:00 - 15:00</span></li>
<li>Average Response Time: <span style="color:#2ed573;">120ms</span></li>
<li>Data Packets Sent (24h): <span style="color:#a55eea;">1,234,567</span></li>
</ul>
<div style="margin-top: 30px;">
<canvas id="analyticsChart" width="600" height="220"></canvas>
</div>
</div>
</div>
</div>
<!-- Profile Settings Page -->
<div id="profile" class="page-content">
<h1 class="page-title">Profile Settings</h1>
<div class="dashboard-grid">
<div class="card large-card">
<div class="card-header">
<h3 class="card-title">User Profile</h3>
<div class="card-icon" style="background: linear-gradient(45deg, #00d4ff, #0078ff);">
<i class="fas fa-user-cog"></i>
</div>
</div>
<form style="margin-top: 20px; color: #fff;">
<div class="form-group">
<label class="form-label">Full Name</label>
<input class="form-input" type="text" value="Rohit Giri" />
</div>
<div class="form-group">
<label class="form-label">Email</label>
<input class="form-input" type="email" value="rohit@example.com" />
</div>
<div class="form-group">
<label class="form-label">Role</label>
<input class="form-input" type="text" value="System Administrator" />
</div>
<button class="btn-primary" type="submit">Save Changes</button>
</form>
</div>
</div>
</div>
</main>
<!-- Settings Panel, Footer, or other content can go here if needed -->
</div>
<!-- Optionally, add scripts for navigation and interactivity -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<script>
// SPA-style navigation
function showPage(pageId) {
const pages = document.querySelectorAll('.page-content');
pages.forEach(page => page.classList.remove('active'));
const page = document.getElementById(pageId);
if (page) page.classList.add('active');
// Update active nav link
document.querySelectorAll('.nav-link').forEach(link => link.classList.remove('active'));
const navLinks = document.querySelectorAll('.nav-link');
navLinks.forEach(link => {
if (link.getAttribute('onclick') && link.getAttribute('onclick').includes(pageId)) {
link.classList.add('active');
}
});
// Update URL hash for routing
window.location.hash = pageId;
}
// On load, show page based on hash
window.addEventListener('DOMContentLoaded', () => {
const hash = window.location.hash.replace('#', '');
if (hash) showPage(hash);
});
// Listen for hash changes (browser navigation)
window.addEventListener('hashchange', () => {
const hash = window.location.hash.replace('#', '');
if (hash) showPage(hash);
});
// Real-time Performance Chart with only Temperature
const ctx = document.getElementById('performanceChart')?.getContext('2d');
if (ctx) {
const chartData = {
labels: Array.from({length: 30}, (_, i) => ''),
datasets: [
{
label: 'Temperature (°C)',
data: Array.from({length: 30}, () => Math.floor(Math.random() * 10) + 20),
borderColor: '#ff6384',
backgroundColor: 'rgba(255,99,132,0.08)',
tension: 0.4,
fill: true,
}
]
};
const perfChart = new Chart(ctx, {
type: 'line',
data: chartData,
options: {
responsive: true,
plugins: { legend: { display: true, labels: { color: '#fff', font: { size: 14 } } } },
scales: {
y: { min: 10, max: 40, ticks: { color: '#fff' }, grid: { color: '#333' } },
x: { display: false }
}
}
});
setInterval(() => {
chartData.datasets[0].data.push(Math.floor(Math.random() * 10) + 20);
chartData.datasets[0].data.shift();
perfChart.update();
}, 1500);
}
</script>
<script>
// Analytics Bar Chart
const analyticsCtx = document.getElementById('analyticsChart')?.getContext('2d');
if (analyticsCtx) {
const analyticsData = {
labels: ['Sensor A1', 'Monitor B2', 'Gauge C3', 'Detector D4', 'Air Quality E5'],
datasets: [{
label: 'Data Packets (k)',
data: [120, 95, 60, 150, 110],
backgroundColor: [
'rgba(0,212,255,0.7)',
'rgba(255,165,2,0.7)',
'rgba(255,71,87,0.7)',
'rgba(46,213,115,0.7)',
'rgba(165,94,234,0.7)'
],
borderRadius: 8,
barPercentage: 0.6,
categoryPercentage: 0.6
}]
};
new Chart(analyticsCtx, {
type: 'bar',
data: analyticsData,
options: {
plugins: { legend: { display: false } },
scales: {
y: { beginAtZero: true, ticks: { color: '#fff' }, grid: { color: '#333' } },
x: { ticks: { color: '#fff' }, grid: { color: '#333' } }
}
}
});
}
</script>
</body>
</html>