This commit is contained in:
Saeed Vaziry
2025-05-15 14:23:26 +03:00
parent a81e9b18b7
commit b8ba83949b
47 changed files with 1536 additions and 980 deletions

View File

@ -11,8 +11,8 @@
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Validation\Rule;
use Inertia\Inertia;
use Inertia\Response;
use Inertia\ResponseFactory;
use Spatie\RouteAttributes\Attributes\Delete;
use Spatie\RouteAttributes\Attributes\Get;
use Spatie\RouteAttributes\Attributes\Middleware;
@ -24,7 +24,7 @@
class ServerController extends Controller
{
#[Get('/', name: 'servers')]
public function index(): Response|ResponseFactory
public function index(): Response
{
$project = user()->currentProject;
@ -32,7 +32,7 @@ public function index(): Response|ResponseFactory
$servers = $project->servers()->simplePaginate(config('web.pagination_size'));
return inertia('servers/index', [
return Inertia::render('servers/index', [
'servers' => ServerResource::collection($servers),
'public_key' => __('servers.create.public_key_text', ['public_key' => get_public_key_content()]),
'server_providers' => ServerProviderResource::collection(ServerProvider::getByProjectId($project->id)->get()),
@ -52,11 +52,11 @@ public function store(Request $request): RedirectResponse
}
#[Get('/{server}', name: 'servers.show')]
public function show(Server $server): Response|ResponseFactory
public function show(Server $server): Response
{
$this->authorize('view', $server);
return inertia('servers/show', [
return Inertia::render('servers/show', [
'server' => ServerResource::make($server),
'logs' => ServerLogResource::collection($server->logs()->latest()->paginate(config('web.pagination_size'))),
]);