mirror of
https://github.com/nextcloud/all-in-one.git
synced 2025-12-20 14:36:52 +00:00
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:
commit
6beaa3b391
3 changed files with 9 additions and 5 deletions
|
|
@ -52,8 +52,12 @@ class DockerController
|
||||||
public function GetLogs(Request $request, Response $response, $args) : Response
|
public function GetLogs(Request $request, Response $response, $args) : Response
|
||||||
{
|
{
|
||||||
$id = $request->getQueryParams()['id'];
|
$id = $request->getQueryParams()['id'];
|
||||||
$container = $this->containerDefinitionFetcher->GetContainerById($id);
|
if (str_starts_with($id, 'nextcloud-aio-')) {
|
||||||
$logs = $this->dockerActionManager->GetLogs($container);
|
$logs = $this->dockerActionManager->GetLogs($id);
|
||||||
|
} else {
|
||||||
|
$logs = 'Container not found.';
|
||||||
|
}
|
||||||
|
|
||||||
$body = $response->getBody();
|
$body = $response->getBody();
|
||||||
$body->write($logs);
|
$body->write($logs);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,12 +120,12 @@ class DockerActionManager
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function GetLogs(Container $container) : string
|
public function GetLogs(string $id) : string
|
||||||
{
|
{
|
||||||
$url = $this->BuildApiUrl(
|
$url = $this->BuildApiUrl(
|
||||||
sprintf(
|
sprintf(
|
||||||
'containers/%s/logs?stdout=true&stderr=true',
|
'containers/%s/logs?stdout=true&stderr=true',
|
||||||
urlencode($container->GetIdentifier())
|
urlencode($id)
|
||||||
));
|
));
|
||||||
$responseBody = (string)$this->guzzleClient->get($url)->getBody();
|
$responseBody = (string)$this->guzzleClient->get($url)->getBody();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@
|
||||||
|
|
||||||
{% if isBackupOrRestoreRunning == false %}
|
{% if isBackupOrRestoreRunning == false %}
|
||||||
<h2>Mastercontainer</h2>
|
<h2>Mastercontainer</h2>
|
||||||
You are currently running the {{ current_channel }} channel.<br><br>
|
You are currently running the {{ current_channel }} channel. (<a href="/api/docker/logs?id=nextcloud-aio-mastercontainer">Logs</a>)<br><br>
|
||||||
|
|
||||||
{% if is_mastercontainer_update_available == true %}
|
{% if is_mastercontainer_update_available == true %}
|
||||||
{% if isAnyRunning == false %}
|
{% if isAnyRunning == false %}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue