mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-01 20:55:16 +09:00
fix(ui): load Monitoring and Security events data in one step
Monitoring fetches the monitors summary from the page (useMonitorsSummary) so it runs alongside the first load, and holds the page skeleton until it arrives instead of mounting the overview and fetching a second wave. Security only gates on the status request for Overview, so Events starts its own requests at mount; its events card uses a compact loading line instead of a tall feed placeholder. Drops the now-unused monitors skeleton string and loaded-size KPI CSS.
This commit is contained in:
1 parent
8539eb505d
commit
aa8ed23ec9
24 files changed
+83
-120
No files matched your search
@@ -48,7 +48,7 @@ function last(series) {
|
||||
export default function MonitoringOverview({
|
||||
scope, isHost, scopeLabel, status, activeAlerts = [],
|
||||
speedTest, speedTestRunning, onRunSpeedTest,
|
||||
thresholds = {}, onScopeChange, refreshKey = 0,
|
||||
thresholds = {}, onScopeChange, refreshKey = 0, monitorsSummary,
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [period, setPeriod] = useState('24h');
|
||||
@@ -198,7 +198,7 @@ export default function MonitoringOverview({
|
||||
{/* Monitors first: "is the site up" is the question this page is
|
||||
for, and everything below describes the machines ServerKit runs
|
||||
on rather than the things it is watching. */}
|
||||
<MonitorsSummary refreshKey={refreshKey} />
|
||||
<MonitorsSummary summary={monitorsSummary} />
|
||||
|
||||
<div className="mon-section-head">
|
||||
<h3>{t('app.monitoringOverview.hostHealth', 'Host health')}</h3>
|
||||
|
||||
@@ -5,23 +5,15 @@
|
||||
// machines ServerKit runs on, and nothing described the things it is supposed to
|
||||
// be watching. Host health stays below; this sits above it because "is the site
|
||||
// up" is the question the page is actually for.
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { Link, useNavigate } from 'react-router-dom';
|
||||
import { Activity, Plus, Radar, ShieldAlert, Timer, Zap } from 'lucide-react';
|
||||
import api from '../../services/api';
|
||||
import { AreaChart, KpiBand, MetricCard, Pill } from '@/components/ds';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { monitorStateOf } from './monitorShared';
|
||||
import { usePolling } from '../../hooks/usePolling';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import InfoTip from '@/components/InfoTip';
|
||||
import ErrorState from '../ErrorState';
|
||||
import { Skeleton } from '../Skeleton';
|
||||
|
||||
const POLL_MS = 15000;
|
||||
const FEED_LIMIT = 9;
|
||||
// Height of the monitor list at its usual size (rows + header), for the first-load placeholder.
|
||||
const SKELETON_LIST_HEIGHT = 407;
|
||||
|
||||
function relativeTime(iso) {
|
||||
if (!iso) return 'never';
|
||||
@@ -33,73 +25,10 @@ function relativeTime(iso) {
|
||||
return `${Math.floor(seconds / 3600)}h ago`;
|
||||
}
|
||||
|
||||
export default function MonitorsSummary({ refreshKey = 0 }) {
|
||||
export default function MonitorsSummary({ summary }) {
|
||||
const { t } = useTranslation();
|
||||
const navigate = useNavigate();
|
||||
const [monitors, setMonitors] = useState([]);
|
||||
const [stats, setStats] = useState(null);
|
||||
const [feed, setFeed] = useState([]);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
const [listRes, statsRes] = await Promise.all([
|
||||
api.getMonitors(),
|
||||
api.getMonitorStats().catch(() => null),
|
||||
]);
|
||||
const list = listRes?.monitors || [];
|
||||
setMonitors(list);
|
||||
setStats(statsRes?.stats || null);
|
||||
setLoadError(null);
|
||||
|
||||
// The live feed is the most recently checked monitors, newest first —
|
||||
// derived from what we already fetched rather than a second request
|
||||
// per monitor.
|
||||
setFeed(
|
||||
[...list]
|
||||
.filter((m) => m.last_check_at && !m.is_paused)
|
||||
.sort((a, b) => new Date(b.last_check_at) - new Date(a.last_check_at))
|
||||
.slice(0, FEED_LIMIT),
|
||||
);
|
||||
} catch (err) {
|
||||
// Overview must survive a monitors outage; the rest of the page is fine.
|
||||
setLoadError(err);
|
||||
} finally {
|
||||
setLoaded(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const refresh = usePolling(load, POLL_MS);
|
||||
|
||||
// The parent bumps refreshKey to force a reload (e.g. after creating a
|
||||
// monitor); it is not part of the polling schedule.
|
||||
useEffect(() => {
|
||||
if (refreshKey) refresh();
|
||||
}, [refreshKey, refresh]);
|
||||
|
||||
// First load holds the KPI band and the two-panel row at their loaded size,
|
||||
// so the host sections below stay put when the monitors arrive.
|
||||
if (!loaded) {
|
||||
return (
|
||||
<div
|
||||
className="mon-monitors-summary"
|
||||
role="status"
|
||||
aria-busy="true"
|
||||
aria-label={t('app.monitorsSummary.loadingMonitors', 'Loading monitors')}
|
||||
>
|
||||
<KpiBand loading count={4} className="mon-kpiband--loaded-size" />
|
||||
<div className="mon-grid2" aria-hidden="true">
|
||||
{[0, 1].map((p) => (
|
||||
<section className="monitoring-panel" key={p}>
|
||||
<Skeleton variant="title" width="30%" />
|
||||
<Skeleton variant="block" height={SKELETON_LIST_HEIGHT} />
|
||||
</section>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const { monitors, stats, feed, loadError, load } = summary;
|
||||
|
||||
// A failed fetch with nothing loaded is not "nothing is being watched".
|
||||
if (loadError && !monitors.length) {
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import api from '../../services/api';
|
||||
import { usePolling } from '../../hooks/usePolling';
|
||||
|
||||
const POLL_MS = 15000;
|
||||
const FEED_LIMIT = 9;
|
||||
|
||||
// Lives in the page, not in the component: started at page mount it runs in
|
||||
// parallel with the page's own first load, so the overview can appear in one step.
|
||||
export function useMonitorsSummary(refreshKey = 0, enabled = true) {
|
||||
const [monitors, setMonitors] = useState([]);
|
||||
const [stats, setStats] = useState(null);
|
||||
const [feed, setFeed] = useState([]);
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
const [loadError, setLoadError] = useState(null);
|
||||
|
||||
const load = useCallback(async () => {
|
||||
try {
|
||||
const [listRes, statsRes] = await Promise.all([
|
||||
api.getMonitors(),
|
||||
api.getMonitorStats().catch(() => null),
|
||||
]);
|
||||
const list = listRes?.monitors || [];
|
||||
setMonitors(list);
|
||||
setStats(statsRes?.stats || null);
|
||||
setLoadError(null);
|
||||
|
||||
// The live feed is the most recently checked monitors, newest first —
|
||||
// derived from what we already fetched rather than a second request
|
||||
// per monitor.
|
||||
setFeed(
|
||||
[...list]
|
||||
.filter((m) => m.last_check_at && !m.is_paused)
|
||||
.sort((a, b) => new Date(b.last_check_at) - new Date(a.last_check_at))
|
||||
.slice(0, FEED_LIMIT),
|
||||
);
|
||||
} catch (err) {
|
||||
// Overview must survive a monitors outage; the rest of the page is fine.
|
||||
setLoadError(err);
|
||||
} finally {
|
||||
setLoaded(true);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const refresh = usePolling(load, POLL_MS, { enabled });
|
||||
|
||||
// The parent bumps refreshKey to force a reload (e.g. after creating a
|
||||
// monitor); it is not part of the polling schedule.
|
||||
useEffect(() => {
|
||||
if (refreshKey) refresh();
|
||||
}, [refreshKey, refresh]);
|
||||
|
||||
return { monitors, stats, feed, loaded, loadError, load };
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
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 { Skeleton } from '@/components/Skeleton';
|
||||
import { Feed, FeedItem } from '@/components/ds';
|
||||
@@ -109,7 +108,9 @@ const EventsTab = () => {
|
||||
</SharedCardHeader>
|
||||
<SharedCardContent variant="legacy" className="card-body">
|
||||
{loading ? (
|
||||
<EmptyState loading loadingVariant="feed" loadingRows={10} title={t('common.loading', 'Loading…')} />
|
||||
<div role="status" aria-busy="true" aria-label={t('common.loading', 'Loading…')}>
|
||||
<Skeleton variant="line" width="60%" height={14} />
|
||||
</div>
|
||||
) : eventsError && events.length === 0 ? (
|
||||
<ErrorState
|
||||
title={t('app.eventsTab.couldntLoadSecurityEvents', "Couldn't load security events.")}
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "أحدث النتائج",
|
||||
"noChecksRecordedYetTheScheduler": "لم يتم تسجيل أي عمليات تحقق حتى الآن - يقوم المجدول بالاستقصاء على الفاصل الزمني لكل جهاز عرض.",
|
||||
"nothingIsBeingWatchedYet": "لا شيء يتم مراقبته بعد",
|
||||
"couldntLoadMonitors": "تعذّر تحميل أجهزة المراقبة.",
|
||||
"loadingMonitors": "جارٍ تحميل أجهزة المراقبة"
|
||||
"couldntLoadMonitors": "تعذّر تحميل أجهزة المراقبة."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "إنشاء شبكة لربط الحاويات.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "সাম্প্রতিক ফলাফল",
|
||||
"noChecksRecordedYetTheScheduler": "এখনও কোন চেক রেকর্ড করা হয়নি — প্রতিটি মনিটরের ব্যবধানে শিডিউলারের পোল।",
|
||||
"nothingIsBeingWatchedYet": "এখনও কিছুই দেখা হচ্ছে না",
|
||||
"couldntLoadMonitors": "মনিটরগুলো লোড করা যায়নি।",
|
||||
"loadingMonitors": "মনিটর লোড হচ্ছে"
|
||||
"couldntLoadMonitors": "মনিটরগুলো লোড করা যায়নি।"
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "পাত্রে সংযোগ করার জন্য একটি নেটওয়ার্ক তৈরি করুন।",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Neueste Ergebnisse",
|
||||
"noChecksRecordedYetTheScheduler": "Es wurden noch keine Prüfungen aufgezeichnet – der Planer fragt die Intervalle jedes Monitors ab.",
|
||||
"nothingIsBeingWatchedYet": "Es wird noch nichts angeschaut",
|
||||
"couldntLoadMonitors": "Monitore konnten nicht geladen werden.",
|
||||
"loadingMonitors": "Monitore werden geladen"
|
||||
"couldntLoadMonitors": "Monitore konnten nicht geladen werden."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Erstellen Sie ein Netzwerk, um Container zu verbinden.",
|
||||
|
||||
@@ -4126,7 +4126,6 @@
|
||||
"everythingBelowDescribesTheMachinesServerkit": "Everything below describes the servers ServerKit runs on. Add a monitor to watch a website, an API endpoint, a database port or a WordPress site and get an incident when it stops answering.",
|
||||
"everythingBelowDescribesTheMachinesServerkitShort": "Below: the servers ServerKit runs on.",
|
||||
"liveChecks": "Live checks",
|
||||
"loadingMonitors": "Loading monitors",
|
||||
"manage": "Manage",
|
||||
"monitors": "Monitors",
|
||||
"monitorsDown": "Monitors down",
|
||||
|
||||
@@ -4017,8 +4017,7 @@
|
||||
"mostRecentResults": "Resultados más recientes",
|
||||
"noChecksRecordedYetTheScheduler": "Aún no hay comprobaciones registradas: el planificador consulta según el intervalo de cada monitor.",
|
||||
"nothingIsBeingWatchedYet": "Aún no se vigila nada",
|
||||
"couldntLoadMonitors": "No se pudieron cargar los monitores.",
|
||||
"loadingMonitors": "Cargando monitores"
|
||||
"couldntLoadMonitors": "No se pudieron cargar los monitores."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Crea una red para conectar contenedores.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Résultats les plus récents",
|
||||
"noChecksRecordedYetTheScheduler": "Aucune vérification enregistrée pour l'instant : le planificateur interroge les intervalles de chaque moniteur.",
|
||||
"nothingIsBeingWatchedYet": "Rien n'est encore regardé",
|
||||
"couldntLoadMonitors": "Impossible de charger les moniteurs.",
|
||||
"loadingMonitors": "Chargement des moniteurs"
|
||||
"couldntLoadMonitors": "Impossible de charger les moniteurs."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Créez un réseau pour connecter les conteneurs.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Hasil terkini",
|
||||
"noChecksRecordedYetTheScheduler": "Belum ada pemeriksaan yang dicatat — penjadwal melakukan jajak pendapat pada setiap interval monitor.",
|
||||
"nothingIsBeingWatchedYet": "Belum ada yang diawasi",
|
||||
"couldntLoadMonitors": "Tidak dapat memuat monitor.",
|
||||
"loadingMonitors": "Memuat monitor"
|
||||
"couldntLoadMonitors": "Tidak dapat memuat monitor."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Buat jaringan untuk menghubungkan kontainer.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Risultati più recenti",
|
||||
"noChecksRecordedYetTheScheduler": "Nessun controllo ancora registrato: lo scheduler esegue il polling sull'intervallo di ciascun monitor.",
|
||||
"nothingIsBeingWatchedYet": "Non si sta ancora guardando nulla",
|
||||
"couldntLoadMonitors": "Impossibile caricare i monitor.",
|
||||
"loadingMonitors": "Caricamento dei monitor"
|
||||
"couldntLoadMonitors": "Impossibile caricare i monitor."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Crea una rete per connettere i contenitori.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "가장 최근 결과",
|
||||
"noChecksRecordedYetTheScheduler": "아직 검사가 기록되지 않았습니다. 스케줄러는 각 모니터의 간격을 폴링합니다.",
|
||||
"nothingIsBeingWatchedYet": "아직 시청 중인 항목이 없습니다.",
|
||||
"couldntLoadMonitors": "모니터를 불러오지 못했습니다.",
|
||||
"loadingMonitors": "모니터를 불러오는 중"
|
||||
"couldntLoadMonitors": "모니터를 불러오지 못했습니다."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "컨테이너를 연결하기 위한 네트워크를 만듭니다.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Najnowsze wyniki",
|
||||
"noChecksRecordedYetTheScheduler": "Nie zarejestrowano jeszcze żadnych kontroli — program planujący odpytuje interwał każdego monitora.",
|
||||
"nothingIsBeingWatchedYet": "Na razie nic nie jest oglądane",
|
||||
"couldntLoadMonitors": "Nie udało się wczytać monitorów.",
|
||||
"loadingMonitors": "Wczytywanie monitorów"
|
||||
"couldntLoadMonitors": "Nie udało się wczytać monitorów."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Utwórz sieć do łączenia kontenerów.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Resultados mais recentes",
|
||||
"noChecksRecordedYetTheScheduler": "Nenhuma verificação registrada ainda — o agendador pesquisa o intervalo de cada monitor.",
|
||||
"nothingIsBeingWatchedYet": "Nada está sendo assistido ainda",
|
||||
"couldntLoadMonitors": "Não foi possível carregar os monitores.",
|
||||
"loadingMonitors": "Carregando monitores"
|
||||
"couldntLoadMonitors": "Não foi possível carregar os monitores."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Crie uma rede para conectar contêineres.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Последние результаты",
|
||||
"noChecksRecordedYetTheScheduler": "Проверок пока не зарегистрировано — планировщик опрашивает интервал каждого монитора.",
|
||||
"nothingIsBeingWatchedYet": "Пока ничего не смотрят",
|
||||
"couldntLoadMonitors": "Не удалось загрузить мониторы.",
|
||||
"loadingMonitors": "Загрузка мониторов"
|
||||
"couldntLoadMonitors": "Не удалось загрузить мониторы."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Создайте сеть для подключения контейнеров.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "ผลลัพธ์ล่าสุด",
|
||||
"noChecksRecordedYetTheScheduler": "ยังไม่มีการบันทึกการตรวจสอบ — ตัวกำหนดตารางเวลาจะโพลตามช่วงเวลาของจอภาพแต่ละจอ",
|
||||
"nothingIsBeingWatchedYet": "ยังไม่ได้ดูอะไรเลย",
|
||||
"couldntLoadMonitors": "ไม่สามารถโหลดมอนิเตอร์ได้",
|
||||
"loadingMonitors": "กำลังโหลดมอนิเตอร์"
|
||||
"couldntLoadMonitors": "ไม่สามารถโหลดมอนิเตอร์ได้"
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "สร้างเครือข่ายเพื่อเชื่อมต่อคอนเทนเนอร์",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "En yeni sonuçlar",
|
||||
"noChecksRecordedYetTheScheduler": "Henüz hiçbir kontrol kaydedilmedi; zamanlayıcı her monitörün aralığını yoklar.",
|
||||
"nothingIsBeingWatchedYet": "Henüz hiçbir şey izlenmiyor",
|
||||
"couldntLoadMonitors": "Monitörler yüklenemedi.",
|
||||
"loadingMonitors": "Monitörler yükleniyor"
|
||||
"couldntLoadMonitors": "Monitörler yüklenemedi."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Kapları bağlamak için bir ağ oluşturun.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "Kết quả gần đây nhất",
|
||||
"noChecksRecordedYetTheScheduler": "Chưa có cuộc kiểm tra nào được ghi lại - bộ lập lịch thăm dò theo khoảng thời gian của mỗi màn hình.",
|
||||
"nothingIsBeingWatchedYet": "Chưa có gì được theo dõi",
|
||||
"couldntLoadMonitors": "Không thể tải các trình giám sát.",
|
||||
"loadingMonitors": "Đang tải các trình giám sát"
|
||||
"couldntLoadMonitors": "Không thể tải các trình giám sát."
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "Tạo một mạng để kết nối các container.",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "最新结果",
|
||||
"noChecksRecordedYetTheScheduler": "尚未记录任何检查 - 调度程序轮询每个监视器的时间间隔。",
|
||||
"nothingIsBeingWatchedYet": "目前还没有任何内容被关注",
|
||||
"couldntLoadMonitors": "无法加载监控项。",
|
||||
"loadingMonitors": "正在加载监控项"
|
||||
"couldntLoadMonitors": "无法加载监控项。"
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "创建网络来连接容器。",
|
||||
|
||||
@@ -4016,8 +4016,7 @@
|
||||
"mostRecentResults": "最新結果",
|
||||
"noChecksRecordedYetTheScheduler": "尚未記錄任何檢查結果;排程器會依各監測器的間隔進行檢查。",
|
||||
"nothingIsBeingWatchedYet": "目前還沒有任何內容被關注",
|
||||
"couldntLoadMonitors": "無法載入監控項。",
|
||||
"loadingMonitors": "正在載入監控項"
|
||||
"couldntLoadMonitors": "無法載入監控項。"
|
||||
},
|
||||
"networksTab": {
|
||||
"createANetworkToConnectContainers": "建立網路來連線容器。",
|
||||
|
||||
@@ -7,6 +7,7 @@ import EmptyState from '../components/EmptyState';
|
||||
import ErrorState from '../components/ErrorState';
|
||||
import DoctorPanel from '../components/monitoring/DoctorPanel';
|
||||
import MonitoringOverview from '../components/monitoring/MonitoringOverview';
|
||||
import { useMonitorsSummary } from '../components/monitoring/useMonitorsSummary';
|
||||
import FleetCapacityPanel from '../components/monitoring/FleetCapacityPanel';
|
||||
import FleetThresholdsPanel from '../components/monitoring/FleetThresholdsPanel';
|
||||
import ServerScopePicker from '../components/monitoring/ServerScopePicker';
|
||||
@@ -93,6 +94,7 @@ const Monitoring = () => {
|
||||
// Bumped by the top-bar Refresh so the scope-driven panels reload with the
|
||||
// host-scoped data instead of each growing a refresh button of its own.
|
||||
const [refreshKey, setRefreshKey] = useState(0);
|
||||
const monitorsSummary = useMonitorsSummary(refreshKey, activeTab === 'overview');
|
||||
|
||||
const loadSpeedTest = async () => {
|
||||
try {
|
||||
@@ -296,7 +298,7 @@ const Monitoring = () => {
|
||||
[status?.enabled, scope, servers.length, scopeLabel]
|
||||
);
|
||||
|
||||
if (loading) {
|
||||
if (loading || (activeTab === 'overview' && !monitorsSummary.loaded)) {
|
||||
return (
|
||||
<div className="sk-tabgroup__inner monitoring-page">
|
||||
<EmptyState loading loadingVariant="chart" size="lg" title={t('app.monitoring.loadingMonitoringData', 'Loading monitoring data')} />
|
||||
@@ -339,6 +341,7 @@ const Monitoring = () => {
|
||||
thresholds={thresholds}
|
||||
onScopeChange={setScope}
|
||||
refreshKey={refreshKey}
|
||||
monitorsSummary={monitorsSummary}
|
||||
/>
|
||||
)}
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ const Security = () => {
|
||||
await loadStatus();
|
||||
}
|
||||
|
||||
if (loading) {
|
||||
// Only Overview renders the status; other tabs load themselves in parallel.
|
||||
if (loading && activeTab === 'overview') {
|
||||
return (
|
||||
<div className="sk-tabgroup__inner security-page">
|
||||
<EmptyState loading loadingVariant="detail" title={t('app.security.loadingSecurityStatus', 'Loading security status…')} />
|
||||
|
||||
@@ -935,14 +935,6 @@
|
||||
|
||||
.mon-nomonitors { margin-bottom: 22px; }
|
||||
|
||||
// First-load tiles at the size of the loaded ones (one carries a sparkline),
|
||||
// so the band does not grow when the monitors arrive.
|
||||
.mon-kpiband--loaded-size .sk-kpiband__skel {
|
||||
min-height: 114px;
|
||||
|
||||
@media (max-width: 560px) { &:nth-child(n + 3) { min-height: 66px; } }
|
||||
}
|
||||
|
||||
.mon-monitor-list,
|
||||
.mon-feed { display: flex; flex-direction: column; }
|
||||
|
||||
|
||||
Reference in new issue
Block a user