Spaces:
Running
Running
add more features to this
Browse files- components/navbar.js +8 -2
- index.html +6 -1
- script.js +12 -1
- status.html +178 -0
- style.css +23 -2
components/navbar.js
CHANGED
|
@@ -16,8 +16,14 @@ class CustomNavbar extends HTMLElement {
|
|
| 16 |
<i data-feather="wifi" class="text-primary-500"></i>
|
| 17 |
<span class="text-xl font-bold text-gray-800 dark:text-white">Modem Magic</span>
|
| 18 |
</div>
|
| 19 |
-
<div class="flex items-center space-x-
|
| 20 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
<i data-feather="moon"></i>
|
| 22 |
</button>
|
| 23 |
</div>
|
|
|
|
| 16 |
<i data-feather="wifi" class="text-primary-500"></i>
|
| 17 |
<span class="text-xl font-bold text-gray-800 dark:text-white">Modem Magic</span>
|
| 18 |
</div>
|
| 19 |
+
<div class="flex items-center space-x-6">
|
| 20 |
+
<a href="/" class="text-gray-600 dark:text-gray-300 hover:text-primary-500 transition-colors hidden md:block">
|
| 21 |
+
<i data-feather="home"></i>
|
| 22 |
+
</a>
|
| 23 |
+
<a href="status.html" class="text-gray-600 dark:text-gray-300 hover:text-primary-500 transition-colors hidden md:block">
|
| 24 |
+
<i data-feather="activity"></i>
|
| 25 |
+
</a>
|
| 26 |
+
<button id="themeToggle" class="theme-toggle p-2 rounded-full bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-200">
|
| 27 |
<i data-feather="moon"></i>
|
| 28 |
</button>
|
| 29 |
</div>
|
index.html
CHANGED
|
@@ -32,7 +32,12 @@
|
|
| 32 |
<main class="container mx-auto px-4 py-8">
|
| 33 |
<div class="flex justify-between items-center mb-8">
|
| 34 |
<h1 class="text-3xl font-bold text-gray-800 dark:text-white">Modem Tasks</h1>
|
| 35 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
<i data-feather="plus"></i> Add Task
|
| 37 |
</button>
|
| 38 |
</div>
|
|
|
|
| 32 |
<main class="container mx-auto px-4 py-8">
|
| 33 |
<div class="flex justify-between items-center mb-8">
|
| 34 |
<h1 class="text-3xl font-bold text-gray-800 dark:text-white">Modem Tasks</h1>
|
| 35 |
+
<div class="flex gap-4">
|
| 36 |
+
<a href="status.html" class="flex items-center gap-2 text-gray-600 dark:text-gray-300 hover:text-primary-500 transition-colors">
|
| 37 |
+
<i data-feather="activity"></i> Status
|
| 38 |
+
</a>
|
| 39 |
+
<button id="addTaskBtn" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-all hover:scale-105">
|
| 40 |
+
<button id="addTaskBtn" class="bg-primary-500 hover:bg-primary-600 text-white px-4 py-2 rounded-lg flex items-center gap-2 transition-all hover:scale-105">
|
| 41 |
<i data-feather="plus"></i> Add Task
|
| 42 |
</button>
|
| 43 |
</div>
|
script.js
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
document.addEventListener('DOMContentLoaded', function() {
|
| 2 |
-
|
| 3 |
const addTaskBtn = document.getElementById('addTaskBtn');
|
| 4 |
const taskModal = document.getElementById('taskModal');
|
| 5 |
const closeModalBtn = document.getElementById('closeModalBtn');
|
|
|
|
| 1 |
+
|
| 2 |
+
// Utility functions
|
| 3 |
+
function formatBytes(bytes, decimals = 2) {
|
| 4 |
+
if (bytes === 0) return '0 Bytes';
|
| 5 |
+
const k = 1024;
|
| 6 |
+
const dm = decimals < 0 ? 0 : decimals;
|
| 7 |
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
|
| 8 |
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
| 9 |
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
document.addEventListener('DOMContentLoaded', function() {
|
| 13 |
+
// DOM Elements
|
| 14 |
const addTaskBtn = document.getElementById('add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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Status | Modem Magic Manager</title>
|
| 7 |
+
<link rel="stylesheet" href="style.css">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
</head>
|
| 11 |
+
<body class="bg-gray-100 dark:bg-gray-900 transition-colors duration-300 min-h-screen">
|
| 12 |
+
<custom-navbar></custom-navbar>
|
| 13 |
+
|
| 14 |
+
<main class="container mx-auto px-4 py-8">
|
| 15 |
+
<h1 class="text-3xl font-bold text-gray-800 dark:text-white mb-8">Network Status</h1>
|
| 16 |
+
|
| 17 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
|
| 18 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
| 19 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Connection Status</h2>
|
| 20 |
+
<div class="flex items-center mb-2">
|
| 21 |
+
<div class="w-3 h-3 rounded-full bg-green-500 mr-2 pulse"></div>
|
| 22 |
+
<span class="text-gray-700 dark:text-gray-300">Connected</span>
|
| 23 |
+
</div>
|
| 24 |
+
<div class="grid grid-cols-2 gap-4 mt-4">
|
| 25 |
+
<div>
|
| 26 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Download Speed</p>
|
| 27 |
+
<p class="text-2xl font-bold text-primary-500">95.2 Mbps</p>
|
| 28 |
+
</div>
|
| 29 |
+
<div>
|
| 30 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Upload Speed</p>
|
| 31 |
+
<p class="text-2xl font-bold text-secondary-500">42.8 Mbps</p>
|
| 32 |
+
</div>
|
| 33 |
+
<div>
|
| 34 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Latency</p>
|
| 35 |
+
<p class="text-2xl font-bold">24 ms</p>
|
| 36 |
+
</div>
|
| 37 |
+
<div>
|
| 38 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Uptime</p>
|
| 39 |
+
<p class="text-2xl font-bold">12d 4h</p>
|
| 40 |
+
</div>
|
| 41 |
+
</div>
|
| 42 |
+
</div>
|
| 43 |
+
|
| 44 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
| 45 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Connected Devices</h2>
|
| 46 |
+
<div class="flex justify-between mb-4">
|
| 47 |
+
<div>
|
| 48 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Total Devices</p>
|
| 49 |
+
<p class="text-2xl font-bold">8</p>
|
| 50 |
+
</div>
|
| 51 |
+
<div>
|
| 52 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">Active Now</p>
|
| 53 |
+
<p class="text-2xl font-bold text-green-500">5</p>
|
| 54 |
+
</div>
|
| 55 |
+
</div>
|
| 56 |
+
<div class="h-48" id="deviceChart"></div>
|
| 57 |
+
</div>
|
| 58 |
+
</div>
|
| 59 |
+
|
| 60 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
| 61 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
| 62 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Data Usage</h2>
|
| 63 |
+
<div class="h-64" id="dataUsageChart"></div>
|
| 64 |
+
</div>
|
| 65 |
+
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-md p-6">
|
| 66 |
+
<h2 class="text-xl font-semibold text-gray-800 dark:text-white mb-4">Recent Events</h2>
|
| 67 |
+
<div class="space-y-4">
|
| 68 |
+
<div class="flex items-start">
|
| 69 |
+
<div class="w-2 h-2 rounded-full bg-green-500 mt-2 mr-3"></div>
|
| 70 |
+
<div>
|
| 71 |
+
<p class="text-gray-800 dark:text-gray-200">New device connected - Smart TV</p>
|
| 72 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">2 minutes ago</p>
|
| 73 |
+
</div>
|
| 74 |
+
</div>
|
| 75 |
+
<div class="flex items-start">
|
| 76 |
+
<div class="w-2 h-2 rounded-full bg-blue-500 mt-2 mr-3"></div>
|
| 77 |
+
<div>
|
| 78 |
+
<p class="text-gray-800 dark:text-gray-200">Firmware check completed</p>
|
| 79 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">1 hour ago</p>
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
<div class="flex items-start">
|
| 83 |
+
<div class="w-2 h-2 rounded-full bg-yellow-500 mt-2 mr-3"></div>
|
| 84 |
+
<div>
|
| 85 |
+
<p class="text-gray-800 dark:text-gray-200">Connection instability detected</p>
|
| 86 |
+
<p class="text-sm text-gray-500 dark:text-gray-400">3 hours ago</p>
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
</div>
|
| 90 |
+
</div>
|
| 91 |
+
</div>
|
| 92 |
+
</main>
|
| 93 |
+
|
| 94 |
+
<custom-footer></custom-footer>
|
| 95 |
+
|
| 96 |
+
<script src="components/navbar.js"></script>
|
| 97 |
+
<script src="components/footer.js"></script>
|
| 98 |
+
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
| 99 |
+
<script src="script.js"></script>
|
| 100 |
+
<script>
|
| 101 |
+
feather.replace();
|
| 102 |
+
|
| 103 |
+
// Initialize charts
|
| 104 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 105 |
+
// Device Chart
|
| 106 |
+
const deviceCtx = document.getElementById('deviceChart').getContext('2d');
|
| 107 |
+
new Chart(deviceCtx, {
|
| 108 |
+
type: 'doughnut',
|
| 109 |
+
data: {
|
| 110 |
+
labels: ['Phones', 'Computers', 'IoT', 'Other'],
|
| 111 |
+
datasets: [{
|
| 112 |
+
data: [3, 2, 2, 1],
|
| 113 |
+
backgroundColor: [
|
| 114 |
+
'#6366f1',
|
| 115 |
+
'#10b981',
|
| 116 |
+
'#f59e0b',
|
| 117 |
+
'#888888'
|
| 118 |
+
],
|
| 119 |
+
borderWidth: 0
|
| 120 |
+
}]
|
| 121 |
+
},
|
| 122 |
+
options: {
|
| 123 |
+
cutout: '70%',
|
| 124 |
+
plugins: {
|
| 125 |
+
legend: {
|
| 126 |
+
position: 'right'
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
}
|
| 130 |
+
});
|
| 131 |
+
|
| 132 |
+
// Data Usage Chart
|
| 133 |
+
const dataUsageCtx = document.getElementById('dataUsageChart').getContext('2d');
|
| 134 |
+
new Chart(dataUsageCtx, {
|
| 135 |
+
type: 'line',
|
| 136 |
+
data: {
|
| 137 |
+
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
| 138 |
+
datasets: [
|
| 139 |
+
{
|
| 140 |
+
label: 'Download',
|
| 141 |
+
data: [12, 19, 15, 22, 18, 25, 30],
|
| 142 |
+
borderColor: '#6366f1',
|
| 143 |
+
backgroundColor: 'rgba(99, 102, 241, 0.1)',
|
| 144 |
+
fill: true,
|
| 145 |
+
tension: 0.3
|
| 146 |
+
},
|
| 147 |
+
{
|
| 148 |
+
label: 'Upload',
|
| 149 |
+
data: [5, 8, 6, 9, 7, 10, 12],
|
| 150 |
+
borderColor: '#10b981',
|
| 151 |
+
backgroundColor: 'rgba(16, 185, 129, 0.1)',
|
| 152 |
+
fill: true,
|
| 153 |
+
tension: 0.3
|
| 154 |
+
}
|
| 155 |
+
]
|
| 156 |
+
},
|
| 157 |
+
options: {
|
| 158 |
+
responsive: true,
|
| 159 |
+
plugins: {
|
| 160 |
+
legend: {
|
| 161 |
+
position: 'top'
|
| 162 |
+
}
|
| 163 |
+
},
|
| 164 |
+
scales: {
|
| 165 |
+
y: {
|
| 166 |
+
beginAtZero: true,
|
| 167 |
+
title: {
|
| 168 |
+
display: true,
|
| 169 |
+
text: 'GB'
|
| 170 |
+
}
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
});
|
| 175 |
+
});
|
| 176 |
+
</script>
|
| 177 |
+
</body>
|
| 178 |
+
</html>
|
style.css
CHANGED
|
@@ -40,7 +40,6 @@
|
|
| 40 |
.completed {
|
| 41 |
position: relative;
|
| 42 |
}
|
| 43 |
-
|
| 44 |
.completed::after {
|
| 45 |
content: '';
|
| 46 |
position: absolute;
|
|
@@ -51,4 +50,26 @@
|
|
| 51 |
background: rgba(16, 185, 129, 0.1);
|
| 52 |
z-index: 1;
|
| 53 |
border-radius: 0.5rem;
|
| 54 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
.completed {
|
| 41 |
position: relative;
|
| 42 |
}
|
|
|
|
| 43 |
.completed::after {
|
| 44 |
content: '';
|
| 45 |
position: absolute;
|
|
|
|
| 50 |
background: rgba(16, 185, 129, 0.1);
|
| 51 |
z-index: 1;
|
| 52 |
border-radius: 0.5rem;
|
| 53 |
+
}
|
| 54 |
+
|
| 55 |
+
/* Status page styles */
|
| 56 |
+
.pulse {
|
| 57 |
+
animation: pulse 1.5s infinite;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
#deviceChart, #dataUsageChart {
|
| 61 |
+
width: 100% !important;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
.status-card {
|
| 65 |
+
transition: all 0.3s ease;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
.status-card:hover {
|
| 69 |
+
transform: translateY(-3px);
|
| 70 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
.dark .status-card:hover {
|
| 74 |
+
box-shadow: 0 4px 6px -1px rgba(255, 255, 255, 0.1), 0 2px 4px -1px rgba(255, 255, 255, 0.06);
|
| 75 |
+
}
|