[0]['data'];
+ history?: HistoryResponse;
historyLoading: boolean;
historySource?: string;
- resolutionSeconds?: number | null;
- range: { from: string; to: string };
- valueMode: 'avg' | 'last' | 'min' | 'max';
+ range: DateRangeState;
onSearchChange: (value: string) => void;
- onRangeChange: (value: { from: string; to: string }) => void;
- onValueModeChange: (value: 'avg' | 'last' | 'min' | 'max') => void;
+ onRangeChange: (value: DateRangeState) => void;
onToggleTag: (tag: string) => void;
onSelectFirstTags: () => void;
onSelectVisibleTags: () => void;
@@ -447,8 +456,7 @@ function ArchiveView({
- {historySource ?? 'source'}
- {resolutionSeconds ? ` · ${resolutionSeconds}s` : ''}
+ cloud-v3 · {historySource ?? 'ожидание'}
@@ -497,6 +505,7 @@ function ArchiveView({
{items.map((item) => {
const selected = selectedTags.includes(item.tag);
+ const label = getTagLabel(item.tag);
return (
);
})}
@@ -543,15 +552,6 @@ function ArchiveView({
onChange={(event) => onRangeChange({ ...range, to: event.target.value })}
/>
-
{selectedTags.length ? (
@@ -570,7 +570,7 @@ function ArchiveView({
);
}
-/** Встраивает страницу активного оборудования из TOиР light почти на всю рабочую область. */
+/** Встраивает страницу активного оборудования из ТОиР light почти на всю рабочую область. */
function EquipmentView() {
const [iframeLoaded, setIframeLoaded] = useState(false);
diff --git a/src/pages/EdgesDashboard.tsx b/src/pages/EdgesDashboard.tsx
index 9ba953a..89e2759 100644
--- a/src/pages/EdgesDashboard.tsx
+++ b/src/pages/EdgesDashboard.tsx
@@ -33,7 +33,7 @@ function getEdgeTitle(edge: EdgeItem): string {
return edge.id;
}
-/** Отображает стартовый dashboard со списком edge-установок и общей статистикой. */
+/** Отображает стартовый dashboard со списком edge-установок и общей статистикой cloud-v3. */
export function EdgesDashboard({ onOpenEdge, onOpenEquipment }: EdgesDashboardProps) {
const [search, setSearch] = useState('');
const auth = useAuth();
@@ -54,19 +54,26 @@ export function EdgesDashboard({ onOpenEdge, onOpenEquipment }: EdgesDashboardPr
return items.filter((edge) => `${edge.id} ${edge.name}`.toLowerCase().includes(query));
}, [edges.data?.items, search]);
- const stats = {
- total: edges.data?.items.length ?? 0,
- normal: 0,
- emergency: 0,
- equipmentProblem: 0,
- maintenanceRequired: 0,
- };
+ const stats = useMemo(() => {
+ const items = edges.data?.items ?? [];
+ const normal = items.filter((edge) => getEdgeState(edge) === 'ok').length;
+ const stale = items.filter((edge) => getEdgeState(edge) === 'warn').length;
+ const empty = items.filter((edge) => getEdgeState(edge) === 'empty').length;
+
+ return {
+ total: items.length,
+ normal,
+ stale,
+ empty,
+ liveTags: items.reduce((sum, edge) => sum + edge.liveTagCount, 0),
+ };
+ }, [edges.data?.items]);
return (
- Drill Cloud
+ Drill Cloud v3
Буровые установки
@@ -80,7 +87,7 @@ export function EdgesDashboard({ onOpenEdge, onOpenEquipment }: EdgesDashboardPr
{auth.enabled ? (
) : null}
@@ -89,9 +96,9 @@ export function EdgesDashboard({ onOpenEdge, onOpenEquipment }: EdgesDashboardPr
{edges.isError ? (
@@ -99,13 +106,19 @@ export function EdgesDashboard({ onOpenEdge, onOpenEquipment }: EdgesDashboardPr
) : (
{filteredEdges.map((edge, index) => (
-
+
))}
)}
{!edges.isPending && !filteredEdges.length && !edges.isError ? (
- В cloud-v2 пока нет буровых
+ В cloud-v3 пока нет буровых
) : null}
);
@@ -129,7 +142,7 @@ function StatBlock({
);
}
-/** Рендерит продуктовую карточку edge с быстрыми переходами в рабочие разделы. */
+/** Рендерит карточку edge с быстрыми переходами в рабочие разделы. */
function EdgeCard({
edge,
onOpenEdge,
@@ -174,7 +187,7 @@ function EdgeCard({
Последние данные
- {edge.lastDataAt ? formatDateTime(edge.lastDataAt) : '—'}
+ {edge.lastDataAt ? formatDateTime(edge.lastDataAt) : '-'}
@@ -187,6 +200,11 @@ function EdgeCard({
Состояние байпасов