Merge pull request #336 from nextcloud/enh/noid/allow-to-get-mastercontainer-logs

allow to get the mastercontainer logs from the frontend
This commit is contained in:
Simon L
2022-03-14 15:01:08 +01:00
committed by GitHub
3 changed files with 9 additions and 5 deletions

View File

@@ -52,8 +52,12 @@ class DockerController
public function GetLogs(Request $request, Response $response, $args) : Response
{
$id = $request->getQueryParams()['id'];
$container = $this->containerDefinitionFetcher->GetContainerById($id);
$logs = $this->dockerActionManager->GetLogs($container);
if (str_starts_with($id, 'nextcloud-aio-')) {
$logs = $this->dockerActionManager->GetLogs($id);
} else {
$logs = 'Container not found.';
}
$body = $response->getBody();
$body->write($logs);