- Switched from mock data to real backend APIs. - Implemented unified ApiClient for consistent frontend data fetching. - Refactored dashboard structure and styles for a modern SaaS aesthetic. - Fixed Axum 0.8+ routing and parameter syntax issues. - Implemented real client creation/deletion and provider health monitoring. - Synchronized WebSocket event structures between backend and frontend.
409 lines
8.2 KiB
CSS
409 lines
8.2 KiB
CSS
/* Reset and Base Styles */
|
|
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
/* Color Palette - Modern SaaS Darkish Theme */
|
|
--primary: #6366f1;
|
|
--primary-dark: #4f46e5;
|
|
--primary-light: #818cf8;
|
|
--secondary: #64748b;
|
|
--success: #10b981;
|
|
--warning: #f59e0b;
|
|
--danger: #ef4444;
|
|
--info: #06b6d4;
|
|
|
|
/* Background Colors */
|
|
--bg-primary: #ffffff;
|
|
--bg-secondary: #f8fafc;
|
|
--bg-sidebar: #0f172a;
|
|
--bg-card: #ffffff;
|
|
--bg-hover: #f1f5f9;
|
|
|
|
/* Text Colors */
|
|
--text-primary: #0f172a;
|
|
--text-secondary: #475569;
|
|
--text-light: #94a3b8;
|
|
--text-white: #ffffff;
|
|
|
|
/* Borders */
|
|
--border-color: #e2e8f0;
|
|
--border-radius: 12px;
|
|
--border-radius-sm: 6px;
|
|
|
|
/* Shadows */
|
|
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
|
--shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
|
--shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
|
|
--shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
|
|
}
|
|
|
|
body {
|
|
font-family: 'Inter', -apple-system, sans-serif;
|
|
background-color: var(--bg-secondary);
|
|
color: var(--text-primary);
|
|
line-height: 1.6;
|
|
overflow-x: hidden;
|
|
}
|
|
|
|
/* Utils */
|
|
.text-center { text-align: center; }
|
|
.whitespace-nowrap { white-space: nowrap; }
|
|
.code-sm { font-family: monospace; font-size: 0.8rem; background: var(--bg-secondary); padding: 2px 4px; border-radius: 4px; }
|
|
|
|
/* Login Screen */
|
|
.login-container {
|
|
min-height: 100vh;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
background: radial-gradient(circle at top left, #1e293b, #0f172a);
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
.login-card {
|
|
background: var(--bg-primary);
|
|
border-radius: var(--border-radius);
|
|
box-shadow: var(--shadow-lg);
|
|
padding: 3rem;
|
|
width: 100%;
|
|
max-width: 450px;
|
|
}
|
|
|
|
/* Sidebar */
|
|
.sidebar {
|
|
width: 260px;
|
|
background-color: var(--bg-sidebar);
|
|
color: var(--text-white);
|
|
position: fixed;
|
|
height: 100vh;
|
|
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
z-index: 1000;
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
.sidebar.collapsed .logo span,
|
|
.sidebar.collapsed .menu-title,
|
|
.sidebar.collapsed .menu-item span,
|
|
.sidebar.collapsed .user-details {
|
|
display: none;
|
|
}
|
|
|
|
.sidebar.collapsed .menu-item {
|
|
justify-content: center;
|
|
padding: 0.75rem 0;
|
|
}
|
|
|
|
.sidebar.collapsed .menu-item i {
|
|
margin: 0;
|
|
font-size: 1.25rem;
|
|
}
|
|
|
|
.sidebar-header {
|
|
padding: 1.5rem;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
|
|
}
|
|
|
|
.logo {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
font-size: 1.25rem;
|
|
font-weight: 800;
|
|
letter-spacing: -0.025em;
|
|
}
|
|
|
|
.logo i {
|
|
color: var(--primary-light);
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.menu-section {
|
|
padding: 1.5rem 0;
|
|
}
|
|
|
|
.menu-title {
|
|
font-size: 0.7rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
color: var(--text-light);
|
|
padding: 0 1.5rem 0.75rem;
|
|
letter-spacing: 0.1em;
|
|
}
|
|
|
|
.menu-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
padding: 0.75rem 1.5rem;
|
|
color: #94a3b8;
|
|
text-decoration: none;
|
|
font-weight: 500;
|
|
transition: all 0.2s;
|
|
border-right: 3px solid transparent;
|
|
}
|
|
|
|
.menu-item:hover {
|
|
color: var(--text-white);
|
|
background: rgba(255, 255, 255, 0.03);
|
|
}
|
|
|
|
.menu-item.active {
|
|
color: var(--text-white);
|
|
background: linear-gradient(90deg, rgba(99, 102, 241, 0.1), transparent);
|
|
border-right-color: var(--primary);
|
|
}
|
|
|
|
/* Main Content Area */
|
|
.main-content {
|
|
margin-left: 260px;
|
|
min-height: 100vh;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.sidebar.collapsed ~ .main-content {
|
|
margin-left: 80px;
|
|
}
|
|
|
|
.top-nav {
|
|
height: 70px;
|
|
background: rgba(255, 255, 255, 0.8);
|
|
backdrop-filter: blur(8px);
|
|
border-bottom: 1px solid var(--border-color);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
padding: 0 2rem;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.page-content {
|
|
padding: 2rem;
|
|
}
|
|
|
|
/* Dashboard Cards */
|
|
.stat-card {
|
|
background: var(--bg-card);
|
|
padding: 1.5rem;
|
|
border-radius: var(--border-radius);
|
|
border: 1px solid var(--border-color);
|
|
box-shadow: var(--shadow-sm);
|
|
display: flex;
|
|
gap: 1.25rem;
|
|
align-items: flex-start;
|
|
}
|
|
|
|
.stat-icon {
|
|
width: 48px;
|
|
height: 48px;
|
|
border-radius: 10px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 1.25rem;
|
|
}
|
|
|
|
.stat-value {
|
|
font-size: 1.75rem;
|
|
font-weight: 800;
|
|
letter-spacing: -0.025em;
|
|
}
|
|
|
|
.stat-label {
|
|
color: var(--text-secondary);
|
|
font-size: 0.875rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
/* Badges */
|
|
.grid-2 {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.grid-3 {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.status-badge {
|
|
padding: 0.25rem 0.75rem;
|
|
border-radius: 9999px;
|
|
font-size: 0.7rem;
|
|
font-weight: 700;
|
|
text-transform: uppercase;
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.375rem;
|
|
}
|
|
|
|
.status-badge.online, .status-badge.success { background: #dcfce7; color: #166534; }
|
|
.status-badge.offline, .status-badge.danger { background: #fee2e2; color: #991b1b; }
|
|
.status-badge.warning { background: #fef9c3; color: #854d0e; }
|
|
|
|
.badge-client {
|
|
background: #f1f5f9;
|
|
color: #475569;
|
|
padding: 2px 8px;
|
|
border-radius: 6px;
|
|
font-family: monospace;
|
|
font-size: 0.85rem;
|
|
border: 1px solid #e2e8f0;
|
|
}
|
|
|
|
/* Provider Grid */
|
|
.provider-cards-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
|
gap: 1.5rem;
|
|
}
|
|
|
|
.provider-card {
|
|
background: var(--bg-card);
|
|
border-radius: var(--border-radius);
|
|
border: 1px solid var(--border-color);
|
|
overflow: hidden;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.provider-card:hover {
|
|
box-shadow: var(--shadow-md);
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.provider-card-header {
|
|
padding: 1.25rem;
|
|
border-bottom: 1px solid var(--border-color);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.provider-name {
|
|
font-size: 1.125rem;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.provider-card-body {
|
|
padding: 1.25rem;
|
|
}
|
|
|
|
.model-tags {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 0.5rem;
|
|
margin-top: 1rem;
|
|
}
|
|
|
|
.model-tag {
|
|
background: #f1f5f9;
|
|
padding: 2px 10px;
|
|
border-radius: 6px;
|
|
font-size: 0.75rem;
|
|
font-weight: 600;
|
|
color: #64748b;
|
|
}
|
|
|
|
/* Forms */
|
|
.form-control label {
|
|
font-weight: 600;
|
|
margin-bottom: 0.5rem;
|
|
font-size: 0.875rem;
|
|
}
|
|
|
|
.form-control input, .form-control textarea {
|
|
border: 1px solid #cbd5e1;
|
|
border-radius: 8px;
|
|
padding: 0.75rem;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.form-control input:focus {
|
|
border-color: var(--primary);
|
|
box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
|
|
}
|
|
|
|
/* Modals */
|
|
.modal {
|
|
background: rgba(15, 23, 42, 0.6);
|
|
backdrop-filter: blur(4px);
|
|
}
|
|
|
|
.modal-content {
|
|
border-radius: 16px;
|
|
border: none;
|
|
box-shadow: var(--shadow-lg);
|
|
}
|
|
|
|
/* Charts Area */
|
|
.chart-container {
|
|
background: white;
|
|
border: 1px solid var(--border-color);
|
|
border-radius: var(--border-radius);
|
|
padding: 1.5rem;
|
|
}
|
|
|
|
/* Logs Style */
|
|
.log-row {
|
|
font-family: 'Inter', sans-serif;
|
|
}
|
|
|
|
.log-meta {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.log-provider {
|
|
font-size: 0.75rem;
|
|
color: var(--text-light);
|
|
text-transform: uppercase;
|
|
font-weight: 700;
|
|
}
|
|
|
|
.log-message-container {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
align-items: center;
|
|
}
|
|
|
|
.log-tokens, .log-duration {
|
|
font-size: 0.75rem;
|
|
color: var(--text-secondary);
|
|
background: #f8fafc;
|
|
padding: 2px 6px;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
.log-error-msg {
|
|
width: 100%;
|
|
color: var(--danger);
|
|
font-size: 0.8rem;
|
|
margin-top: 4px;
|
|
font-style: italic;
|
|
}
|
|
|
|
/* WebSocket Status */
|
|
.ws-status {
|
|
background: #0f172a;
|
|
color: white;
|
|
padding: 6px 16px;
|
|
border-radius: 999px;
|
|
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
}
|
|
|
|
.ws-dot.connected { background: var(--success); box-shadow: 0 0 8px var(--success); }
|
|
.ws-dot.disconnected { background: var(--danger); }
|
|
.ws-dot.error { background: var(--warning); }
|