#1957 -- Fix system-wide log view.

This commit is contained in:
Buster "Silver Eagle" Neece 2019-09-11 14:16:19 -05:00
parent bf8bece9ac
commit abc9930472
No known key found for this signature in database
GPG Key ID: 6D9E12FF03411F4E
1 changed files with 3 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class LogsController
return $log_paths;
}
public function viewAction(ServerRequest $request, Response $response, $station_id, $log_key): ResponseInterface
public function viewAction(ServerRequest $request, Response $response, $station_id, $log): ResponseInterface
{
if ('global' === $station_id) {
$log_areas = $this->_getGlobalLogs();
@ -87,11 +87,11 @@ class LogsController
$log_areas = $this->_getStationLogs($request->getStation());
}
if (!isset($log_areas[$log_key])) {
if (!isset($log_areas[$log])) {
throw new Exception('Invalid log file specified.');
}
$log = $log_areas[$log_key];
$log = $log_areas[$log];
return $this->_view($request, $response, $log['path'], $log['tail'] ?? true);
}
}