fixes and improvements
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user