Skip to content

Commit

Permalink
fix: ui + subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Aug 14, 2023
1 parent 619d395 commit b941f35
Show file tree
Hide file tree
Showing 32 changed files with 185 additions and 114 deletions.
3 changes: 3 additions & 0 deletions app/Actions/License/CheckResaleLicense.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ public function __invoke()
$settings->update([
'is_resale_license_active' => false,
]);
if (is_dev()) {
return;
}
if (!$settings->resale_license) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Livewire/Settings/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Backup extends Component
{
public InstanceSettings $settings;
public $s3s;
public StandalonePostgresql|null $database = null;
public ScheduledDatabaseBackup|null $backup = null;
public StandalonePostgresql|null|array $database = [];
public ScheduledDatabaseBackup|null|array $backup = [];
public $executions = [];

protected $rules = [
Expand All @@ -36,8 +36,8 @@ class Backup extends Component

public function mount()
{
$this->backup = $this->database->scheduledBackups->first();
$this->executions = $this->backup->executions;
$this->backup = $this->database?->scheduledBackups->first() ?? [];
$this->executions = $this->backup?->executions ?? [];
}
public function add_coolify_database()
{
Expand Down
4 changes: 2 additions & 2 deletions bootstrap/helpers/subscriptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

use Illuminate\Support\Carbon;

function getSubscriptionLink($id)
function getSubscriptionLink($type)
{
$checkout_id = config("coolify.lemon_squeezy_checkout_id_$id");
$checkout_id = config("coolify.lemon_squeezy_checkout_id_$type");
if (!$checkout_id) {
return null;
}
Expand Down
5 changes: 2 additions & 3 deletions config/coolify.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
'self_hosted' => env('SELF_HOSTED', true),
'license_url' => 'https://license.coolify.io',
'lemon_squeezy_webhook_secret' => env('LEMON_SQUEEZY_WEBHOOK_SECRET'),
'lemon_squeezy_checkout_id_1' => env('LEMON_SQUEEZY_CHECKOUT_ID_1'),
'lemon_squeezy_checkout_id_2' => env('LEMON_SQUEEZY_CHECKOUT_ID_2'),
'lemon_squeezy_checkout_id_3' => env('LEMON_SQUEEZY_CHECKOUT_ID_3'),
'lemon_squeezy_checkout_id_monthly' => env('LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY'),
'lemon_squeezy_checkout_id_yearly' => env('LEMON_SQUEEZY_CHECKOUT_ID_YEARLY'),
'mux_enabled' => env('MUX_ENABLED', true),
'dev_webhook' => env('SERVEO_URL'),
'base_config_path' => env('BASE_CONFIG_PATH', '/_data/coolify'),
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@ services:
- PHP_PM_MAX_SPARE_SERVERS=10
- SELF_HOSTED
- LEMON_SQUEEZY_WEBHOOK_SECRET
- LEMON_SQUEEZY_CHECKOUT_ID_1
- LEMON_SQUEEZY_CHECKOUT_ID_2
- LEMON_SQUEEZY_CHECKOUT_ID_3
- LEMON_SQUEEZY_CHECKOUT_ID_MONTHLY
- LEMON_SQUEEZY_CHECKOUT_ID_YEARLY
ports:
- "${APP_PORT:-8000}:80"
expose:
Expand Down
5 changes: 4 additions & 1 deletion resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,5 +111,8 @@ tr td:first-child {
}

.buyme {
@apply block px-3 py-2 mt-10 text-sm font-semibold leading-6 text-center text-white rounded-md shadow-sm bg-coolgray-200 hover:bg-coolgray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-coolgray-200;
@apply block px-3 py-2 mt-10 text-sm font-semibold leading-6 text-center text-white rounded-md shadow-sm bg-coolgray-200 hover:bg-coolgray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-coolgray-200 hover:no-underline;
}
.subtitle {
@apply pt-2 pb-10;
}
6 changes: 3 additions & 3 deletions resources/views/command-center.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<x-layout>
<h1>Command Center</h1>
<div class="pt-2 pb-10">Execute commands on your servers without leaving the browser.</div>
<div class="subtitle">Execute commands on your servers without leaving the browser.</div>
@if ($servers->count() > 0)
<livewire:run-command :servers="$servers" />
@else
<div>
<div>No validated servers found.</div>
<x-use-magic-bar />
<div>No servers found. Without a server, you won't be able to do much.</div>
<x-use-magic-bar link="/server/new" />
</div>
@endif
</x-layout>
82 changes: 40 additions & 42 deletions resources/views/components/navbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,48 @@ class="{{ request()->is('project/*') || request()->is('projects') ? 'text-warnin
</svg>
</a>
</li>


<li title="Command Center">
<a class="hover:bg-transparent" @if (!request()->is('command-center')) href="/command-center" @endif>
<svg xmlns="http://www.w3.org/2000/svg"
class="{{ request()->is('command-center') ? 'text-warning icon' : 'icon' }}" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M5 7l5 5l-5 5" />
<path d="M12 19l7 0" />
</svg>
</a>
</li>
<div class="flex-1"></div>
@if (auth()->user()->isInstanceAdmin())
<li title="Command Center">
<a class="hover:bg-transparent" @if (!request()->is('command-center')) href="/command-center" @endif>
<svg xmlns="http://www.w3.org/2000/svg"
class="{{ request()->is('command-center') ? 'text-warning icon' : 'icon' }}" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M5 7l5 5l-5 5" />
<path d="M12 19l7 0" />
</svg>
</a>
</li>

<li title="Profile">
<a class="hover:bg-transparent" @if (!request()->is('profile')) href="/profile" @endif>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
<path d="M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" />
<path d="M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855" />
</svg>
</a>
</li>
<li title="Teams">
<a class="hover:bg-transparent" href="{{ route('team.show') }}">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1" />
<path d="M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M17 10h2a2 2 0 0 1 2 2v1" />
<path d="M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M3 13v-1a2 2 0 0 1 2 -2h2" />
</svg>
</a>
</li>
<livewire:upgrade />
<div class="flex-1"></div>
@endif
<li title="Profile">
<a class="hover:bg-transparent" @if (!request()->is('profile')) href="/profile" @endif>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0" />
<path d="M12 10m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" />
<path d="M6.168 18.849a4 4 0 0 1 3.832 -2.849h4a4 4 0 0 1 3.834 2.855" />
</svg>
</a>
</li>
<li title="Teams">
<a class="hover:bg-transparent" href="{{ route('team.show') }}">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M10 13a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M8 21v-1a2 2 0 0 1 2 -2h4a2 2 0 0 1 2 2v1" />
<path d="M15 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M17 10h2a2 2 0 0 1 2 2v1" />
<path d="M5 5a2 2 0 1 0 4 0a2 2 0 0 0 -4 0" />
<path d="M3 13v-1a2 2 0 0 1 2 -2h2" />
</svg>
</a>
</li>
@if (auth()->user()->isInstanceAdmin())
<li title="Settings" class="mt-auto">
<a class="hover:bg-transparent" @if (!request()->is('settings')) href="/settings" @endif>
<svg xmlns="http://www.w3.org/2000/svg"
Expand All @@ -95,7 +94,6 @@ class="{{ request()->is('settings*') ? 'text-warning icon' : 'icon' }}" viewBox=
</a>
</li>
@endif

<li class="pb-6" title="Logout">
<form action="/logout" method="POST" class=" hover:bg-transparent">
@csrf
Expand Down
Loading

0 comments on commit b941f35

Please sign in to comment.