Skip to content

Commit

Permalink
Big UI Update (#104)
Browse files Browse the repository at this point in the history
* add tailwindcss

* vue update to tailwindcss

* vue update to tailwindcss

* update tailwind

* update tailwind

* update tailwind

* update tailwind

* update submit buttons

* update styles

* set package.json

* style changes

* add file-manager

* update styles

* update styles

* spa update

* spa dedicated servers

* spa update

* spa update

* spa admin games

* spa admin users

* spa admin nodes

* spa update ui

* spa admin daemon tasks

* spa gameap daemon tasks

* spa tokens

* spa small updates

* spa small updates

* spa login

* spa update icons

* spa updates and fixes

* spa content updates

* spa fixes

* remove composer.lock

* remove unused controllers and views

* spa fixes

* remove irrelevant tests

* update routes

* fix routes

* fix tests

* update tests

* update login browser test

* fixes and updates

* update consoles

* update consoles

* remove browser test

* update console components

* ui updates

* ui responsive design updates

* add permission test

* update permissions tests

* update permissions tests

* update permissions tests

* update permissions tests

* update permissions tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests, update phpunit

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* trying to fix permission tests

* updates
  • Loading branch information
et-nik authored May 26, 2024
1 parent 6890af0 commit 41eb0d9
Show file tree
Hide file tree
Showing 407 changed files with 30,337 additions and 26,192 deletions.
14 changes: 7 additions & 7 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ steps:
- composer install --no-ansi
- touch composer_installed

- name: npm
image: node:20
commands:
- node --version
- npm install
- npm run prod

- name: tests-php-7.3
image: knik/php:7.3-fpm-stretch
environment:
Expand Down Expand Up @@ -129,6 +122,13 @@ steps:
- rm -rf storage/logs/*
- rm .env

- name: npm
image: node:20
commands:
- node --version
- npm install
- npm run prod

- name: browser-tests
image: knik/php:7.3-fpm-buster
environment:
Expand Down
1 change: 0 additions & 1 deletion app/Exceptions/GdaemonAPI/InvalidApiKeyException.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ public function getHeaders()
{
return [];
}

}
16 changes: 16 additions & 0 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Response;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

class Handler extends ExceptionHandler
{
Expand Down Expand Up @@ -46,13 +48,27 @@ private function renderJson($request, \Throwable $exception)
}
}

if ($exception instanceof HttpExceptionInterface) {
return response()->json([
'message' => $exception->getMessage(),
'http_code' => $exception->getStatusCode(),
], $exception->getStatusCode(), $exception->getHeaders());
}

if ($exception instanceof \Symfony\Component\HttpKernel\Exception\HttpException) {
return response()->json([
'message' => $exception->getMessage(),
'http_code' => $exception->getStatusCode(),
], $exception->getStatusCode(), $exception->getHeaders());
}

if ($exception instanceof \Illuminate\Auth\Access\AuthorizationException) {
return response()->json([
'message' => $exception->getMessage(),
'http_code' => Response::HTTP_FORBIDDEN,
], Response::HTTP_FORBIDDEN);
}

return parent::render($request, $exception);
}
}
17 changes: 16 additions & 1 deletion app/Exceptions/Http/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,22 @@
namespace Gameap\Exceptions\Http;

use Gameap\Exceptions\GameapException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;

class HttpException extends GameapException
class HttpException extends GameapException implements HttpExceptionInterface
{
public $statusCode = Response::HTTP_INTERNAL_SERVER_ERROR;

public $headers = [];

public function getStatusCode()
{
return $this->statusCode;
}

public function getHeaders()
{
return $this->headers;
}
}
19 changes: 19 additions & 0 deletions app/Exceptions/Repositories/InvalidCertificateException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

namespace Gameap\Exceptions\Repositories;

use Gameap\Exceptions\Http\HttpException;
use Illuminate\Http\Response;

class InvalidCertificateException extends HttpException
{
public function getStatusCode()
{
return Response::HTTP_UNPROCESSABLE_ENTITY;
}

public function getHeaders()
{
return [];
}
}
57 changes: 57 additions & 0 deletions app/Http/Controllers/API/AuthController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php

namespace Gameap\Http\Controllers\API;

use Gameap\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;

class AuthController extends Controller
{
use AuthenticatesUsers;

/**
* @var Request
*/
protected $request;

/**
* The maximum number of attempts to allow.
* @var int
*/
protected $maxAttempts = 5;

/**
* Number of minutes to throttle for.
*
* @var int
*/
protected $decayMinutes = 3;

/**
* Create a new controller instance.
*
* @param \Illuminate\Http\Request $request
* @return void
*/
public function __construct(Request $request)
{
$this->request = $request;
}

/**
* Get the login username to be used by the controller.
*
* @return string
*/
public function username()
{
$field = filter_var($this->request->get('login'), FILTER_VALIDATE_EMAIL)
? 'email'
: 'login';

$this->request->merge([$field => $this->request->get('login')]);

return $field;
}
}
65 changes: 65 additions & 0 deletions app/Http/Controllers/API/ClientCertificatesController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Gameap\Http\Controllers\API;

use Gameap\Http\Controllers\AuthController;
use Gameap\Http\Requests\ClientCertificatesRequest;
use Gameap\Models\ClientCertificate;
use Gameap\Repositories\ClientCertificateRepository;

class ClientCertificatesController extends AuthController
{
/**
* The ClientCertificateRepository instance.
*
* @var \Gameap\Repositories\ClientCertificateRepository
*/
protected $repository;

/**
* Create a new ClientCertificatesController instance.
*
* @param \Gameap\Repositories\ClientCertificateRepository $repository
*/
public function __construct(ClientCertificateRepository $repository)
{
parent::__construct();

$this->repository = $repository;
}

/**
* Display a listing of the resource.
*
* @return \Illuminate\View\View
*/
public function list()
{
$clientCertificates = $this->repository->getAll(99999);

return $clientCertificates->map(function ($item) {
return $item->only([
'id',
'fingerprint',
'expires',
'info',
]);
});
}

public function store(ClientCertificatesRequest $request)
{
$this->repository->store($request);

return ['message' => 'success'];
}

public function destroy($id)
{
$clientCertificate = $this->repository->findById($id);

$this->repository->destroy($clientCertificate);

return ['message' => 'success'];
}
}
Loading

0 comments on commit 41eb0d9

Please sign in to comment.