mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-01 20:55:16 +09:00
Merge pull request #244 from jhd3197/feat/ux-loading-states
Consistent loading skeletons and no layout jumps (settings, security, docker)
This commit is contained in:
33 files changed
+127
-107
No files matched your search
@@ -79,7 +79,7 @@ try {
|
||||
await route.fulfill({ json: payload });
|
||||
});
|
||||
await page.goto(`${base}tests/browser/settings.html`);
|
||||
await page.getByText('Loading users…', { exact: true }).waitFor();
|
||||
await page.getByRole('status', { name: 'Loading users…' }).waitFor();
|
||||
resolveUsers();
|
||||
await page.locator('.users-table').first().getByText('needs-mfa', { exact: true }).waitFor();
|
||||
await page.getByText('invite@example.test', { exact: true }).waitFor();
|
||||
|
||||
@@ -3,6 +3,12 @@ import { PageSkeleton } from './PageSkeleton';
|
||||
import { t } from '../i18n/t';
|
||||
|
||||
/**
|
||||
* Loading rule: first load = EmptyState `loading` with a shaped
|
||||
* `loadingVariant` (or Skeleton pieces in-card); refresh = keep the loaded
|
||||
* content (SkeletonBoundary, or only skeleton while there is no data yet);
|
||||
* failure = an error with retry (ErrorState), never an empty state or an
|
||||
* endless skeleton.
|
||||
*
|
||||
* `loadingVariant` names the shape of the page that is loading — see
|
||||
* PageSkeleton for the archetypes (table, feed, cards, detail, console, form,
|
||||
* chart, tree, split). It defaults to the generic `panel`, which is a safe
|
||||
|
||||
@@ -111,6 +111,9 @@ const ComposeTab = ({ onStatsChange }) => {
|
||||
const loadSeq = useRef(0);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
// A different server's rows must not linger as the "already loaded" list.
|
||||
useEffect(() => { setProjects([]); }, [serverId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadProjects();
|
||||
}, [serverId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
@@ -370,10 +373,10 @@ const ComposeTab = ({ onStatsChange }) => {
|
||||
applyPage: applyViewPageState,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && projects.length === 0) {
|
||||
return (
|
||||
<div className="dx-tab-pane">
|
||||
<div className="docker-loading">{t('app.composeTab.loadingComposeProjects', 'Loading compose projects…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={4} title={t('app.composeTab.loadingComposeProjects', 'Loading compose projects…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -231,6 +231,9 @@ const ContainersTab = ({ onStatsChange }) => {
|
||||
const loadSeq = useRef(0);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
// A different server's rows must not linger as the "already loaded" list.
|
||||
useEffect(() => { setContainers([]); }, [serverId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadContainers();
|
||||
}, [showAll, serverId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
@@ -767,10 +770,10 @@ const ContainersTab = ({ onStatsChange }) => {
|
||||
applyPage: applyViewPageState,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && containers.length === 0) {
|
||||
return (
|
||||
<div className="dx-tab-pane">
|
||||
<div className="docker-loading">{t('app.containersTab.loadingContainers', 'Loading containers…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={8} title={t('app.containersTab.loadingContainers', 'Loading containers…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -125,6 +125,9 @@ const ImagesTab = ({ onStatsChange }) => {
|
||||
const loadSeq = useRef(0);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
// A different server's rows must not linger as the "already loaded" list.
|
||||
useEffect(() => { setImages([]); }, [serverId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadImages();
|
||||
}, [serverId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
@@ -308,10 +311,10 @@ const ImagesTab = ({ onStatsChange }) => {
|
||||
applyPage: applyViewPageState,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && images.length === 0) {
|
||||
return (
|
||||
<div className="dx-tab-pane">
|
||||
<div className="docker-loading">{t('app.imagesTab.loadingImages', 'Loading images…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={5} title={t('app.imagesTab.loadingImages', 'Loading images…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -119,6 +119,9 @@ const NetworksTab = ({ onStatsChange }) => {
|
||||
const loadSeq = useRef(0);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
// A different server's rows must not linger as the "already loaded" list.
|
||||
useEffect(() => { setNetworks([]); }, [serverId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadNetworks();
|
||||
}, [serverId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
@@ -292,10 +295,10 @@ const NetworksTab = ({ onStatsChange }) => {
|
||||
applyPage: applyViewPageState,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && networks.length === 0) {
|
||||
return (
|
||||
<div className="dx-tab-pane">
|
||||
<div className="docker-loading">{t('app.networksTab.loadingNetworks', 'Loading networks…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={5} title={t('app.networksTab.loadingNetworks', 'Loading networks…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -123,6 +123,9 @@ const VolumesTab = ({ onStatsChange }) => {
|
||||
const loadSeq = useRef(0);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
// A different server's rows must not linger as the "already loaded" list.
|
||||
useEffect(() => { setVolumes([]); }, [serverId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadVolumes();
|
||||
}, [serverId]); // eslint-disable-line react-hooks/exhaustive-deps
|
||||
@@ -288,10 +291,10 @@ const VolumesTab = ({ onStatsChange }) => {
|
||||
applyPage: applyViewPageState,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && volumes.length === 0) {
|
||||
return (
|
||||
<div className="dx-tab-pane">
|
||||
<div className="docker-loading">{t('app.volumesTab.loadingVolumes', 'Loading volumes…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={5} title={t('app.volumesTab.loadingVolumes', 'Loading volumes…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -70,14 +70,11 @@ const AuditTab = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{loading && (
|
||||
<div className="loading-state">
|
||||
<div className="spinner"></div>
|
||||
<p>{t('app.auditTab.runningSecurityAudit', 'Running security audit…')}</p>
|
||||
</div>
|
||||
{loading && !audit && (
|
||||
<EmptyState loading loadingVariant="detail" title={t('app.auditTab.runningSecurityAudit', 'Running security audit…')} />
|
||||
)}
|
||||
|
||||
{audit && !loading && (
|
||||
{audit && (
|
||||
<div className="audit-results">
|
||||
<div className="sec-audit-score">
|
||||
<ScoreGauge
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import api from '../../services/api';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import EmptyState from '@/components/EmptyState';
|
||||
import ErrorState from '@/components/ErrorState';
|
||||
import { Feed, FeedItem } from '@/components/ds';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
@@ -99,7 +100,7 @@ const EventsTab = () => {
|
||||
</SharedCardHeader>
|
||||
<SharedCardContent variant="legacy" className="card-body">
|
||||
{loading ? (
|
||||
<div className="loading-sm">{t('common.loading', 'Loading…')}</div>
|
||||
<EmptyState loading loadingVariant="feed" loadingRows={5} title={t('common.loading', 'Loading…')} />
|
||||
) : eventsError && events.length === 0 ? (
|
||||
<ErrorState
|
||||
title={t('app.eventsTab.couldntLoadSecurityEvents', "Couldn't load security events.")}
|
||||
|
||||
@@ -430,8 +430,8 @@ const FirewallTab = () => {
|
||||
[rules, chrome.cfg.filters, chrome.columns],
|
||||
);
|
||||
|
||||
if (loading) {
|
||||
return <div className="loading-sm">{t('app.firewallTab.loadingFirewallStatus', 'Loading firewall status…')}</div>;
|
||||
if (loading && !status) {
|
||||
return <EmptyState loading loadingVariant="detail" title={t('app.firewallTab.loadingFirewallStatus', 'Loading firewall status…')} />;
|
||||
}
|
||||
|
||||
if (loadErrors.status && !status) {
|
||||
|
||||
@@ -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 EmptyState from '@/components/EmptyState';
|
||||
import ErrorState from '@/components/ErrorState';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Input } from '@/components/ui/input';
|
||||
@@ -311,8 +312,8 @@ const IPListsTab = () => {
|
||||
);
|
||||
};
|
||||
|
||||
if (loading) {
|
||||
return <div className="loading-sm">{t('app.iPListsTab.loadingIpLists', 'Loading IP lists…')}</div>;
|
||||
if (loading && !loaded) {
|
||||
return <EmptyState loading loadingVariant="table" loadingRows={4} title={t('app.iPListsTab.loadingIpLists', 'Loading IP lists…')} />;
|
||||
}
|
||||
|
||||
if (loadError && !loaded) {
|
||||
|
||||
@@ -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 EmptyState from '@/components/EmptyState';
|
||||
import ErrorState from '@/components/ErrorState';
|
||||
import { DataTable, DataTableFooter, ListToolbar } from '@/components/ds';
|
||||
import {
|
||||
@@ -426,7 +427,7 @@ const IntegrityTab = () => {
|
||||
onRetry={load}
|
||||
/>
|
||||
) : (
|
||||
<div className="loading-sm">{t('common.loading', 'Loading…')}</div>
|
||||
<EmptyState loading loadingVariant="detail" title={t('common.loading', 'Loading…')} />
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -237,10 +237,8 @@ const SSHKeysTab = () => {
|
||||
<ErrorState compact error={loadError} onRetry={loadKeys} />
|
||||
)}
|
||||
|
||||
{loading ? (
|
||||
<SharedCard variant="legacy" className="card">
|
||||
<div className="loading-sm">{t('common.loading', 'Loading…')}</div>
|
||||
</SharedCard>
|
||||
{loading && keys.length === 0 ? (
|
||||
<EmptyState loading loadingVariant="table" loadingRows={3} title={t('common.loading', 'Loading…')} />
|
||||
) : loadError && keys.length === 0 ? (
|
||||
<ErrorState
|
||||
title={t('app.sSHKeysTab.couldntLoadSshKeys', "Couldn't load SSH keys.")}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useState, useEffect, useId } from 'react';
|
||||
import api from '../../services/api';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import EmptyState from '@/components/EmptyState';
|
||||
import ErrorState from '@/components/ErrorState';
|
||||
import { Input } from '@/components/ui/input';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
@@ -58,8 +59,8 @@ const SecurityConfigTab = () => {
|
||||
}));
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <div className="loading-sm">{t('app.securityConfigTab.loadingSettings', 'Loading settings…')}</div>;
|
||||
if (loading && !config) {
|
||||
return <EmptyState loading loadingVariant="form" loadingRows={4} title={t('app.securityConfigTab.loadingSettings', 'Loading settings…')} />;
|
||||
}
|
||||
|
||||
// Never render the form on a failed load: saving it would write the
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function AIManagementSettings({ connections, defaultId }) {
|
||||
catch (e) { setError(e.message); }
|
||||
finally { setBusy(false); }
|
||||
};
|
||||
if (!config) return <div className="settings-card">{error ? <><p role="alert">{error}</p><Button onClick={load}>{t('common.retry', 'Retry')}</Button></> : <EmptyState loading title={t('common.loading', 'Loading…')} />}</div>;
|
||||
if (!config) return <div className="settings-card">{error ? <><p role="alert">{error}</p><Button onClick={load}>{t('common.retry', 'Retry')}</Button></> : <EmptyState loading loadingVariant="form" loadingRows={5} title={t('common.loading', 'Loading…')} />}</div>;
|
||||
const profiles = [
|
||||
['utility', t('ai.management.utility', 'Utility'), t('ai.management.utilityHint', 'Economical model for summaries and structured extraction.')],
|
||||
['standard', t('ai.management.standard', 'Standard'), t('ai.management.standardHint', 'Everyday questions and tool-assisted troubleshooting.')],
|
||||
|
||||
@@ -103,7 +103,7 @@ const AISettingsTab = () => {
|
||||
return <div className="settings-section"><p>{t('app.aISettingsTab.adminAccessRequired', 'Admin access required.')}</p></div>;
|
||||
}
|
||||
if (loading) {
|
||||
return <EmptyState loading title={t('common.loading', 'Loading…')} />;
|
||||
return <EmptyState loading loadingVariant="form" loadingRows={4} title={t('common.loading', 'Loading…')} />;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,8 +79,8 @@ export default function AIUsageSettings({ connections }) {
|
||||
</div>
|
||||
<div className="settings-actions settings-actions--footer"><Button variant="outline" disabled={busy} onClick={() => { setOffset(0); setApplied({ ...filters }); }}>{t('ai.usage.apply', 'Apply filters')}</Button></div>
|
||||
{error && <p className="error-message" role="alert">{error}</p>}
|
||||
{busy && <EmptyState loading title={t('common.loading', 'Loading…')} />}
|
||||
{!busy && data?.totals && <>
|
||||
{busy && !data && <EmptyState loading loadingVariant="table" loadingRows={4} title={t('common.loading', 'Loading…')} />}
|
||||
{data?.totals && <>
|
||||
<div className="stat-strip">
|
||||
<div className="stat-strip__item"><span>{t('ai.usage.cost', 'Known cost')}</span><strong>{money(data.totals.cost)}</strong></div>
|
||||
<div className="stat-strip__item"><span>{t('ai.usage.tokens', 'Tokens')}</span><strong>{formatNumber(data.totals.tokens)}</strong></div>
|
||||
|
||||
@@ -126,7 +126,7 @@ const ActivityTab = () => {
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <div className="activity-tab"><div className="loading-state">{t('app.activityTab.loadingActivity', 'Loading activity…')}</div></div>;
|
||||
return <div className="activity-tab"><EmptyState loading loadingVariant="feed" loadingRows={6} title={t('app.activityTab.loadingActivity', 'Loading activity…')} /></div>;
|
||||
}
|
||||
|
||||
const maxCount = summary?.top_users?.length
|
||||
@@ -260,11 +260,8 @@ const ActivityTab = () => {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{feedLoading ? (
|
||||
<div className="loading-state">
|
||||
<div className="spinner" />
|
||||
{t('app.activityTab.loadingLogs', 'Loading logs…')}
|
||||
</div>
|
||||
{feedLoading && logs.length === 0 ? (
|
||||
<EmptyState loading loadingVariant="feed" loadingRows={6} title={t('app.activityTab.loadingLogs', 'Loading logs…')} />
|
||||
) : logsError && logs.length === 0 ? (
|
||||
<ErrorState
|
||||
title={t('app.activityTab.couldntLoadAuditLogs', "Couldn't load audit logs.")}
|
||||
@@ -304,7 +301,7 @@ const ActivityTab = () => {
|
||||
table, so it keeps its own markup; only the pager is
|
||||
standardized onto the shared DataTableFooter (paged mode).
|
||||
Fetch logic and pagination state are unchanged. */}
|
||||
{!feedLoading && logs.length > 0 && (
|
||||
{logs.length > 0 && (
|
||||
<DataTableFooter
|
||||
shown={logs.length}
|
||||
total={pagination.total}
|
||||
|
||||
@@ -21,6 +21,8 @@ import {
|
||||
import { useTableSort } from '@/hooks/useTableSort';
|
||||
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
|
||||
import EmptyState from '../EmptyState';
|
||||
import { ErrorState } from '../ErrorState';
|
||||
import { Skeleton } from '../Skeleton';
|
||||
import { useConfirm } from '@/hooks/useConfirm';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { formatDate, formatDateTime, formatNumber } from '@/utils/intl';
|
||||
@@ -93,12 +95,22 @@ const API_KEY_VIEWS = [
|
||||
},
|
||||
];
|
||||
|
||||
// First-load placeholder that keeps the card near its final height.
|
||||
const CardLoading = ({ label, rows = 3 }) => (
|
||||
<div className="settings-card__loading" role="status" aria-busy="true" aria-label={label}>
|
||||
{Array.from({ length: rows }, (_, i) => (
|
||||
<Skeleton key={i} variant="block" height={36} radius={8} />
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
const ApiKeysSection = () => {
|
||||
const { t } = useTranslation();
|
||||
const { confirm } = useConfirm();
|
||||
const register = useSettingFocus();
|
||||
const [keys, setKeys] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
const [createdKey, setCreatedKey] = useState(null);
|
||||
|
||||
@@ -114,9 +126,10 @@ const ApiKeysSection = () => {
|
||||
|
||||
const loadKeys = () => {
|
||||
setLoading(true);
|
||||
setLoadError(null);
|
||||
api.getApiKeys().then(data => {
|
||||
setKeys(data.api_keys || []);
|
||||
}).catch(() => {}).finally(() => setLoading(false));
|
||||
}).catch(err => setLoadError(err)).finally(() => setLoading(false));
|
||||
};
|
||||
|
||||
useEffect(() => { loadKeys(); }, []);
|
||||
@@ -319,8 +332,10 @@ const ApiKeysSection = () => {
|
||||
/>
|
||||
<GridChips {...chrome.chipProps} />
|
||||
|
||||
{loading ? (
|
||||
<div className="settings-card__loading">{t('common.loading', 'Loading…')}</div>
|
||||
{loading && keys.length === 0 ? (
|
||||
<CardLoading label={t('common.loading', 'Loading…')} />
|
||||
) : loadError && keys.length === 0 ? (
|
||||
<ErrorState compact error={loadError} onRetry={loadKeys} />
|
||||
) : keys.length === 0 ? (
|
||||
<EmptyState
|
||||
icon={Key}
|
||||
@@ -496,6 +511,7 @@ const WebhookSection = () => {
|
||||
const register = useSettingFocus();
|
||||
const [subscriptions, setSubscriptions] = useState([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
const [editingSub, setEditingSub] = useState(null);
|
||||
const [expandedId, setExpandedId] = useState(null);
|
||||
@@ -503,9 +519,10 @@ const WebhookSection = () => {
|
||||
|
||||
const loadSubscriptions = () => {
|
||||
setLoading(true);
|
||||
setLoadError(null);
|
||||
api.getEventSubscriptions().then(data => {
|
||||
setSubscriptions(data.subscriptions || []);
|
||||
}).catch(() => {}).finally(() => setLoading(false));
|
||||
}).catch(err => setLoadError(err)).finally(() => setLoading(false));
|
||||
};
|
||||
|
||||
useEffect(() => { loadSubscriptions(); }, []);
|
||||
@@ -570,8 +587,10 @@ const WebhookSection = () => {
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
<div className="settings-card__loading">{t('common.loading', 'Loading…')}</div>
|
||||
{loading && subscriptions.length === 0 ? (
|
||||
<CardLoading label={t('common.loading', 'Loading…')} />
|
||||
) : loadError && subscriptions.length === 0 ? (
|
||||
<ErrorState compact error={loadError} onRetry={loadSubscriptions} />
|
||||
) : subscriptions.length === 0 ? (
|
||||
<EmptyState
|
||||
icon={Zap}
|
||||
@@ -714,9 +733,11 @@ const AnalyticsSection = () => {
|
||||
const [timeseries, setTimeseries] = useState([]);
|
||||
const [period, setPeriod] = useState('24h');
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
const loadData = useCallback(() => {
|
||||
setLoading(true);
|
||||
setLoadError(null);
|
||||
Promise.all([
|
||||
api.getApiAnalyticsOverview(period),
|
||||
api.getApiAnalyticsEndpoints(period),
|
||||
@@ -725,7 +746,7 @@ const AnalyticsSection = () => {
|
||||
setOverview(ov);
|
||||
setEndpoints(ep.endpoints || []);
|
||||
setTimeseries(ts.data || []);
|
||||
}).catch(() => {}).finally(() => setLoading(false));
|
||||
}).catch(err => setLoadError(err)).finally(() => setLoading(false));
|
||||
}, [period]);
|
||||
|
||||
useEffect(() => { loadData(); }, [loadData]);
|
||||
@@ -756,8 +777,10 @@ const AnalyticsSection = () => {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{loading ? (
|
||||
<div className="settings-card__loading">{t('common.loading', 'Loading…')}</div>
|
||||
{loading && !overview ? (
|
||||
<CardLoading label={t('common.loading', 'Loading…')} />
|
||||
) : loadError && !overview ? (
|
||||
<ErrorState compact error={loadError} onRetry={loadData} />
|
||||
) : (
|
||||
<>
|
||||
{overview && (
|
||||
|
||||
@@ -328,8 +328,8 @@ const InvitationsTab = () => {
|
||||
|
||||
{error && <div className="error-message" role="alert">{error}</div>}
|
||||
|
||||
{loading ? (
|
||||
<div className="loading-state">{t('app.invitationsTab.loadingInvitations', 'Loading invitations…')}</div>
|
||||
{loading && invitations.length === 0 ? (
|
||||
<EmptyState loading loadingVariant="table" loadingRows={4} title={t('app.invitationsTab.loadingInvitations', 'Loading invitations…')} />
|
||||
) : invitations.length === 0 && !error ? (
|
||||
<EmptyState title={t('app.invitationsTab.noInvitationsYet', 'No invitations yet')} />
|
||||
) : (
|
||||
|
||||
@@ -218,13 +218,10 @@ const MigrationHistoryTab = () => {
|
||||
}
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
if (loading && revisions.length === 0) {
|
||||
return (
|
||||
<div className="settings-section">
|
||||
<div className="loading-state">
|
||||
<Loader size={20} className="spin" />
|
||||
<span>{t('app.migrationHistoryTab.loadingMigrationHistory', 'Loading migration history…')}</span>
|
||||
</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={5} title={t('app.migrationHistoryTab.loadingMigrationHistory', 'Loading migration history…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ const NotificationsTab = () => {
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <EmptyState loading title={t('app.notificationsTab.loadingNotificationSettings', 'Loading notification settings…')} />;
|
||||
return <EmptyState loading loadingVariant="form" loadingRows={5} title={t('app.notificationsTab.loadingNotificationSettings', 'Loading notification settings…')} />;
|
||||
}
|
||||
|
||||
if (loadError) return <EmptyState title={t('notifications.loadFailed', "Couldn't load notification settings. Reload to try again.")}
|
||||
|
||||
@@ -13,6 +13,7 @@ import { Badge } from '@/components/ui/badge';
|
||||
import InfoTip from '../InfoTip';
|
||||
import LockShieldIllustration from '../illustrations/LockShieldIllustration';
|
||||
import CopyField from '../CopyField';
|
||||
import { Skeleton } from '../Skeleton';
|
||||
import { downloadBlob } from '@/utils/downloadBlob';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { formatDate, formatDateTime } from '@/utils/intl';
|
||||
@@ -323,7 +324,9 @@ Keep these codes in a safe place.`;
|
||||
</div>
|
||||
|
||||
{twoFALoading && !twoFAStatus ? (
|
||||
<div className="loading-sm">{t('common.loading', 'Loading…')}</div>
|
||||
<div role="status" aria-busy="true" aria-label={t('common.loading', 'Loading…')}>
|
||||
<Skeleton variant="block" width={260} height={40} radius={8} />
|
||||
</div>
|
||||
) : twoFALoadError && !twoFAStatus ? (
|
||||
<ErrorState
|
||||
title={t('app.securitySettingsTab.couldntLoad2fa', "Couldn't load 2FA status.")}
|
||||
|
||||
@@ -144,7 +144,7 @@ export default function StorageTab() {
|
||||
if (loading && !overview) {
|
||||
return (
|
||||
<div className="settings-section">
|
||||
<EmptyState loading title={t('app.storageTab.measuring', 'Measuring disk usage…')} />
|
||||
<EmptyState loading loadingVariant="detail" title={t('app.storageTab.measuring', 'Measuring disk usage…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ const SystemTab = () => {
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
return <EmptyState loading title={t('app.systemTab.loadingSystemInformation', 'Loading system information…')} />;
|
||||
return <EmptyState loading loadingVariant="detail" title={t('app.systemTab.loadingSystemInformation', 'Loading system information…')} />;
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -307,7 +307,7 @@ const SystemTab = () => {
|
||||
</div>
|
||||
)}
|
||||
{domainLoading ? (
|
||||
<EmptyState loading title={t('app.systemTab.loadingDomainSettings', 'Loading domain settings…')} />
|
||||
<EmptyState loading loadingVariant="form" loadingRows={2} title={t('app.systemTab.loadingDomainSettings', 'Loading domain settings…')} />
|
||||
) : domainError ? (
|
||||
<ErrorState
|
||||
title={t('app.systemTab.couldntLoadDomainSettings', "Couldn't load domain settings.")}
|
||||
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
import { useTableSort } from '@/hooks/useTableSort';
|
||||
import { useColumnVisibility } from '@/hooks/useColumnVisibility';
|
||||
import useSettingFocus from '../../hooks/useSettingFocus';
|
||||
import EmptyState from '../EmptyState';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
// The label the Status cell shows, in one place: the built-in view below
|
||||
@@ -411,10 +412,10 @@ const UsersTab = () => {
|
||||
setGroupBy,
|
||||
});
|
||||
|
||||
if (loading) {
|
||||
if (loading && users.length === 0) {
|
||||
return (
|
||||
<div className="users-tab">
|
||||
<div className="loading-state">{t('app.usersTab.loadingUsers', 'Loading users…')}</div>
|
||||
<EmptyState loading loadingVariant="table" loadingRows={6} title={t('app.usersTab.loadingUsers', 'Loading users…')} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -172,8 +172,20 @@ const Docker = () => {
|
||||
return `${total} B`;
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ id: 'containers', label: t('app.docker.containers', 'Containers'), icon: Box },
|
||||
{ id: 'compose', label: t('app.docker.compose', 'Compose'), icon: Package },
|
||||
{ id: 'images', label: t('app.docker.images', 'Images'), icon: Layers },
|
||||
{ id: 'volumes', label: t('app.docker.volumes', 'Volumes'), icon: HardDrive },
|
||||
{ id: 'networks', label: t('app.docker.networks', 'Networks'), icon: NetworkIcon },
|
||||
].map(({ id, label, icon: Icon }) => ({ to: `/docker/${id}`, label, icon: <Icon size={15} /> }));
|
||||
|
||||
if (loading) {
|
||||
return <EmptyState loading loadingVariant="table" title={t('app.docker.checkingDockerStatus', 'Checking Docker status…')} />;
|
||||
return (
|
||||
<PageLayout className="docker-page" icon={<Box size={18} />} title={t('common.labels.docker', 'Docker')} tabs={tabs}>
|
||||
<EmptyState loading loadingVariant="table" title={t('app.docker.checkingDockerStatus', 'Checking Docker status…')} />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
if (!dockerStatus?.installed) {
|
||||
@@ -222,14 +234,6 @@ const Docker = () => {
|
||||
);
|
||||
}
|
||||
|
||||
const tabs = [
|
||||
{ id: 'containers', label: t('app.docker.containers', 'Containers'), icon: Box },
|
||||
{ id: 'compose', label: t('app.docker.compose', 'Compose'), icon: Package },
|
||||
{ id: 'images', label: t('app.docker.images', 'Images'), icon: Layers },
|
||||
{ id: 'volumes', label: t('app.docker.volumes', 'Volumes'), icon: HardDrive },
|
||||
{ id: 'networks', label: t('app.docker.networks', 'Networks'), icon: NetworkIcon },
|
||||
].map(({ id, label, icon: Icon }) => ({ to: `/docker/${id}`, label, icon: <Icon size={15} /> }));
|
||||
|
||||
const hasMultipleTargets = availableServers.length > 1;
|
||||
|
||||
const serverContextValue = {
|
||||
|
||||
@@ -462,12 +462,9 @@ const QueueOperations = () => {
|
||||
|
||||
if (loading) {
|
||||
return (
|
||||
<div className="queue-page queue-page--loading">
|
||||
<div className="queue-loading-card">
|
||||
<Layers size={24} />
|
||||
<span>{t('app.queueOperations.loadingQueueBus', 'Loading queue bus…')}</span>
|
||||
</div>
|
||||
</div>
|
||||
<PageLayout fill className="queue-page queue-page--ops" icon={<Layers size={18} />} title={t('app.queueOperations.queueBus', 'Queue bus')}>
|
||||
<EmptyState loading loadingVariant="table" title={t('app.queueOperations.loadingQueueBus', 'Loading queue bus…')} />
|
||||
</PageLayout>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,9 @@
|
||||
gap: $space-4;
|
||||
width: 100%;
|
||||
|
||||
// Some variants use >100% ragged widths; never let a bar exceed its container.
|
||||
.skeleton { max-width: 100%; }
|
||||
|
||||
// Pushes a trailing control to the right edge of a toolbar row.
|
||||
&__push { margin-left: auto; }
|
||||
|
||||
|
||||
@@ -134,12 +134,6 @@
|
||||
font-size: $text-xs;
|
||||
}
|
||||
|
||||
.loading-sm {
|
||||
color: $text-tertiary;
|
||||
font-size: $text-xs;
|
||||
padding: $space-4;
|
||||
}
|
||||
|
||||
.spinner-inline {
|
||||
display: inline-block;
|
||||
width: 14px;
|
||||
|
||||
@@ -25,12 +25,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.docker-loading {
|
||||
text-align: center;
|
||||
padding: $space-12;
|
||||
color: $text-secondary;
|
||||
}
|
||||
|
||||
// Container Exec Modal
|
||||
.exec-modal-body {
|
||||
display: flex;
|
||||
|
||||
@@ -820,19 +820,6 @@
|
||||
|
||||
// ── Audit tab ────────────────────────────────────────────────
|
||||
.audit-tab {
|
||||
.loading-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: $space-8;
|
||||
gap: $space-4;
|
||||
|
||||
.spinner {
|
||||
width: 40px;
|
||||
height: 40px; // geometry: spinner icon
|
||||
}
|
||||
}
|
||||
|
||||
.audit-results {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -395,10 +395,10 @@
|
||||
}
|
||||
|
||||
.settings-card__loading {
|
||||
padding: $space-6;
|
||||
text-align: center;
|
||||
color: $text-tertiary;
|
||||
font-size: $text-xs;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: $space-3;
|
||||
padding: $space-4 0;
|
||||
}
|
||||
|
||||
.settings-card__footer {
|
||||
|
||||
Reference in new issue
Block a user