From 9ad6ce5851c721da9d1fcae171daed48bec05d6b Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 25 Mar 2024 11:33:38 +0100 Subject: [PATCH] ui ui ui ui --- .../Project/Service/Configuration.php | 24 +++++++++++ app/Models/ServiceApplication.php | 5 +++ app/Models/ServiceDatabase.php | 5 +++ resources/css/app.css | 4 +- resources/views/components/helper.blade.php | 2 +- .../components/modal-confirmation.blade.php | 8 ++-- resources/views/components/navbar.blade.php | 25 +++++------ .../views/components/slide-over.blade.php | 2 +- resources/views/livewire/dashboard.blade.php | 1 - .../livewire/destination/new/docker.blade.php | 2 +- .../views/livewire/destination/show.blade.php | 12 ++---- .../project/add-environment.blade.php | 4 +- .../database/backup/execution.blade.php | 10 ----- .../project/database/backup/index.blade.php | 22 ++-------- .../project/database/configuration.blade.php | 10 ----- .../create-scheduled-backup.blade.php | 4 +- .../project/database/heading.blade.php | 2 +- .../database/postgresql/general.blade.php | 26 +++++------- .../database/scheduled-backups.blade.php | 18 ++++---- .../views/livewire/project/edit.blade.php | 19 ++++----- .../project/environment-edit.blade.php | 14 ++----- .../views/livewire/project/index.blade.php | 2 +- .../project/service/configuration.blade.php | 33 ++++++--------- .../livewire/project/service/index.blade.php | 11 ++--- .../project/service/stack-form.blade.php | 12 ++---- .../project/service/storage.blade.php | 10 ++--- .../shared/environment-variable/add.blade.php | 4 +- .../shared/environment-variable/all.blade.php | 10 ++--- .../shared/scheduled-task/add.blade.php | 4 +- .../shared/scheduled-task/all.blade.php | 31 ++++++-------- .../project/shared/storages/add.blade.php | 2 +- .../views/livewire/project/show.blade.php | 13 ++---- .../dynamic-configuration-navbar.blade.php | 13 ++---- .../proxy/dynamic-configurations.blade.php | 17 ++++---- .../proxy/new-dynamic-configuration.blade.php | 4 +- .../server/show-private-key.blade.php | 21 ++++------ .../livewire/source/github/create.blade.php | 42 +++++++++---------- .../team-shared-variables-index.blade.php | 11 ++--- .../livewire/team/storage/index.blade.php | 11 ++--- .../security/private-key/index.blade.php | 11 ++--- resources/views/source/all.blade.php | 11 ++--- 41 files changed, 203 insertions(+), 289 deletions(-) diff --git a/app/Livewire/Project/Service/Configuration.php b/app/Livewire/Project/Service/Configuration.php index eb72c803c..cdedb3f8e 100644 --- a/app/Livewire/Project/Service/Configuration.php +++ b/app/Livewire/Project/Service/Configuration.php @@ -36,6 +36,30 @@ public function mount() $this->applications = $this->service->applications->sort(); $this->databases = $this->service->databases->sort(); } + public function restartApplication($id) + { + try { + $application = $this->service->applications->find($id); + if ($application) { + $application->restart(); + $this->dispatch('success', 'Application restarted successfully.'); + } + } catch (\Exception $e) { + return handleError($e, $this); + } + } + public function restartDatabase($id) + { + try { + $database = $this->service->databases->find($id); + if ($database) { + $database->restart(); + $this->dispatch('success', 'Database restarted successfully.'); + } + } catch (\Exception $e) { + return handleError($e, $this); + } + } public function check_status() { try { diff --git a/app/Models/ServiceApplication.php b/app/Models/ServiceApplication.php index 37f7d9c9c..820ef6fee 100644 --- a/app/Models/ServiceApplication.php +++ b/app/Models/ServiceApplication.php @@ -19,6 +19,11 @@ protected static function booted() $service->fileStorages()->delete(); }); } + public function restart() + { + $container_id = $this->name . '-' . $this->service->uuid; + instant_remote_process(["docker restart {$container_id}"], $this->service->server); + } public function isLogDrainEnabled() { return data_get($this, 'is_log_drain_enabled', false); diff --git a/app/Models/ServiceDatabase.php b/app/Models/ServiceDatabase.php index 9375fe807..9e9e9d202 100644 --- a/app/Models/ServiceDatabase.php +++ b/app/Models/ServiceDatabase.php @@ -17,6 +17,11 @@ protected static function booted() $service->fileStorages()->delete(); }); } + public function restart() + { + $container_id = $this->name . '-' . $this->service->uuid; + remote_process(["docker restart {$container_id}"], $this->service->server); + } public function isLogDrainEnabled() { return data_get($this, 'is_log_drain_enabled', false); diff --git a/resources/css/app.css b/resources/css/app.css index efeb4af7c..f03e7e850 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -41,7 +41,7 @@ option { } .button { - @apply flex items-center justify-center gap-2 px-3 py-1 text-sm font-normal normal-case rounded cursor-pointer bg-neutral-200 hover:bg-neutral-300 dark:bg-coolgray-200 dark:text-white dark:hover:bg-coolgray-100 dark:hover:dark:text-white dark:disabled:bg-coolgray-100/40 dark:disabled:text-neutral-800 min-w-fit hover:dark:text-white focus-visible:outline-none; + @apply flex items-center justify-center gap-2 px-3 py-1 text-sm font-normal normal-case rounded cursor-pointer bg-neutral-200 hover:bg-neutral-300 dark:bg-coolgray-200 dark:text-white dark:hover:bg-coolgray-100 dark:hover:dark:text-white dark:disabled:bg-coolgray-100/40 dark:disabled:text-neutral-800 disabled:bg-neutral-100 disabled:text-neutral-200 disabled:cursor-not-allowed min-w-fit hover:dark:text-white focus:outline-1 ; } button[isError]:not(:disabled) { @@ -195,7 +195,7 @@ .on-box { } .box-without-bg { - @apply flex p-2 transition-colors dark:hover:text-white hover:no-underline min-h-[4rem] dark:border-black border-neutral-200; + @apply flex p-2 transition-colors dark:hover:text-white hover:no-underline min-h-[4rem]; } .box-title { diff --git a/resources/views/components/helper.blade.php b/resources/views/components/helper.blade.php index 378892b85..43c49491d 100644 --- a/resources/views/components/helper.blade.php +++ b/resources/views/components/helper.blade.php @@ -1,4 +1,4 @@ -
+
merge(['class' => "group"]) }}>
@else @if ($disabled) @if ($buttonFullWidth) - + {{ $buttonTitle }} @else - + {{ $buttonTitle }} @endif @@ -36,11 +36,11 @@ class="relative w-auto h-auto"> @endif @else @if ($buttonFullWidth) - + {{ $buttonTitle }} @else - + {{ $buttonTitle }} @endif diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index 6ecc2e70b..3c90651dd 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -57,18 +57,7 @@ class="{{ request()->is('server/*') || request()->is('servers') ? 'menu-item men Servers -
  • - - - - - Security - -
  • +
  • + + + + Keys & Tokens + +
  • + class="fixed inset-0 dark:bg-black/60 backdrop-blur-sm">
  • diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php index bab6156ec..a53b06882 100644 --- a/resources/views/livewire/dashboard.blade.php +++ b/resources/views/livewire/dashboard.blade.php @@ -20,7 +20,6 @@
    @foreach ($projects as $project)
    - @if (data_get($project, 'environments')->count() === 1) diff --git a/resources/views/livewire/destination/new/docker.blade.php b/resources/views/livewire/destination/new/docker.blade.php index 894ed2cb1..d05218def 100644 --- a/resources/views/livewire/destination/new/docker.blade.php +++ b/resources/views/livewire/destination/new/docker.blade.php @@ -1,4 +1,4 @@ -
    +
    Destinations are used to segregate resources by network.
    diff --git a/resources/views/livewire/destination/show.blade.php b/resources/views/livewire/destination/show.blade.php index a73c8aceb..ecc68dc5c 100644 --- a/resources/views/livewire/destination/show.blade.php +++ b/resources/views/livewire/destination/show.blade.php @@ -2,15 +2,9 @@ @if ($server->isFunctional())

    Destinations

    - - New Destination - - - - - - + + + Scan Destinations
    Destinations are used to segregate resources by network.
    diff --git a/resources/views/livewire/project/add-environment.blade.php b/resources/views/livewire/project/add-environment.blade.php index 80a1047b6..01b56102a 100644 --- a/resources/views/livewire/project/add-environment.blade.php +++ b/resources/views/livewire/project/add-environment.blade.php @@ -1,5 +1,5 @@ - - + + Save diff --git a/resources/views/livewire/project/database/backup/execution.blade.php b/resources/views/livewire/project/database/backup/execution.blade.php index f63ed2be7..9a9a8733c 100644 --- a/resources/views/livewire/project/database/backup/execution.blade.php +++ b/resources/views/livewire/project/database/backup/execution.blade.php @@ -1,16 +1,6 @@

    Backups

    - - - - - - - Close - - -
    diff --git a/resources/views/livewire/project/database/backup/index.blade.php b/resources/views/livewire/project/database/backup/index.blade.php index 3538c6688..e26a28c3a 100644 --- a/resources/views/livewire/project/database/backup/index.blade.php +++ b/resources/views/livewire/project/database/backup/index.blade.php @@ -1,28 +1,12 @@

    Backups

    - - - - - - - - Close - - -

    Scheduled Backups

    - - New Scheduled Backup - - - - - + + +
    diff --git a/resources/views/livewire/project/database/configuration.blade.php b/resources/views/livewire/project/database/configuration.blade.php index 1cb43d939..725fb1233 100644 --- a/resources/views/livewire/project/database/configuration.blade.php +++ b/resources/views/livewire/project/database/configuration.blade.php @@ -1,16 +1,6 @@

    Configuration

    - - - - - - - Close - - -
    - + + @if ($s3s->count() === 0) diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php index ada627c19..f4eadd6bf 100644 --- a/resources/views/livewire/project/database/heading.blade.php +++ b/resources/views/livewire/project/database/heading.blade.php @@ -3,7 +3,7 @@ Database Startup Logs - +