Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,14 @@ h2 {
align-items: flex-start;
}
}

.row-link {
cursor: pointer;
}
.row-link:hover td {
background: #eff6ff;
}
.row-link .name {
color: #2563eb;
font-weight: 500;
}
5 changes: 2 additions & 3 deletions frontend/src/pages/EquipmentCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export function EquipmentCard() {
{recalcError && <ErrorMessage message={recalcError} />}

<div className="grid">
<HistoryChart id={id} />
<ForecastChart id={id} />
<HistoryChart id={id} />
<PhysicsChart />
<EquipmentAlerts id={id} />
</div>
Expand Down Expand Up @@ -159,8 +159,7 @@ function PhysicsChart() {
<h2>Физическая модель против фактических показаний</h2>
</div>
<div className="placeholder">
Заглушка: появится, когда физическая модель начнёт писать в <code>physics_predictions</code> и будет готов
эндпоинт.
Заглушка
</div>
</div>
);
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/pages/EquipmentList.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link } from "react-router-dom";
import { useNavigate } from "react-router-dom";

import { api } from "../api";
import { Empty, ErrorMessage, Loading } from "../components/State";
Expand All @@ -8,6 +8,7 @@ import { useFetch } from "../useFetch";

export function EquipmentList() {
const { data, error, loading, reload } = useFetch(api.listEquipment, []);
const navigate = useNavigate();

return (
<section>
Expand All @@ -34,10 +35,8 @@ export function EquipmentList() {
</thead>
<tbody>
{data.map((e) => (
<tr key={e.id}>
<td>
<Link to={`/equipment/${e.id}`}>{e.name}</Link>
</td>
<tr key={e.id} className="row-link" onClick={() => navigate(`/equipment/${e.id}`)}>
<td className="name">{e.name}</td>
<td>
<StatusBadge status={e.status} />
</td>
Expand Down
Loading