8437f5ef49
- Add custom_color field to EdgeData type, Edge DB model and all schemas - HomelableEdge applies custom_color as stroke override (before selected highlight) - EDGE_DEFAULT_COLORS extracted to utils/edgeColors.ts (react-refresh compliant) - EdgeModal: color picker row showing effective color (custom or type default) with hex value, Reset button when custom color is active - Auto-migration adds custom_color column to edges table
33 lines
613 B
Python
33 lines
613 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class EdgeBase(BaseModel):
|
|
source: str
|
|
target: str
|
|
type: str = "ethernet"
|
|
label: str | None = None
|
|
vlan_id: int | None = None
|
|
speed: str | None = None
|
|
custom_color: str | None = None
|
|
|
|
|
|
class EdgeCreate(EdgeBase):
|
|
pass
|
|
|
|
|
|
class EdgeUpdate(BaseModel):
|
|
type: str | None = None
|
|
label: str | None = None
|
|
vlan_id: int | None = None
|
|
speed: str | None = None
|
|
custom_color: str | None = None
|
|
|
|
|
|
class EdgeResponse(EdgeBase):
|
|
id: str
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|