Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

Add audit graphs, server selector & UI tweaks

Juan Denisd84441810f98
diff --git a/README.md b/README.md
index a56ea027..b58842ae 100644
--- a/README.md
+++ b/README.md
@@ -62,10 +62,14 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
**Domain Management** — Nginx virtual hosts with easy configuration
+**DNS Zone Management** — Full DNS record management with propagation checking (A, AAAA, CNAME, MX, TXT, etc.)
+
**SSL Certificates** — Automatic Let's Encrypt with auto-renewal
**Databases** — MySQL/MariaDB and PostgreSQL with user management and query interface
+**Cloud Provisioning** — Provision servers on DigitalOcean, Hetzner, Vultr, and Linode with cost tracking
+
**Firewall** — UFW/firewalld with visual rule management and port presets
**Cron Jobs** — Schedule tasks with a visual editor
@@ -96,7 +100,13 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
**Agent-Based Architecture** — Go agent with HMAC-SHA256 authentication and real-time WebSocket gateway
-**Fleet Overview** — Centralized dashboard with server grouping, tagging, and health monitoring
+**Fleet Management** — Agent lifecycle control with version rollouts, approval queue, network discovery, and command queue
+
+**Fleet Monitor** — Cross-server heatmaps, metric comparison charts, alert thresholds, anomaly detection, and capacity forecasting
+
+**Agent Plugins** — Extensible plugin system with capabilities, permissions, and per-server installation
+
+**Server Templates** — Configuration templates with compliance tracking, drift detection, and auto-remediation
**Remote Docker** — Manage containers, images, volumes, networks, and Compose projects across all servers
@@ -110,6 +120,8 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
**Uptime Tracking** — Historical server uptime data and visualization
+**Status Pages** — Public status pages with HTTP/TCP/DNS/Ping health checks, component monitoring, and incident management
+
**Notifications** — Discord, Slack, Telegram, email (HTML templates), and generic webhooks
**Per-User Preferences** — Individual notification channels, severity filters, and quiet hours
@@ -118,6 +130,8 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
**Multi-User** — Admin, developer, and viewer roles with team invitations
+**Workspaces** — Multi-tenant workspace isolation with quotas and member management
+
**RBAC** — Granular per-feature permissions (read/write per module)
**SSO & OAuth** — Google, GitHub, OpenID Connect, and SAML 2.0 with account linking
@@ -128,6 +142,18 @@ English | [Español](docs/README.es.md) | [中文版](docs/README.zh-CN.md) | [P
**Webhook Subscriptions** — Event-driven webhooks with HMAC signatures, retry logic, and custom headers
+### 🎨 Customization
+
+**Sidebar Presets** — Switch between Full, Web Hosting, Email Admin, DevOps, and Minimal views with one click
+
+**Collapsible Navigation** — Sidebar groups auto-expand on navigation and collapse when switching sections
+
+**Accent Colors** — 8 preset accent colors plus custom hex picker
+
+**Custom Branding** — White-label the sidebar with your own logo, brand name, or full-width banner
+
+**Dashboard Widgets** — Toggle and reorder dashboard widgets to fit your workflow
+
---
## 🚀 Quick Start
@@ -262,13 +288,15 @@ See the [Installation Guide](docs/INSTALLATION.md) for step-by-step instructions
- [x] API enhancements — API keys, rate limiting, OpenAPI docs, webhook subscriptions
- [x] SSO & OAuth — Google, GitHub, OIDC, SAML
- [x] Database migrations — Flask-Migrate/Alembic, versioned schema
-- [ ] Agent fleet management — Auto-upgrade, bulk ops, offline command queue
-- [ ] Cross-server monitoring — Fleet dashboard, anomaly detection, alerting
-- [ ] Agent plugin system — Extensible agent with custom metrics, commands, health checks
-- [ ] Server templates & config sync — Drift detection, compliance dashboards
-- [ ] Multi-tenancy — Workspaces, team isolation, per-workspace settings
-- [ ] DNS zone management — Cloudflare, Route53, DigitalOcean integrations
-- [ ] Status pages — Public status page, health checks, incident management
+- [x] Agent fleet management — Version rollouts, approval queue, discovery, command queue
+- [x] Cross-server monitoring — Fleet heatmaps, comparison charts, anomaly detection, capacity forecasting
+- [x] Agent plugin system — Extensible agent with capabilities, permissions, per-server install
+- [x] Server templates & config sync — Drift detection, compliance dashboards, auto-remediation
+- [x] Multi-tenancy — Workspaces with quotas, member management, isolation
+- [x] DNS zone management — Full record management with propagation checking
+- [x] Status pages — Public status pages with health checks, incident management
+- [x] Cloud provisioning — DigitalOcean, Hetzner, Vultr, Linode with cost tracking
+- [x] Customizable sidebar — Collapsible groups, view presets, accent colors, white-label branding
Full details: [ROADMAP.md](ROADMAP.md)
@@ -292,7 +320,7 @@ Full details: [ROADMAP.md](ROADMAP.md)
| Layer | Technology |
|-------|------------|
| Backend | Python 3.11, Flask, SQLAlchemy, Flask-SocketIO, Flask-Migrate |
-| Frontend | React 18, Vite, LESS, Recharts |
+| Frontend | React 18, Vite, SCSS, Recharts |
| Database | SQLite / PostgreSQL |
| Web Server | Nginx, Gunicorn (GeventWebSocket) |
| Containers | Docker, Docker Compose |
@@ -311,7 +339,7 @@ Contributions are welcome! Please read [CONTRIBUTING.md](CONTRIBUTING.md) first.
fork → feature branch → commit → push → pull request
```
-**Priority areas:** Agent plugin system, fleet management, DNS integrations, status pages, UI/UX improvements, documentation.
+**Priority areas:** Cloud provider integrations, marketplace extensions, UI/UX improvements, documentation, test coverage.
---
diff --git a/backend/app/api/admin.py b/backend/app/api/admin.py
index c01e65e0..bc8b6b2b 100644
--- a/backend/app/api/admin.py
+++ b/backend/app/api/admin.py
@@ -518,10 +518,11 @@ def get_activity_summary():
'action_count': count
})
- # Daily action counts for the past 7 days
+ # Daily action counts for the past 90 days
daily_counts = []
- for i in range(7):
- day_start = today_start - timedelta(days=6 - i)
+ days_to_fetch = 90
+ for i in range(days_to_fetch):
+ day_start = today_start - timedelta(days=(days_to_fetch - 1) - i)
day_end = day_start + timedelta(days=1)
count = db.session.query(func.count(AuditLog.id)).filter(
AuditLog.created_at >= day_start,
@@ -532,12 +533,30 @@ def get_activity_summary():
'count': count
})
+ # Top user activity (past 90 days)
+ top_user_daily = []
+ if top_users:
+ top_user_id = top_users[0]['user_id']
+ for i in range(days_to_fetch):
+ day_start = today_start - timedelta(days=(days_to_fetch - 1) - i)
+ day_end = day_start + timedelta(days=1)
+ count = db.session.query(func.count(AuditLog.id)).filter(
+ AuditLog.user_id == top_user_id,
+ AuditLog.created_at >= day_start,
+ AuditLog.created_at < day_end
+ ).scalar() or 0
+ top_user_daily.append({
+ 'date': day_start.strftime('%Y-%m-%d'),
+ 'count': count
+ })
+
return jsonify({
'active_users_today': active_today,
'actions_this_week': actions_this_week,
'total_users': total_users,
'top_users': top_users,
'daily_counts': daily_counts,
+ 'top_user_daily': top_user_daily,
}), 200
diff --git a/frontend/src/components/Sidebar.jsx b/frontend/src/components/Sidebar.jsx
index e33b5d74..ab6825ad 100644
--- a/frontend/src/components/Sidebar.jsx
+++ b/frontend/src/components/Sidebar.jsx
@@ -72,20 +72,21 @@ const Sidebar = () => {
const conditions = { wpInstalled };
const currentPreset = user?.sidebar_config?.preset || 'full';
- const [expandedItems, setExpandedItems] = useState({});
+ const [manualExpanded, setManualExpanded] = useState({});
+ const [autoExpanded, setAutoExpanded] = useState(null);
const location = useLocation();
const toggleExpand = (itemId) => {
- setExpandedItems(prev => ({ ...prev, [itemId]: !prev[itemId] }));
+ const currentlyExpanded = manualExpanded[itemId] ?? (autoExpanded === itemId);
+ setManualExpanded(prev => ({ ...prev, [itemId]: !currentlyExpanded }));
};
- const handlePresetSwitch = async (presetKey) => {
+ const handlePresetSwitch = (presetKey) => {
if (presetKey === currentPreset) return;
const config = { preset: presetKey, hiddenItems: [] };
- try {
- await api.updateCurrentUser({ sidebar_config: config });
- await updateUser({ sidebar_config: config });
- } catch {}
+ // Update locally first (instant), persist to backend in background
+ updateUser({ sidebar_config: config });
+ api.updateCurrentUser({ sidebar_config: config }).catch(() => {});
};
const visibleItems = useMemo(
@@ -105,19 +106,27 @@ const Sidebar = () => {
return groups;
}, [visibleItems]);
- // Auto-expand parent when a sub-item route is active
+ // Auto-expand the active parent (or parent of active sub-item), auto-close others
useEffect(() => {
const path = location.pathname;
+ let activeParent = null;
for (const item of visibleItems) {
- if (item.subItems?.some(sub => path === sub.route || path.startsWith(sub.route + '/'))) {
- setExpandedItems(prev => prev[item.id] ? prev : { ...prev, [item.id]: true });
+ if (!item.subItems?.length) continue;
+ // Expand if on the parent route itself or any sub-item route
+ if (path === item.route || path.startsWith(item.route + '/') ||
+ item.subItems.some(sub => path === sub.route || path.startsWith(sub.route + '/'))) {
+ activeParent = item.id;
+ break;
}
}
+ setAutoExpanded(activeParent);
+ setManualExpanded({});
}, [location.pathname, visibleItems]);
const renderNavItem = (item) => {
const hasChildren = item.subItems && item.subItems.length > 0;
- const isExpanded = expandedItems[item.id];
+ // Show expanded if manually toggled OR auto-expanded by active route
+ const isExpanded = manualExpanded[item.id] ?? (autoExpanded === item.id);
const visibleSubs = hasChildren
? item.subItems.filter(sub => !sub.requiresCondition || conditions[sub.requiresCondition])
: [];
diff --git a/frontend/src/components/settings/ActivityTab.jsx b/frontend/src/components/settings/ActivityTab.jsx
index 0b72f5e8..53fd858b 100644
--- a/frontend/src/components/settings/ActivityTab.jsx
+++ b/frontend/src/components/settings/ActivityTab.jsx
@@ -1,15 +1,19 @@
-import React, { useState, useEffect } from 'react';
+import { useState, useEffect } from 'react';
import api from '../../services/api';
+import ContributionGraph from './ContributionGraph';
+import { Search, Filter, X, ChevronRight, User as UserIcon, Activity as ActivityIcon, Terminal } from 'lucide-react';
const ActivityTab = () => {
const [summary, setSummary] = useState(null);
- const [feed, setFeed] = useState([]);
- const [feedPagination, setFeedPagination] = useState(null);
+ const [logs, setLogs] = useState([]);
const [loading, setLoading] = useState(true);
const [feedLoading, setFeedLoading] = useState(false);
const [users, setUsers] = useState([]);
- const [filters, setFilters] = useState({ user_id: '', action: '', page: 1 });
const [actions, setActions] = useState([]);
+ const [pagination, setPagination] = useState({
+ page: 1, perPage: 50, total: 0, pages: 1
+ });
+ const [filters, setFilters] = useState({ action: '', user_id: '' });
useEffect(() => {
loadSummary();
@@ -18,8 +22,8 @@ const ActivityTab = () => {
}, []);
useEffect(() => {
- loadFeed();
- }, [filters]);
+ loadLogs();
+ }, [pagination.page, filters]);
async function loadSummary() {
try {
@@ -32,16 +36,23 @@ const ActivityTab = () => {
}
}
- async function loadFeed() {
+ async function loadLogs() {
try {
setFeedLoading(true);
- const params = { per_page: 20 };
- if (filters.page) params.page = filters.page;
- if (filters.user_id) params.user_id = filters.user_id;
+ const params = {
+ page: pagination.page,
+ per_page: pagination.perPage
+ };
if (filters.action) params.action = filters.action;
- const data = await api.getActivityFeed(params);
- setFeed(data.logs || []);
- setFeedPagination(data.pagination);
+ if (filters.user_id) params.user_id = filters.user_id;
+
+ const data = await api.getAuditLogs(params);
+ setLogs(data.logs || []);
+ setPagination(prev => ({
+ ...prev,
+ total: data.pagination?.total || 0,
+ pages: data.pagination?.pages || 1
+ }));
} catch {
// Silently handle
} finally {
@@ -53,34 +64,70 @@ const ActivityTab = () => {
try {
const data = await api.getUsers();
setUsers(data.users || []);
- } catch {
- // Silently handle
- }
+ } catch { /* ignore */ }
}
async function loadActions() {
try {
const data = await api.getAuditLogActions();
setActions(data.actions || []);
- } catch {
- // Silently handle
- }
+ } catch { /* ignore */ }
+ }
+
+ function handleFilterChange(name, value) {
+ setFilters(prev => ({ ...prev, [name]: value }));
+ setPagination(prev => ({ ...prev, page: 1 }));
}
function formatDate(dateString) {
if (!dateString) return '';
- return new Date(dateString).toLocaleDateString('en-US', {
- month: 'short', day: 'numeric', hour: '2-digit', minute: '2-digit'
+ const date = new Date(dateString);
+ return date.toLocaleString('en-US', {
+ month: 'short', day: 'numeric',
+ hour: '2-digit', minute: '2-digit'
});
}
+ function getActionIcon(action) {
+ if (action.includes('login')) {
+ return <UserIcon size={16} />;
+ }
+ if (action.includes('app') || action.includes('deploy')) {
+ return <Terminal size={16} />;
+ }
+ if (action.includes('setting')) {
+ return <ActivityIcon size={16} />;
+ }
+ return <ChevronRight size={16} />;
+ }
+
function getActionClass(action) {
- if (action?.includes('delete') || action?.includes('revoke')) return 'action-danger';
- if (action?.includes('failed') || action?.includes('disable')) return 'action-warning';
- if (action?.includes('create') || action?.includes('login') || action?.includes('accept')) return 'action-success';
+ if (action?.includes('failed') || action?.includes('delete') || action?.includes('revoke')) return 'action-danger';
+ if (action?.includes('create') || action?.includes('enable') || action?.includes('login') || action?.includes('accept')) return 'action-success';
+ if (action?.includes('update') || action?.includes('disable')) return 'action-warning';
return 'action-info';
}
+ function formatActionName(action) {
+ return action.replace(/\./g, ' ').replace(/_/g, ' ');
+ }
+
+ function renderDetails(details) {
+ if (!details || Object.keys(details).length === 0) return null;
+ return (
+ <div className="log-details">
+ {Object.entries(details).map(([key, value]) => (
+ <span key={key} className="detail-item">
+ <span className="detail-key">{key}</span>
+ <span className="detail-value">
+ {typeof value === 'object' ? JSON.stringify(value) : String(value)}
+ </span>
+ </span>
+ ))}
+ </div>
+ );
+ }
+
if (loading) {
return <div className="activity-tab"><div className="loading-state">Loading activity...</div></div>;
}
@@ -94,7 +141,7 @@ const ActivityTab = () => {
<div className="tab-header">
<div className="tab-header-content">
<h3>Activity Dashboard</h3>
- <p>Monitor team activity and recent actions</p>
+ <p>Monitor team activity, audit actions, and system events</p>
</div>
</div>
@@ -102,102 +149,158 @@ const ActivityTab = () => {
<>
<div className="activity-summary">
<div className="activity-stat-card">
- <span className="stat-number">{summary.active_users_today}</span>
<span className="stat-label">Active Users Today</span>
+ <span className="stat-number">{summary.active_users_today}</span>
</div>
<div className="activity-stat-card">
- <span className="stat-number">{summary.actions_this_week}</span>
<span className="stat-label">Actions This Week</span>
+ <span className="stat-number">{summary.actions_this_week}</span>
</div>
<div className="activity-stat-card">
- <span className="stat-number">{summary.total_users}</span>
<span className="stat-label">Total Users</span>
+ <span className="stat-number">{summary.total_users}</span>
</div>
</div>
+ <div className="graphs-section">
+ <ContributionGraph
+ data={summary.daily_counts}
+ title="Overall System Activity"
+ />
+ {summary.top_user_daily && summary.top_user_daily.length > 0 && summary.top_users?.length > 1 && (
+ <ContributionGraph
+ data={summary.top_user_daily}
+ title="Most Active User Activity"
+ username={summary.top_users[0]?.username}
+ />
+ )}
+ </div>
+
{summary.top_users && summary.top_users.length > 0 && (
<div className="most-active-users">
<h4>Most Active Users (This Week)</h4>
- {summary.top_users.map((u, i) => (
- <div key={u.user_id} className="active-user-item">
- <span className="active-user-rank">{i + 1}</span>
- <span className="active-user-name">{u.username}</span>
- <div className="active-user-bar-wrapper">
- <div
- className="active-user-bar"
- style={{ width: `${(u.action_count / maxCount) * 100}%` }}
- />
+ <div className="active-users-list">
+ {summary.top_users.map((u, i) => (
+ <div key={u.user_id} className="active-user-item">
+ <span className="active-user-rank">{i + 1}</span>
+ <div className="active-user-info">
+ <span className="active-user-name">{u.username}</span>
+ <div className="active-user-bar-wrapper">
+ <div
+ className="active-user-bar"
+ style={{ width: `${(u.action_count / maxCount) * 100}%` }}
+ />
+ </div>
+ </div>
+ <span className="active-user-count">{u.action_count} actions</span>
</div>
- <span className="active-user-count">{u.action_count}</span>
- </div>
- ))}
+ ))}
+ </div>
</div>
)}
</>
)}
<div className="activity-feed-section">
- <h4>Activity Feed</h4>
+ <div className="section-header">
+ <h4>Audit Log</h4>
+ </div>
+
<div className="filters-bar">
<div className="filter-group">
- <label>User</label>
- <select value={filters.user_id} onChange={e => setFilters(f => ({ ...f, user_id: e.target.value, page: 1 }))}>
- <option value="">All users</option>
- {users.map(u => (
- <option key={u.id} value={u.id}>{u.username}</option>
+ <label><Filter size={12} /> Action Type</label>
+ <select
+ className="form-control"
+ value={filters.action}
+ onChange={e => handleFilterChange('action', e.target.value)}
+ >
+ <option value="">All Actions</option>
+ {actions.map(action => (
+ <option key={action} value={action}>{formatActionName(action)}</option>
))}
</select>
</div>
<div className="filter-group">
- <label>Action</label>
- <select value={filters.action} onChange={e => setFilters(f => ({ ...f, action: e.target.value, page: 1 }))}>
- <option value="">All actions</option>
- {actions.map(a => (
- <option key={a} value={a}>{a}</option>
+ <label><UserIcon size={12} /> User</label>
+ <select
+ className="form-control"
+ value={filters.user_id}
+ onChange={e => handleFilterChange('user_id', e.target.value)}
+ >
+ <option value="">All Users</option>
+ {users.map(u => (
+ <option key={u.id} value={u.id}>{u.username}</option>
))}
</select>
</div>
+ {(filters.action || filters.user_id) && (
+ <button className="btn btn-ghost btn-sm btn-clear" onClick={() => {
+ setFilters({ action: '', user_id: '' });
+ setPagination(prev => ({ ...prev, page: 1 }));
+ }}>
+ <X size={14} /> Clear
+ </button>
+ )}
</div>
{feedLoading ? (
- <div className="loading-state">Loading...</div>
- ) : feed.length === 0 ? (
- <div className="empty-state">No activity found</div>
+ <div className="loading-state">
+ <div className="spinner" />
+ Loading logs...
+ </div>
+ ) : logs.length === 0 ? (
+ <div className="empty-state">
+ <Search size={40} />
+ <p>No audit logs found</p>
+ </div>
) : (
<div className="audit-log-list">
- {feed.map(entry => (
- <div key={entry.id} className={`log-entry ${getActionClass(entry.action)}`}>
+ {logs.map(log => (
+ <div key={log.id} className={`log-entry ${getActionClass(log.action)}`}>
+ <div className="log-icon">
+ {getActionIcon(log.action)}
+ </div>
<div className="log-content">
<div className="log-header">
- <span className="log-action">{entry.action}</span>
- {entry.username && <span className="log-user">by {entry.username}</span>}
- </div>
- <div className="log-meta">
- <span>{formatDate(entry.created_at)}</span>
- {entry.ip_address && <span className="log-ip">{entry.ip_address}</span>}
+ <span className="log-action">{formatActionName(log.action)}</span>
+ <span className="log-user">
+ {log.username || 'System'}
+ </span>
+ {log.target_type && (
+ <span className="log-target">
+ on {log.target_type} {log.target_id ? `#${log.target_id}` : ''}
+ </span>
+ )}
+ <span className="log-time">{formatDate(log.created_at)}</span>
</div>
+ {renderDetails(log.details)}
+ {log.ip_address && (
+ <div className="log-meta">
+ <span className="log-ip">{log.ip_address}</span>
+ </div>
+ )}
</div>
</div>
))}
</div>
)}
- {feedPagination && feedPagination.pages > 1 && (
+ {pagination.pages > 1 && (
<div className="pagination">
<button
- className="btn btn-ghost btn-sm"
- disabled={!feedPagination.has_prev}
- onClick={() => setFilters(f => ({ ...f, page: f.page - 1 }))}
+ className="btn btn-sm btn-outline"
+ disabled={pagination.page <= 1}
+ onClick={() => setPagination(prev => ({ ...prev, page: prev.page - 1 }))}
>
Previous
</button>
<span className="pagination-info">
- Page {feedPagination.page} of {feedPagination.pages}
+ Page {pagination.page} of {pagination.pages}
</span>
<button
- className="btn btn-ghost btn-sm"
- disabled={!feedPagination.has_next}
- onClick={() => setFilters(f => ({ ...f, page: f.page + 1 }))}
+ className="btn btn-sm btn-outline"
+ disabled={pagination.page >= pagination.pages}
+ onClick={() => setPagination(prev => ({ ...prev, page: prev.page + 1 }))}
>
Next
</button>
diff --git a/frontend/src/components/settings/AppearanceTab.jsx b/frontend/src/components/settings/AppearanceTab.jsx
index 75a43ae5..506df3d9 100644
--- a/frontend/src/components/settings/AppearanceTab.jsx
+++ b/frontend/src/components/settings/AppearanceTab.jsx
@@ -1,9 +1,6 @@
-import React, { useRef } from 'react';
import { useTheme } from '../../contexts/ThemeContext';
import useDashboardLayout from '../../hooks/useDashboardLayout';
-import {
- ChevronDown, ChevronUp, RotateCcw, Star, X, Layers, Image, Type, Upload
-} from 'lucide-react';
+import { ChevronDown, ChevronUp, RotateCcw } from 'lucide-react';
const ACCENT_PRESETS = [
{ label: 'Indigo', color: '#6366f1' },
@@ -16,16 +13,9 @@ const ACCENT_PRESETS = [
{ label: 'Cyan', color: '#06b6d4' },
];
-const WHITELABEL_MODES = [
- { id: 'image_text', label: 'Logo + Text', icon: Layers, desc: 'Mini logo with brand name' },
- { id: 'image_full', label: 'Full-width Logo', icon: Image, desc: 'Banner image only' },
- { id: 'text_only', label: 'Text Only', icon: Type, desc: 'Just the brand name' },
-];
-
const AppearanceTab = () => {
- const { theme, setTheme, accentColor, setAccentColor, whiteLabel, setWhiteLabel } = useTheme();
+ const { theme, setTheme, accentColor, setAccentColor } = useTheme();
const { widgets, toggleWidget, moveWidget, resetLayout } = useDashboardLayout();
- const logoInputRef = useRef(null);
return (
<div className="settings-section">
@@ -153,157 +143,6 @@ const AppearanceTab = () => {
</button>
</div>
- <div className="settings-card">
- <h3>Custom Branding</h3>
- <p>Replace the default ServerKit branding in the sidebar with your own</p>
-
- <div className="settings-row">
- <div className="settings-label">
- <span>Enable custom branding</span>
- <span className="settings-hint">Replaces the sidebar logo, name, and GitHub star link</span>
- </div>
- <div className="settings-control">
- <label className="toggle-switch">
- <input
- type="checkbox"
- checked={whiteLabel.enabled}
- onChange={(e) => setWhiteLabel({ enabled: e.target.checked })}
- />
- <span className="toggle-slider"></span>
- </label>
- </div>
- </div>
-
- {whiteLabel.enabled && (
- <>
- <div className="whitelabel-modes">
- {WHITELABEL_MODES.map(({ id, label, icon: Icon, desc }) => (
- <button
- key={id}
- className={`whitelabel-mode${whiteLabel.mode === id ? ' active' : ''}`}
- onClick={() => setWhiteLabel({ mode: id })}
- >
- <Icon size={20} />
- <span className="whitelabel-mode__label">{label}</span>
- <span className="whitelabel-mode__desc">{desc}</span>
- </button>
- ))}
- </div>
-
- <div className="whitelabel-fields">
- {whiteLabel.mode !== 'image_full' && (
- <div className="form-group">
- <label>Brand Name</label>
- <input
- type="text"
- value={whiteLabel.brandName}
- onChange={(e) => setWhiteLabel({ brandName: e.target.value })}
- placeholder="My Brand"
- maxLength={30}
- />
- </div>
- )}
-
- {whiteLabel.mode !== 'text_only' && (
- <div className="form-group">
- <label>Logo Image</label>
- <div className="whitelabel-upload" onClick={() => logoInputRef.current?.click()}>
- {whiteLabel.logoData ? (
- <div className="whitelabel-logo-preview">
- <img src={whiteLabel.logoData} alt="Logo preview" />
- <button
- className="btn btn-secondary btn-sm"
- onClick={(e) => { e.stopPropagation(); setWhiteLabel({ logoData: '' }); }}
- >
- <X size={12} /> Remove
- </button>
- </div>
- ) : (
- <div className="whitelabel-upload__placeholder">
- <Upload size={20} />
- <span>Click to upload logo</span>
- <span className="whitelabel-upload__hint">PNG, JPG, SVG — max 200KB</span>
- </div>
- )}
- <input
- ref={logoInputRef}
- type="file"
- accept="image/png,image/jpeg,image/svg+xml,image/webp"
- style={{ display: 'none' }}
- onChange={(e) => {
- const file = e.target.files?.[0];
- if (!file) return;
- if (file.size > 200 * 1024) {
- alert('Image must be under 200KB');
- return;
- }
- const reader = new FileReader();
- reader.onload = (ev) => setWhiteLabel({ logoData: ev.target.result });
- reader.readAsDataURL(file);
- e.target.value = '';
- }}
- />
- </div>
- </div>
- )}
- </div>
-
- <div className="whitelabel-preview">
- <span className="whitelabel-preview__label">Preview</span>
- <div className="whitelabel-preview__box">
- {whiteLabel.mode === 'image_full' ? (
- <div className="brand-custom-banner">
- {whiteLabel.logoData ? (
- <img src={whiteLabel.logoData} alt="Preview" />
- ) : (
- <Layers size={24} />
- )}
- </div>
- ) : whiteLabel.mode === 'text_only' ? (
- <span className="brand-custom-text">
- {whiteLabel.brandName || 'Brand'}
- </span>
- ) : (
- <>
- <div className="brand-custom-logo">
- {whiteLabel.logoData ? (
- <img src={whiteLabel.logoData} alt="Preview" />
- ) : (
- <Layers size={16} />
- )}
- </div>
- <span className="brand-custom-text">
- {whiteLabel.brandName || 'Brand'}
- </span>
- </>
- )}
- </div>
- </div>
-
- <div className="whitelabel-star-prompt">
- <div className="star-icon">
- <Star size={22} />
- </div>
- <div className="star-content">
- <h4>Support ServerKit</h4>
- <p>
- By using custom branding, the GitHub star link is hidden from the sidebar.
- If ServerKit is useful to you, please consider starring the project — it helps the community grow!
- </p>
- <a
- href="https://github.com/jhd3197/ServerKit"
- target="_blank"
- rel="noopener noreferrer"
- className="btn btn-primary btn-sm"
- >
- <Star size={14} />
- Star on GitHub
- </a>
- </div>
- </div>
- </>
- )}
- </div>
</div>
);
};
diff --git a/frontend/src/components/settings/ContributionGraph.jsx b/frontend/src/components/settings/ContributionGraph.jsx
new file mode 100644
index 00000000..e84af796
--- /dev/null
+++ b/frontend/src/components/settings/ContributionGraph.jsx
@@ -0,0 +1,69 @@
+import React from 'react';
+
+const ContributionGraph = ({ data, title, username }) => {
+ if (!data || data.length === 0) return null;
+
+ const maxCount = Math.max(...data.map(d => d.count), 1);
+
+ // Group by week for display
+ const weeks = [];
+ let currentWeek = [];
+
+ data.forEach((day, index) => {
+ currentWeek.push(day);
+ if (currentWeek.length === 7 || index === data.length - 1) {
+ weeks.push(currentWeek);
+ currentWeek = [];
+ }
+ });
+
+ const getLevel = (count) => {
+ if (count === 0) return 0;
+ const percentage = (count / maxCount) * 100;
+ if (percentage <= 25) return 1;
+ if (percentage <= 50) return 2;
+ if (percentage <= 75) return 3;
+ return 4;
+ };
+
+ const formatDate = (dateStr) => {
+ const date = new Date(dateStr);
+ return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' });
+ };
+
+ return (
+ <div className="contribution-graph-container">
+ <div className="graph-header">
+ <h4>{title} {username && <span className="username">@{username}</span>}</h4>
+ <div className="graph-legend">
+ <span>Less</span>
+ <div className="legend-cells">
+ <div className="cell level-0" />
+ <div className="cell level-1" />
+ <div className="cell level-2" />
+ <div className="cell level-3" />
+ <div className="cell level-4" />
+ </div>
+ <span>More</span>
+ </div>
+ </div>
+ <div className="graph-grid-wrapper">
+ <div className="graph-grid">
+ {weeks.map((week, weekIndex) => (
+ <div key={weekIndex} className="graph-week">
+ {week.map((day, dayIndex) => (
+ <div
+ key={dayIndex}
+ className={`graph-cell level-${getLevel(day.count)}`}
+ title={`${day.count} actions on ${formatDate(day.date)}`}
+ />
+ ))}
+ </div>
+ ))}
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export default ContributionGraph;
diff --git a/frontend/src/components/settings/SSOConfigTab.jsx b/frontend/src/components/settings/SSOConfigTab.jsx
index 504b7017..ad99bf96 100644
--- a/frontend/src/components/settings/SSOConfigTab.jsx
+++ b/frontend/src/components/settings/SSOConfigTab.jsx
@@ -156,19 +156,32 @@ const SSOConfigTab = () => {
)}
{/* General Settings */}
- <div className="settings-card">
- <h3><Globe size={18} /> General Settings</h3>
- <div className="settings-form">
- <div className="form-group">
- <label className="toggle-label">
- <input
- type="checkbox"
- checked={autoProvision}
- onChange={e => setAutoProvision(e.target.checked)}
- />
+ <div className="settings-card sso-general-card">
+ <div className="settings-card__header">
+ <div className="settings-card__header-left">
+ <Globe size={20} />
+ <div>
+ <h3>General Settings</h3>
+ </div>
+ </div>
+ </div>
+
+ <div className="sso-general-form">
+ <div className="settings-row">
+ <div className="settings-label">
<span>Auto-provision users</span>
- </label>
- <p className="form-help">Automatically create accounts for new SSO users</p>
+ <span className="settings-hint">Automatically create accounts for new SSO users</span>
+ </div>
+ <div className="settings-control">
+ <label className="toggle-switch">
+ <input
+ type="checkbox"
+ checked={autoProvision}
+ onChange={e => setAutoProvision(e.target.checked)}
+ />
+ <span className="toggle-slider"></span>
+ </label>
+ </div>
</div>
<div className="form-group">
@@ -180,23 +193,29 @@ const SSOConfigTab = () => {
</select>
</div>
- <div className="form-group">
- <label className="toggle-label">
- <input
- type="checkbox"
- checked={forceSso}
- onChange={e => setForceSso(e.target.checked)}
- />
+ <div className="settings-row">
+ <div className="settings-label">
<span>SSO-only mode</span>
- </label>
- <p className="form-help">
- {forceSso && (
- <span className="text-warning">
- <AlertTriangle size={14} /> Password login will be disabled for all users.
- </span>
- )}
- {!forceSso && 'Disable password login and require SSO for all users'}
- </p>
+ <span className="settings-hint">
+ {forceSso ? (
+ <span className="text-warning">
+ <AlertTriangle size={14} /> Password login will be disabled for all users.
+ </span>
+ ) : (
+ 'Disable password login and require SSO for all users'
+ )}
+ </span>
+ </div>
+ <div className="settings-control">
+ <label className="toggle-switch">
+ <input
+ type="checkbox"
+ checked={forceSso}
+ onChange={e => setForceSso(e.target.checked)}
+ />
+ <span className="toggle-slider"></span>
+ </label>
+ </div>
</div>
<div className="form-group">
@@ -207,7 +226,7 @@ const SSOConfigTab = () => {
onChange={e => setAllowedDomains(e.target.value)}
placeholder="company.com, example.org"
/>
- <p className="form-help">Comma-separated. Leave empty to allow all domains.</p>
+ <span className="form-help">Comma-separated. Leave empty to allow all domains.</span>
</div>
<button
@@ -247,15 +266,20 @@ const SSOConfigTab = () => {
{isExpanded && (
<div className="sso-provider-config__body">
- <div className="form-group">
- <label className="toggle-label">
- <input
- type="checkbox"
- checked={enabled}
- onChange={e => setFieldValue(provider.id, 'enabled', e.target.checked)}
- />
+ <div className="settings-row">
+ <div className="settings-label">
<span>Enable {provider.name}</span>
- </label>
+ </div>
+ <div className="settings-control">
+ <label className="toggle-switch">
+ <input
+ type="checkbox"
+ checked={enabled}
+ onChange={e => setFieldValue(provider.id, 'enabled', e.target.checked)}
+ />
+ <span className="toggle-slider"></span>
+ </label>
+ </div>
</div>
{provider.fields.map(field => (
diff --git a/frontend/src/components/settings/WhiteLabelTab.jsx b/frontend/src/components/settings/WhiteLabelTab.jsx
new file mode 100644
index 00000000..c85f44d6
--- /dev/null
+++ b/frontend/src/components/settings/WhiteLabelTab.jsx
@@ -0,0 +1,177 @@
+import { useRef } from 'react';
+import { useTheme } from '../../contexts/ThemeContext';
+import { Star, X, Layers, Image, Type, Upload } from 'lucide-react';
+
+const WHITELABEL_MODES = [
+ { id: 'image_text', label: 'Logo + Text', icon: Layers, desc: 'Mini logo with brand name' },
+ { id: 'image_full', label: 'Full-width Logo', icon: Image, desc: 'Banner image only' },
+ { id: 'text_only', label: 'Text Only', icon: Type, desc: 'Just the brand name' },
+];
+
+const WhiteLabelTab = () => {
+ const { whiteLabel, setWhiteLabel } = useTheme();
+ const logoInputRef = useRef(null);
+
+ return (
+ <div className="settings-section">
+ <div className="section-header">
+ <h2>White Label</h2>
+ <p>Replace the default ServerKit branding with your own</p>
+ </div>
+
+ <div className="settings-card">
+ <h3>Custom Branding</h3>
+ <p>Replace the sidebar logo, name, and GitHub star link</p>
+
+ <div className="settings-row">
+ <div className="settings-label">
+ <span>Enable custom branding</span>
+ <span className="settings-hint">Replaces the sidebar logo, name, and GitHub star link</span>
+ </div>
+ <div className="settings-control">
+ <label className="toggle-switch">
+ <input
+ type="checkbox"
+ checked={whiteLabel.enabled}
+ onChange={(e) => setWhiteLabel({ enabled: e.target.checked })}
+ />
+ <span className="toggle-slider"></span>
+ </label>
+ </div>
+ </div>
+
+ {whiteLabel.enabled && (
+ <>
+ <div className="whitelabel-modes">
+ {WHITELABEL_MODES.map(({ id, label, icon: Icon, desc }) => (
+ <button
+ key={id}
+ className={`whitelabel-mode${whiteLabel.mode === id ? ' active' : ''}`}
+ onClick={() => setWhiteLabel({ mode: id })}
+ >
+ <Icon size={20} />
+ <span className="whitelabel-mode__label">{label}</span>
+ <span className="whitelabel-mode__desc">{desc}</span>
+ </button>
+ ))}
+ </div>
+
+ <div className="whitelabel-fields">
+ {whiteLabel.mode !== 'image_full' && (
+ <div className="form-group">
+ <label>Brand Name</label>
+ <input
+ type="text"
+ value={whiteLabel.brandName}
+ onChange={(e) => setWhiteLabel({ brandName: e.target.value })}
+ placeholder="My Brand"
+ maxLength={30}
+ />
+ </div>
+ )}
+
+ {whiteLabel.mode !== 'text_only' && (
+ <div className="form-group">
+ <label>Logo Image</label>
+ <div className="whitelabel-upload" onClick={() => logoInputRef.current?.click()}>
+ {whiteLabel.logoData ? (
+ <div className="whitelabel-logo-preview">
+ <img src={whiteLabel.logoData} alt="Logo preview" />
+ <button
+ className="btn btn-secondary btn-sm"
+ onClick={(e) => { e.stopPropagation(); setWhiteLabel({ logoData: '' }); }}
+ >
+ <X size={12} /> Remove
+ </button>
+ </div>
+ ) : (
+ <div className="whitelabel-upload__placeholder">
+ <Upload size={20} />
+ <span>Click to upload logo</span>
+ <span className="whitelabel-upload__hint">PNG, JPG, SVG — max 200KB</span>
+ </div>
+ )}
+ <input
+ ref={logoInputRef}
+ type="file"
+ accept="image/png,image/jpeg,image/svg+xml,image/webp"
+ style={{ display: 'none' }}
+ onChange={(e) => {
+ const file = e.target.files?.[0];
+ if (!file) return;
+ if (file.size > 200 * 1024) {
+ alert('Image must be under 200KB');
+ return;
+ }
+ const reader = new FileReader();
+ reader.onload = (ev) => setWhiteLabel({ logoData: ev.target.result });
+ reader.readAsDataURL(file);
+ e.target.value = '';
+ }}
+ />
+ </div>
+ </div>
+ )}
+ </div>
+
+ <div className="whitelabel-preview">
+ <span className="whitelabel-preview__label">Preview</span>
+ <div className="whitelabel-preview__box">
+ {whiteLabel.mode === 'image_full' ? (
+ <div className="brand-custom-banner">
+ {whiteLabel.logoData ? (
+ <img src={whiteLabel.logoData} alt="Preview" />
+ ) : (
+ <Layers size={24} />
+ )}
+ </div>
+ ) : whiteLabel.mode === 'text_only' ? (
+ <span className="brand-custom-text">
+ {whiteLabel.brandName || 'Brand'}
+ </span>
+ ) : (
+ <>
+ <div className="brand-custom-logo">
+ {whiteLabel.logoData ? (
+ <img src={whiteLabel.logoData} alt="Preview" />
+ ) : (
+ <Layers size={16} />
+ )}
+ </div>
+ <span className="brand-custom-text">
+ {whiteLabel.brandName || 'Brand'}
+ </span>
+ </>
+ )}
+ </div>
+ </div>
+
+ <div className="whitelabel-star-prompt">
+ <div className="star-icon">
+ <Star size={22} />
+ </div>
+ <div className="star-content">
+ <h4>Support ServerKit</h4>
+ <p>
+ By using custom branding, the GitHub star link is hidden from the sidebar.
+ If ServerKit is useful to you, please consider starring the project — it helps the community grow!
+ </p>
+ <a
+ href="https://github.com/jhd3197/ServerKit"
+ target="_blank"
+ rel="noopener noreferrer"
+ className="btn btn-primary btn-sm"
+ >
+ <Star size={14} />
+ Star on GitHub
+ </a>
+ </div>
+ </div>
+ </>
+ )}
+ </div>
+ </div>
+ );
+};
+
+export default WhiteLabelTab;
diff --git a/frontend/src/pages/Dashboard.jsx b/frontend/src/pages/Dashboard.jsx
index 38341812..60ac7f5b 100644
--- a/frontend/src/pages/Dashboard.jsx
+++ b/frontend/src/pages/Dashboard.jsx
@@ -1,9 +1,9 @@
import React, { useState, useEffect, useCallback } from 'react';
import { useNavigate } from 'react-router-dom';
import {
- Cpu, MemoryStick, HardDrive, Activity,
- Plus, RefreshCw, Server, Zap,
- RotateCcw, Database, Layers, Container, Globe, Code, Settings
+ HardDrive, Activity,
+ RefreshCw, Zap,
+ Database, Container, Globe, Code, Layers, Server, Terminal
} from 'lucide-react';
import api from '../services/api';
import { useMetrics } from '../hooks/useMetrics';
@@ -19,49 +19,103 @@ const REFRESH_OPTIONS = [
{ label: '1m', value: 60 },
];
+const ServerSelectorIcon = () => (
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
+ <rect x="2" y="2" width="20" height="8" rx="2" ry="2"/>
+ <rect x="2" y="14" width="20" height="8" rx="2" ry="2"/>
+ <line x1="6" y1="6" x2="6.01" y2="6"/>
+ <line x1="6" y1="18" x2="6.01" y2="18"/>
+ </svg>
+);
+
const Dashboard = () => {
const navigate = useNavigate();
- const { metrics, loading: metricsLoading, connected, refresh: refreshMetrics } = useMetrics(true);
+ const { metrics: localMetrics, loading: metricsLoading, connected, refresh: refreshMetrics } = useMetrics(true);
const { widgets } = useDashboardLayout();
const [apps, setApps] = useState([]);
- const [services, setServices] = useState([]);
- const [dbStatus, setDbStatus] = useState(null);
const [systemInfo, setSystemInfo] = useState(null);
const [loading, setLoading] = useState(true);
const [refreshInterval, setRefreshInterval] = useState(() => {
const saved = localStorage.getItem('dashboard_refresh_interval');
- return saved ? parseInt(saved, 10) : 10; // Default 10 seconds
+ return saved ? parseInt(saved, 10) : 10;
});
- const [lastUpdate, setLastUpdate] = useState(Date.now());
const [localUptime, setLocalUptime] = useState(null);
const [localTime, setLocalTime] = useState(null);
const lastServerUptime = React.useRef(null);
const lastServerTime = React.useRef(null);
- const syncedAt = React.useRef(null);
+
+ // Server selector state
+ const [servers, setServers] = useState([]);
+ const [selectedServer, setSelectedServer] = useState({ id: 'local', name: 'Local (this server)' });
+ const isRemote = selectedServer.id !== 'local';
+
+ // Remote metrics (when a non-local server is selected)
+ const [remoteMetrics, setRemoteMetrics] = useState(null);
+ const [remoteSystemInfo, setRemoteSystemInfo] = useState(null);
+ const [remoteLoading, setRemoteLoading] = useState(false);
+
+ // Active metrics: remote when a remote server is selected, local otherwise
+ const metrics = isRemote ? remoteMetrics : localMetrics;
+
+ const fetchRemote = useCallback(async () => {
+ if (!isRemote) return;
+ setRemoteLoading(true);
+ try {
+ const [metricsData, sysInfo] = await Promise.all([
+ api.getRemoteSystemMetrics(selectedServer.id),
+ api.getRemoteSystemInfo(selectedServer.id).catch(() => null)
+ ]);
+ setRemoteMetrics(metricsData);
+ setRemoteSystemInfo(sysInfo);
+ } catch (err) {
+ console.error('Failed to load remote metrics:', err);
+ } finally {
+ setRemoteLoading(false);
+ }
+ }, [selectedServer.id, isRemote]);
+
+ // Load servers list on mount
+ useEffect(() => {
+ api.getAvailableServers()
+ .then(data => setServers(Array.isArray(data) ? data : []))
+ .catch(() => setServers([{ id: 'local', name: 'Local (this server)', status: 'online' }]));
+ }, []);
+
+ // Fetch remote metrics when a remote server is selected
+ useEffect(() => {
+ if (!isRemote) {
+ setRemoteMetrics(null);
+ setRemoteSystemInfo(null);
+ return;
+ }
+
+ fetchRemote();
+ const interval = refreshInterval > 0
+ ? setInterval(fetchRemote, refreshInterval * 1000)
+ : null;
+
+ return () => { if (interval) clearInterval(interval); };
+ }, [fetchRemote, refreshInterval, isRemote]);
// Sync local counters when server data arrives
useEffect(() => {
const serverUptime = metrics?.system?.uptime_seconds;
const serverTimeStr = metrics?.time?.current_time_formatted;
- const serverTzId = metrics?.time?.timezone_id;
if (serverUptime && serverUptime !== lastServerUptime.current) {
lastServerUptime.current = serverUptime;
setLocalUptime(serverUptime);
- syncedAt.current = Date.now();
}
if (serverTimeStr && serverTimeStr !== lastServerTime.current) {
lastServerTime.current = serverTimeStr;
- // Parse server time into a Date object
try {
const parsed = new Date(serverTimeStr);
if (!isNaN(parsed)) {
setLocalTime(parsed);
- syncedAt.current = Date.now();
}
} catch {
- // If parsing fails, try extracting just the time portion
+ // If parsing fails, skip
}
}
}, [metrics?.system?.uptime_seconds, metrics?.time?.current_time_formatted]);
@@ -85,23 +139,15 @@ const Dashboard = () => {
loadData();
}, []);
- // Polling fallback when WebSocket is not connected
+ // Polling fallback when WebSocket is not connected (local only)
useEffect(() => {
- if (refreshInterval > 0 && !connected) {
+ if (refreshInterval > 0 && !connected && !isRemote) {
const interval = setInterval(() => {
refreshMetrics();
- setLastUpdate(Date.now());
}, refreshInterval * 1000);
return () => clearInterval(interval);
}
- }, [refreshInterval, connected, refreshMetrics]);
-
- // Update lastUpdate when metrics change (from WebSocket)
- useEffect(() => {
- if (metrics) {
- setLastUpdate(Date.now());
- }
- }, [metrics]);
+ }, [refreshInterval, connected, refreshMetrics, isRemote]);
// Save refresh interval preference
const handleRefreshIntervalChange = useCallback((value) => {
@@ -109,17 +155,24 @@ const Dashboard = () => {
localStorage.setItem('dashboard_refresh_interval', value.toString());
}, []);
+ function handleServerChange(e) {
+ const serverId = e.target.value;
+ const server = servers.find(s => s.id === serverId) || { id: 'local', name: 'Local (this server)' };
+ setSelectedServer(server);
+ // Reset ticking counters when switching servers
+ lastServerUptime.current = null;
+ lastServerTime.current = null;
+ setLocalUptime(null);
+ setLocalTime(null);
+ }
+
async function loadData() {
try {
- const [appsData, servicesData, dbData, sysInfoData] = await Promise.all([
+ const [appsData, sysInfoData] = await Promise.all([
api.getApps(),
- api.getServicesStatus().catch(() => ({ services: [] })),
- api.getDatabaseStatus().catch(() => null),
api.getSystemInfo().catch(() => null)
]);
setApps(appsData.apps || []);
- setServices(servicesData.services || []);
- setDbStatus(dbData);
setSystemInfo(sysInfoData);
} catch (err) {
console.error('Failed to load data:', err);
@@ -128,7 +181,15 @@ const Dashboard = () => {
}
}
- // Helper to format uptime from seconds
+ function handleRefreshAll() {
+ if (isRemote) {
+ fetchRemote();
+ } else {
+ refreshMetrics();
+ }
+ loadData();
+ }
+
function formatUptime(seconds) {
if (!seconds) return { days: 0, hours: 0, minutes: 0 };
const days = Math.floor(seconds / 86400);
@@ -137,15 +198,6 @@ const Dashboard = () => {
return { days, hours, minutes };
}
- function getStatusClass(status) {
- switch (status) {
- case 'running': return 'status-active';
- case 'stopped': return 'status-stopped';
- case 'error': return 'status-error';
- default: return 'status-warning';
- }
- }
-
function getStackIcon(type) {
switch (type) {
case 'docker': return <Container size={16} />;
@@ -159,10 +211,10 @@ const Dashboard = () => {
// Get uptime from local ticking counter (synced with server)
const uptimeFormatted = formatUptime(localUptime ?? metrics?.system?.uptime_seconds);
- // Fallback to systemInfo for static data, prefer metrics.system for live data
- const hostname = metrics?.system?.hostname || systemInfo?.hostname || 'server';
- const kernelVersion = metrics?.system?.kernel || systemInfo?.kernel || '-';
- const ipAddress = metrics?.system?.ip_address || systemInfo?.ip_address || '-';
+ const activeSysInfo = isRemote ? remoteSystemInfo : systemInfo;
+ const hostname = metrics?.system?.hostname || activeSysInfo?.hostname || 'server';
+ const kernelVersion = metrics?.system?.kernel || activeSysInfo?.kernel || '-';
+ const ipAddress = metrics?.system?.ip_address || activeSysInfo?.ip_address || '-';
const serverTime = metrics?.time;
// Format the local ticking clock
@@ -170,6 +222,9 @@ const Dashboard = () => {
? localTime.toLocaleTimeString('en-US', { hour12: false })
: serverTime?.current_time_formatted?.split(' ')[1] || '--:--:--';
+ // Show green if we have metrics data (regardless of transport — WS or HTTP poll)
+ const isConnected = isRemote ? !remoteLoading && !!remoteMetrics : !!localMetrics;
+
if (loading && metricsLoading) {
return <div className="loading">Loading dashboard...</div>;
}
@@ -180,7 +235,7 @@ const Dashboard = () => {
<div className="top-bar">
<div className="server-identity">
<h1>
- <span className={`status-dot-live ${connected ? '' : 'disconnected'}`}></span>
+ <span className={`status-dot-live ${isConnected ? '' : 'disconnected'}`}></span>
{hostname}
</h1>
<div className="server-details">
@@ -192,6 +247,18 @@ const Dashboard = () => {
</div>
</div>
<div className="top-bar-right">
+ {servers.length > 1 && (
+ <div className="server-selector">
+ <ServerSelectorIcon />
+ <select value={selectedServer.id} onChange={handleServerChange}>
+ {servers.map(server => (
+ <option key={server.id} value={server.id} disabled={server.status === 'offline'}>
+ {server.name} {server.status === 'offline' ? '(Offline)' : ''}
+ </option>
+ ))}
+ </select>
+ </div>
+ )}
<div className="clock-widget">
<span className="clock-time">{displayTime}</span>
<span className="clock-zone">{serverTime?.timezone_id || 'UTC'}</span>
@@ -199,7 +266,7 @@ const Dashboard = () => {
<div className="refresh-control">
<button
className="btn-refresh"
- onClick={() => { refreshMetrics(); loadData(); }}
+ onClick={handleRefreshAll}
title="Refresh now"
>
<RefreshCw size={14} />
@@ -231,9 +298,6 @@ const Dashboard = () => {
<div className="tile-val">{(metrics?.cpu?.percent || 0).toFixed(1)}%</div>
<div className="tile-sub">
<span>Cores: {metrics?.cpu?.count_logical || 0}</span>
- <span className={metrics?.cpu?.percent > 50 ? 'trend-up' : 'trend-down'}>
- {metrics?.cpu?.percent > 50 ? '▲' : '▼'} {Math.abs(metrics?.cpu?.percent - 50).toFixed(0)}%
- </span>
</div>
</div>
),
@@ -290,27 +354,27 @@ const Dashboard = () => {
specs: () => (
<div key="specs" className="spec-panel">
<h3 className="spec-panel-title">Quick Actions</h3>
- <button className="btn-action" onClick={() => navigate('/docker')}>
- <span>Restart Services</span>
- <span>►</span>
+ <button className="btn-action" onClick={() => navigate('/servers')}>
+ <span>Manage Servers</span>
+ <span><Server size={14} /></span>
</button>
- <button className="btn-action" onClick={() => navigate('/databases')}>
- <span>Clear Cache</span>
- <span><Zap size={14} /></span>
+ <button className="btn-action" onClick={() => navigate('/docker')}>
+ <span>Docker Containers</span>
+ <span><Container size={14} /></span>
</button>
- <button className="btn-action" onClick={() => navigate('/ssl')}>
- <span>Rotate SSL Certs</span>
- <span><RotateCcw size={14} /></span>
+ <button className="btn-action" onClick={() => navigate('/terminal')}>
+ <span>Open Terminal</span>
+ <span><Terminal size={14} /></span>
</button>
<h3 className="spec-panel-title mt-6">Hardware Specs</h3>
<div className="spec-row">
<span className="spec-label">Processor</span>
- <span className="spec-data">{systemInfo?.cpu?.model || 'N/A'}</span>
+ <span className="spec-data">{activeSysInfo?.cpu?.model || 'N/A'}</span>
</div>
<div className="spec-row">
<span className="spec-label">Architecture</span>
- <span className="spec-data">{systemInfo?.cpu?.architecture || 'N/A'}</span>
+ <span className="spec-data">{activeSysInfo?.cpu?.architecture || 'N/A'}</span>
</div>
<div className="spec-row">
<span className="spec-label">Swap Memory</span>
@@ -321,7 +385,7 @@ const Dashboard = () => {
processes: () => (
<div key="processes" className="table-panel">
<div className="table-header">
- <span>Active Processes / Containers</span>
+ <span>Applications</span>
<button className="btn btn-sm btn-secondary" onClick={loadData}>
<RefreshCw size={14} />
</button>
diff --git a/frontend/src/pages/Settings.jsx b/frontend/src/pages/Settings.jsx
index de4d8edb..d23d9bd6 100644
--- a/frontend/src/pages/Settings.jsx
+++ b/frontend/src/pages/Settings.jsx
@@ -1,4 +1,4 @@
-import React, { useState, useEffect } from 'react';
+import { useState, useEffect } from 'react';
import useTabParam from '../hooks/useTabParam';
import { useAuth } from '../contexts/AuthContext';
import api from '../services/api';
@@ -6,10 +6,10 @@ import ProfileTab from '../components/settings/ProfileTab';
import SecuritySettingsTab from '../components/settings/SecuritySettingsTab';
import AppearanceTab from '../components/settings/AppearanceTab';
import SidebarSettings from '../components/settings/SidebarSettings';
+import WhiteLabelTab from '../components/settings/WhiteLabelTab';
import NotificationsTab from '../components/settings/NotificationsTab';
import SystemTab from '../components/settings/SystemTab';
import UsersTab from '../components/settings/UsersTab';
-import AuditLogTab from '../components/settings/AuditLogTab';
import ActivityTab from '../components/settings/ActivityTab';
import SiteSettingsTab from '../components/settings/SiteSettingsTab';
import SSOConfigTab from '../components/settings/SSOConfigTab';
@@ -17,9 +17,9 @@ import ApiSettingsTab from '../components/settings/ApiSettingsTab';
import MigrationHistoryTab from '../components/settings/MigrationHistoryTab';
import IconReferenceTab from '../components/settings/IconReferenceTab';
import AboutTab from '../components/settings/AboutTab';
-import { Activity, Code, Database } from 'lucide-react';
+import { Activity, Code, Database, Layers } from 'lucide-react';
-const VALID_TABS = ['profile', 'security', 'appearance', 'sidebar', 'notifications', 'system', 'users', 'audit', 'activity', 'site', 'sso', 'api', 'migrations', 'developer', 'about'];
+const VALID_TABS = ['profile', 'security', 'appearance', 'sidebar', 'whitelabel', 'notifications', 'system', 'users', 'activity', 'site', 'sso', 'api', 'migrations', 'developer', 'about'];
const Settings = () => {
const [activeTab, setActiveTab] = useTabParam('/settings', VALID_TABS);
@@ -104,6 +104,13 @@ const Settings = () => {
</svg>
Sidebar
</button>
+ <button
+ className={`settings-nav-item ${activeTab === 'whitelabel' ? 'active' : ''}`}
+ onClick={() => setActiveTab('whitelabel')}
+ >
+ <Layers size={18} />
+ White Label
+ </button>
{isAdmin && (
<>
<div className="settings-nav-divider">Admin</div>
@@ -119,19 +126,6 @@ const Settings = () => {
</svg>
Users
</button>
- <button
- className={`settings-nav-item ${activeTab === 'audit' ? 'active' : ''}`}
- onClick={() => setActiveTab('audit')}
- >
- <svg viewBox="0 0 24 24" width="18" height="18">
- <path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/>
- <polyline points="14 2 14 8 20 8"/>
- <line x1="16" y1="13" x2="8" y2="13"/>
- <line x1="16" y1="17" x2="8" y2="17"/>
- <polyline points="10 9 9 9 8 9"/>
- </svg>
- Audit Log
- </button>
<button
className={`settings-nav-item ${activeTab === 'activity' ? 'active' : ''}`}
onClick={() => setActiveTab('activity')}
@@ -199,7 +193,6 @@ const Settings = () => {
</button>
</>
)}
- <div className="settings-nav-spacer" />
<button
className={`settings-nav-item ${activeTab === 'about' ? 'active' : ''}`}
onClick={() => setActiveTab('about')}
@@ -218,9 +211,9 @@ const Settings = () => {
{activeTab === 'security' && <SecuritySettingsTab />}
{activeTab === 'appearance' && <AppearanceTab />}
{activeTab === 'sidebar' && <SidebarSettings />}
+ {activeTab === 'whitelabel' && <WhiteLabelTab />}
{activeTab === 'notifications' && <NotificationsTab />}
{activeTab === 'users' && isAdmin && <UsersTab />}
- {activeTab === 'audit' && isAdmin && <AuditLogTab />}
{activeTab === 'activity' && isAdmin && <ActivityTab />}
{activeTab === 'site' && isAdmin && <SiteSettingsTab onDevModeChange={setDevMode} />}
{activeTab === 'sso' && isAdmin && <SSOConfigTab />}
diff --git a/frontend/src/styles/components/_contribution-graph.scss b/frontend/src/styles/components/_contribution-graph.scss
new file mode 100644
index 00000000..d2f1b08c
--- /dev/null
+++ b/frontend/src/styles/components/_contribution-graph.scss
@@ -0,0 +1,91 @@
+.contribution-graph-container {
+ padding: $space-4;
+ background: $bg-card;
+ border: 1px solid $border-default;
+ border-radius: $radius-md;
+ margin-bottom: $space-6;
+
+ .graph-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: $space-4;
+
+ h4 {
+ margin: 0;
+ font-size: $font-size-md;
+ font-weight: 600;
+
+ .username {
+ color: $accent-primary;
+ margin-left: $space-2;
+ font-weight: 500;
+ }
+ }
+
+ .graph-legend {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+
+ .legend-cells {
+ display: flex;
+ gap: 2px;
+
+ .cell {
+ width: 10px;
+ height: 10px;
+ border-radius: 2px;
+ }
+ }
+ }
+ }
+
+ .graph-grid-wrapper {
+ overflow-x: auto;
+ padding-bottom: $space-2;
+
+ &::-webkit-scrollbar {
+ height: 6px;
+ }
+ &::-webkit-scrollbar-track {
+ background: transparent;
+ }
+ &::-webkit-scrollbar-thumb {
+ background: $bg-hover;
+ border-radius: $radius-full;
+ }
+ }
+
+ .graph-grid {
+ display: flex;
+ gap: 3px;
+ min-width: fit-content;
+ }
+
+ .graph-week {
+ display: flex;
+ flex-direction: column;
+ gap: 3px;
+ }
+
+ .graph-cell {
+ width: 12px;
+ height: 12px;
+ border-radius: 2px;
+ transition: transform 0.1s ease;
+
+ &:hover {
+ transform: scale(1.2);
+ z-index: 10;
+ }
+ }
+
+ .level-0 { background-color: $bg-hover; }
+ .level-1 { background-color: fade($accent-primary-raw, 30%); }
+ .level-2 { background-color: fade($accent-primary-raw, 55%); }
+ .level-3 { background-color: fade($accent-primary-raw, 80%); }
+ .level-4 { background-color: $accent-primary; }
+}
diff --git a/frontend/src/styles/components/_server-selector.scss b/frontend/src/styles/components/_server-selector.scss
new file mode 100644
index 00000000..8af15cab
--- /dev/null
+++ b/frontend/src/styles/components/_server-selector.scss
@@ -0,0 +1,41 @@
+// ============================================
+// SERVER SELECTOR — shared across Dashboard, Docker, etc.
+// ============================================
+
+.server-selector {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ background: $bg-card;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ padding: $space-2 $space-3;
+
+ svg {
+ color: $text-tertiary;
+ flex-shrink: 0;
+ }
+
+ select {
+ background: transparent;
+ border: none;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ cursor: pointer;
+ padding-right: $space-4;
+ min-width: 140px;
+
+ &:focus {
+ outline: none;
+ }
+
+ option {
+ background: $bg-card;
+ color: $text-primary;
+ }
+
+ option:disabled {
+ color: $text-tertiary;
+ }
+ }
+}
diff --git a/frontend/src/styles/components/_users.scss b/frontend/src/styles/components/_users.scss
index fd8cfe99..24148f1f 100644
--- a/frontend/src/styles/components/_users.scss
+++ b/frontend/src/styles/components/_users.scss
@@ -665,14 +665,15 @@
h3 {
margin: 0 0 $space-1 0;
- font-size: $font-size-lg;
- font-weight: 600;
+ font-size: 1.5rem;
+ font-weight: 700;
+ color: $text-primary;
}
p {
margin: 0;
color: $text-secondary;
- font-size: $font-size-sm;
+ font-size: $font-size-md;
}
}
}
@@ -680,10 +681,10 @@
.activity-summary {
display: grid;
grid-template-columns: repeat(3, 1fr);
- gap: $space-4;
- margin-bottom: $space-6;
+ gap: $space-6;
+ margin-bottom: $space-8;
- @media (max-width: 600px) {
+ @media (max-width: 768px) {
grid-template-columns: 1fr;
}
}
@@ -691,92 +692,320 @@
.activity-stat-card {
display: flex;
flex-direction: column;
- align-items: center;
padding: $space-6;
background: $bg-card;
border: 1px solid $border-default;
- border-radius: $radius-md;
+ border-radius: $radius-lg;
+ box-shadow: $shadow-sm;
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
- .stat-number {
- font-size: 2rem;
- font-weight: 700;
- color: $accent-primary;
- line-height: 1;
+ &:hover {
+ transform: translateY(-2px);
+ box-shadow: $shadow-md;
}
.stat-label {
- margin-top: $space-2;
font-size: $font-size-sm;
- color: $text-secondary;
+ font-weight: 500;
+ color: $text-tertiary;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ margin-bottom: $space-2;
+ }
+
+ .stat-number {
+ font-size: 2.25rem;
+ font-weight: 800;
+ color: $accent-primary;
+ line-height: 1;
}
}
.most-active-users {
- margin-bottom: $space-6;
- padding: $space-4;
+ margin-bottom: $space-8;
+ padding: $space-6;
background: $bg-card;
border: 1px solid $border-default;
- border-radius: $radius-md;
+ border-radius: $radius-lg;
+ box-shadow: $shadow-sm;
h4 {
- margin: 0 0 $space-4 0;
- font-size: $font-size-md;
+ margin: 0 0 $space-6 0;
+ font-size: $font-size-lg;
font-weight: 600;
+ color: $text-primary;
}
}
+.active-users-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+}
+
.active-user-item {
display: flex;
align-items: center;
- gap: $space-3;
- padding: $space-2 0;
+ gap: $space-4;
- &:not(:last-child) {
- border-bottom: 1px solid $border-default;
+ .active-user-rank {
+ width: 28px;
+ height: 28px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ background: $bg-hover;
+ border-radius: 50%;
+ font-weight: 700;
+ font-size: $font-size-xs;
+ color: $text-tertiary;
}
-}
-.active-user-rank {
- width: 24px;
- text-align: center;
- font-weight: 600;
- font-size: $font-size-sm;
- color: $text-tertiary;
+ .active-user-info {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ gap: $space-1;
+ }
+
+ .active-user-name {
+ font-size: $font-size-sm;
+ font-weight: 600;
+ color: $text-primary;
+ }
+
+ .active-user-bar-wrapper {
+ height: 6px;
+ background: $bg-hover;
+ border-radius: $radius-full;
+ overflow: hidden;
+ }
+
+ .active-user-bar {
+ height: 100%;
+ background: linear-gradient(90deg, $accent-primary, $accent-hover);
+ border-radius: $radius-full;
+ transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
+ }
+
+ .active-user-count {
+ font-size: $font-size-sm;
+ font-weight: 600;
+ color: $text-secondary;
+ white-space: nowrap;
+ }
}
-.active-user-name {
- min-width: 100px;
- font-size: $font-size-sm;
- font-weight: 500;
+.activity-feed-section {
+ margin-top: $space-8;
+
+ .section-header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ margin-bottom: $space-4;
+
+ h4 {
+ margin: 0;
+ font-size: $font-size-lg;
+ font-weight: 600;
+ color: $text-primary;
+ }
+ }
}
-.active-user-bar-wrapper {
- flex: 1;
- height: 8px;
+.filters-bar {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-4;
+ align-items: flex-end;
+ margin-bottom: $space-6;
+ padding: $space-5;
background: $bg-hover;
- border-radius: $radius-full;
- overflow: hidden;
-}
+ border-radius: $radius-lg;
+ border: 1px solid $border-default;
-.active-user-bar {
- height: 100%;
- background: $accent-primary;
- border-radius: $radius-full;
- transition: width 0.3s ease;
+ .filter-group {
+ display: flex;
+ flex-direction: column;
+ gap: $space-2;
+
+ label {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ font-size: $font-size-xs;
+ font-weight: 600;
+ color: $text-tertiary;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ }
+
+ select.form-control {
+ min-width: 200px;
+ height: 38px;
+ padding: 0 $space-3;
+ background: $bg-card;
+ border: 1px solid $border-default;
+ border-radius: $radius-md;
+ font-size: $font-size-sm;
+ color: $text-primary;
+ cursor: pointer;
+ transition: border-color 0.2s, box-shadow 0.2s;
+
+ &:focus {
+ outline: none;
+ border-color: $accent-primary;
+ box-shadow: 0 0 0 3px fade($accent-primary-raw, 10%);
+ }
+
+ &:hover {
+ border-color: $border-active;
+ }
+ }
+ }
+
+ .btn-clear {
+ height: 38px;
+ display: flex;
+ align-items: center;
+ gap: $space-2;
+ padding: 0 $space-4;
+ color: $text-tertiary;
+
+ &:hover {
+ color: $danger;
+ background: fade($danger, 10%);
+ }
+ }
}
-.active-user-count {
- min-width: 40px;
- text-align: right;
- font-size: $font-size-sm;
- font-weight: 600;
- color: $text-secondary;
+.audit-log-list {
+ display: flex;
+ flex-direction: column;
+ gap: $space-3;
}
-.activity-feed-section {
- h4 {
- margin: 0 0 $space-4 0;
- font-size: $font-size-md;
- font-weight: 600;
+.log-entry {
+ display: flex;
+ gap: $space-5;
+ padding: $space-5;
+ background: $bg-card;
+ border-radius: $radius-lg;
+ border: 1px solid $border-default;
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
+
+ &:hover {
+ transform: translateX(4px);
+ box-shadow: $shadow-sm;
+ border-color: $border-active;
+ }
+
+ &.action-success .log-icon { background: fade($success, 10%); color: $success; }
+ &.action-warning .log-icon { background: fade($warning, 10%); color: $warning; }
+ &.action-danger .log-icon { background: fade($danger, 10%); color: $danger; }
+ &.action-info .log-icon { background: fade($accent-primary-raw, 10%); color: $accent-primary; }
+
+ .log-icon {
+ flex-shrink: 0;
+ width: 42px;
+ height: 42px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: $radius-md;
+ background: $bg-hover;
+ color: $text-secondary;
+ }
+
+ .log-content {
+ flex: 1;
+ min-width: 0;
+ }
+
+ .log-header {
+ display: flex;
+ flex-wrap: wrap;
+ align-items: center;
+ gap: $space-2;
+ margin-bottom: $space-2;
+
+ .log-action {
+ font-weight: 600;
+ color: $text-primary;
+ text-transform: capitalize;
+ font-size: $font-size-md;
+ }
+
+ .log-user {
+ font-weight: 500;
+ color: $accent-primary;
+ background: fade($accent-primary-raw, 8%);
+ padding: 2px 8px;
+ border-radius: $radius-full;
+ font-size: $font-size-xs;
+ }
+
+ .log-target {
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+ }
+
+ .log-time {
+ margin-left: auto;
+ color: $text-tertiary;
+ font-size: $font-size-xs;
+ font-weight: 500;
+ }
+ }
+
+ .log-details {
+ display: flex;
+ flex-wrap: wrap;
+ gap: $space-2;
+ margin-top: $space-3;
+
+ .detail-item {
+ display: inline-flex;
+ align-items: center;
+ gap: $space-2;
+ padding: 4px $space-3;
+ background: $bg-hover;
+ border: 1px solid $border-default;
+ border-radius: $radius-md;
+ font-size: $font-size-xs;
+
+ .detail-key {
+ color: $text-tertiary;
+ font-weight: 600;
+ text-transform: uppercase;
+ letter-spacing: 0.05em;
+ font-size: 0.7rem;
+ }
+
+ .detail-value {
+ color: $text-secondary;
+ font-family: $font-mono;
+ max-width: 300px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+ }
+
+ .log-meta {
+ margin-top: $space-3;
+ display: flex;
+ gap: $space-4;
+
+ .log-ip {
+ font-size: $font-size-xs;
+ color: $text-tertiary;
+ background: $bg-hover;
+ padding: 2px 6px;
+ border-radius: $radius-sm;
+ font-family: $font-mono;
+ }
}
}
diff --git a/frontend/src/styles/main.scss b/frontend/src/styles/main.scss
index 716b8740..8d2fd394 100644
--- a/frontend/src/styles/main.scss
+++ b/frontend/src/styles/main.scss
@@ -55,6 +55,8 @@
@import 'components/_api-settings';
@import 'components/_empty-state';
@import 'components/_status-badge';
+@import 'components/_server-selector';
+@import 'components/_contribution-graph';
// --------------------------------------------
// 5. PAGE-SPECIFIC STYLES
diff --git a/frontend/src/styles/pages/_dashboard.scss b/frontend/src/styles/pages/_dashboard.scss
index a48ca1ea..449c0a52 100644
--- a/frontend/src/styles/pages/_dashboard.scss
+++ b/frontend/src/styles/pages/_dashboard.scss
@@ -7,6 +7,11 @@
flex-direction: column;
gap: $space-6;
min-height: 100%;
+
+ // Override generic .top-bar margin from _main-content (40px not needed here)
+ > .top-bar {
+ margin-bottom: 0;
+ }
}
// --- Top Bar: Pro Layout ---
diff --git a/frontend/src/styles/pages/_docker.scss b/frontend/src/styles/pages/_docker.scss
index cc9e07d9..b0023fcc 100644
--- a/frontend/src/styles/pages/_docker.scss
+++ b/frontend/src/styles/pages/_docker.scss
@@ -35,44 +35,9 @@
gap: $space-3;
}
-// Server Selector
-.server-selector {
- display: flex;
- align-items: center;
- gap: $space-2;
- background: $bg-card;
- border: 1px solid $border-subtle;
- border-radius: $radius-md;
- padding: $space-2 $space-3;
+// Docker-specific server-selector spacing (base styles in components/_server-selector)
+.docker-page-actions .server-selector {
margin-right: $space-2;
-
- svg {
- color: $text-tertiary;
- flex-shrink: 0;
- }
-
- select {
- background: transparent;
- border: none;
- color: $text-primary;
- font-size: $font-size-sm;
- cursor: pointer;
- padding-right: $space-4;
- min-width: 140px;
-
- &:focus {
- outline: none;
- }
-
- option {
- background: $bg-card;
- color: $text-primary;
- }
-
- option:disabled {
- color: $text-tertiary;
- }
- }
}
// Stats Row
diff --git a/frontend/src/styles/pages/_settings.scss b/frontend/src/styles/pages/_settings.scss
index 874b4847..ad17aa1e 100644
--- a/frontend/src/styles/pages/_settings.scss
+++ b/frontend/src/styles/pages/_settings.scss
@@ -111,6 +111,12 @@
}
}
+// Nav spacer pushes About to the bottom of the sticky sidebar
+.settings-nav-spacer {
+ flex: 1;
+ min-height: $space-4;
+}
+
// Settings Content Area
.settings-content {
min-width: 0;
@@ -154,7 +160,7 @@
padding: $space-5;
h3 {
- margin-bottom: $space-2;
+ margin: 0;
}
> p {
@@ -164,6 +170,74 @@
}
}
+.settings-card__header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: $space-4;
+ margin-bottom: $space-5;
+}
+
+.settings-card__header-left {
+ display: flex;
+ align-items: flex-start;
+ gap: $space-3;
+
+ > svg {
+ flex-shrink: 0;
+ color: $text-tertiary;
+ margin-top: 2px;
+ }
+
+ h3 {
+ font-size: $font-size-base;
+ font-weight: $font-weight-semibold;
+ color: $text-primary;
+ margin: 0;
+ }
+
+ p {
+ color: $text-secondary;
+ font-size: $font-size-sm;
+ margin: $space-1 0 0 0;
+ }
+}
+
+.settings-card__empty {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: $space-3;
+ padding: $space-8 $space-4;
+ color: $text-tertiary;
+ text-align: center;
+
+ > svg {
+ opacity: 0.4;
+ }
+
+ p {
+ margin: 0;
+ font-size: $font-size-sm;
+ color: $text-tertiary;
+ }
+}
+
+.settings-card__loading {
+ padding: $space-6;
+ text-align: center;
+ color: $text-tertiary;
+ font-size: $font-size-sm;
+}
+
+.settings-card__footer {
+ display: flex;
+ gap: $space-2;
+ margin-top: $space-5;
+ padding-top: $space-4;
+ border-top: 1px solid $border-subtle;
+}
+
// Settings Form
.settings-form {
background: $bg-card;
@@ -228,24 +302,31 @@
// Alert Messages
.alert {
+ display: flex;
+ align-items: center;
+ gap: $space-2;
padding: $space-3 $space-4;
border-radius: $radius-md;
font-size: $font-size-sm;
margin-bottom: $space-4;
- &.alert-success {
+ &.alert-success,
+ &.alert--success {
background: $success-bg;
border: 1px solid $success-border;
color: $success;
}
- &.alert-danger {
+ &.alert-danger,
+ &.alert--danger,
+ &.alert--error {
background: $danger-bg;
border: 1px solid $danger-border;
color: $danger;
}
- &.alert-warning {
+ &.alert-warning,
+ &.alert--warning {
background: $warning-bg;
border: 1px solid $warning-border;
color: $warning;
@@ -650,15 +731,9 @@
width: 80px;
height: 80px;
margin: 0 auto $space-4;
- background: linear-gradient(135deg, $accent-primary 0%, $accent-hover 100%);
- border-radius: $radius-xl;
display: flex;
align-items: center;
justify-content: center;
-
- svg {
- stroke: white;
- }
}
h3 {
@@ -1420,6 +1495,38 @@
gap: $space-5;
}
+.sso-general-form {
+ display: flex;
+ flex-direction: column;
+ gap: $space-4;
+
+ .form-group {
+ label {
+ display: block;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-secondary;
+ margin-bottom: $space-2;
+ }
+
+ select,
+ input[type="text"] {
+ width: 100%;
+ padding: $space-3;
+ background: $bg-hover;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ color: $text-primary;
+ font-size: $font-size-sm;
+
+ &:focus {
+ outline: none;
+ border-color: $accent-primary;
+ }
+ }
+ }
+}
+
.sso-provider-config {
border: 1px solid $border-subtle;
@@ -1462,11 +1569,43 @@
}
.sso-provider-config__body {
- padding: $space-1 $space-4 $space-4;
+ padding: $space-4;
border-top: 1px solid $border-subtle;
display: flex;
flex-direction: column;
gap: $space-4;
+
+ .form-group {
+ label {
+ display: block;
+ font-size: $font-size-sm;
+ font-weight: $font-weight-medium;
+ color: $text-secondary;
+ margin-bottom: $space-2;
+ }
+
+ input,
+ textarea {
+ width: 100%;
+ padding: $space-3;
+ background: $bg-hover;
+ border: 1px solid $border-subtle;
+ border-radius: $radius-md;
+ color: $text-primary;
+ font-size: $font-size-sm;
+ font-family: $font-mono;
+
+ &:focus {
+ outline: none;
+ border-color: $accent-primary;
+ }
+ }
+
+ textarea {
+ resize: vertical;
+ font-family: $font-mono;
+ }
+ }
}
.sso-provider-config__actions {