diff --git a/README.md b/README.md index 6e6d80c59..3a211d4b1 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ ## Github Sponsors ($40+) CryptoJobsList typebot BC Direct +UXWizz Corentin Clichy Corentin Clichy Niklas Lausch diff --git a/app/Livewire/ActivityMonitor.php b/app/Livewire/ActivityMonitor.php index ad2a599a1..421992cb5 100644 --- a/app/Livewire/ActivityMonitor.php +++ b/app/Livewire/ActivityMonitor.php @@ -13,6 +13,7 @@ class ActivityMonitor extends Component public $activityId; public $eventToDispatch = 'activityFinished'; public $isPollingActive = false; + public bool $showWaiting = false; protected $activity; protected $listeners = ['activityMonitor' => 'newMonitorActivity']; diff --git a/app/Livewire/Destination/New/Docker.php b/app/Livewire/Destination/New/Docker.php index 66d0df82e..842a44683 100644 --- a/app/Livewire/Destination/New/Docker.php +++ b/app/Livewire/Destination/New/Docker.php @@ -5,7 +5,7 @@ use App\Models\Server; use App\Models\StandaloneDocker as ModelsStandaloneDocker; use App\Models\SwarmDocker; -use Illuminate\Database\Eloquent\Collection; +use Illuminate\Support\Collection; use Livewire\Component; use Visus\Cuid2\Cuid2; @@ -14,7 +14,7 @@ class Docker extends Component public string $name; public string $network; - public Collection $servers; + public ?Collection $servers = null; public Server $server; public ?int $server_id = null; public bool $is_swarm = false; @@ -34,6 +34,9 @@ class Docker extends Component public function mount() { + if (is_null($this->servers)) { + $this->servers = Server::ownedByCurrentTeam()->get(); + } if (request()->query('server_id')) { $this->server_id = request()->query('server_id'); } else { diff --git a/app/Livewire/Destination/Show.php b/app/Livewire/Destination/Show.php index b9cbcc147..4b763bae2 100644 --- a/app/Livewire/Destination/Show.php +++ b/app/Livewire/Destination/Show.php @@ -3,6 +3,8 @@ namespace App\Livewire\Destination; use App\Models\Server; +use App\Models\StandaloneDocker; +use App\Models\SwarmDocker; use Illuminate\Support\Collection; use Livewire\Component; @@ -11,6 +13,40 @@ class Show extends Component public Server $server; public Collection|array $networks = []; + private function createNetworkAndAttachToProxy() + { + $connectProxyToDockerNetworks = connectProxyToNetworks($this->server); + instant_remote_process($connectProxyToDockerNetworks, $this->server, false); + } + public function add($name) + { + if ($this->server->isSwarm()) { + $found = $this->server->swarmDockers()->where('network', $name)->first(); + if ($found) { + $this->dispatch('error', 'Network already added to this server.'); + return; + } else { + $docker = SwarmDocker::create([ + 'name' => $this->server->name . "-" . $name, + 'network' => $this->name, + 'server_id' => $this->server->id, + ]); + } + } else { + $found = $this->server->standaloneDockers()->where('network', $name)->first(); + if ($found) { + $this->dispatch('error', 'Network already added to this server.'); + return; + } else { + $docker = StandaloneDocker::create([ + 'name' => $this->server->name . "-" . $name, + 'network' => $name, + 'server_id' => $this->server->id, + ]); + } + $this->createNetworkAndAttachToProxy(); + } + } public function scan() { if ($this->server->isSwarm()) { @@ -26,6 +62,8 @@ public function scan() }); if ($this->networks->count() === 0) { $this->dispatch('success', 'No new networks found.'); + return; } + $this->dispatch('success', 'Scan done.'); } } diff --git a/app/Livewire/LayoutPopups.php b/app/Livewire/LayoutPopups.php index b6f06f808..136c94ca2 100644 --- a/app/Livewire/LayoutPopups.php +++ b/app/Livewire/LayoutPopups.php @@ -17,14 +17,6 @@ public function testEvent() { $this->dispatch('success', 'Realtime events configured!'); } - public function disableSponsorship() - { - auth()->user()->update(['is_notification_sponsorship_enabled' => false]); - } - public function disableNotifications() - { - auth()->user()->update(['is_notification_notifications_enabled' => false]); - } public function render() { return view('livewire.layout-popups'); diff --git a/app/Livewire/Project/Index.php b/app/Livewire/Project/Index.php index 1e6f79855..0537ad192 100644 --- a/app/Livewire/Project/Index.php +++ b/app/Livewire/Project/Index.php @@ -2,6 +2,7 @@ namespace App\Livewire\Project; +use App\Models\PrivateKey; use App\Models\Project; use App\Models\Server; use Livewire\Component; @@ -10,7 +11,9 @@ class Index extends Component { public $projects; public $servers; + public $private_keys; public function mount() { + $this->private_keys = PrivateKey::ownedByCurrentTeam()->get(); $this->projects = Project::ownedByCurrentTeam()->get(); $this->servers = Server::ownedByCurrentTeam()->count(); } diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php index 02211b20a..3462a96e1 100644 --- a/app/Livewire/Project/Service/Navbar.php +++ b/app/Livewire/Project/Service/Navbar.php @@ -26,7 +26,7 @@ public function getListeners() ]; } public function serviceStarted() { - $this->dispatch('success', 'Service started.'); + $this->dispatch('success', 'Service status changed.'); } public function serviceStatusChanged() { diff --git a/app/Livewire/Project/Service/ServiceApplicationView.php b/app/Livewire/Project/Service/ServiceApplicationView.php index 29bd796fd..0b3a4cef6 100644 --- a/app/Livewire/Project/Service/ServiceApplicationView.php +++ b/app/Livewire/Project/Service/ServiceApplicationView.php @@ -59,7 +59,7 @@ public function submit() $this->validate(); $this->application->save(); updateCompose($this->application); - $this->dispatch('success', 'Application saved.'); + $this->dispatch('success', 'Service saved.'); } catch (\Throwable $e) { return handleError($e, $this); } finally { diff --git a/app/Livewire/Server/New/ByIp.php b/app/Livewire/Server/New/ByIp.php index df3fae20f..1ce3df273 100644 --- a/app/Livewire/Server/New/ByIp.php +++ b/app/Livewire/Server/New/ByIp.php @@ -53,7 +53,7 @@ class ByIp extends Component public function mount() { $this->name = generate_random_name(); - $this->private_key_id = $this->private_keys->first()->id; + $this->private_key_id = $this->private_keys->first()?->id; $this->swarm_managers = Server::isUsable()->get()->where('settings.is_swarm_manager', true); if ($this->swarm_managers->count() > 0) { $this->selected_swarm_cluster = $this->swarm_managers->first()->id; diff --git a/app/Livewire/Settings/License.php b/app/Livewire/Settings/License.php index 64ad0a6f7..e2ae5fcf7 100644 --- a/app/Livewire/Settings/License.php +++ b/app/Livewire/Settings/License.php @@ -30,7 +30,7 @@ public function mount () { } public function render() { - return view('livewire.settings.license')->layout('layouts.subscription'); + return view('livewire.settings.license'); } public function submit() { diff --git a/app/Models/Team.php b/app/Models/Team.php index 7cb1601de..a3dd4e473 100644 --- a/app/Models/Team.php +++ b/app/Models/Team.php @@ -177,9 +177,6 @@ public function isAnyNotificationEnabled() if (isCloud()) { return true; } - if (!data_get(auth()->user(), 'is_notification_notifications_enabled')) { - return true; - } if ($this->smtp_enabled || $this->resend_enabled || $this->discord_enabled || $this->telegram_enabled || $this->use_instance_email_settings) { return true; } diff --git a/app/View/Components/Forms/Button.php b/app/View/Components/Forms/Button.php index 350039fce..06681910e 100644 --- a/app/View/Components/Forms/Button.php +++ b/app/View/Components/Forms/Button.php @@ -13,7 +13,6 @@ class Button extends Component */ public function __construct( public bool $disabled = false, - public bool $isModal = false, public bool $noStyle = false, public ?string $modalId = null, public string $defaultClass = "button" diff --git a/database/migrations/2024_03_22_080914_remove_popup_notifications.php b/database/migrations/2024_03_22_080914_remove_popup_notifications.php new file mode 100644 index 000000000..ccb270093 --- /dev/null +++ b/database/migrations/2024_03_22_080914_remove_popup_notifications.php @@ -0,0 +1,30 @@ +dropColumn('is_notification_sponsorship_enabled'); + $table->dropColumn('is_notification_notifications_enabled'); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table) { + $table->boolean('is_notification_sponsorship_enabled')->default(true); + $table->boolean('is_notification_notifications_enabled')->default(true); + }); + } +}; diff --git a/resources/css/app.css b/resources/css/app.css index a3fc32386..d3ac514e6 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -84,7 +84,7 @@ input { } .input { - @apply block w-full py-1.5 rounded border-0 text-sm ring-inset ring-1 dark:bg-coolgray-100 dark:text-white text-black focus:ring-2 dark:focus:ring-coolgray-300 dark:ring-coolgray-300 dark:read-only:text-neutral-500 dark:read-only:ring-0 dark:read-only:bg-coolgray-100/40 dark:placeholder:text-neutral-700; + @apply block w-full py-1.5 pr-[2.8rem] rounded border-0 text-sm ring-inset ring-1 dark:bg-coolgray-100 dark:text-white text-black focus:ring-2 dark:focus:ring-coolgray-300 dark:ring-coolgray-300 dark:read-only:text-neutral-500 dark:read-only:ring-0 dark:read-only:bg-coolgray-100/40 dark:placeholder:text-neutral-700; } option { @@ -100,7 +100,7 @@ .alert-error { } .dropdown-item { - @apply relative flex cursor-pointer select-none dark:hover:text-white dark:hover:bg-coollabs items-center pr-4 pl-2 py-1 text-xs justify-center outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 gap-2 w-full; + @apply relative flex cursor-pointer select-none dark:text-white dark:hover:bg-coollabs items-center pr-4 pl-2 py-1 text-xs justify-start outline-none transition-colors data-[disabled]:pointer-events-none data-[disabled]:opacity-50 gap-2 w-full; } .badge { diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 919765f6c..82ea5062b 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -5,7 +5,7 @@ Coolify
+ class="w-full bg-white shadow md:mt-0 sm:max-w-md xl:p-0 dark:bg-base ">
@csrf @@ -15,6 +15,7 @@ class="w-full bg-white rounded shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dar + {{ __('auth.forgot_password') }}? @@ -28,8 +29,7 @@ class="w-full bg-white rounded shadow dark:border md:mt-0 sm:max-w-md xl:p-0 dar @endenv {{ __('auth.login') }} @if ($is_registration_enabled) - + {{ __('auth.register_now') }} @endif diff --git a/resources/views/components/applications/links.blade.php b/resources/views/components/applications/links.blade.php index dc067dfe6..bd82f75a1 100644 --- a/resources/views/components/applications/links.blade.php +++ b/resources/views/components/applications/links.blade.php @@ -3,15 +3,15 @@ }" class="relative" @click.outside="dropdownOpen = false">
+ class="relative z-[999] w-full py-2 mx-auto duration-100 ease-out shadow-sm bg-coolgray-100 sm:py-0 sm:h-14" x-cloak>
{{ $slot }} @if ($closable) diff --git a/resources/views/components/forms/button.blade.php b/resources/views/components/forms/button.blade.php index f1c869217..f91a53b77 100644 --- a/resources/views/components/forms/button.blade.php +++ b/resources/views/components/forms/button.blade.php @@ -6,14 +6,10 @@ @isset($confirmAction) x-on:{{ explode('(', $confirmAction)[0] }}.window="$wire.{{ explode('(', $confirmAction)[0] }}" @endisset - @if ($isModal) onclick="{{ $modalId }}.showModal()" @endif> + > {{ $slot }} - @if ($attributes->get('type') === 'submit') - - @else - @if ($attributes->whereStartsWith('wire:click')->first()) - - @endif + @if ($attributes->whereStartsWith('wire:click')->first() && $attributes->get('type') === 'submit') + @endif diff --git a/resources/views/components/forms/input.blade.php b/resources/views/components/forms/input.blade.php index 11d1cf0db..8f4c38edf 100644 --- a/resources/views/components/forms/input.blade.php +++ b/resources/views/components/forms/input.blade.php @@ -25,12 +25,12 @@ class="absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer hover:te
@endif - merge(['class' => $defaultClass]) }} @required($required) + merge(['class' => $defaultClass]) }} @required($required) @if ($id !== 'null') wire:model={{ $id }} @endif - wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300' wire:dirty.class="dark:focus:ring-warning dark:ring-warning" - wire:loading.attr="disabled" type="{{ $type }}" @readonly($readonly) @disabled($disabled) - id="{{ $id }}" name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}" + wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300' + wire:dirty.class="dark:focus:ring-warning dark:ring-warning" wire:loading.attr="disabled" + type="{{ $type }}" @readonly($readonly) @disabled($disabled) id="{{ $id }}" + name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}" aria-placeholder="{{ $attributes->get('placeholder') }}">
@@ -38,8 +38,9 @@ class="absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer hover:te merge(['class' => $defaultClass]) }} @required($required) @readonly($readonly) @if ($id !== 'null') wire:model={{ $id }} @endif - wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300' wire:dirty.class="dark:focus:ring-warning dark:ring-warning" - wire:loading.attr="disabled" type="{{ $type }}" @disabled($disabled) + wire:dirty.class.remove='dark:focus:ring-coolgray-300 dark:ring-coolgray-300' + wire:dirty.class="dark:focus:ring-warning dark:ring-warning" wire:loading.attr="disabled" + type="{{ $type }}" @disabled($disabled) @if ($id !== 'null') id={{ $id }} @endif name="{{ $name }}" placeholder="{{ $attributes->get('placeholder') }}"> @endif diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php index 9652edbc7..e4ac66c17 100644 --- a/resources/views/components/modal-confirmation.blade.php +++ b/resources/views/components/modal-confirmation.blade.php @@ -2,6 +2,7 @@ 'title' => 'Are you sure?', 'buttonTitle' => 'Open Modal', 'isErrorButton' => false, + 'buttonFullWidth' => false, 'disabled' => false, 'action' => 'delete', 'content' => null, @@ -14,17 +15,35 @@ class="relative w-auto h-auto">
@else @if ($disabled) - - {{ $buttonTitle }} - + @if ($buttonFullWidth) + + {{ $buttonTitle }} + + @else + + {{ $buttonTitle }} + + @endif @elseif ($isErrorButton) - - {{ $buttonTitle }} - + @if ($buttonFullWidth) + + {{ $buttonTitle }} + + @else + + {{ $buttonTitle }} + + @endif @else - - {{ $buttonTitle }} - + @if ($buttonFullWidth) + + {{ $buttonTitle }} + + @else + + {{ $buttonTitle }} + + @endif @endif @endif