diff --git a/app/Http/Controllers/Accessories/AccessoriesFilesController.php b/app/Http/Controllers/Accessories/AccessoriesFilesController.php index baf09c66b0..a7eec8a057 100644 --- a/app/Http/Controllers/Accessories/AccessoriesFilesController.php +++ b/app/Http/Controllers/Accessories/AccessoriesFilesController.php @@ -12,6 +12,7 @@ use Illuminate\Support\Facades\Log; use \Illuminate\Contracts\View\View; use \Illuminate\Http\RedirectResponse; use Illuminate\Support\Facades\Response; +use Symfony\Component\HttpFoundation\BinaryFileResponse; class AccessoriesFilesController extends Controller { @@ -104,7 +105,7 @@ class AccessoriesFilesController extends Controller * @param int $accessoryId * @param int $fileId */ - public function show($accessoryId = null, $fileId = null, $download = true) : View | RedirectResponse | Response + public function show($accessoryId = null, $fileId = null, $download = true) : View | RedirectResponse | Response | BinaryFileResponse { Log::debug('Private filesystem is: '.config('filesystems.default')); diff --git a/app/Http/Controllers/Api/ProfileController.php b/app/Http/Controllers/Api/ProfileController.php index fb7335145f..f7f91e094e 100644 --- a/app/Http/Controllers/Api/ProfileController.php +++ b/app/Http/Controllers/Api/ProfileController.php @@ -110,7 +110,7 @@ class ProfileController extends Controller $accessTokenData['id'] = $token->id; $accessTokenData['token'] = $accessToken; $accessTokenData['name'] = $accessTokenName; - return response()->json(Helper::formatStandardApiResponse('success', $accessTokenData, 'Personal access token '.$accessTokenName.' created successfully')); + return response()->json(Helper::formatStandardApiResponse('success', $accessTokenData, trans('account/general.personal_api_keys_success', ['key' => $accessTokenName]))); } return response()->json(Helper::formatStandardApiResponse('error', null, 'Token could not be created.')); diff --git a/resources/lang/en-US/account/general.php b/resources/lang/en-US/account/general.php index 1a9e2c03b8..d99e36df82 100644 --- a/resources/lang/en-US/account/general.php +++ b/resources/lang/en-US/account/general.php @@ -2,10 +2,14 @@ return array( 'personal_api_keys' => 'Personal API Keys', + 'personal_access_token' => 'Personal Access Token', + 'personal_api_keys_success' => 'Personal API Key :key created sucessfully', + 'here_is_api_key' => 'Here is your new personal access token. This is the only time it will be shown so do not lose it! You may now use this token to make API requests.', 'api_key_warning' => 'When generating an API token, be sure to copy it down immediately as they will not be visible to you again.', 'api_base_url' => 'Your API base url is located at:', 'api_base_url_endpoint' => '/<endpoint>', 'api_token_expiration_time' => 'API tokens are set to expire in:', 'api_reference' => 'Please check the API reference to find specific API endpoints and additional API documentation.', 'profile_updated' => 'Account successfully updated', + 'no_tokens' => 'You have not created any personal access tokens.', ); diff --git a/resources/lang/en-US/general.php b/resources/lang/en-US/general.php index 98748282fa..60f9af30e1 100644 --- a/resources/lang/en-US/general.php +++ b/resources/lang/en-US/general.php @@ -552,5 +552,9 @@ return [ ], 'more_info' => 'More Info', 'quickscan_bulk_help' => 'Checking this box will edit the asset record to reflect this new location. Leaving it unchecked will simply note the location in the audit log. Note that if this asset is checked out, it will not change the location of the person, asset or location it is checked out to.', + 'whoops' => 'Whoops!', + 'something_went_wrong' => 'Something went wrong with your request.', + 'close' => 'Close', + 'expires' => 'Expires', ]; diff --git a/resources/views/livewire/personal-access-tokens.blade.php b/resources/views/livewire/personal-access-tokens.blade.php index 8cae9d264c..d4242c7a35 100644 --- a/resources/views/livewire/personal-access-tokens.blade.php +++ b/resources/views/livewire/personal-access-tokens.blade.php @@ -1,62 +1,65 @@
-
-
-
- + -
+
@if($tokens->count() === 0) -

- You have not created any personal access tokens. +

+ {{ trans('account/general.no_tokens') }}

@endif - +
+
@if($tokens->count() > 0) - - - - + + + + + @endif @foreach($tokens as $token) - + - - - - - - - + @endforeach +
NameCreatedExpiresDelete{{ trans('general.name') }}{{ trans('general.created_at') }}{{ trans('general.expires') }}{{ trans('general.delete') }}
+ {{ $token->name }} + {{ $token->created_at }} + {{ $token->expires_at }} + - + wire:loading.attr="disabled" data-tooltip="true" title="{{ trans('general.delete') }}"> + + + {{ trans('general.delete') }} +
+
@@ -74,22 +77,23 @@