fixes and improvements

This commit is contained in:
2026-05-11 17:00:46 +02:00
parent 67a619e148
commit 80d38ed86d
6 changed files with 40 additions and 25 deletions
@@ -355,7 +355,7 @@ class SettingsStore:
)
def list_machines(self) -> list[dict[str, Any]]:
self.ensure_defaults()
self.init_schema()
with self.connect() as conn:
rows = conn.execute(
"SELECT * FROM monitoring_machines ORDER BY CASE WHEN id = ? THEN 0 ELSE 1 END, name COLLATE NOCASE",
@@ -366,7 +366,7 @@ class SettingsStore:
def get_machine(self, machine_id: str | None) -> dict[str, Any] | None:
if not machine_id:
return None
self.ensure_defaults()
self.init_schema()
with self.connect() as conn:
row = conn.execute("SELECT * FROM monitoring_machines WHERE id = ?", (machine_id,)).fetchone()
return self._row_to_machine(row) if row else None
@@ -375,7 +375,7 @@ class SettingsStore:
"""Return the full machine config including secrets."""
if not machine_id:
return None
self.ensure_defaults()
self.init_schema()
with self.connect() as conn:
row = conn.execute("SELECT * FROM monitoring_machines WHERE id = ?", (machine_id,)).fetchone()
if not row: