feat(ssh-keys): add ssh key endpoints and ui components
This commit is contained in:
parent
9d64c6751b
commit
f9114e2de0
17 changed files with 375 additions and 7 deletions
29
app/Transformers/Api/Client/UserSSHKeyTransformer.php
Normal file
29
app/Transformers/Api/Client/UserSSHKeyTransformer.php
Normal file
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Transformers\Api\Client;
|
||||
|
||||
use Pterodactyl\Models\UserSSHKey;
|
||||
|
||||
class UserSSHKeyTransformer extends BaseClientTransformer
|
||||
{
|
||||
/**
|
||||
* Return the resource name for the JSONAPI output.
|
||||
*/
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return 'user_ssh_key';
|
||||
}
|
||||
|
||||
/**
|
||||
* Return basic information about the currently logged in user.
|
||||
*/
|
||||
public function transform(UserSSHKey $model): array
|
||||
{
|
||||
return [
|
||||
'id' => $model->id,
|
||||
'name' => $model->name,
|
||||
'public_key' => $model->public_key,
|
||||
'created_at' => $model->created_at->toIso8601String(),
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue