fix: only show last 1000 lines

This commit is contained in:
Andras Bacsai
2023-10-02 14:01:16 +02:00
parent 97027875bf
commit 3adc0bdd6e
2 changed files with 8 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ class GetLogs extends Component
public Server $server;
public ?string $container = null;
public ?bool $streamLogs = false;
public int $numberOfLines = 1000;
public function doSomethingWithThisChunkOfOutput($output)
{
$this->outputs .= $output;
@@ -24,7 +24,7 @@ class GetLogs extends Component
public function getLogs($refresh = false)
{
if ($this->container) {
$sshCommand = generateSshCommand($this->server, "docker logs -t {$this->container}");
$sshCommand = generateSshCommand($this->server, "docker logs -n {$this->numberOfLines} -t {$this->container}");
if ($refresh) {
$this->outputs = '';
}