From c023fdae8b2270a3c09f4f5931f588ea7d4ee87a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 22 May 2023 22:30:33 +0200 Subject: [PATCH] fixes --- app/Http/Livewire/Profile/Form.php | 35 ++++++ .../Livewire/Project/Application/Deploy.php | 5 - .../Livewire/Project/Application/Status.php | 15 +++ app/Models/User.php | 5 +- resources/css/app.css | 10 +- resources/views/auth/login.blade.php | 18 +-- resources/views/auth/register.blade.php | 2 +- .../components/applications/navbar.blade.php | 6 +- resources/views/components/layout.blade.php | 6 +- .../views/components/naked-modal.blade.php | 2 +- resources/views/components/navbar.blade.php | 105 +----------------- resources/views/dashboard.blade.php | 4 +- .../views/livewire/profile/form.blade.php | 10 ++ .../project/application/danger.blade.php | 2 +- .../project/application/deploy.blade.php | 15 +-- .../environment-variable/add.blade.php | 2 +- .../environment-variable/show.blade.php | 2 +- .../application/poll-deployment.blade.php | 2 +- .../project/application/status.blade.php | 15 +++ .../views/livewire/server/form.blade.php | 46 ++++---- .../livewire/server/private-key.blade.php | 7 +- .../views/livewire/server/proxy.blade.php | 95 ++++++++-------- .../views/livewire/switch-team.blade.php | 3 +- resources/views/profile.blade.php | 9 +- .../application/configuration.blade.php | 13 ++- .../project/application/deployment.blade.php | 13 ++- .../project/application/deployments.blade.php | 13 ++- resources/views/project/resources.blade.php | 17 ++- resources/views/servers.blade.php | 8 +- resources/views/team.blade.php | 9 +- 30 files changed, 251 insertions(+), 243 deletions(-) create mode 100644 app/Http/Livewire/Profile/Form.php create mode 100644 app/Http/Livewire/Project/Application/Status.php create mode 100644 resources/views/livewire/profile/form.blade.php create mode 100644 resources/views/livewire/project/application/status.blade.php diff --git a/app/Http/Livewire/Profile/Form.php b/app/Http/Livewire/Profile/Form.php new file mode 100644 index 000000000..ceefbd4e6 --- /dev/null +++ b/app/Http/Livewire/Profile/Form.php @@ -0,0 +1,35 @@ + 'required', + ]; + public function mount() + { + $this->userId = auth()->user()->id; + $this->name = auth()->user()->name; + $this->email = auth()->user()->email; + } + public function submit() + + { + try { + $this->validate(); + User::where('id', $this->userId)->update([ + 'name' => $this->name, + ]); + } catch (\Throwable $error) { + return generalErrorHandler($error, $this); + } + } +} diff --git a/app/Http/Livewire/Project/Application/Deploy.php b/app/Http/Livewire/Project/Application/Deploy.php index 2a655473e..cc3df7e8b 100644 --- a/app/Http/Livewire/Project/Application/Deploy.php +++ b/app/Http/Livewire/Project/Application/Deploy.php @@ -72,9 +72,4 @@ class Deploy extends Component $this->application->save(); } } - - public function pollingStatus() - { - $this->application->refresh(); - } } diff --git a/app/Http/Livewire/Project/Application/Status.php b/app/Http/Livewire/Project/Application/Status.php new file mode 100644 index 000000000..3f68dc35c --- /dev/null +++ b/app/Http/Livewire/Project/Application/Status.php @@ -0,0 +1,15 @@ +application->refresh(); + } +} diff --git a/app/Models/User.php b/app/Models/User.php index 2df832eeb..768160bce 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -74,15 +74,14 @@ class User extends Authenticatable public function otherTeams() { - $team_id = data_get(session('currentTeam'), 'id'); - + $team_id = session('currentTeam')->id; return auth()->user()->teams->filter(function ($team) use ($team_id) { return $team->id != $team_id; }); } public function resources() { - $team_id = data_get(session('currentTeam'), 'id'); + $team_id = session('currentTeam')->id; $data = Application::where('team_id', $team_id)->get(); return $data; } diff --git a/resources/css/app.css b/resources/css/app.css index f7983c87a..1503638de 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -33,10 +33,10 @@ select { } button[type="button"] { - @apply btn btn-xs btn-ghost no-animation normal-case text-white rounded; + @apply btn btn-xs bg-coolgray-200 no-animation normal-case text-white rounded-none; } button[type="submit"] { - @apply btn btn-xs no-animation normal-case text-white btn-primary rounded; + @apply btn btn-xs no-animation normal-case text-white btn-primary rounded-none; } button[isWarning] { @apply text-error; @@ -58,7 +58,7 @@ a { } main { - @apply h-full w-full min-h-screen px-32 xl:px-10 pt-4 mx-auto max-w-7xl; + @apply h-full w-full pb-10 px-32 xl:px-14 pt-8 mx-auto max-w-screen-xl; } .main-navbar { @apply fixed top-0 left-0 min-h-screen overflow-hidden; @@ -70,7 +70,7 @@ main { @apply text-white; } .box { - @apply flex items-center justify-center text-sm rounded cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; + @apply flex items-center justify-center text-sm rounded-none cursor-pointer h-14 bg-coolgray-200 hover:bg-coollabs-100 hover:text-white p-2 hover:no-underline transition-colors; } .main-menu { @@ -84,7 +84,7 @@ main { @apply min-w-fit px-2 rounded text-center border border-dotted border-primary text-white text-xs; } .magic-input { - @apply input input-sm w-96 placeholder:text-neutral-700 text-sm rounded-none; + @apply input input-sm w-80 xl:w-96 placeholder:text-neutral-700 text-sm rounded-none; } .magic-items { @apply absolute top-12 mt-2 w-[24rem] bg-coolgray-200 rounded z-50; diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 11a58e975..f7e72b629 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,22 +1,23 @@
-
+
Coolify
+
@csrf + @if ($errors->any()) +
+ {{ __('auth.failed') }} +
+ @endif {{ __('auth.login') }} +
- @if ($errors->any()) -
-
    -
  • {{ __('auth.failed') }}
  • -
-
- @endif +
@if ($is_registration_enabled) @@ -25,6 +26,7 @@ @else
{{ __('auth.registration_disabled') }}
@endif +
diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index 884fbdc82..ec30adad6 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -14,7 +14,7 @@ {{ __('auth.register') }} @if ($errors->any()) -
+ + diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index d25f87392..ccba26fe9 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -29,10 +29,10 @@ @auth @endauth +
+ +
-
- -
{{ $slot }}
{{ $message }}
- + Yes No diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index b45da5b14..aa06d00b6 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -59,21 +59,20 @@ @endif - -
- {{-- --}} @endauth diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 8b6808f27..0f521ea31 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -1,6 +1,6 @@

Dashboard

-
- Something useful will be here +
+ Something useful will be here.
diff --git a/resources/views/livewire/profile/form.blade.php b/resources/views/livewire/profile/form.blade.php new file mode 100644 index 000000000..158a7409d --- /dev/null +++ b/resources/views/livewire/profile/form.blade.php @@ -0,0 +1,10 @@ +
+
+
+

Profile

+ Save +
+ + + +
diff --git a/resources/views/livewire/project/application/danger.blade.php b/resources/views/livewire/project/application/danger.blade.php index 66afc3b73..5e5f17724 100644 --- a/resources/views/livewire/project/application/danger.blade.php +++ b/resources/views/livewire/project/application/danger.blade.php @@ -1,5 +1,5 @@

Danger Zone

- Delete this application + Delete this application
diff --git a/resources/views/livewire/project/application/deploy.blade.php b/resources/views/livewire/project/application/deploy.blade.php index 1d1923590..44abfc75d 100644 --- a/resources/views/livewire/project/application/deploy.blade.php +++ b/resources/views/livewire/project/application/deploy.blade.php @@ -2,7 +2,7 @@ @if ($application->status === 'running') - running @else - stopped @endif - - {{-- @if ($application->status === 'running') - Loading current status... - {{ $application->status }} - @else - Loading current status... - {{ $application->status }} - @endif --}} -
diff --git a/resources/views/livewire/project/application/environment-variable/add.blade.php b/resources/views/livewire/project/application/environment-variable/add.blade.php index b966e0249..7e5e85ef8 100644 --- a/resources/views/livewire/project/application/environment-variable/add.blade.php +++ b/resources/views/livewire/project/application/environment-variable/add.blade.php @@ -1,4 +1,4 @@ -
+
diff --git a/resources/views/livewire/project/application/environment-variable/show.blade.php b/resources/views/livewire/project/application/environment-variable/show.blade.php index 4b1a2ff75..8cba3ad1e 100644 --- a/resources/views/livewire/project/application/environment-variable/show.blade.php +++ b/resources/views/livewire/project/application/environment-variable/show.blade.php @@ -1,5 +1,5 @@
- +
diff --git a/resources/views/livewire/project/application/poll-deployment.blade.php b/resources/views/livewire/project/application/poll-deployment.blade.php index c66f96871..27e1c1953 100644 --- a/resources/views/livewire/project/application/poll-deployment.blade.php +++ b/resources/views/livewire/project/application/poll-deployment.blade.php @@ -1,4 +1,4 @@
+ class="flex flex-col-reverse w-full overflow-y-auto border border-solid rounded border-coolgray-300 max-h-[32rem] p-4 mt-4 text-xs text-white">
{{ \App\Actions\CoolifyTask\RunRemoteProcess::decodeOutput($activity) }}
diff --git a/resources/views/livewire/project/application/status.blade.php b/resources/views/livewire/project/application/status.blade.php new file mode 100644 index 000000000..27279fb38 --- /dev/null +++ b/resources/views/livewire/project/application/status.blade.php @@ -0,0 +1,15 @@ +
+ @if ($application->status === 'running') + Loading current status... +
+ + Running +
+ @else + Loading current status... +
+ + Stopped +
+ @endif +
diff --git a/resources/views/livewire/server/form.blade.php b/resources/views/livewire/server/form.blade.php index ef70c569b..c88ae75b3 100644 --- a/resources/views/livewire/server/form.blade.php +++ b/resources/views/livewire/server/form.blade.php @@ -5,7 +5,7 @@

General

Save @if ($server_id !== 0) - + Delete @endif @@ -17,32 +17,32 @@ {{-- --}}
-
+
@if ($server->id === 0) @else - - +
+ + +
@endif
- +

Quick Actions

- + @if ($server->settings->is_validated) Check Connection @else Validate Server @endif - - {{-- Install Docker --}} - + {{-- Install Docker --}}
-
+
@isset($uptime)

Uptime: {{ $uptime }}

@endisset @@ -55,27 +55,25 @@
+ + +
-
Destinations
-
- @foreach ($server->standaloneDockers as $docker) - - {{ data_get($docker, 'network') }} - - @endforeach -
+

Destinations

Add
+
+ @foreach ($server->standaloneDockers as $docker) + + + + @endforeach +
diff --git a/resources/views/livewire/server/private-key.blade.php b/resources/views/livewire/server/private-key.blade.php index 473b3054f..3e15f3dc9 100644 --- a/resources/views/livewire/server/private-key.blade.php +++ b/resources/views/livewire/server/private-key.blade.php @@ -1,6 +1,9 @@ -
+
@forelse ($private_keys as $private_key) - {{ $private_key->name }} +
+ +
@empty

No private keys found

@endforelse diff --git a/resources/views/livewire/server/proxy.blade.php b/resources/views/livewire/server/proxy.blade.php index bf8aff14e..090a0dbd4 100644 --- a/resources/views/livewire/server/proxy.blade.php +++ b/resources/views/livewire/server/proxy.blade.php @@ -2,54 +2,61 @@ @if ($server->settings->is_validated) -
-

Proxy

-
{{ $server->extra_attributes->proxy_status }}
+
+

Proxy

+ @if ($server->extra_attributes->proxy_type) + + Start/Reconfigure Proxy + + Stop + +
+ @if ( + $server->extra_attributes->last_applied_proxy_settings && + $server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings) +
Configuration out of sync.
+ @endif + + +
+ @endif + @if ($server->extra_attributes->proxy_status === 'running') + Loading current status... +
+ + Running +
+ @else + Loading current status... +
+ + Stopped +
+ @endif
+ @if ($server->extra_attributes->proxy_type) -

Actions

-
- @if ( - $server->extra_attributes->last_applied_proxy_settings && - $server->extra_attributes->last_saved_proxy_settings !== $server->extra_attributes->last_applied_proxy_settings) -
Configuration out of sync.
- - Reconfigure - - @endif - @if ($server->extra_attributes->proxy_status !== 'running') - - Start - - @else - Stop - - @endif -
- -
-
-
- -
- @isset($proxy_settings) - @if ($selectedProxy->value === 'TRAEFIK_V2') -
-
-

Configuration

- Save - - Reset Configuration - -
-

traefik.conf

- - - @endif - @endisset +
+
+
+ @isset($proxy_settings) + @if ($selectedProxy->value === 'TRAEFIK_V2') +
+
+

Configuration

+ Save + + Reset Configuration + +
+

traefik.conf

+ + + @endif + @endisset
@else