Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Have Sail and SSU. Runs a command on a remote host.

Joao Patricio2d6af39ed0dc
diff --git a/app/Http/Livewire/RunCommand.php b/app/Http/Livewire/RunCommand.php
index 11dad08936..96add0fb37 100755
--- a/app/Http/Livewire/RunCommand.php
+++ b/app/Http/Livewire/RunCommand.php
@@ -26,7 +26,7 @@ class RunCommand extends Component
// Override manual to experiment
$override = 0;
- if($override) {
+ if ($override) {
// Good to play with the throttle feature
$sleepingBeauty = 'x=1; while [ $x -le 40 ]; do sleep 0.1 && echo "Welcome $x times" $(( x++ )); done';
@@ -42,6 +42,23 @@ class RunCommand extends Component
$this->activity = coolifyProcess($this->command, 'testing-host');
}
+ public function runSleepingBeauty()
+ {
+ $this->isKeepAliveOn = true;
+
+ $this->activity = coolifyProcess('x=1; while [ $x -le 40 ]; do sleep 0.1 && echo "Welcome $x times" $(( x++ )); done', 'testing-host');
+ }
+
+ public function runDummyProjectBuild()
+ {
+ $this->isKeepAliveOn = true;
+
+ $this->activity = coolifyProcess(<<<EOT
+ cd projects/dummy-project
+ ~/.docker/cli-plugins/docker-compose build --no-cache
+ EOT, 'testing-host');
+ }
+
public function polling()
{
$this->activity?->refresh();
diff --git a/resources/views/livewire/run-command.blade.php b/resources/views/livewire/run-command.blade.php
index 782b5c3091..370264e6c2 100755
--- a/resources/views/livewire/run-command.blade.php
+++ b/resources/views/livewire/run-command.blade.php
@@ -2,13 +2,37 @@
<div>
<div>
<label for="command">
- <input class="ring-1" id="command" wire:model="command" type="text"/>
+ <input class="py-2 rounded ring-1" id="command" wire:model="command" type="text"/>
</label>
- <button class="btn btn-success btn-xs rounded-none" wire:click="runCommand">
+ <button
+ @disabled($activity)
+ class="bg-indigo-500 rounded py-2 px-4 disabled:bg-gray-300"
+ wire:click="runCommand"
+ >
Run command
- <button>
+ <button>
</div>
+ <div class="mt-2 flex gap-2">
+ <button
+ @disabled($activity)
+ class="bg-indigo-500 rounded py-2 px-4 disabled:bg-gray-300"
+ wire:click="runSleepingBeauty"
+ >
+ Run sleeping beauty
+ <button>
+ </div>
+ <div class="mt-2 flex gap-2">
+ <button
+ @disabled($activity)
+ class="bg-indigo-500 rounded py-2 px-4 disabled:bg-gray-300"
+ wire:click="runDummyProjectBuild"
+ >
+ Build DummyProject
+ <button>
+ </div>
+
+
@isset($activity?->id)
<div>
Activity: <span>{{ $activity?->id ?? 'waiting' }}</span>
@@ -51,7 +75,7 @@
style="
background-color: #FFFFFF;
width: 1200px;
- height: 600px;
+ height: 300px;
overflow-y: scroll;
display: flex;
flex-direction: column-reverse;