cleanup file structure
This commit is contained in:
@@ -282,9 +282,11 @@ def check_component_health(component_name: str, check_function) -> Dict[str, Any
|
||||
"""
|
||||
try:
|
||||
result = check_function()
|
||||
# Ensure details is always a dictionary
|
||||
details = result if isinstance(result, dict) else {"status": result}
|
||||
return {
|
||||
"status": "healthy",
|
||||
"details": result,
|
||||
"details": details,
|
||||
"last_check": datetime.utcnow().isoformat()
|
||||
}
|
||||
except Exception as e:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text
|
||||
from sqlalchemy import Column, Integer, String, DateTime, Text, JSON, Boolean
|
||||
from sqlalchemy.sql import func
|
||||
from ..core.database import Base
|
||||
|
||||
@@ -9,6 +9,24 @@ class Project(Base):
|
||||
name = Column(String, unique=True, index=True, nullable=False)
|
||||
description = Column(Text, nullable=True)
|
||||
status = Column(String, default="active") # e.g., active, completed, archived
|
||||
|
||||
# GitHub Integration Fields
|
||||
github_repo = Column(String, nullable=True) # owner/repo format
|
||||
git_url = Column(String, nullable=True)
|
||||
git_owner = Column(String, nullable=True)
|
||||
git_repository = Column(String, nullable=True)
|
||||
git_branch = Column(String, default="main")
|
||||
|
||||
# Bzzz Configuration
|
||||
bzzz_enabled = Column(Boolean, default=False)
|
||||
ready_to_claim = Column(Boolean, default=False)
|
||||
private_repo = Column(Boolean, default=False)
|
||||
github_token_required = Column(Boolean, default=False)
|
||||
|
||||
# Additional metadata
|
||||
metadata = Column(JSON, nullable=True)
|
||||
tags = Column(JSON, nullable=True)
|
||||
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), onupdate=func.now())
|
||||
|
||||
|
||||
@@ -258,6 +258,11 @@ class ComponentStatus(BaseModel):
|
||||
status: StatusEnum = Field(..., description="Component status")
|
||||
details: Optional[Dict[str, Any]] = Field(None, description="Additional status details")
|
||||
last_check: datetime = Field(default_factory=datetime.utcnow, description="Last status check time")
|
||||
|
||||
class Config:
|
||||
json_encoders = {
|
||||
datetime: lambda v: v.isoformat() if v else None
|
||||
}
|
||||
|
||||
|
||||
class SystemStatusResponse(BaseResponse):
|
||||
|
||||
@@ -459,8 +459,8 @@ class ProjectService:
|
||||
print("DEBUG: Attempting to connect to database...")
|
||||
# Connect to database
|
||||
conn = psycopg2.connect(
|
||||
host="192.168.1.27",
|
||||
port=5433,
|
||||
host="postgres",
|
||||
port=5432,
|
||||
database="hive",
|
||||
user="hive",
|
||||
password="hivepass"
|
||||
|
||||
Reference in New Issue
Block a user