feat: Implement UVM Dashboard with frontend and backend integration
- Added dashboard.js for frontend functionality, including VM management and system health monitoring. - Created dashboard route to serve the dashboard HTML. - Introduced diagnostics route for token-protected host diagnostics. - Enhanced VMs router with bulk actions, VM log retrieval, and port management. - Updated lifecycle service to read VM log tails with truncation handling. - Integrated static file serving for dashboard assets in the FastAPI server. - Redirect root URL to the dashboard for improved user experience.
This commit is contained in:
@@ -73,6 +73,46 @@ class DestroyResponse(BaseModel):
|
||||
status: str = "terminated"
|
||||
|
||||
|
||||
class PortUpdateRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
mode: Literal["set", "open", "close"] = "set"
|
||||
ports: list[PortRuleModel] = Field(default_factory=list)
|
||||
|
||||
|
||||
class PortSyncResponse(BaseModel):
|
||||
id: str
|
||||
policy_status: str
|
||||
status: str
|
||||
|
||||
|
||||
class VmLogResponse(BaseModel):
|
||||
content: str
|
||||
truncated: bool
|
||||
|
||||
|
||||
class DiagnosticResponse(BaseModel):
|
||||
name: str
|
||||
ok: bool
|
||||
message: str
|
||||
|
||||
|
||||
class VmBulkActionRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
|
||||
action: Literal["start", "stop", "restart", "delete", "ports-sync"]
|
||||
identifiers: list[str] = Field(default_factory=list)
|
||||
all_vms: bool = Field(default=False, strict=True)
|
||||
timeout: float | None = None
|
||||
|
||||
|
||||
class VmActionResultResponse(BaseModel):
|
||||
id: str
|
||||
action: str
|
||||
outcome: str
|
||||
error: str | None = None
|
||||
|
||||
|
||||
def vm_response(
|
||||
vm: VmRecord,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user