www/getnodes.php

Sat, 18 Aug 2018 17:31:11 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 18 Aug 2018 17:31:11 +0200
changeset 23
4b157d7a1cee
parent 7
59048cd5f00d
permissions
-rw-r--r--

Added first part of mash profiles. Steps are in the database but not in the web ui.

<?php
require_once('config.php');
$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$result = $mysqli->query("SELECT uuid,node,online,net_address FROM nodes");
while($row = $result->fetch_array(MYSQLI_ASSOC)) {
  if ($row['online'] == 'Y')
    $row['online'] = true;
  else
    $row['online'] = false;
  $resultArray[] = $row;
}
echo json_encode($resultArray);

mercurial