feat: auto-detect OS from description; expand OS_LIST to 51 distros
- Remove os field from Device API and form — OS is now detected automatically from name/description via detectOs() in brandIcons.js - Expand OS_LIST from 20 to 51 entries covering all major distros (Debian/Ubuntu flavours, Red Hat, SUSE, Arch, BSD, security distros, Windows/macOS/iOS/Android, generic Linux/BSD catch-alls) - Display detected OS icon in IpAddressing.vue description column - Fix virt_type validator to normalise empty string to null Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -91,6 +91,8 @@ class DeviceCreate(BaseModel):
|
||||
@field_validator("virt_type")
|
||||
@classmethod
|
||||
def _virt_type(cls, v: Optional[str]) -> Optional[str]:
|
||||
if not v:
|
||||
return None
|
||||
if v not in _VALID_VIRT_TYPES:
|
||||
raise ValueError(f"Invalid virt_type: {v!r}. Must be one of: baremetal, lxc, qemu")
|
||||
return v
|
||||
@@ -104,7 +106,6 @@ class DeviceCreate(BaseModel):
|
||||
raise ValueError("url must be a valid http or https URL")
|
||||
return v
|
||||
|
||||
|
||||
class DeviceOut(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
|
||||
Reference in New Issue
Block a user