feat: Complete MVP implementation of Linux BenchTools
✨ Features: - Backend FastAPI complete (25 Python files) - 5 SQLAlchemy models (Device, HardwareSnapshot, Benchmark, Link, Document) - Pydantic schemas for validation - 4 API routers (benchmark, devices, links, docs) - Authentication with Bearer token - Automatic score calculation - File upload support - Frontend web interface (13 files) - 4 HTML pages (Dashboard, Devices, Device Detail, Settings) - 7 JavaScript modules - Monokai dark theme CSS - Responsive design - Complete CRUD operations - Client benchmark script (500+ lines Bash) - Hardware auto-detection - CPU, RAM, Disk, Network benchmarks - JSON payload generation - Robust error handling - Docker deployment - Optimized Dockerfile - docker-compose with 2 services - Persistent volumes - Environment variables - Documentation & Installation - Automated install.sh script - README, QUICKSTART, DEPLOYMENT guides - Complete API documentation - Project structure documentation 📊 Stats: - ~60 files created - ~5000 lines of code - Full MVP feature set implemented 🚀 Ready for production deployment! 🤖 Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
66
backend/app/schemas/device.py
Normal file
66
backend/app/schemas/device.py
Normal file
@@ -0,0 +1,66 @@
|
||||
"""
|
||||
Linux BenchTools - Device Schemas
|
||||
"""
|
||||
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, List
|
||||
from app.schemas.benchmark import BenchmarkSummary
|
||||
from app.schemas.hardware import HardwareSnapshotResponse
|
||||
|
||||
|
||||
class DeviceBase(BaseModel):
|
||||
"""Base device schema"""
|
||||
hostname: str
|
||||
fqdn: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
asset_tag: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
owner: Optional[str] = None
|
||||
tags: Optional[str] = None
|
||||
|
||||
|
||||
class DeviceCreate(DeviceBase):
|
||||
"""Schema for creating a device"""
|
||||
pass
|
||||
|
||||
|
||||
class DeviceUpdate(BaseModel):
|
||||
"""Schema for updating a device"""
|
||||
hostname: Optional[str] = None
|
||||
fqdn: Optional[str] = None
|
||||
description: Optional[str] = None
|
||||
asset_tag: Optional[str] = None
|
||||
location: Optional[str] = None
|
||||
owner: Optional[str] = None
|
||||
tags: Optional[str] = None
|
||||
|
||||
|
||||
class DeviceSummary(DeviceBase):
|
||||
"""Device summary for lists"""
|
||||
id: int
|
||||
created_at: str
|
||||
updated_at: str
|
||||
last_benchmark: Optional[BenchmarkSummary] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class DeviceDetail(DeviceBase):
|
||||
"""Detailed device information"""
|
||||
id: int
|
||||
created_at: str
|
||||
updated_at: str
|
||||
last_benchmark: Optional[BenchmarkSummary] = None
|
||||
last_hardware_snapshot: Optional[HardwareSnapshotResponse] = None
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class DeviceListResponse(BaseModel):
|
||||
"""Paginated device list response"""
|
||||
items: List[DeviceSummary]
|
||||
total: int
|
||||
page: int
|
||||
page_size: int
|
||||
Reference in New Issue
Block a user