adding notes to machines
Deploy / deploy (push) Successful in 39s

This commit is contained in:
2026-05-07 20:51:25 +02:00
parent 9dba20441c
commit f37d6d52f7
4 changed files with 16 additions and 5 deletions
+5 -4
View File
@@ -368,8 +368,8 @@ function handleNodes($method, $id, $db) {
case 'POST':
$data = json_decode(file_get_contents('php://input'), true);
$stmt = $db->prepare("
INSERT INTO network_nodes (label, ip_address, node_type, status, group_name, pos_x, pos_y)
VALUES (?, ?, ?, ?, ?, ?, ?)
INSERT INTO network_nodes (label, ip_address, node_type, status, group_name, pos_x, pos_y, notes)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
");
$stmt->execute([
$data['label'],
@@ -378,7 +378,8 @@ function handleNodes($method, $id, $db) {
$data['status'] ?? 'unknown',
$data['group_name'] ?? 'default',
$data['pos_x'] ?? 0,
$data['pos_y'] ?? 0
$data['pos_y'] ?? 0,
$data['notes'] ?? ''
]);
echo json_encode(['id' => $db->lastInsertId()]);
break;
@@ -387,7 +388,7 @@ function handleNodes($method, $id, $db) {
$data = json_decode(file_get_contents('php://input'), true);
$fields = [];
$params = [];
foreach (['label','ip_address','node_type','status','group_name','pos_x','pos_y'] as $f) {
foreach (['label','ip_address','node_type','status','group_name','pos_x','pos_y','notes'] as $f) {
if (isset($data[$f])) {
$fields[] = "$f = ?";
$params[] = $data[$f];