ApiPanelFrontend::getLastChangeTs($uuid), 'now' => round(microtime(true) * 1000), ]; } elseif ($get === "machines") { $locationIds = LocationInfo::getLocationsOr404($uuid); $output = array(); InfoPanel::appendMachineData($output, $locationIds, true); $output = array_values($output); } elseif ($get === "config") { $type = InfoPanel::getConfig($uuid, $output); if ($type === null) { http_response_code(404); die('Panel not found'); } } elseif ($get === "pcstates") { $locationIds = LocationInfo::getLocationsOr404($uuid); $output = ApiPanelFrontend::getPcStates($locationIds, $uuid); } elseif ($get === "locationtree") { $locationIds = LocationInfo::getLocationsOr404($uuid); $output = Location::getTree(...$locationIds); } elseif ($get === "calendar") { $locationIds = LocationInfo::getLocationsOr404($uuid); $output = LocationInfo::getCalendar($locationIds, time() + 3); } elseif ($get === "manifest") { $output = ApiPanelFrontend::generateManifest($uuid); } elseif ($get === 'list') { $output = ApiExternalPanels::generatePublicPanelList(); } elseif ($get === 'external-register') { $output = ApiExternalPanels::registerDevice(); } elseif ($get === 'external-checkin') { $output = ApiExternalPanels::checkinCallback(); } if ($output !== null) { Header('Content-Type: application/json; charset=utf-8'); echo json_encode($output); } else { http_response_code(404); echo 'Unknown get option'; } }