Backend (Phase 1-6): - Pydantic schemas for request/response validation - Service layer (SSH Key, Server, Repo, Sync) - API routes with authentication - FastAPI main application with lifespan management - ORM models (SshKey, Server, Repo, SyncLog) Frontend (Phase 7): - Vue 3 + Element Plus + Pinia + Vue Router - API client with Axios and interceptors - State management stores - All page components (Dashboard, Servers, Repos, SyncLogs, SshKeys, Settings) Deployment (Phase 8): - README with quick start guide - Startup script (start.sh) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
53 lines
1.6 KiB
Python
53 lines
1.6 KiB
Python
"""
|
|
Sync Log Pydantic schemas.
|
|
"""
|
|
from typing import Optional
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class SyncLogResponse(BaseModel):
|
|
"""
|
|
Schema for sync log response.
|
|
"""
|
|
id: int = Field(description="Sync log ID")
|
|
repo_id: int = Field(description="Repository ID")
|
|
status: str = Field(description="Sync status")
|
|
started_at: int = Field(description="Sync start timestamp (Unix timestamp)")
|
|
finished_at: int = Field(description="Sync finish timestamp (Unix timestamp)")
|
|
commits_count: Optional[int] = Field(
|
|
default=None,
|
|
description="Number of commits synced"
|
|
)
|
|
error_msg: Optional[str] = Field(
|
|
default=None,
|
|
description="Error message if sync failed"
|
|
)
|
|
created_at: int = Field(description="Creation timestamp (Unix timestamp)")
|
|
|
|
model_config = {
|
|
"json_schema_extra": {
|
|
"examples": [
|
|
{
|
|
"id": 1,
|
|
"repo_id": 1,
|
|
"status": "success",
|
|
"started_at": 1711891200,
|
|
"finished_at": 1711891500,
|
|
"commits_count": 5,
|
|
"error_msg": None,
|
|
"created_at": 1711891200
|
|
},
|
|
{
|
|
"id": 2,
|
|
"repo_id": 1,
|
|
"status": "error",
|
|
"started_at": 1711891800,
|
|
"finished_at": 1711892000,
|
|
"commits_count": None,
|
|
"error_msg": "Connection timeout",
|
|
"created_at": 1711891800
|
|
}
|
|
]
|
|
}
|
|
}
|