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
2 changes: 2 additions & 0 deletions backend/app/schemas/equipment.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from datetime import date
from typing import Literal

from pydantic import BaseModel, Field
Expand All @@ -10,6 +11,7 @@ class EquipmentOut(BaseModel):
name: str
type: str
unit_number: int
last_maintenance_date: date | None = Field(None, description="Дата последнего обслуживания")
current_cycle: int
status: Status
predicted_rul: float = Field(description="Прогноз остаточного ресурса, циклов")
Expand Down
4 changes: 3 additions & 1 deletion backend/app/services/equipment_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def _latest_predictions(db: Connection, equipment_id: int | None = None) -> list
Equipment.name,
Equipment.type,
Equipment.unit_number,
Equipment.last_maintenance_date,
MlPrediction.cycle.label("current_cycle"),
MlPrediction.predicted_rul,
MlPrediction.defect_probability,
Expand Down Expand Up @@ -64,7 +65,8 @@ def _latest_predictions(db: Connection, equipment_id: int | None = None) -> list


def _to_equipment_out(item: dict) -> dict:
keys = ("id", "name", "type", "unit_number", "current_cycle", "status", "predicted_rul")
keys = ("id", "name", "type", "unit_number", "last_maintenance_date",
"current_cycle", "status", "predicted_rul")
return {k: item[k] for k in keys}


Expand Down
3 changes: 3 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
*.tsbuildinfo
Empty file removed frontend/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OFF-Tech: состояние оборудования</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading