diff --git a/app/Http/Livewire/RunCommand.php b/app/Http/Livewire/RunCommand.php
index 41002ca17..c83a83084 100755
--- a/app/Http/Livewire/RunCommand.php
+++ b/app/Http/Livewire/RunCommand.php
@@ -8,51 +8,24 @@ use Livewire\Component;
class RunCommand extends Component
{
- public $activity;
-
- public $isKeepAliveOn = false;
-
- public $manualKeepAlive = false;
-
- public $command = 'ls';
-
+ public $command;
public $server;
-
public $servers = [];
protected $rules = [
'server' => 'required',
+ 'command' => 'required',
];
public function mount()
{
- $this->servers = Server::all();
+ $this->servers = Server::where('team_id', session('currentTeam')->id)->get();
$this->server = $this->servers[0]->uuid;
}
public function runCommand()
{
- $this->isKeepAliveOn = true;
- $this->activity = remoteProcess([$this->command], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);
- }
-
- public function runSleepingBeauty()
- {
- $this->isKeepAliveOn = true;
- $this->activity = remoteProcess(['x=1; while [ $x -le 40 ]; do sleep 0.1 && echo "Welcome $x times" $(( x++ )); done'], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);
- }
-
- public function runDummyProjectBuild()
- {
- $this->isKeepAliveOn = true;
- $this->activity = remoteProcess([' cd projects/dummy-project', 'docker-compose build --no-cache'], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);
- }
-
- public function polling()
- {
- $this->activity?->refresh();
-
- if (data_get($this->activity, 'properties.exitCode') !== null) {
- $this->isKeepAliveOn = false;
- }
+ $this->validate();
+ $activity = remoteProcess([$this->command], Server::where('uuid', $this->server)->first(), ActivityTypes::INLINE->value);
+ $this->emit('newMonitorActivity', $activity->id);
}
}
diff --git a/resources/views/demo.blade.php b/resources/views/command-center.blade.php
similarity index 100%
rename from resources/views/demo.blade.php
rename to resources/views/command-center.blade.php
diff --git a/resources/views/components/inputs/input.blade.php b/resources/views/components/inputs/input.blade.php
index f899cb64e..a09af0496 100644
--- a/resources/views/components/inputs/input.blade.php
+++ b/resources/views/components/inputs/input.blade.php
@@ -1,32 +1,19 @@
@props([
'id' => null,
+ 'type' => 'text',
'required' => false,
'readonly' => false,
'label' => null,
- 'type' => 'text',
- 'class' => '',
'instantSave' => false,
'disabled' => false,
'hidden' => false,
])
-@if ($type === 'checkbox')
-
- @error($id)
- {{ $message }}
- @enderror
-@else
+
+ $type === 'checkbox',
+ 'flex flex-col' => $type !== 'checkbox',
+])>
@if ($type === 'textarea')
-
+
@else
-
+
@endif
@error($id)
{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($this->activity) }}
diff --git a/resources/views/livewire/run-command.blade.php b/resources/views/livewire/run-command.blade.php
index 81473dd40..951fd5407 100755
--- a/resources/views/livewire/run-command.blade.php
+++ b/resources/views/livewire/run-command.blade.php
@@ -1,26 +1,12 @@
{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}
- @endisset
+
+