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.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
Show load errors in settings and security instead of empty states
Juan Denisb571f0146580
diff --git a/frontend/src/components/log-viewer/LogFileList.jsx b/frontend/src/components/log-viewer/LogFileList.jsxindex 522616e0..37b1d42f 100644--- a/frontend/src/components/log-viewer/LogFileList.jsx+++ b/frontend/src/components/log-viewer/LogFileList.jsx@@ -3,6 +3,7 @@ import { Search, RefreshCw, ChevronDown, ChevronRight, FileText, AlertTriangle,import { LOG_GROUPS, categoriseLog, logKindFromPath, formatBytes, formatRelativeTime } from './logHelpers';import { useTranslation } from 'react-i18next';import { Button as SharedButton } from '@/components/ui/button';+import ErrorState from '@/components/ErrorState';const GROUP_ICONS = {web: Globe,@@ -14,7 +15,9 @@ const GROUP_ICONS = {other: FileText,};-export default function LogFileList({ files, selectedPath, onSelect, onRefresh, loading }) {+// `error` (string or Error) is the failure of the file-list request itself;+// with no files loaded it replaces the "No log files found" hint.+export default function LogFileList({ files, selectedPath, onSelect, onRefresh, loading, error }) {const { t } = useTranslation();const [query, setQuery] = useState('');const [collapsed, setCollapsed] = useState(new Set());@@ -71,7 +74,18 @@ export default function LogFileList({ files, selectedPath, onSelect, onRefresh,</div><div className="lv-sidebar-body">- {files.length === 0 ? (+ {loading && files.length === 0 ? (+ <div className="lv-empty-hint" role="status" aria-busy="true">+ <p>{t('app.logFileList.loadingLogFiles', 'Loading log files…')}</p>+ </div>+ ) : error && files.length === 0 ? (+ <ErrorState+ compact+ error={typeof error === 'string' ? undefined : error}+ message={typeof error === 'string' ? error : undefined}+ onRetry={onRefresh}+ />+ ) : files.length === 0 ? (<div className="lv-empty-hint"><AlertTriangle size={20} /><p>{t('app.logFileList.noLogFilesFound', 'No log files found.')}</p>diff --git a/frontend/src/components/security/AuditTab.jsx b/frontend/src/components/security/AuditTab.jsxindex d3144f04..3cd93041 100644--- a/frontend/src/components/security/AuditTab.jsx+++ b/frontend/src/components/security/AuditTab.jsx@@ -3,6 +3,7 @@ import { statusKind } from '@/components/ds/status';import { ClipboardCheck } from 'lucide-react';import api from '../../services/api';import EmptyState from '@/components/EmptyState';+import ErrorState from '@/components/ErrorState';import { Button } from '@/components/ui/button';import { ScoreGauge } from '@/components/ds';import { useTranslation } from 'react-i18next';@@ -29,7 +30,7 @@ const AuditTab = () => {const data = await api.generateSecurityAudit();setAudit(data.audit);} catch (err) {- setError(err.message);+ setError(err);} finally {setLoading(false);}@@ -45,9 +46,16 @@ const AuditTab = () => {</Button></SharedCardHeader><SharedCardContent variant="legacy" className="card-body">- {error && <div className="alert alert-danger">{error}</div>}+ {error && !loading && (+ <ErrorState+ title={t('app.auditTab.couldntRunAudit', "Couldn't run the security audit")}+ error={error}+ onRetry={runAudit}+ compact={!!audit}+ />+ )}- {!audit && !loading && (+ {!audit && !loading && !error && (<EmptyStateicon={ClipboardCheck}title={t('app.auditTab.runASecurityAuditToCheck', 'Run a security audit to check your server\'s configuration.')}diff --git a/frontend/src/components/security/EventsTab.jsx b/frontend/src/components/security/EventsTab.jsxindex afcd881b..fe447c42 100644--- a/frontend/src/components/security/EventsTab.jsx+++ b/frontend/src/components/security/EventsTab.jsx@@ -1,6 +1,7 @@import { useState, useEffect } from 'react';import api from '../../services/api';import { Button } from '@/components/ui/button';+import ErrorState from '@/components/ErrorState';import { Feed, FeedItem } from '@/components/ds';import { useTranslation } from 'react-i18next';import { CardHeader as SharedCardHeader, CardContent as SharedCardContent, Card as SharedCard } from '@/components/ui/card';@@ -10,6 +11,8 @@ const EventsTab = () => {const [events, setEvents] = useState([]);const [failedLogins, setFailedLogins] = useState(null);const [loading, setLoading] = useState(true);+ const [eventsError, setEventsError] = useState(null);+ const [failedLoginsError, setFailedLoginsError] = useState(null);useEffect(() => {loadEvents();@@ -20,8 +23,10 @@ const EventsTab = () => {try {const data = await api.getSecurityEvents(50);setEvents(data.events || []);+ setEventsError(null);} catch (err) {console.error('Failed to load security events:', err);+ setEventsError(err);} finally {setLoading(false);}@@ -31,8 +36,10 @@ const EventsTab = () => {try {const data = await api.getFailedLogins(24);setFailedLogins(data);+ setFailedLoginsError(null);} catch (err) {console.error('Failed to load failed logins:', err);+ setFailedLoginsError(err);}}@@ -54,6 +61,13 @@ const EventsTab = () => {return (<div className="events-tab">+ {failedLoginsError && (+ <ErrorState+ compact+ error={failedLoginsError}+ onRetry={loadFailedLogins}+ />+ )}{failedLogins && (<div className={`card ${failedLogins.alert_triggered ? 'card-warning' : ''}`}><SharedCardHeader variant="legacy" className="card-header">@@ -85,9 +99,17 @@ const EventsTab = () => {<SharedCardContent variant="legacy" className="card-body">{loading ? (<div className="loading-sm">{t('common.loading', 'Loading…')}</div>+ ) : eventsError && events.length === 0 ? (+ <ErrorState+ title={t('app.eventsTab.couldntLoadSecurityEvents', "Couldn't load security events")}+ error={eventsError}+ onRetry={loadEvents}+ />) : events.length === 0 ? (<p className="text-muted">{t('app.eventsTab.noSecurityEventsRecorded', 'No security events recorded.')}</p>) : (+ <>+ {eventsError && <ErrorState compact error={eventsError} onRetry={loadEvents} />}<Feed className="sec-feed">{events.map((event, index) => (<FeedItem@@ -100,6 +122,7 @@ const EventsTab = () => {</FeedItem>))}</Feed>+ </>)}</SharedCardContent></SharedCard>diff --git a/frontend/src/components/security/FirewallTab.jsx b/frontend/src/components/security/FirewallTab.jsxindex 290680bb..d5a13383 100644--- a/frontend/src/components/security/FirewallTab.jsx+++ b/frontend/src/components/security/FirewallTab.jsx@@ -3,6 +3,7 @@ import api from '../../services/api';import { useToast } from '../../contexts/useToast.js';import { useConfirm } from '@/hooks/useConfirm';import EmptyState from '@/components/EmptyState';+import ErrorState from '@/components/ErrorState';import Modal from '../Modal';import { InfoList, InfoItem } from '../InfoList';import PortField from '../PortField';@@ -103,6 +104,17 @@ const FirewallTab = () => {const [actionLoading, setActionLoading] = useState(false);const [guard, setGuard] = useState(null);const [guardLoading, setGuardLoading] = useState(false);+ // Per-request load failures, keyed by loader. A failed status read must not+ // fall through to the "No firewall installed" call to action.+ const [loadErrors, setLoadErrors] = useState({});+ const recordLoad = useCallback((key, error) => {+ setLoadErrors((prev) => {+ if (!error && !prev[key]) return prev;+ const next = { ...prev };+ if (error) next[key] = error; else delete next[key];+ return next;+ });+ }, []);const toast = useToast();const { confirm } = useConfirm();const { sorts, setSorts } = useTableSort({ storageKey: 'serverkit-table-firewall-rules-sort' });@@ -126,37 +138,45 @@ const FirewallTab = () => {try {const data = await api.getFirewallStatus();setStatus(data);+ recordLoad('status', null);} catch (error) {console.error('Failed to load status:', error);+ recordLoad('status', error);}- }, []);+ }, [recordLoad]);const loadRules = useCallback(async () => {try {const data = await api.getFirewallRules();setRules(data.rules || []);+ recordLoad('rules', null);} catch (error) {console.error('Failed to load rules:', error);+ recordLoad('rules', error);}- }, []);+ }, [recordLoad]);const loadBlockedIPs = useCallback(async () => {try {const data = await api.getBlockedIPs();setBlockedIPs(data.blocked_ips || []);+ recordLoad('blocked', null);} catch (error) {console.error('Failed to load blocked IPs:', error);+ recordLoad('blocked', error);}- }, []);+ }, [recordLoad]);const loadGuard = useCallback(async () => {try {const data = await api.getMetadataGuard();setGuard(data);+ recordLoad('guard', null);} catch (error) {console.error('Failed to load metadata guard status:', error);+ recordLoad('guard', error);}- }, []);+ }, [recordLoad]);const loadData = useCallback(async () => {setLoading(true);@@ -409,8 +429,21 @@ const FirewallTab = () => {return <div className="loading-sm">{t('app.firewallTab.loadingFirewallStatus', 'Loading firewall status…')}</div>;}+ if (loadErrors.status && !status) {+ return (+ <ErrorState+ title={t('app.firewallTab.couldntLoadStatus', "Couldn't load firewall status")}+ error={loadErrors.status}+ onRetry={loadData}+ />+ );+ }++ const partialError = loadErrors.status || loadErrors.rules || loadErrors.blocked || loadErrors.guard;+return (<div className="firewall-tab">+ {partialError && <ErrorState compact error={partialError} onRetry={loadData} />}{!status?.any_installed ? (<EmptyStateicon={Shield}diff --git a/frontend/src/components/security/IPListsTab.jsx b/frontend/src/components/security/IPListsTab.jsxindex f705ddac..2a3fc6c2 100644--- a/frontend/src/components/security/IPListsTab.jsx+++ b/frontend/src/components/security/IPListsTab.jsx@@ -3,6 +3,7 @@ import api from '../../services/api';import { useToast } from '../../contexts/useToast.js';import { useConfirm } from '@/hooks/useConfirm';import Modal from '../Modal';+import ErrorState from '@/components/ErrorState';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';import { Label } from '@/components/ui/label';@@ -131,6 +132,8 @@ const IPListsTab = () => {const { t } = useTranslation();const [lists, setLists] = useState({ allowlist: [], blocklist: [] });const [loading, setLoading] = useState(true);+ const [loadError, setLoadError] = useState(null);+ const [loaded, setLoaded] = useState(false);const [showAddModal, setShowAddModal] = useState(null);const [newIP, setNewIP] = useState('');const [newComment, setNewComment] = useState('');@@ -155,8 +158,11 @@ const IPListsTab = () => {allowlist: data.allowlist || [],blocklist: data.blocklist || []});+ setLoaded(true);+ setLoadError(null);} catch (error) {console.error('Failed to load IP lists:', error);+ setLoadError(error);} finally {setLoading(false);}@@ -304,8 +310,19 @@ const IPListsTab = () => {return <div className="loading-sm">{t('app.iPListsTab.loadingIpLists', 'Loading IP lists…')}</div>;}+ if (loadError && !loaded) {+ return (+ <ErrorState+ title={t('app.iPListsTab.couldntLoadIpLists', "Couldn't load IP lists")}+ error={loadError}+ onRetry={loadLists}+ />+ );+ }+return (<div className="ip-lists-tab">+ {loadError && <ErrorState compact error={loadError} onRetry={loadLists} />}<div className="ip-lists-grid">{renderList('allowlist', lists.allowlist, allowSorts, allowChrome)}{renderList('blocklist', lists.blocklist, blockSorts, blockChrome)}diff --git a/frontend/src/components/security/IntegrityTab.jsx b/frontend/src/components/security/IntegrityTab.jsxindex 239ae3e3..ec24d41e 100644--- a/frontend/src/components/security/IntegrityTab.jsx+++ b/frontend/src/components/security/IntegrityTab.jsx@@ -2,6 +2,7 @@ import { useCallback, useEffect, useMemo, useState } from 'react';import api from '../../services/api';import { Button } from '@/components/ui/button';import { Switch } from '@/components/ui/switch';+import ErrorState from '@/components/ErrorState';import { DataTable, DataTableFooter, ListToolbar } from '@/components/ds';import {useTableChrome, GridViewPicker, GridChips, GridFilterButton,@@ -168,6 +169,8 @@ const IntegrityTab = () => {const [busy, setBusy] = useState(null); // `${scope}:${action}` while a call runsconst [savingOptins, setSavingOptins] = useState(false);const [message, setMessage] = useState(null);+ const [loadError, setLoadError] = useState(null);+ const [appsError, setAppsError] = useState(null);const [expanded, setExpanded] = useState(null); // scope whose changes table is open// Lifted out of <DataTable storageKey> so the chrome can capture and@@ -184,18 +187,25 @@ const IntegrityTab = () => {try {const data = await api.request('/security/fim');setStatus(data);+ setLoadError(null);} catch (err) {- setMessage({ type: 'error', text: err.message });+ setLoadError(err);}}, []);- useEffect(() => {- load();+ const loadApps = useCallback(() => {api.getApps().then(- (data) => setApps(data.apps || []),- () => {} // apps list is optional chrome; FIM still works without it+ (data) => { setApps(data.apps || []); setAppsError(null); },+ // The apps list is optional chrome; FIM still works without it, but+ // a failed read must not claim there are no applications.+ (err) => setAppsError(err),);- }, [load]);+ }, []);++ useEffect(() => {+ load();+ loadApps();+ }, [load, loadApps]);async function runAction(scope, action) {setBusy(`${scope}:${action}`);@@ -391,8 +401,21 @@ const IntegrityTab = () => {const managedScopes = scopes.filter((s) => !s.scope.startsWith('app:'));const appScopes = scopes.filter((s) => s.scope.startsWith('app:'));+ if (!status) {+ return loadError ? (+ <ErrorState+ title={t('app.integrityTab.couldntLoadIntegrity', "Couldn't load file integrity status")}+ error={loadError}+ onRetry={load}+ />+ ) : (+ <div className="loading-sm">{t('common.loading', 'Loading…')}</div>+ );+ }+return (<div className="integrity-tab">+ {loadError && <ErrorState compact error={loadError} onRetry={load} />}{message && (<div className={`alert alert-${message.type === 'success' ? 'success' : 'danger'}`}>{message.text}@@ -414,7 +437,9 @@ const IntegrityTab = () => {<p className="sec-hint sec-hint--lead">{t('app.integrityTab.watchingADocrootHashesEveryFile', 'Watching a docroot hashes every file outside upload/cache directories, so it is opt-in per application.')}</p>- {apps.length === 0 ? (+ {appsError ? (+ <ErrorState compact error={appsError} onRetry={loadApps} />+ ) : apps.length === 0 ? (<p className="sec-faint">{t('app.integrityTab.noApplicationsFound', 'No applications found.')}</p>) : (<div className="sec-finding-list">diff --git a/frontend/src/components/security/SSHKeysTab.jsx b/frontend/src/components/security/SSHKeysTab.jsxindex 1df69816..9827853a 100644--- a/frontend/src/components/security/SSHKeysTab.jsx+++ b/frontend/src/components/security/SSHKeysTab.jsx@@ -4,6 +4,7 @@ import api from '../../services/api';import { useToast } from '../../contexts/useToast.js';import { useConfirm } from '@/hooks/useConfirm';import EmptyState from '@/components/EmptyState';+import ErrorState from '@/components/ErrorState';import Modal from '../Modal';import { Button } from '@/components/ui/button';import { Textarea } from '@/components/ui/textarea';@@ -64,6 +65,7 @@ const SSHKeysTab = () => {const { t } = useTranslation();const [keys, setKeys] = useState([]);const [loading, setLoading] = useState(true);+ const [loadError, setLoadError] = useState(null);const [showAddModal, setShowAddModal] = useState(false);const [newKey, setNewKey] = useState('');const [actionLoading, setActionLoading] = useState(false);@@ -83,8 +85,10 @@ const SSHKeysTab = () => {try {const data = await api.getSSHKeys();setKeys(data.keys || []);+ setLoadError(null);} catch (error) {console.error('Failed to load SSH keys:', error);+ setLoadError(error);} finally {setLoading(false);}@@ -226,10 +230,20 @@ const SSHKeysTab = () => {<GridChips {...chrome.chipProps} />+ {loadError && keys.length > 0 && !loading && (+ <ErrorState compact error={loadError} onRetry={loadKeys} />+ )}+{loading ? (<SharedCard variant="legacy" className="card"><div className="loading-sm">{t('common.loading', 'Loading…')}</div></SharedCard>+ ) : loadError && keys.length === 0 ? (+ <ErrorState+ title={t('app.sSHKeysTab.couldntLoadSshKeys', "Couldn't load SSH keys")}+ error={loadError}+ onRetry={loadKeys}+ />) : keys.length === 0 ? (<SharedCard variant="legacy" className="card"><EmptyStatediff --git a/frontend/src/components/security/SecurityConfigTab.jsx b/frontend/src/components/security/SecurityConfigTab.jsxindex 10510739..78d07aee 100644--- a/frontend/src/components/security/SecurityConfigTab.jsx+++ b/frontend/src/components/security/SecurityConfigTab.jsx@@ -1,6 +1,7 @@import { useState, useEffect } from 'react';import api from '../../services/api';import { Button } from '@/components/ui/button';+import ErrorState from '@/components/ErrorState';import { Input } from '@/components/ui/input';import { Switch } from '@/components/ui/switch';import { Label } from '@/components/ui/label';@@ -13,17 +14,21 @@ const SecurityConfigTab = () => {const [loading, setLoading] = useState(true);const [saving, setSaving] = useState(false);const [message, setMessage] = useState(null);+ const [loadError, setLoadError] = useState(null);useEffect(() => {loadConfig();}, []);async function loadConfig() {+ setLoading(true);try {const data = await api.getSecurityConfig();setConfig(data);+ setLoadError(null);} catch (err) {console.error('Failed to load security config:', err);+ setLoadError(err);} finally {setLoading(false);}@@ -56,6 +61,18 @@ const SecurityConfigTab = () => {return <div className="loading-sm">{t('app.securityConfigTab.loadingSettings', 'Loading settings…')}</div>;}+ // Never render the form on a failed load: saving it would write the+ // empty defaults over the real configuration.+ if (loadError && !config) {+ return (+ <ErrorState+ title={t('app.securityConfigTab.couldntLoadSettings', "Couldn't load security settings")}+ error={loadError}+ onRetry={loadConfig}+ />+ );+ }+return (<div className="settings-tab">{message && (diff --git a/frontend/src/components/settings/AboutTab.jsx b/frontend/src/components/settings/AboutTab.jsxindex 8afa4c3c..0a7a37ee 100644--- a/frontend/src/components/settings/AboutTab.jsx+++ b/frontend/src/components/settings/AboutTab.jsx@@ -5,6 +5,7 @@ import {RefreshCw, ExternalLink, Star, X, AlertTriangle} from 'lucide-react';import ServerKitLogo from '../ServerKitLogo';+import ErrorState from '../ErrorState';import { Button } from '@/components/ui/button';import useSettingFocus from '../../hooks/useSettingFocus';import { useManagedProfile } from '../../contexts/useManagedProfile';@@ -15,7 +16,9 @@ const STAR_PROMPT_KEY = 'serverkit-star-prompt-dismissed';const AboutTab = () => {const { t } = useTranslation();- const [version, setVersion] = useState('...');+ // null until known: a failed read shows "—", never an invented number.+ const [version, setVersion] = useState(null);+ const [versionError, setVersionError] = useState(null);const [updateInfo, setUpdateInfo] = useState(null);const [checkingUpdate, setCheckingUpdate] = useState(false);const [showStarPrompt, setShowStarPrompt] = useState(() => {@@ -38,15 +41,18 @@ const AboutTab = () => {useEffect(() => () => { cancelledRef.current = true; }, []);+ const fetchVersion = async () => {+ setVersionError(null);+ try {+ const data = await api.getVersion();+ setVersion(data.version || null);+ } catch (err) {+ setVersion(null);+ setVersionError(err);+ }+ };+useEffect(() => {- const fetchVersion = async () => {- try {- const data = await api.getVersion();- setVersion(data.version || '1.0.0');- } catch {- setVersion('1.0.0');- }- };fetchVersion();}, []);@@ -77,7 +83,14 @@ const AboutTab = () => {const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));const runUpdate = async () => {- const startVersion = version;+ let startVersion = version;+ if (!startVersion) {+ // Without a known starting version the poll below cannot tell the+ // new backend from the old one, so read it once more first.+ try {+ startVersion = (await api.getVersion()).version || null;+ } catch { /* fall back to the running/outcome signals */ }+ }setUpdatePhase('starting');setUpdateError(null);setUpdateLogTail('');@@ -97,7 +110,7 @@ const AboutTab = () => {try {const st = await api.getPanelUpdateStatus();if (st.log?.tail) setUpdateLogTail(st.log.tail);- if (st.version && st.version !== startVersion) {+ if (st.version && startVersion && st.version !== startVersion) {// The backend that answered is already the new version.setUpdatedVersion(st.version);setUpdatePhase('done');@@ -141,7 +154,8 @@ const AboutTab = () => {<ServerKitLogo width={64} height={64} /></div><h3>{t('common.labels.serverKit', 'ServerKit')}</h3>- <p className="version">{t('common.labels.version', 'Version')} {version}</p>+ <p className="version">{t('common.labels.version', 'Version')} {version || (versionError ? '—' : '…')}</p>+ {versionError && <ErrorState compact error={versionError} onRetry={fetchVersion} />}<p className="description">{t('app.aboutTab.aModernLightweightServerManagementPanel', 'A modern, lightweight server management panel for managing web applications, databases, domains, and more. Built with Flask and React.')}</p>diff --git a/frontend/src/components/settings/ActivityTab.jsx b/frontend/src/components/settings/ActivityTab.jsxindex 4d1cad57..81222eea 100644--- a/frontend/src/components/settings/ActivityTab.jsx+++ b/frontend/src/components/settings/ActivityTab.jsx@@ -2,6 +2,7 @@ import { useCallback, useState, useEffect } from 'react';import api from '../../services/api';import ContributionGraph from './ContributionGraph';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import { Search, Filter, X, User as UserIcon } from 'lucide-react';import { Button } from '@/components/ui/button';import { DataTableFooter } from '@/components/ds';@@ -16,6 +17,8 @@ const ActivityTab = () => {const [logs, setLogs] = useState([]);const [loading, setLoading] = useState(true);const [feedLoading, setFeedLoading] = useState(false);+ const [summaryError, setSummaryError] = useState(null);+ const [logsError, setLogsError] = useState(null);const [users, setUsers] = useState([]);const [actions, setActions] = useState([]);const [pagination, setPagination] = useState({@@ -46,8 +49,9 @@ const ActivityTab = () => {total: data.pagination?.total || 0,pages: data.pagination?.pages || 1}));- } catch {- // Silently handle+ setLogsError(null);+ } catch (err) {+ setLogsError(err);} finally {setFeedLoading(false);}@@ -61,8 +65,9 @@ const ActivityTab = () => {try {const data = await api.getActivitySummary();setSummary(data);- } catch {- // Silently handle+ setSummaryError(null);+ } catch (err) {+ setSummaryError(err);} finally {setLoading(false);}@@ -135,6 +140,14 @@ const ActivityTab = () => {</div></div>+ {summaryError && !summary && (+ <ErrorState+ title={t('app.activityTab.couldntLoadSummary', "Couldn't load activity summary")}+ error={summaryError}+ onRetry={loadSummary}+ />+ )}+{summary && (<><div {...register('activity-dashboard', 'activity-stats')}>@@ -250,9 +263,17 @@ const ActivityTab = () => {<div className="spinner" />{t('app.activityTab.loadingLogs', 'Loading logs…')}</div>+ ) : logsError && logs.length === 0 ? (+ <ErrorState+ title={t('app.activityTab.couldntLoadAuditLogs', "Couldn't load audit logs")}+ error={logsError}+ onRetry={loadLogs}+ />) : logs.length === 0 ? (<EmptyState icon={Search} title={t('app.activityTab.noAuditLogsFound', 'No audit logs found')} />) : (+ <>+ {logsError && <ErrorState compact error={logsError} onRetry={loadLogs} />}<div className="audit-log-list" role="list">{logs.map(log => (<div key={log.id} className={`log-row ${getActionClass(log.action)}`} role="listitem">@@ -274,6 +295,7 @@ const ActivityTab = () => {</div>))}</div>+ </>)}{/* The audit feed is a flex-wrapped log-row layout, not adiff --git a/frontend/src/components/settings/CloudTab.jsx b/frontend/src/components/settings/CloudTab.jsxindex 2f6544b8..fc99cb1d 100644--- a/frontend/src/components/settings/CloudTab.jsx+++ b/frontend/src/components/settings/CloudTab.jsx@@ -5,6 +5,8 @@ import api from '../../services/api';import { useManagedProfile } from '../../contexts/useManagedProfile';import useLabel from '../../i18n/labels';import { MANAGED_CAPABILITY_MAP } from '../sidebarItems';+import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';// Settings › ServerKit Cloud (plan 25 M3): the one place the customer reads// what ServerKit Cloud holds for them — the connect state, and the managed@@ -16,9 +18,22 @@ const CloudTab = () => {const label_ = useLabel();const { profile, lapsed } = useManagedProfile();const [connect, setConnect] = useState(null);+ // Loading and failure are their own states: neither may read as "not+ // connected", which is only true when the status call said so.+ const [connectLoading, setConnectLoading] = useState(true);+ const [connectError, setConnectError] = useState(null);++ const loadConnect = () => {+ setConnectLoading(true);+ setConnectError(null);+ api.getConnectStatus()+ .then(setConnect)+ .catch((err) => setConnectError(err))+ .finally(() => setConnectLoading(false));+ };useEffect(() => {- api.getConnectStatus().then(setConnect).catch(() => setConnect(null));+ loadConnect();}, []);const held = profile?.held_capabilities || [];@@ -36,7 +51,15 @@ const CloudTab = () => {<h3><PlugZap size={16} /> {t('app.settings.cloud.connection', 'Connection')}</h3>- {connect ? (+ {connectLoading ? (+ <EmptyState loading loadingVariant="form" loadingRows={3} title={t('app.settings.cloud.loadingConnection', 'Loading connection status…')} />+ ) : connectError ? (+ <ErrorState+ title={t('app.settings.cloud.couldntLoadConnection', "Couldn't load Cloud connection status")}+ error={connectError}+ onRetry={loadConnect}+ />+ ) : connect ? (<div className="managed-spec-list"><div className="managed-spec-row"><span className="managed-spec-key">{t('app.settings.cloud.state', 'State')}</span>diff --git a/frontend/src/components/settings/MigrationHistoryTab.jsx b/frontend/src/components/settings/MigrationHistoryTab.jsxindex d2e14c0c..f64d6bec 100644--- a/frontend/src/components/settings/MigrationHistoryTab.jsx+++ b/frontend/src/components/settings/MigrationHistoryTab.jsx@@ -10,6 +10,7 @@ import {import { useTableSort } from '@/hooks/useTableSort';import { useColumnVisibility } from '@/hooks/useColumnVisibility';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import { useToast } from '../../contexts/useToast.js';import { useConfirm } from '../../hooks/useConfirm';import useSettingFocus from '../../hooks/useSettingFocus';@@ -84,7 +85,7 @@ const MigrationHistoryTab = () => {setRevisions(hist.revisions || []);setStatus(stat);} catch (err) {- setError(err.message || 'Failed to load migration history');+ setError(err);} finally {setLoading(false);}@@ -231,7 +232,11 @@ const MigrationHistoryTab = () => {if (error) {return (<div className="settings-section">- <EmptyState icon={Database} title={error} />+ <ErrorState+ title={t('app.migrationHistoryTab.couldntLoadMigrationHistory', "Couldn't load migration history")}+ error={error}+ onRetry={load}+ /></div>);}diff --git a/frontend/src/components/settings/RecycleBinTab.jsx b/frontend/src/components/settings/RecycleBinTab.jsxindex 35a2c40b..8f1036c8 100644--- a/frontend/src/components/settings/RecycleBinTab.jsx+++ b/frontend/src/components/settings/RecycleBinTab.jsx@@ -5,6 +5,7 @@ import { useToast } from '@/contexts/useToast.js';import { useAuth } from '@/contexts/useAuth.js';import { Button } from '@/components/ui/button';import EmptyState from '@/components/EmptyState';+import ErrorState from '@/components/ErrorState';import { Pill, DataTable, DataTableFooter } from '@/components/ds';import {useTableChrome, GridViewPicker, GridChips, GridFilterButton,@@ -58,6 +59,8 @@ export default function RecycleBinTab() {const [items, setItems] = useState([]);const [retentionDays, setRetentionDays] = useState(30);const [loading, setLoading] = useState(true);+ const [loadError, setLoadError] = useState(null);+ const [loaded, setLoaded] = useState(false);const [busyId, setBusyId] = useState(null);const [purgeTarget, setPurgeTarget] = useState(null);@@ -80,12 +83,14 @@ export default function RecycleBinTab() {const data = await api.getRecycleBin();setItems(data.items || []);setRetentionDays(data.retention_days ?? 30);+ setLoaded(true);+ setLoadError(null);} catch (err) {- toast.error(err.message || t('app.recycleBinTab.couldNotLoadTheRecycleBin', 'Could not load the recycle bin'));+ setLoadError(err);} finally {setLoading(false);}- }, [t, toast]);+ }, []);useEffect(() => { load(); }, []); // eslint-disable-line react-hooks/exhaustive-deps@@ -230,6 +235,12 @@ export default function RecycleBinTab() {<div className="settings-section recyclebin">{loading ? (<EmptyState loading loadingVariant="table" title={t('app.recycleBinTab.loadingDeletedRecords', 'Loading deleted records…')} />+ ) : loadError && (!loaded || items.length === 0) ? (+ <ErrorState+ title={t('app.recycleBinTab.couldntLoadRecycleBin', "Couldn't load the recycle bin")}+ error={loadError}+ onRetry={load}+ />) : items.length === 0 ? (<EmptyStateicon={Trash2}@@ -238,6 +249,7 @@ export default function RecycleBinTab() {/>) : (<>+ {loadError && <ErrorState compact error={loadError} onRetry={load} />}<GridViewPickerviews={chrome.views}label="items"diff --git a/frontend/src/components/settings/SecuritySettingsTab.jsx b/frontend/src/components/settings/SecuritySettingsTab.jsxindex 253c1c30..a38329bf 100644--- a/frontend/src/components/settings/SecuritySettingsTab.jsx+++ b/frontend/src/components/settings/SecuritySettingsTab.jsx@@ -5,6 +5,7 @@ import useSettingFocus from '../../hooks/useSettingFocus';import TwoFactorPolicyCard from './TwoFactorPolicyCard';import SSOProviderIcon from '../SSOProviderIcon';import Modal from '../Modal';+import ErrorState from '../ErrorState';import { Button } from '@/components/ui/button';import { Input } from '@/components/ui/input';import { Label } from '@/components/ui/label';@@ -21,6 +22,7 @@ const LinkedAccounts = ({ register }) => {const [unlinking, setUnlinking] = useState(null);const [linkingProvider, setLinkingProvider] = useState(null);const [error, setError] = useState('');+ const [loadError, setLoadError] = useState(null);useEffect(() => {loadIdentities();@@ -30,8 +32,11 @@ const LinkedAccounts = ({ register }) => {try {const data = await api.getSSOIdentities();setIdentities(data.identities || []);- } catch {- // SSO may not be configured; silently handle+ setLoadError(null);+ } catch (err) {+ // Only surfaced when SSO providers exist (the card is hidden+ // otherwise), so an unconfigured SSO stays quiet.+ setLoadError(err);} finally {setLoading(false);}@@ -76,6 +81,7 @@ const LinkedAccounts = ({ register }) => {<p className="text-secondary">{t('app.securitySettingsTab.connectExternalIdentityProvidersToYour', 'Connect external identity providers to your account')}</p>{error && <div className="alert alert-danger">{error}</div>}+ {loadError && <ErrorState compact error={loadError} onRetry={loadIdentities} />}{identities.length > 0 && (<div className="linked-accounts-list">@@ -143,17 +149,21 @@ const SecuritySettingsTab = () => {const [verificationCode, setVerificationCode] = useState('');const [backupCodes, setBackupCodes] = useState([]);const [twoFAError, setTwoFAError] = useState('');+ const [twoFALoadError, setTwoFALoadError] = useState(null);useEffect(() => {load2FAStatus();}, []);async function load2FAStatus() {+ setTwoFALoading(true);try {const status = await api.get2FAStatus();setTwoFAStatus(status);+ setTwoFALoadError(null);} catch (err) {console.error('Failed to load 2FA status:', err);+ setTwoFALoadError(err);} finally {setTwoFALoading(false);}@@ -315,6 +325,12 @@ Keep these codes in a safe place.`;{twoFALoading && !twoFAStatus ? (<div className="loading-sm">{t('common.loading', 'Loading…')}</div>+ ) : twoFALoadError && !twoFAStatus ? (+ <ErrorState+ title={t('app.securitySettingsTab.couldntLoad2fa', "Couldn't load two-factor status")}+ error={twoFALoadError}+ onRetry={load2FAStatus}+ />) : twoFAStatus?.enabled ? (<div className="two-fa-enabled"><div className="two-fa-status">diff --git a/frontend/src/components/settings/SiteSettingsTab.jsx b/frontend/src/components/settings/SiteSettingsTab.jsxindex b36b3188..a9af8f22 100644--- a/frontend/src/components/settings/SiteSettingsTab.jsx+++ b/frontend/src/components/settings/SiteSettingsTab.jsx@@ -6,6 +6,7 @@ import { Input } from '@/components/ui/input';import { Button } from '@/components/ui/button';import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';import DomainField from '../DomainField';+import ErrorState from '../ErrorState';import { Pill } from '@/components/ds';import useSettingFocus from '../../hooks/useSettingFocus';import { useAuth } from '../../contexts/useAuth.js';@@ -25,6 +26,8 @@ const SiteSettingsTab = ({ onDevModeChange }) => {});const [basePort, setBasePort] = useState('0');const [loading, setLoading] = useState(true);+ const [loadError, setLoadError] = useState(null);+ const [httpsError, setHttpsError] = useState(null);const [saving, setSaving] = useState(false);const [savingPort, setSavingPort] = useState(false);const [message, setMessage] = useState(null);@@ -48,10 +51,14 @@ const SiteSettingsTab = ({ onDevModeChange }) => {setBaseDomain(h.base_domain || '');setServerIp(h.server_ip || '');if (h.providers?.length) setProviderId(current => current || String(h.providers[0].id));- } catch { /* non-admin or endpoint unavailable */ }+ setHttpsError(null);+ } catch (err) {+ setHttpsError(err);+ }}, []);const loadSettings = useCallback(async () => {+ setLoading(true);try {const data = await api.getSystemSettings();setSettings({@@ -62,9 +69,11 @@ const SiteSettingsTab = ({ onDevModeChange }) => {setPanelTitle(data.panel_title ?? 'ServerKit');setPublicTitle(data.public_title ?? 'Control Panel');setLoginLayout(data.login_layout ?? 'centered');+ setLoadError(null);await loadHttps();} catch (err) {console.error('Failed to load settings:', err);+ setLoadError(err);} finally {setLoading(false);}@@ -295,6 +304,20 @@ const SiteSettingsTab = ({ onDevModeChange }) => {return <div className="settings-section"><p>{t('common.loading', 'Loading…')}</p></div>;}+ // The form is seeded with defaults, so rendering it after a failed load+ // would invite saving those defaults over the real settings.+ if (loadError) {+ return (+ <div className="settings-section">+ <ErrorState+ title={t('app.siteSettingsTab.couldntLoadSiteSettings', "Couldn't load site settings")}+ error={loadError}+ onRetry={loadSettings}+ />+ </div>+ );+ }+return (<div className="settings-section"><h2>{t('app.siteSettingsTab.siteSettings', 'Site Settings')}</h2>@@ -424,6 +447,14 @@ const SiteSettingsTab = ({ onDevModeChange }) => {<h3>{t('app.siteSettingsTab.managedSitesBaseDomains', 'Managed Sites — Base Domains')}</h3><p>{t('app.siteSettingsTab.publishManagedSitesAt', 'Publish managed sites at')} <code><name>.<base-domain></code>. Register one or more base domains; a new site can be created under any of them, defaulting to the one marked <strong>{t('common.labels.default', 'Default')}</strong>. Point a wildcard record <code>*.<base></code> {t('app.siteSettingsTab.orPerSiteARecordsAt', '(or per-site A records) at this server.')}</p>+ {httpsError ? (+ <ErrorState+ title={t('app.siteSettingsTab.couldntLoadBaseDomains', "Couldn't load base domains")}+ error={httpsError}+ onRetry={loadHttps}+ />+ ) : (+ <><div className="form-group"><div className="settings-row"><div className="settings-label">@@ -556,6 +587,8 @@ const SiteSettingsTab = ({ onDevModeChange }) => {</div><span className="form-help">{t('app.siteSettingsTab.registerAnotherDomainSitesCanBe', 'Register another domain sites can be published under. Set up its wildcard HTTPS from its row above.')}</span></div>+ </>+ )}</div><div {...register('site-dev-mode', 'settings-card')}>diff --git a/frontend/src/components/settings/SystemTab.jsx b/frontend/src/components/settings/SystemTab.jsxindex fc6f66d0..39209278 100644--- a/frontend/src/components/settings/SystemTab.jsx+++ b/frontend/src/components/settings/SystemTab.jsx@@ -10,6 +10,7 @@ import { Switch } from '@/components/ui/switch';import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';import { formatBytes } from '@/utils/formatBytes';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import { useTranslation } from 'react-i18next';function formatUptime(seconds) {@@ -26,6 +27,11 @@ function formatUptime(seconds) {return parts.join(' ') || '< 1m';}+// A missing reading is "—", never an invented 0%.+function formatPercent(value) {+ return typeof value === 'number' ? `${value.toFixed(1)}%` : '—';+}+const SystemTab = () => {const { t } = useTranslation();const register = useSettingFocus();@@ -35,6 +41,9 @@ const SystemTab = () => {const [metrics, setMetrics] = useState(null);const [version, setVersion] = useState('');const [loading, setLoading] = useState(true);+ const [metricsError, setMetricsError] = useState(null);+ const [timezonesError, setTimezonesError] = useState(null);+ const [domainError, setDomainError] = useState(null);const [timezones, setTimezones] = useState([]);const [selectedTimezone, setSelectedTimezone] = useState('');const [savingTimezone, setSavingTimezone] = useState(false);@@ -62,11 +71,13 @@ const SystemTab = () => {try {const data = await api.getSystemMetrics();setMetrics(data);+ setMetricsError(null);if (data?.time?.timezone_id) {setSelectedTimezone(data.time.timezone_id);}} catch (err) {console.error('Failed to load metrics:', err);+ setMetricsError(err);} finally {setLoading(false);}@@ -76,8 +87,10 @@ const SystemTab = () => {try {const data = await api.getTimezones();setTimezones(data.timezones || []);+ setTimezonesError(null);} catch (err) {console.error('Failed to load timezones:', err);+ setTimezonesError(err);}}@@ -92,8 +105,10 @@ const SystemTab = () => {setCanonicalDomain(detection.current_canonical_domain || '');setCanonicalHttps(detection.current_canonical_https_enabled || false);setEncryptionConfigured(health.encryption_configured !== false);+ setDomainError(null);} catch (err) {console.error('Failed to load domain info:', err);+ setDomainError(err);} finally {setDomainLoading(false);}@@ -167,11 +182,21 @@ const SystemTab = () => {<h2>{t('app.systemTab.systemInformation', 'System Information')}</h2></div>+ {metricsError && !metrics && (+ <ErrorState+ title={t('app.systemTab.couldntLoadSystemInformation', "Couldn't load system information")}+ error={metricsError}+ onRetry={loadMetrics}+ />+ )}+ {metricsError && metrics && <ErrorState compact error={metricsError} onRetry={loadMetrics} />}++ {metrics && (<div className="system-info-grid"><div {...register('system-cpu', 'settings-card')}><h3>CPU</h3><InfoList>- <InfoItem label={t('app.systemTab.usage', 'Usage')} value={`${metrics?.cpu?.percent?.toFixed(1) || 0}%`} />+ <InfoItem label={t('app.systemTab.usage', 'Usage')} value={formatPercent(metrics?.cpu?.percent)} /><InfoItem label={t('app.systemTab.cores', 'Cores')} value={metrics?.cpu?.count || '-'} /><InfoItemlabel={t('app.systemTab.loadAverage', 'Load Average')}@@ -183,7 +208,7 @@ const SystemTab = () => {<div {...register('system-memory', 'settings-card')}><h3>{t('common.labels.memory', 'Memory')}</h3><InfoList>- <InfoItem label={t('app.systemTab.usage', 'Usage')} value={`${metrics?.memory?.percent?.toFixed(1) || 0}%`} />+ <InfoItem label={t('app.systemTab.usage', 'Usage')} value={formatPercent(metrics?.memory?.percent)} /><InfoItem label={t('app.systemTab.used', 'Used')} value={formatBytes(metrics?.memory?.used)} /><InfoItem label={t('app.systemTab.total', 'Total')} value={formatBytes(metrics?.memory?.total)} /></InfoList>@@ -192,7 +217,7 @@ const SystemTab = () => {<div {...register('system-disk', 'settings-card')}><h3>{t('common.labels.disk', 'Disk')}</h3><InfoList>- <InfoItem label={t('app.systemTab.usage', 'Usage')} value={`${metrics?.disk?.percent?.toFixed(1) || 0}%`} />+ <InfoItem label={t('app.systemTab.usage', 'Usage')} value={formatPercent(metrics?.disk?.percent)} /><InfoItem label={t('app.systemTab.used', 'Used')} value={formatBytes(metrics?.disk?.used)} /><InfoItem label={t('app.systemTab.total', 'Total')} value={formatBytes(metrics?.disk?.total)} /></InfoList>@@ -206,6 +231,7 @@ const SystemTab = () => {</InfoList></div></div>+ )}{(metrics?.system || version) && (<div className="settings-card">@@ -234,6 +260,7 @@ const SystemTab = () => {<InfoItem label={t('app.systemTab.currentTimezone', 'Current Timezone')} value={metrics.time.timezone_id || metrics.time.timezone_name} /></InfoList>)}+ {timezonesError && <ErrorState compact error={timezonesError} onRetry={loadTimezones} />}<div className="form-group"><label>{t('app.systemTab.changeTimezone', 'Change Timezone')}</label><div className="timezone-selector">@@ -280,6 +307,12 @@ const SystemTab = () => {)}{domainLoading ? (<EmptyState loading title={t('app.systemTab.loadingDomainSettings', 'Loading domain settings…')} />+ ) : domainError ? (+ <ErrorState+ title={t('app.systemTab.couldntLoadDomainSettings', "Couldn't load domain settings")}+ error={domainError}+ onRetry={loadDomainInfo}+ />) : (<>{detectedDomain?.detected_domain && (diff --git a/frontend/src/components/settings/TwoFactorPolicyCard.jsx b/frontend/src/components/settings/TwoFactorPolicyCard.jsxindex bc429b98..622fdf1a 100644--- a/frontend/src/components/settings/TwoFactorPolicyCard.jsx+++ b/frontend/src/components/settings/TwoFactorPolicyCard.jsx@@ -1,6 +1,7 @@import { useEffect, useState } from 'react';import api from '../../services/api';import { Button } from '@/components/ui/button';+import ErrorState from '../ErrorState';import { Input } from '@/components/ui/input';import { Select, SelectTrigger, SelectContent, SelectItem, SelectValue } from '@/components/ui/select';import { useTranslation } from 'react-i18next';@@ -26,8 +27,11 @@ const TwoFactorPolicyCard = (props) => {const [loading, setLoading] = useState(true);const [saving, setSaving] = useState(false);const [message, setMessage] = useState(null);+ const [loadError, setLoadError] = useState(null);- useEffect(() => {+ const loadPolicy = () => {+ setLoading(true);+ setLoadError(null);api.getSystemSettings().then((data) => {setPolicy(data.security_require_2fa || 'off');@@ -35,8 +39,14 @@ const TwoFactorPolicyCard = (props) => {setGraceDays(data.security_require_2fa_grace_days);}})- .catch(() => { /* leave defaults */ })+ // Never fall back to the 'off' default: saving it would silently+ // lift a stricter policy the server actually holds.+ .catch((err) => setLoadError(err)).finally(() => setLoading(false));+ };++ useEffect(() => {+ loadPolicy();}, []);async function handleSave() {@@ -58,6 +68,19 @@ const TwoFactorPolicyCard = (props) => {if (loading) return null;+ if (loadError) {+ return (+ <div className="settings-card" {...props}>+ <h3>{t('app.twoFactorPolicyCard.twoFactorAuthenticationPolicy', 'Two-Factor Authentication Policy')}</h3>+ <ErrorState+ title={t('app.twoFactorPolicyCard.couldntLoadPolicy', "Couldn't load the two-factor policy")}+ error={loadError}+ onRetry={loadPolicy}+ />+ </div>+ );+ }+return (<div className="settings-card" {...props}><h3>{t('app.twoFactorPolicyCard.twoFactorAuthenticationPolicy', 'Two-Factor Authentication Policy')}</h3>diff --git a/frontend/src/components/settings/WebhooksTab.jsx b/frontend/src/components/settings/WebhooksTab.jsxindex 3871944c..17412534 100644--- a/frontend/src/components/settings/WebhooksTab.jsx+++ b/frontend/src/components/settings/WebhooksTab.jsx@@ -13,6 +13,7 @@ import { useToast } from '../../contexts/useToast.js';import { useConfirm } from '../../hooks/useConfirm';import { Plus, MoreVertical, RefreshCw, ArrowRightLeft } from 'lucide-react';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import CopyField from '@/components/CopyField';import { useTranslation } from 'react-i18next';@@ -29,11 +30,12 @@ const formatDate = (d) => (d ? new Date(d).toLocaleString() : '—');export default function WebhooksTab() {const { t } = useTranslation();const toast = useToast();- const toastError = toast.error;const { confirm } = useConfirm();const [endpoints, setEndpoints] = useState([]);const [loading, setLoading] = useState(true);+ const [loadError, setLoadError] = useState(null);+ const [loaded, setLoaded] = useState(false);const [endpointForm, setEndpointForm] = useState({ open: false, name: '', forward_url: '', filter_paths: '', retry_count: 3 });const [selectedEndpoint, setSelectedEndpoint] = useState(null);@@ -45,12 +47,14 @@ export default function WebhooksTab() {try {const e = await api.listWebhookEndpoints();setEndpoints(e.endpoints || []);+ setLoaded(true);+ setLoadError(null);} catch (err) {- toastError(t('app.webhooksTab.loadFailed', 'Load failed: {{message}}', { message: err.message }));+ setLoadError(err);} finally {setLoading(false);}- }, [t, toastError]);+ }, []);useEffect(() => {loadAll();@@ -139,6 +143,16 @@ export default function WebhooksTab() {return <EmptyState loading loadingVariant="table" title={t('app.webhooksTab.loadingWebhooks', 'Loading webhooks…')} />;}+ if (loadError && !loaded) {+ return (+ <ErrorState+ title={t('app.webhooksTab.couldntLoadWebhooks', "Couldn't load webhook endpoints")}+ error={loadError}+ onRetry={loadAll}+ />+ );+ }+return (<div className="settings-webhooks">{!selectedEndpoint ? (@@ -155,6 +169,7 @@ export default function WebhooksTab() {</div></CardHeader><CardContent>+ {loadError && <ErrorState compact error={loadError} onRetry={loadAll} />}{endpoints.length === 0 ? (<EmptyState title={t('app.webhooksTab.noWebhookEndpoints', 'No webhook endpoints')} description={t('app.webhooksTab.createAnEndpointToReceiveWebhooks', 'Create an endpoint to receive webhooks.')} />) : (diff --git a/frontend/src/components/settings/connections/ConnectionsHub.jsx b/frontend/src/components/settings/connections/ConnectionsHub.jsxindex 30a50aff..10f435c7 100644--- a/frontend/src/components/settings/connections/ConnectionsHub.jsx+++ b/frontend/src/components/settings/connections/ConnectionsHub.jsx@@ -20,6 +20,7 @@ import {CONNECTION_CATEGORIES, CONNECTION_PROVIDERS, deriveScope, dedupeScopes,} from './providerCatalog';import ProviderCard from './ProviderCard';+import ErrorState from '../../ErrorState';import ConnectProviderModal from './ConnectProviderModal';import { useTranslation } from 'react-i18next';@@ -56,24 +57,38 @@ export default function ConnectionsHub() {const [containerRegistries, setContainerRegistries] = useState([]);const [allConnections, setAllConnections] = useState([]);const [loading, setLoading] = useState(true);+ // Which status reads failed on the last load. A failed read must render as+ // "couldn't load", never as "Not connected" with a Connect button.+ const [failed, setFailed] = useState({});+ const [firstError, setFirstError] = useState(null);const [modalProvider, setModalProvider] = useState(null);const [modalOpen, setModalOpen] = useState(false);const loadData = useCallback(async () => {+ const failures = {};+ let firstErr = null;+ // Keep partial results, but remember which reads failed.+ const soft = (key, promise, fallback) => promise.catch((err) => {+ failures[key] = true;+ if (!firstErr) firstErr = err;+ return fallback;+ });try {const [ghStatus, glStatus, bbStatus, dns, cloudP, storage, relay, regConns, regDomains, registries, allConns] = await Promise.all([- api.getGithubSourceStatus().catch(() => null),- api.getGitlabSourceStatus().catch(() => null),- api.getBitbucketSourceStatus().catch(() => null),- api.getEmailDNSProviders().then((d) => d.providers || []).catch(() => []),- api.getCloudProviders().then((d) => d.providers || []).catch(() => []),- api.getStorageConfig().catch(() => null),- api.getEmailRelay().catch(() => null),- api.getRegistrarConnections().then((d) => d.connections || []).catch(() => []),- api.getRegistrarDomains().then((d) => d.domains || []).catch(() => []),- api.getContainerRegistries().then((d) => d.registries || []).catch(() => []),- api.getAllConnections().then((d) => d.connections || []).catch(() => []),+ soft('github', api.getGithubSourceStatus(), null),+ soft('gitlab', api.getGitlabSourceStatus(), null),+ soft('bitbucket', api.getBitbucketSourceStatus(), null),+ soft('dns', api.getEmailDNSProviders().then((d) => d.providers || []), []),+ soft('cloud', api.getCloudProviders().then((d) => d.providers || []), []),+ soft('storage', api.getStorageConfig(), null),+ soft('email', api.getEmailRelay(), null),+ soft('registrar', api.getRegistrarConnections().then((d) => d.connections || []), []),+ soft('registrarDomains', api.getRegistrarDomains().then((d) => d.domains || []), []),+ soft('registry', api.getContainerRegistries().then((d) => d.registries || []), []),+ soft('all', api.getAllConnections().then((d) => d.connections || []), []),]);+ setFailed(failures);+ setFirstError(firstErr);setSourceStatus({ github: ghStatus, gitlab: glStatus, bitbucket: bbStatus });setDnsProviders(dns);setCloudProviders(cloudP);@@ -398,6 +413,11 @@ export default function ConnectionsHub() {for (const provider of CONNECTION_PROVIDERS) {if (provider.comingSoon) { out[provider.id] = { connected: false }; continue; }+ const failedKey = provider.kind === 'source' ? provider.provider : provider.kind;+ if (failed[failedKey]) {+ out[provider.id] = { connected: false, loadFailed: true, statusLabel: t('app.connectionsHub.couldntLoad', "Couldn't load"), statusTone: 'danger', scopes: [] };+ continue;+ }const manageHref = provider.manageHref;if (provider.kind === 'source') {@@ -476,7 +496,7 @@ export default function ConnectionsHub() {}}return out;- }, [sourceStatus, cloudProviders, dnsProviders, registrarConnections, registrarDomains, containerRegistries, storageConfig, relayConfig]);+ }, [sourceStatus, cloudProviders, dnsProviders, registrarConnections, registrarDomains, containerRegistries, storageConfig, relayConfig, failed, t]);function handleManage(provider) {setModalProvider(provider);@@ -508,6 +528,13 @@ export default function ConnectionsHub() {</span></div>)}+ {!loading && firstError && (+ <ErrorState+ compact+ error={firstError}+ onRetry={loadData}+ />+ )}{loading ? (<div className="connections-hub__loading">{t('app.connectionsHub.loadingConnections', 'Loading connections…')}</div>) : (diff --git a/frontend/src/components/settings/connections/DnsActivity.jsx b/frontend/src/components/settings/connections/DnsActivity.jsxindex 85201590..d6b0a9b3 100644--- a/frontend/src/components/settings/connections/DnsActivity.jsx+++ b/frontend/src/components/settings/connections/DnsActivity.jsx@@ -3,6 +3,7 @@// what ServerKit pushed to their Cloudflare account — action, record, and the// result of each sync. Lazily loads when expanded.import { useCallback, useEffect, useState } from 'react';+import ErrorState from '../../ErrorState';import { Activity } from 'lucide-react';import api from '../../../services/api';import { timeAgo } from '../../../utils/time';@@ -29,7 +30,7 @@ export default function DnsActivity({ configId, limit = 25 }) {const data = await api.getDnsChanges({ configId, limit });setChanges(data.changes || []);} catch (err) {- setError(err.message || 'Failed to load DNS activity');+ setError(err);} finally {setLoading(false);}@@ -42,7 +43,7 @@ export default function DnsActivity({ configId, limit = 25 }) {}if (error) {- return <div className="dns-activity__status dns-activity__status--error">{error}</div>;+ return <ErrorState compact error={error} onRetry={load} />;}if (changes.length === 0) {diff --git a/frontend/src/components/settings/connections/ProviderCard.jsx b/frontend/src/components/settings/connections/ProviderCard.jsxindex b890fcc3..8e753a44 100644--- a/frontend/src/components/settings/connections/ProviderCard.jsx+++ b/frontend/src/components/settings/connections/ProviderCard.jsx@@ -14,6 +14,8 @@ export default function ProviderCard({ provider, summary, onManage }) {const comingSoon = provider.comingSoon;const connected = !comingSoon && summary?.connected;+ // A failed status read is not "Not connected": no Connect call to action.+ const loadFailed = !comingSoon && summary?.loadFailed;const statusLabel = comingSoon ? 'Soon' : (summary?.statusLabel || 'Not connected');const statusTone = comingSoon ? 'soon' : (summary?.statusTone || 'neutral');@@ -50,7 +52,9 @@ export default function ProviderCard({ provider, summary, onManage }) {</Link>) : <span />}- {comingSoon ? (+ {loadFailed ? (+ <span />+ ) : comingSoon ? (<span className="conn-card__soon-tag">{t('app.providerCard.comingSoon', 'Coming soon')}</span>) : (<Button variant={connected ? 'outline' : 'default'} size="sm" onClick={() => onManage(provider)}>diff --git a/frontend/src/components/workspaces/WorkspaceApplicationsTab.jsx b/frontend/src/components/workspaces/WorkspaceApplicationsTab.jsxindex 0e4fcd64..2e2e9514 100644--- a/frontend/src/components/workspaces/WorkspaceApplicationsTab.jsx+++ b/frontend/src/components/workspaces/WorkspaceApplicationsTab.jsx@@ -9,6 +9,7 @@ import { useTableSort } from '@/hooks/useTableSort';import { useColumnVisibility } from '@/hooks/useColumnVisibility';import { Button } from '@/components/ui/button';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import { useTranslation } from 'react-i18next';// What the Status cell shows when the row carries none. A real word, not '':@@ -36,7 +37,9 @@ const BUILTIN_VIEWS = Object.fromEntries(Object.entries(CONFIG).map(([kind, conf},]]));-const WorkspaceApplicationsTab = ({ kind, wsId, rows, appsOut, onMoveApp, onShare }) => {+// `loadError` / `onRetry`: the page's apps request failed, so an empty list+// means "unknown", not "nothing here".+const WorkspaceApplicationsTab = ({ kind, wsId, rows, appsOut, onMoveApp, onShare, loadError, onRetry }) => {const { t } = useTranslation();const config = CONFIG[kind];const labels = kind === 'sites' ? {@@ -150,7 +153,15 @@ const WorkspaceApplicationsTab = ({ kind, wsId, rows, appsOut, onMoveApp, onShar{...chrome.tableProps}onRowClick={(a) => navigate(`/services/${a.id}`)}className="ws-detail__tablecard"- emptyState={(+ emptyState={loadError ? (+ <ErrorState+ title={kind === 'sites'+ ? t('app.workspaceApplicationsTab.couldntLoadSites', "Couldn't load sites")+ : t('app.workspaceApplicationsTab.couldntLoadServices', "Couldn't load services")}+ error={loadError}+ onRetry={onRetry}+ />+ ) : (<EmptyState icon={config.icon} title={labels.empty} description={labels.moveBelow} />)}footer={(diff --git a/frontend/src/components/workspaces/WorkspaceMembersTab.jsx b/frontend/src/components/workspaces/WorkspaceMembersTab.jsxindex dcb4188e..bebf7bf3 100644--- a/frontend/src/components/workspaces/WorkspaceMembersTab.jsx+++ b/frontend/src/components/workspaces/WorkspaceMembersTab.jsx@@ -7,6 +7,7 @@ import {import { useTableSort } from '@/hooks/useTableSort';import { useColumnVisibility } from '@/hooks/useColumnVisibility';import { Button } from '@/components/ui/button';+import ErrorState from '../ErrorState';import { useTranslation } from 'react-i18next';const NO_RULES = { match: 'all', rules: [] };@@ -32,7 +33,9 @@ const WORKSPACE_MEMBER_VIEWS = [},];-const WorkspaceMembersTab = ({ members, allUsers, onAddMember, onRemoveMember }) => {+// `loadError` / `onRetry`: the page's members request failed, so an empty+// list means "unknown", not "no members".+const WorkspaceMembersTab = ({ members, allUsers, onAddMember, onRemoveMember, loadError, onRetry }) => {const { t } = useTranslation();const { sorts, setSorts } = useTableSort({ storageKey: 'serverkit-table-ws-members-sort' });const {@@ -141,6 +144,13 @@ const WorkspaceMembersTab = ({ members, allUsers, onAddMember, onRemoveMember })onSortsChange={setSorts}{...chrome.tableProps}className="ws-detail__tablecard"+ emptyState={loadError ? (+ <ErrorState+ title={t('app.workspaceMembersTab.couldntLoadMembers', "Couldn't load members")}+ error={loadError}+ onRetry={onRetry}+ />+ ) : undefined}emptyTitle="No members"emptyMessage={t('app.workspaceMembersTab.thisWorkspaceHasNoMembersYet', 'This workspace has no members yet.')}footer={(diff --git a/frontend/src/components/workspaces/WorkspaceServersTab.jsx b/frontend/src/components/workspaces/WorkspaceServersTab.jsxindex 8f01adc7..28b1d2e9 100644--- a/frontend/src/components/workspaces/WorkspaceServersTab.jsx+++ b/frontend/src/components/workspaces/WorkspaceServersTab.jsx@@ -9,6 +9,7 @@ import { useTableSort } from '@/hooks/useTableSort';import { useColumnVisibility } from '@/hooks/useColumnVisibility';import { Button } from '@/components/ui/button';import EmptyState from '../EmptyState';+import ErrorState from '../ErrorState';import { statusKind } from '@/components/ds/status';import { useTranslation } from 'react-i18next';@@ -43,7 +44,9 @@ const WORKSPACE_SERVER_VIEWS = [},];-const WorkspaceServersTab = ({ wsId, srvIn, srvOut, onMoveServer }) => {+// `loadError` / `onRetry`: the page's servers request failed, so an empty+// list means "unknown", not "no servers".+const WorkspaceServersTab = ({ wsId, srvIn, srvOut, onMoveServer, loadError, onRetry }) => {const { t } = useTranslation();const navigate = useNavigate();const { sorts, setSorts } = useTableSort({ storageKey: 'serverkit-table-ws-servers-sort' });@@ -147,7 +150,13 @@ const WorkspaceServersTab = ({ wsId, srvIn, srvOut, onMoveServer }) => {{...chrome.tableProps}onRowClick={(s) => navigate(`/servers/${s.id}`)}className="ws-detail__tablecard"- emptyState={(+ emptyState={loadError ? (+ <ErrorState+ title={t('app.workspaceServersTab.couldntLoadServers', "Couldn't load servers")}+ error={loadError}+ onRetry={onRetry}+ />+ ) : (<EmptyState icon={Server} title={t('app.workspaceServersTab.noServersInThisWorkspaceYet', 'No servers in this workspace yet')} description={t('app.workspaceServersTab.moveOneInBelow', 'Move one in below.')} />)}footer={(