ui ui ui ui ui ui ux ux ux ux ux ux

This commit is contained in:
Andras Bacsai
2024-03-21 12:44:32 +01:00
parent 8f66a41c09
commit b5775ff9d2
61 changed files with 597 additions and 430 deletions

View File

@@ -34,7 +34,12 @@ class Database extends Component
}
$this->refreshFileStorages();
}
public function instantSaveAdvanced()
public function instantSaveExclude()
{
$this->submit();
}
public function instantSaveLogDrain()
{
if (!$this->database->service->destination->server->isLogDrainEnabled()) {
$this->database->is_log_drain_enabled = false;
@@ -74,6 +79,7 @@ class Database extends Component
public function submit()
{
try {
ray('asdf');
$this->validate();
$this->database->save();
updateCompose($this->database);

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Livewire\Project\Service;
use App\Models\Service;
use Livewire\Component;
class EditCompose extends Component
{
public Service $service;
public $serviceId;
protected $rules = [
'service.docker_compose_raw' => 'required',
'service.docker_compose' => 'required',
];
public function mount() {
$this->service = Service::find($this->serviceId);
}
public function saveEditedCompose() {
$this->dispatch('warning', "Saving new docker compose...");
$this->dispatch('saveCompose', $this->service->docker_compose_raw);
}
public function render()
{
return view('livewire.project.service.edit-compose');
}
}

View File

@@ -1,13 +0,0 @@
<?php
namespace App\Livewire\Project\Service;
use Livewire\Component;
class Modal extends Component
{
public function render()
{
return view('livewire.project.service.modal');
}
}

View File

@@ -16,17 +16,24 @@ class Navbar extends Component
public array $parameters;
public array $query;
public $isDeploymentProgress = false;
public function getListeners()
{
$userId = auth()->user()->id;
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted',
"serviceStatusChanged"
];
}
public function serviceStarted() {
$this->dispatch('success', 'Service started.');
}
public function serviceStatusChanged()
{
$this->dispatch('refresh')->self();
}
public function check_status() {
public function check_status()
{
$this->dispatch('check_status');
$this->dispatch('success', 'Service status updated.');
}
@@ -44,7 +51,7 @@ class Navbar extends Component
$this->isDeploymentProgress = false;
}
}
public function deploy()
public function start()
{
$this->checkDeployments();
if ($this->isDeploymentProgress) {
@@ -73,9 +80,9 @@ class Navbar extends Component
return;
}
PullImage::run($this->service);
$this->dispatch('image-pulled');
StopService::run($this->service);
$this->service->parse();
$this->dispatch('imagePulled');
$activity = StartService::run($this->service);
$this->dispatch('activityMonitor', $activity->id);
}

View File

@@ -2,11 +2,12 @@
namespace App\Livewire\Project\Service;
use App\Models\Service;
use Livewire\Component;
class StackForm extends Component
{
public $service;
public Service $service;
public $fields = [];
protected $listeners = ["saveCompose"];
public $rules = [