fix: status not needed

This commit is contained in:
Andras Bacsai 2023-04-12 15:42:01 +02:00
parent 7954b892bc
commit 94b6c0c49e
2 changed files with 5 additions and 15 deletions

View File

@ -58,16 +58,4 @@ public function pollingStatus()
{
$this->application->refresh();
}
public function checkStatus()
{
$output = runRemoteCommandSync($this->destination->server, ["docker ps -a --format '{{.State}}' --filter 'name={$this->application->uuid}'"]);
if ($output == '') {
$this->application->status = 'exited';
$this->application->save();
} else {
$this->application->status = $output;
$this->application->save();
}
}
}

View File

@ -1,6 +1,8 @@
<div>
<button wire:click='deploy'>Deploy</button>
<button wire:click='stop'>Stop</button>
<button wire:click='checkStatus'>CheckStatus</button>
@if ($application->status === 'running')
<button wire:click='stop'>Stop</button>
@else
<button wire:click='deploy'>Deploy</button>
@endif
<span wire:poll='pollingStatus'>status: {{ $application->status }}</span>
</div>