File tree 5 files changed +20
-7
lines changed
5 files changed +20
-7
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ public function new_server()
20
20
}
21
21
$ servers = auth ()->user ()->currentTeam ()->servers ->count ();
22
22
$ subscription = auth ()->user ()->currentTeam ()?->subscription->type ();
23
- $ limits = config ('constants.limits.server ' )[strtolower ($ subscription )];
24
- $ limit_reached = true ?? $ servers >= $ limits [ $ subscription ] ;
23
+ $ your_limit = config ('constants.limits.server ' )[strtolower ($ subscription )];
24
+ $ limit_reached = $ servers >= $ your_limit ;
25
25
26
26
return view ('server.create ' , [
27
27
'limit_reached ' => $ limit_reached ,
Original file line number Diff line number Diff line change @@ -46,6 +46,6 @@ public function set_destination(string $destination_uuid)
46
46
47
47
public function load_servers ()
48
48
{
49
- $ this ->servers = Server::ownedByCurrentTeam ()->get ();
49
+ $ this ->servers = Server::isUsable ()->get ();
50
50
}
51
51
}
Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ static public function isReachable()
33
33
34
34
static public function ownedByCurrentTeam (array $ select = ['* ' ])
35
35
{
36
+ $ teamId = auth ()->user ()->currentTeam ()->id ;
36
37
$ selectArray = collect ($ select )->concat (['id ' ]);
37
- return Server::whereTeamId (auth ()-> user ()-> currentTeam ()-> id )->with ('settings ' )->select ($ selectArray ->all ())->orderBy ('name ' );
38
+ return Server::whereTeamId ($ teamId )->with ('settings ' )->select ($ selectArray ->all ())->orderBy ('name ' );
38
39
}
39
40
40
41
static public function isUsable ()
Original file line number Diff line number Diff line change 80
80
<li class =" step" >Select a Destination</li >
81
81
</ul >
82
82
<div class =" flex flex-col justify-center gap-2 text-left xl:flex-row" >
83
- @foreach ($servers as $server )
83
+ @forelse ($servers as $server )
84
84
<div class =" gap-2 py-4 cursor-pointer group hover:bg-coollabs bg-coolgray-200"
85
85
wire:click =" set_server({{ $server } } )" >
86
86
<div class =" flex flex-col mx-6" >
91
91
{{ $server -> description } } </div >
92
92
</div >
93
93
</div >
94
- @endforeach
94
+ @empty
95
+ <div >
96
+ <div >No validated & reachable servers found. <a class =" text-white underline" href =" /servers" >
97
+ Go to servers page
98
+ </a ></div >
99
+
100
+ <x-use-magic-bar link =" /server/new" />
101
+ </div >
102
+ @endforelse
95
103
</div >
96
104
@endif
97
105
@if ($current_step === ' destinations' )
Original file line number Diff line number Diff line change 1
1
<x-layout >
2
- <h1 >Servers</span ></h1 >
2
+ <div class =" flex items-start gap-2" >
3
+ <h1 >Servers</h1 >
4
+ <a class =" text-white hover:no-underline" href =" /server/new" > <x-forms .button class =" btn" >+ Add
5
+ </x-forms .button ></a >
6
+ </div >
3
7
<div class =" subtitle " >All Servers</div >
4
8
<div class =" grid gap-2 lg:grid-cols-2" >
5
9
@forelse ($servers as $server )
You can’t perform that action at this time.
0 commit comments