forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b941f35
commit e4279bf
Showing
17 changed files
with
189 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use App\Models\PrivateKey; | ||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests; | ||
use Illuminate\Foundation\Validation\ValidatesRequests; | ||
|
||
class ServerController extends Controller | ||
{ | ||
use AuthorizesRequests, ValidatesRequests; | ||
|
||
public function new_server() | ||
{ | ||
$servers = auth()->user()->currentTeam()->servers->count(); | ||
$subscription = auth()->user()->currentTeam()->subscription->type(); | ||
$limits = config('constants.limits.server')[strtolower($subscription)]; | ||
$limit_reached = true ?? $servers >= $limits[$subscription]; | ||
return view('server.create', [ | ||
'limit_reached' => $limit_reached, | ||
'private_keys' => PrivateKey::ownedByCurrentTeam()->get(), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div class="flex flex-col items-center justify-center h-screen"> | ||
<span class="text-xl font-bold text-white">You have reached the limit of {{ $name }} you can create.</span> | ||
<span>Please <a class="text-white underline "href="{{ route('team.show') }}">upgrade your | ||
subscription<a /> to create more | ||
{{ $name }}.</span> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,34 @@ | ||
<div> | ||
<h1>Create a new Server</h1> | ||
<div class="subtitle ">Servers are the main blocks of your infrastructure.</div> | ||
<form class="flex flex-col gap-2" wire:submit.prevent='submit'> | ||
<div class="flex gap-2"> | ||
<x-forms.input id="name" label="Name" required /> | ||
<x-forms.input id="description" label="Description" /> | ||
</div> | ||
<div class="flex gap-2"> | ||
<x-forms.input id="ip" label="IP Address" required | ||
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." /> | ||
<x-forms.input id="user" label="User" required /> | ||
<x-forms.input type="number" id="port" label="Port" required /> | ||
</div> | ||
<x-forms.select label="Private Key" id="private_key_id"> | ||
<option disabled>Select a private key</option> | ||
@foreach ($private_keys as $key) | ||
@if ($loop->first) | ||
<option selected value="{{ $key->id }}">{{ $key->name }}</option> | ||
@else | ||
<option value="{{ $key->id }}">{{ $key->name }}</option> | ||
@endif | ||
@endforeach | ||
</x-forms.select> | ||
<x-forms.button type="submit"> | ||
Save New Server | ||
</x-forms.button> | ||
</form> | ||
@if ($limit_reached) | ||
<x-limit-reached name="servers" /> | ||
@else | ||
<h1>Create a new Server</h1> | ||
<div class="subtitle ">Servers are the main blocks of your infrastructure.</div> | ||
<form class="flex flex-col gap-2" wire:submit.prevent='submit'> | ||
<div class="flex gap-2"> | ||
<x-forms.input id="name" label="Name" required /> | ||
<x-forms.input id="description" label="Description" /> | ||
</div> | ||
<div class="flex gap-2"> | ||
<x-forms.input id="ip" label="IP Address" required | ||
helper="Could be IP Address (127.0.0.1) or Domain Name (duckduckgo.com)." /> | ||
<x-forms.input id="user" label="User" required /> | ||
<x-forms.input type="number" id="port" label="Port" required /> | ||
</div> | ||
<x-forms.select label="Private Key" id="private_key_id"> | ||
<option disabled>Select a private key</option> | ||
@foreach ($private_keys as $key) | ||
@if ($loop->first) | ||
<option selected value="{{ $key->id }}">{{ $key->name }}</option> | ||
@else | ||
<option value="{{ $key->id }}">{{ $key->name }}</option> | ||
@endif | ||
@endforeach | ||
</x-forms.select> | ||
<x-forms.button type="submit"> | ||
Save New Server | ||
</x-forms.button> | ||
</form> | ||
|
||
@endif | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters