Skip to content

Commit

Permalink
feat: convert hive_id to str since hardware adresses in docker are no…
Browse files Browse the repository at this point in the history
…t unique
  • Loading branch information
aleneum committed Dec 11, 2024
1 parent ba4711b commit bb449ac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hive_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ServerConfig(BaseModel):


class Settings(BaseModel):
hive_id: int = Field(default_factory=uuid.getnode)
hive_id: str = Field(default_factory=uuid.uuid4().hex)
hive_url: str = "https://github.com/caretech-owl/hive.git"
hive_repo: Path = CONFIG_PATH / "hive"
update_interval: int = 60
Expand Down
4 changes: 2 additions & 2 deletions hive_cli/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,14 @@ def setup_ui(self) -> None:
settings = self.settings
ui.input(
label="Hive ID",
value=str(self.settings.hive_id),
value=self.settings.hive_id,
validation={
"Input must be a number!": lambda value: value.isdigit()
},
on_change=lambda evt: setattr(
settings,
"hive_id",
int(evt.value) if evt.value.isdigit() else evt.value,
evt.value if evt.value.isdigit() else evt.value,
),
)

Expand Down

0 comments on commit bb449ac

Please sign in to comment.