some progress

This commit is contained in:
Doar Mihai
2026-01-24 12:16:10 +02:00
parent 3665a1d5a3
commit 612cc097f8
51 changed files with 8089 additions and 470 deletions
+501 -178
View File
@@ -4,13 +4,16 @@
@push('styles')
<style>
/* Modern Stats Cards */
.stat-card {
border: none;
border-radius: 16px;
padding: 1.5rem;
transition: all 0.3s ease;
border-radius: 20px;
padding: 2rem 1.75rem;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
background: var(--bg-primary);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.stat-card::before {
@@ -19,204 +22,425 @@
top: 0;
left: 0;
right: 0;
height: 4px;
background: linear-gradient(90deg, var(--card-gradient-start), var(--card-gradient-end));
height: 3px;
background: var(--card-accent);
opacity: 0.8;
}
.stat-card:hover {
transform: translateY(-4px);
box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
transform: translateY(-6px);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}
.stat-card.primary {
--card-gradient-start: #667eea;
--card-gradient-end: #764ba2;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
--card-accent: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.stat-card.success {
--card-gradient-start: #10b981;
--card-gradient-end: #059669;
background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(5, 150, 105, 0.05));
--card-accent: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.stat-card.danger {
--card-gradient-start: #ef4444;
--card-gradient-end: #dc2626;
background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05));
--card-accent: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.stat-card.info {
--card-gradient-start: #3b82f6;
--card-gradient-end: #2563eb;
background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(37, 99, 235, 0.05));
--card-accent: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}
.dark .stat-card.primary {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
.dark .stat-card {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.dark .stat-card.success {
background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(5, 150, 105, 0.1));
}
.dark .stat-card.danger {
background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(220, 38, 38, 0.1));
}
.dark .stat-card.info {
background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(37, 99, 235, 0.1));
.dark .stat-card:hover {
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}
.stat-icon {
width: 56px;
height: 56px;
border-radius: 12px;
width: 64px;
height: 64px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
font-size: 1.75rem;
position: relative;
overflow: hidden;
}
.stat-icon::before {
content: '';
position: absolute;
inset: 0;
background: var(--icon-gradient);
opacity: 0.1;
}
.stat-icon i {
position: relative;
z-index: 1;
}
.stat-icon.primary {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
--icon-gradient: linear-gradient(135deg, #667eea, #764ba2);
color: #667eea;
}
.stat-icon.success {
background: linear-gradient(135deg, #10b981, #059669);
color: white;
--icon-gradient: linear-gradient(135deg, #10b981, #059669);
color: #10b981;
}
.stat-icon.danger {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
--icon-gradient: linear-gradient(135deg, #ef4444, #dc2626);
color: #ef4444;
}
.stat-icon.info {
background: linear-gradient(135deg, #3b82f6, #2563eb);
color: white;
--icon-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);
color: #3b82f6;
}
.dark .stat-icon {
opacity: 0.9;
}
.stat-value {
font-size: 2rem;
font-weight: 700;
font-size: 2.5rem;
font-weight: 800;
line-height: 1;
margin-bottom: 0.25rem;
margin-bottom: 0.5rem;
letter-spacing: -0.02em;
}
.stat-label {
font-size: 0.875rem;
font-weight: 500;
opacity: 0.7;
font-size: 0.8125rem;
font-weight: 600;
opacity: 0.6;
text-transform: uppercase;
letter-spacing: 0.5px;
letter-spacing: 0.8px;
}
.stat-trend {
font-size: 0.75rem;
margin-top: 0.5rem;
font-weight: 500;
}
.stat-trend.up {
color: #10b981;
}
.stat-trend.down {
color: #ef4444;
}
/* Chart Card */
.chart-card {
border: none;
border-radius: 16px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
border-radius: 20px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
background: var(--bg-primary);
overflow: hidden;
}
.dark .chart-card {
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.chart-card .card-header {
background: transparent;
border-bottom: 1px solid var(--border-color);
padding: 1.5rem;
border-radius: 16px 16px 0 0;
padding: 1.75rem 2rem;
}
.chart-card .card-body {
padding: 2rem;
}
.chart-card .card-title {
font-size: 1.125rem;
font-weight: 700;
margin: 0;
display: flex;
align-items: center;
gap: 0.75rem;
}
.chart-card .card-title i {
color: var(--indigo-600);
}
/* Modern Table */
.table-modern {
border-collapse: separate;
border-spacing: 0;
margin: 0;
}
.table-modern thead th {
background: transparent;
border-bottom: 2px solid var(--border-color);
font-weight: 600;
font-size: 0.875rem;
background: var(--bg-secondary);
border: none;
font-weight: 700;
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 0.5px;
padding: 1rem;
letter-spacing: 1px;
padding: 1.25rem 1.5rem;
color: var(--text-secondary);
white-space: nowrap;
}
.table-modern thead th:first-child {
border-top-left-radius: 12px;
}
.table-modern thead th:last-child {
border-top-right-radius: 12px;
}
.table-modern tbody tr {
transition: all 0.2s ease;
border-bottom: 1px solid var(--border-color);
}
.table-modern tbody tr:hover {
background: var(--bg-secondary);
transform: scale(1.01);
}
.table-modern tbody tr:last-child {
border-bottom: none;
}
.table-modern tbody td {
padding: 1.25rem 1rem;
border-bottom: 1px solid var(--border-color);
padding: 1.5rem 1.5rem;
vertical-align: middle;
border: none;
}
.site-info {
display: flex;
align-items: center;
gap: 1rem;
}
.site-avatar {
width: 48px;
height: 48px;
border-radius: 12px;
background: linear-gradient(135deg, #667eea, #764ba2);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 700;
font-size: 1.25rem;
flex-shrink: 0;
}
.site-details {
flex: 1;
min-width: 0;
}
.site-name {
font-weight: 600;
font-weight: 700;
color: var(--text-primary);
font-size: 0.95rem;
font-size: 1rem;
margin-bottom: 0.25rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.site-url {
font-size: 0.8rem;
font-size: 0.8125rem;
color: var(--text-secondary);
margin-top: 0.25rem;
display: flex;
align-items: center;
gap: 0.375rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.site-url i {
opacity: 0.5;
flex-shrink: 0;
}
/* Status Badges */
.badge-modern {
padding: 0.4rem 0.8rem;
border-radius: 8px;
font-weight: 600;
font-size: 0.75rem;
letter-spacing: 0.3px;
padding: 0.5rem 1rem;
border-radius: 10px;
font-weight: 700;
font-size: 0.6875rem;
letter-spacing: 0.5px;
text-transform: uppercase;
display: inline-flex;
align-items: center;
gap: 0.375rem;
white-space: nowrap;
}
.btn-action {
padding: 0.5rem 1rem;
border-radius: 8px;
.badge-modern i {
font-size: 0.875rem;
}
/* Metric Display */
.metric-display {
display: flex;
align-items: center;
gap: 0.75rem;
}
.metric-value {
font-weight: 700;
font-size: 0.9375rem;
}
.metric-label {
font-size: 0.75rem;
color: var(--text-secondary);
font-weight: 500;
}
/* Progress Bar */
.progress-modern {
height: 8px;
border-radius: 10px;
background: var(--bg-secondary);
overflow: hidden;
}
.progress-modern .progress-bar {
border-radius: 10px;
transition: width 0.6s ease;
}
/* Buttons */
.btn-action {
padding: 0.625rem 1.25rem;
border-radius: 12px;
font-weight: 600;
font-size: 0.875rem;
transition: all 0.2s ease;
display: inline-flex;
align-items: center;
gap: 0.5rem;
border: none;
}
.btn-action:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
box-shadow: 0 8px 20px rgba(79, 70, 229, 0.25);
}
.btn-action.btn-outline-primary:hover {
background: var(--indigo-600);
color: white;
border-color: var(--indigo-600);
}
/* Empty State */
.empty-state {
padding: 4rem 2rem;
padding: 5rem 2rem;
text-align: center;
}
.empty-state-icon {
font-size: 4rem;
opacity: 0.3;
margin-bottom: 1.5rem;
font-size: 5rem;
opacity: 0.15;
margin-bottom: 2rem;
background: linear-gradient(135deg, #667eea, #764ba2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.empty-state h5 {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 0.75rem;
}
.empty-state p {
font-size: 1rem;
color: var(--text-secondary);
max-width: 400px;
margin: 0 auto 2rem;
}
/* Page Header */
.page-header {
margin-bottom: 2rem;
margin-bottom: 2.5rem;
}
.page-title {
font-size: 1.75rem;
font-weight: 700;
font-size: 2.25rem;
font-weight: 800;
margin-bottom: 0.5rem;
letter-spacing: -0.02em;
background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.page-subtitle {
color: var(--text-secondary);
font-size: 1rem;
font-size: 1.0625rem;
font-weight: 400;
}
/* Time Badge */
.time-badge {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 1rem;
background: var(--bg-secondary);
border-radius: 10px;
font-size: 0.8125rem;
font-weight: 600;
color: var(--text-secondary);
}
/* Chart Container */
.chart-container {
position: relative;
min-height: 300px;
}
/* Responsive adjustments */
@media (max-width: 768px) {
.stat-card {
padding: 1.5rem 1.25rem;
}
.stat-value {
font-size: 2rem;
}
.stat-icon {
width: 52px;
height: 52px;
font-size: 1.5rem;
}
.page-title {
font-size: 1.75rem;
}
.table-modern thead th,
.table-modern tbody td {
padding: 1rem;
}
.site-avatar {
width: 40px;
height: 40px;
font-size: 1rem;
}
}
</style>
@endpush
@@ -225,14 +449,14 @@
<!-- Page Header -->
<div class="page-header">
<h1 class="page-title">Dashboard</h1>
<p class="page-subtitle">Welcome back! Here's an overview of all your monitored sites.</p>
<p class="page-subtitle">Monitor and manage all your websites from one place</p>
</div>
<!-- Summary Stats -->
<div class="row g-4 mb-4">
<div class="col-md-3 col-sm-6">
<div class="col-lg-3 col-md-6">
<div class="stat-card primary">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
<div class="stat-label">Total Sites</div>
<div class="stat-value">{{ $totalSites }}</div>
@@ -243,12 +467,12 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="col-lg-3 col-md-6">
<div class="stat-card success">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
<div class="stat-label">Sites Up</div>
<div class="stat-value text-success">{{ $sitesUp }}</div>
<div class="stat-label">Sites Online</div>
<div class="stat-value" style="color: #10b981;">{{ $sitesUp }}</div>
</div>
<div class="stat-icon success">
<i class="bi bi-check-circle-fill"></i>
@@ -256,25 +480,25 @@
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="col-lg-3 col-md-6">
<div class="stat-card danger">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
<div class="stat-label">Sites Down</div>
<div class="stat-value text-danger">{{ $sitesDown }}</div>
<div class="stat-value" style="color: #ef4444;">{{ $sitesDown }}</div>
</div>
<div class="stat-icon danger">
<i class="bi bi-exclamation-circle-fill"></i>
<i class="bi bi-x-circle-fill"></i>
</div>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="col-lg-3 col-md-6">
<div class="stat-card info">
<div class="d-flex justify-content-between align-items-center">
<div class="d-flex justify-content-between align-items-start">
<div class="flex-grow-1">
<div class="stat-label">Avg Uptime</div>
<div class="stat-value text-info">{{ number_format($avgUptime, 1) }}%</div>
<div class="stat-label">Average Uptime</div>
<div class="stat-value" style="color: #3b82f6;">{{ number_format($avgUptime, 1) }}%</div>
</div>
<div class="stat-icon info">
<i class="bi bi-graph-up-arrow"></i>
@@ -285,48 +509,41 @@
</div>
<!-- 7-Day Uptime Chart -->
@if($sites->isNotEmpty())
<div class="card chart-card mb-4">
<div class="card-header d-flex justify-content-between align-items-center">
<div>
<h5 class="mb-0 d-flex align-items-center">
<i class="bi bi-graph-up me-2"></i>
7-Day Uptime Overview
<div class="card-header">
<div class="d-flex justify-content-between align-items-center flex-wrap gap-3">
<h5 class="card-title">
<i class="bi bi-activity"></i>
Uptime Trends
</h5>
</div>
<div class="text-muted small">
<i class="bi bi-clock"></i> Last 7 days
<div class="time-badge">
<i class="bi bi-calendar3"></i>
Last 7 Days
</div>
</div>
</div>
<div class="card-body">
@if($sites->isNotEmpty())
<canvas id="weeklyUptimeChart" height="80"></canvas>
@else
<div class="empty-state">
<div class="empty-state-icon">
<i class="bi bi-graph-up"></i>
</div>
<h5>No Data Available</h5>
<p class="text-muted">Add your first site to start monitoring and viewing analytics.</p>
<a href="{{ route('sites.create') }}" class="btn btn-primary mt-3">
<i class="bi bi-plus-circle"></i> Add Your First Site
</a>
</div>
@endif
<div class="chart-container">
<canvas id="weeklyUptimeChart"></canvas>
</div>
</div>
</div>
@endif
<!-- Sites Table -->
<div class="card chart-card">
<div class="card-header d-flex justify-content-between align-items-center">
<div>
<h5 class="mb-0 d-flex align-items-center">
<i class="bi bi-globe me-2"></i>
Your Sites
<div class="card-header">
<div class="d-flex justify-content-between align-items-center flex-wrap gap-3">
<h5 class="card-title">
<i class="bi bi-list-check"></i>
Your Websites
</h5>
<a href="{{ route('sites.create') }}" class="btn btn-primary btn-action">
<i class="bi bi-plus-lg"></i>
Add Website
</a>
</div>
<a href="{{ route('sites.create') }}" class="btn btn-primary btn-sm btn-action">
<i class="bi bi-plus-circle"></i> Add Site
</a>
</div>
<div class="card-body p-0">
@if($sites->isNotEmpty())
@@ -334,13 +551,13 @@
<table class="table table-modern mb-0">
<thead>
<tr>
<th>Site</th>
<th>Status</th>
<th>Uptime</th>
<th>Response</th>
<th>SSL</th>
<th>Links</th>
<th class="text-end">Actions</th>
<th style="width: 30%;">Website</th>
<th style="width: 12%;">Status</th>
<th style="width: 15%;">Uptime</th>
<th style="width: 12%;">Response</th>
<th style="width: 12%;">SSL</th>
<th style="width: 10%;">Links</th>
<th style="width: 9%;" class="text-end">Action</th>
</tr>
</thead>
<tbody>
@@ -349,18 +566,28 @@
$latestCheck = $site->uptimeChecks->first();
$latestSsl = $site->sslCertificates->first();
$daysUntilExpiry = $latestSsl ? now()->diffInDays($latestSsl->expires_at, false) : null;
$uptime = $site->uptime_percentage ?? 0;
$initials = strtoupper(substr($site->name, 0, 2));
@endphp
<tr>
<td>
<div class="site-name">{{ $site->name }}</div>
<div class="site-url">
<i class="bi bi-link-45deg"></i> {{ Str::limit($site->url, 40) }}
<div class="site-info">
<div class="site-avatar" style="background: linear-gradient(135deg, {{ '#' . substr(md5($site->id), 0, 6) }}, {{ '#' . substr(md5($site->id . 'salt'), 0, 6) }});">
{{ $initials }}
</div>
<div class="site-details">
<div class="site-name" title="{{ $site->name }}">{{ $site->name }}</div>
<div class="site-url" title="{{ $site->url }}">
<i class="bi bi-link-45deg"></i>
<span>{{ Str::limit(parse_url($site->url, PHP_URL_HOST), 35) }}</span>
</div>
</div>
</div>
</td>
<td>
@if(!$latestCheck)
<span class="badge badge-modern bg-secondary">
<i class="bi bi-question-circle"></i> Not Checked
<i class="bi bi-dash-circle"></i> Pending
</span>
@elseif($latestCheck->status_code >= 200 && $latestCheck->status_code < 400)
<span class="badge badge-modern bg-success">
@@ -368,29 +595,31 @@
</span>
@else
<span class="badge badge-modern bg-danger">
<i class="bi bi-x-circle-fill"></i> Down
<i class="bi bi-exclamation-circle-fill"></i> Down
</span>
@endif
</td>
<td>
@php
$uptime = $site->uptime_percentage ?? 0;
@endphp
<div class="d-flex align-items-center gap-2">
<div class="progress" style="width: 60px; height: 6px;">
<div class="metric-display">
<div class="progress-modern" style="width: 70px;">
<div class="progress-bar bg-{{ $uptime >= 99 ? 'success' : ($uptime >= 95 ? 'warning' : 'danger') }}"
role="progressbar"
style="width: {{ $uptime }}%"></div>
style="width: {{ $uptime }}%"
aria-valuenow="{{ $uptime }}"
aria-valuemin="0"
aria-valuemax="100"></div>
</div>
<span class="small fw-semibold">{{ number_format($uptime, 1) }}%</span>
<span class="metric-value">{{ number_format($uptime, 1) }}%</span>
</div>
</td>
<td>
@if($site->avg_response_time)
<span class="fw-semibold">{{ round($site->avg_response_time) }}</span>
<span class="text-muted small">ms</span>
<div class="metric-display">
<span class="metric-value">{{ round($site->avg_response_time) }}</span>
<span class="metric-label">ms</span>
</div>
@else
<span class="text-muted">—</span>
<span class="text-muted fw-semibold">—</span>
@endif
</td>
<td>
@@ -409,7 +638,7 @@
</span>
@endif
@else
<span class="text-muted">—</span>
<span class="text-muted fw-semibold">—</span>
@endif
</td>
<td>
@@ -419,13 +648,13 @@
</span>
@else
<span class="badge badge-modern bg-success">
<i class="bi bi-check-circle"></i> 0
<i class="bi bi-check2"></i> None
</span>
@endif
</td>
<td class="text-end">
<a href="{{ route('dashboard.show', $site) }}" class="btn btn-sm btn-outline-primary btn-action">
<i class="bi bi-arrow-right-circle"></i> Details
<i class="bi bi-arrow-right"></i>
</a>
</td>
</tr>
@@ -436,12 +665,13 @@
@else
<div class="empty-state">
<div class="empty-state-icon">
<i class="bi bi-globe"></i>
<i class="bi bi-globe2"></i>
</div>
<h5>No Sites Yet</h5>
<p class="text-muted">Start monitoring your websites by adding your first site.</p>
<a href="{{ route('sites.create') }}" class="btn btn-primary mt-3">
<i class="bi bi-plus-circle"></i> Add Your First Site
<h5>No Websites Yet</h5>
<p>Get started by adding your first website to monitor. It only takes a few seconds!</p>
<a href="{{ route('sites.create') }}" class="btn btn-primary btn-lg btn-action">
<i class="bi bi-plus-circle-fill"></i>
Add Your First Website
</a>
</div>
@endif
@@ -453,50 +683,143 @@
@if($sites->isNotEmpty() && isset($chartData))
<script>
document.addEventListener('DOMContentLoaded', function() {
const ctx = document.getElementById('weeklyUptimeChart').getContext('2d');
const ctx = document.getElementById('weeklyUptimeChart');
if (!ctx) return;
const chartData = @json($chartData);
// Check if user prefers dark mode
const isDarkMode = document.documentElement.classList.contains('dark') ||
localStorage.getItem('darkMode') === 'true';
const gridColor = isDarkMode ? 'rgba(255, 255, 255, 0.1)' : 'rgba(0, 0, 0, 0.06)';
const textColor = isDarkMode ? 'rgba(255, 255, 255, 0.7)' : 'rgba(0, 0, 0, 0.7)';
new Chart(ctx, {
type: 'line',
data: {
labels: chartData.labels,
datasets: chartData.datasets.map((dataset, index) => ({
label: dataset.label,
data: dataset.data,
borderColor: dataset.color,
backgroundColor: dataset.color + '33',
borderWidth: 2,
fill: false,
tension: 0.1
}))
datasets: chartData.datasets.map((dataset, index) => {
const colors = [
{ border: '#667eea', bg: 'rgba(102, 126, 234, 0.1)' },
{ border: '#10b981', bg: 'rgba(16, 185, 129, 0.1)' },
{ border: '#f59e0b', bg: 'rgba(245, 158, 11, 0.1)' },
{ border: '#ef4444', bg: 'rgba(239, 68, 68, 0.1)' },
{ border: '#3b82f6', bg: 'rgba(59, 130, 246, 0.1)' },
];
const color = colors[index % colors.length];
return {
label: dataset.label,
data: dataset.data,
borderColor: color.border,
backgroundColor: color.bg,
borderWidth: 3,
fill: true,
tension: 0.4,
pointRadius: 4,
pointHoverRadius: 6,
pointBackgroundColor: color.border,
pointBorderColor: '#fff',
pointBorderWidth: 2,
pointHoverBackgroundColor: color.border,
pointHoverBorderColor: '#fff',
pointHoverBorderWidth: 3,
};
})
},
options: {
responsive: true,
maintainAspectRatio: true,
aspectRatio: 2.5,
interaction: {
mode: 'index',
intersect: false,
},
plugins: {
legend: {
display: true,
position: 'top'
position: 'bottom',
labels: {
usePointStyle: true,
pointStyle: 'circle',
padding: 20,
font: {
size: 13,
weight: '600',
family: 'Inter, sans-serif'
},
color: textColor
}
},
tooltip: {
mode: 'index',
intersect: false
enabled: true,
backgroundColor: isDarkMode ? 'rgba(30, 30, 30, 0.95)' : 'rgba(255, 255, 255, 0.95)',
titleColor: isDarkMode ? '#fff' : '#000',
bodyColor: isDarkMode ? 'rgba(255, 255, 255, 0.8)' : 'rgba(0, 0, 0, 0.8)',
borderColor: gridColor,
borderWidth: 1,
padding: 12,
boxPadding: 6,
usePointStyle: true,
titleFont: {
size: 14,
weight: '700',
family: 'Inter, sans-serif'
},
bodyFont: {
size: 13,
weight: '600',
family: 'Inter, sans-serif'
},
callbacks: {
label: function(context) {
let label = context.dataset.label || '';
if (label) {
label += ': ';
}
if (context.parsed.y !== null) {
label += context.parsed.y.toFixed(1) + '%';
}
return label;
}
}
}
},
scales: {
y: {
beginAtZero: true,
max: 100,
title: {
display: true,
text: 'Uptime %'
grid: {
color: gridColor,
drawBorder: false,
},
ticks: {
callback: function(value) {
return value + '%';
},
font: {
size: 12,
weight: '600',
family: 'Inter, sans-serif'
},
color: textColor,
padding: 8
}
},
x: {
title: {
display: true,
text: 'Date'
grid: {
display: false,
drawBorder: false,
},
ticks: {
font: {
size: 12,
weight: '600',
family: 'Inter, sans-serif'
},
color: textColor,
padding: 8
}
}
}