making sources editable, adding sorting in runles
Deploy / deploy (push) Successful in 8s

This commit is contained in:
2026-05-06 19:14:06 +02:00
parent 5b5fd78eb6
commit fae485c9cb
3 changed files with 140 additions and 60 deletions
+9
View File
@@ -46,6 +46,15 @@ class Repository
$this->db->pdo()->prepare("DELETE FROM log_sources WHERE id = ?")->execute([$id]);
}
public function updateSource(int $id, string $name, LogSourceType $type, string $address, array $labels = [], bool $active = true): LogSource
{
$stmt = $this->db->pdo()->prepare(
"UPDATE log_sources SET name = ?, type = ?, address = ?, labels = ?, active = ? WHERE id = ?"
);
$stmt->execute([$name, $type->value, $address, json_encode($labels), (int) $active, $id]);
return $this->getSource($id);
}
// --- Rules ---
public function getRules(): array