Add favorites feature with toggle filters, group management, color/icon pickers, dashboard widget, and star buttons across containers/docker sections with persistent storage and real-time UI updates
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
Tests / Backend Tests (Python) (3.10) (push) Has been cancelled
Tests / Backend Tests (Python) (3.11) (push) Has been cancelled
Tests / Backend Tests (Python) (3.12) (push) Has been cancelled
Tests / Frontend Tests (JS) (push) Has been cancelled
Tests / Integration Tests (push) Has been cancelled
Tests / All Tests Passed (push) Has been cancelled
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Any, Optional
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field
|
||||
|
||||
|
||||
class FavoriteGroupCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=100)
|
||||
sort_order: int = Field(0, ge=0)
|
||||
color: Optional[str] = Field(None, max_length=20)
|
||||
icon_key: Optional[str] = Field(None, max_length=100)
|
||||
|
||||
|
||||
class FavoriteGroupUpdate(BaseModel):
|
||||
name: Optional[str] = Field(None, min_length=1, max_length=100)
|
||||
sort_order: Optional[int] = Field(None, ge=0)
|
||||
color: Optional[str] = Field(None, max_length=20)
|
||||
icon_key: Optional[str] = Field(None, max_length=100)
|
||||
|
||||
|
||||
class FavoriteGroupOut(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
sort_order: int
|
||||
color: Optional[str] = None
|
||||
icon_key: Optional[str] = None
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
|
||||
class FavoriteDockerContainerOut(BaseModel):
|
||||
host_id: str
|
||||
host_name: str
|
||||
host_ip: str
|
||||
host_docker_status: Optional[str] = None
|
||||
|
||||
container_id: str
|
||||
name: str
|
||||
image: Optional[str] = None
|
||||
state: str
|
||||
status: Optional[str] = None
|
||||
health: Optional[str] = None
|
||||
ports: Optional[dict[str, Any]] = None
|
||||
compose_project: Optional[str] = None
|
||||
|
||||
|
||||
class FavoriteContainerCreate(BaseModel):
|
||||
host_id: str
|
||||
container_id: str
|
||||
group_id: Optional[int] = None
|
||||
|
||||
|
||||
class FavoriteContainerOut(BaseModel):
|
||||
id: int
|
||||
group_id: Optional[int] = None
|
||||
created_at: datetime
|
||||
docker_container: FavoriteDockerContainerOut
|
||||
|
||||
|
||||
class FavoriteContainersListResponse(BaseModel):
|
||||
containers: list[FavoriteContainerOut]
|
||||
|
||||
|
||||
class FavoriteGroupsListResponse(BaseModel):
|
||||
groups: list[FavoriteGroupOut]
|
||||
Reference in New Issue
Block a user